++ return 0;
++}
++
++
++/* main awx processing function. called from awk_main() */
++static int do_awx(int argc, char **argv)
++{
++ int ret = -1;
++ var tv;
++ int i, c;
++ char **args = argv;
++
++ zero_out_var(&tv);
++
++ /* register awk C callbacks */
++ register_cfunc("getvar", getvar, 1);
++ register_cfunc("render", render, 1);
++ register_cfunc("render_layout", render_layout, 1);
++ register_cfunc("call", call, 1);
++ register_cfunc("include", include, 1);
++ register_cfunc("init_lang", init_lang, 1);
++ register_cfunc("load_lang", load_lang, 1);
++
++ if (!is_awx)
++ return 0;
++
++ /* fill in ARGV array */
++ setvar_i(V[ARGC], argc + 1);
++ setari_u(V[ARGV], 0, "awx");
++ i = 0;
++ while (*args)
++ setari_u(V[ARGV], ++i, *args++);
++
++ while((c = getopt(argc, argv, "i:f:")) != EOF) {
++ switch(c) {
++ case 'i':
++ programname = optarg;
++ include_file(optarg);
++ break;
++ case 'f':
++ ret = 0;
++ programname = optarg;
++ render_file(optarg);
++ goto done;
++ }
++ }
++ argc -= optind;
++ argv += optind;
++
++ if (argc < 1) {
++ fprintf(stderr, "Invalid argument.\n");
++ goto done;
++ }
++
++ ret = run_awxscript(*argv);
++