static void doit(int undump, char* filename) { FILE* f= (filename==NULL) ? stdin : efopen(filename, undump ? "rb" : "r"); ZIO z; char source[255+2]; /* +2 for '@' and '\0' */ luaL_filesource(source,filename,sizeof(source)); zFopen(&z,f,source); if (verbose) fprintf(stderr,"%s\n",source+1); if (undump) do_undump(&z); else do_compile(&z); if (f!=stdin) fclose(f); }
static void doit(int undump, char* filename) { FILE* f= (filename==NULL) ? stdin : efopen(filename, undump ? "rb" : "r"); ZIO z; if (filename==NULL) filename="(stdin)"; zFopen(&z,f,filename); if (verbose) fprintf(stderr,"%s\n",filename); if (undump) do_undump(&z); else do_compile(&z); if (f!=stdin) fclose(f); }