• Home
  • Raw
  • Download

Lines Matching +full:- +full:printf

56  if (*message=='-')  in usage()
63 " -l list (use -l -l for full listing)\n" in usage()
64 " -o name output to file 'name' (default is \"%s\")\n" in usage()
65 " -p parse only\n" in usage()
66 " -s strip debug information\n" in usage()
67 " -v show version information\n" in usage()
68 " -- stop handling options\n" in usage()
69 " - stop handling options and process stdin\n" in usage()
83 if (*argv[i]!='-') /* end of options; keep it */ in doargs()
85 else if (IS("--")) /* end of options; skip it */ in doargs()
91 else if (IS("-")) /* end of options; use stdin */ in doargs()
93 else if (IS("-l")) /* list */ in doargs()
95 else if (IS("-o")) /* output file */ in doargs()
98 if (output==NULL || *output==0 || (*output=='-' && output[1]!=0)) in doargs()
99 usage("'-o' needs argument"); in doargs()
100 if (IS("-")) output=NULL; in doargs()
102 else if (IS("-p")) /* parse only */ in doargs()
104 else if (IS("-s")) /* strip debug information */ in doargs()
106 else if (IS("-v")) /* show version */ in doargs()
114 argv[--i]=Output; in doargs()
118 printf("%s\n",LUA_COPYRIGHT); in doargs()
119 if (version==argc-1) exit(EXIT_SUCCESS); in doargs()
129 if ((*(int*)ud)--) in reader()
131 *size=sizeof(FUNCTION)-1; in reader()
141 #define toproto(L,i) getproto(s2v(L->top+(i)))
146 return toproto(L,-1); in combine()
151 if (lua_load(L,reader,&i,"=(" PROGNAME ")",NULL)!=LUA_OK) fatal(lua_tostring(L,-1)); in combine()
152 f=toproto(L,-1); in combine()
155 f->p[i]=toproto(L,i-n-1); in combine()
156 if (f->p[i]->sizeupvalues>0) f->p[i]->upvalues[0].instack=0; in combine()
158 f->sizelineinfo=0; in combine()
175 tmname=G(L)->tmname; in pmain()
179 const char* filename=IS("-") ? NULL : argv[i]; in pmain()
180 if (luaL_loadfile(L,filename)!=LUA_OK) fatal(lua_tostring(L,-1)); in pmain()
201 argc-=i; argv+=i; in main()
208 if (lua_pcall(L,2,0,0)!=LUA_OK) fatal(lua_tostring(L,-1)); in main()
217 #define UPVALNAME(x) ((f->upvalues[x].name) ? getstr(f->upvalues[x].name) : "-")
225 printf("\""); in PrintString()
232 printf("\\\""); in PrintString()
235 printf("\\\\"); in PrintString()
238 printf("\\a"); in PrintString()
241 printf("\\b"); in PrintString()
244 printf("\\f"); in PrintString()
247 printf("\\n"); in PrintString()
250 printf("\\r"); in PrintString()
253 printf("\\t"); in PrintString()
256 printf("\\v"); in PrintString()
259 if (isprint(c)) printf("%c",c); else printf("\\%03d",c); in PrintString()
263 printf("\""); in PrintString()
268 const TValue* o=&f->k[i]; in PrintType()
272 printf("N"); in PrintType()
276 printf("B"); in PrintType()
279 printf("F"); in PrintType()
282 printf("I"); in PrintType()
286 printf("S"); in PrintType()
289 printf("?%d",ttypetag(o)); in PrintType()
292 printf("\t"); in PrintType()
297 const TValue* o=&f->k[i]; in PrintConstant()
301 printf("nil"); in PrintConstant()
304 printf("false"); in PrintConstant()
307 printf("true"); in PrintConstant()
313 printf("%s",buff); in PrintConstant()
314 if (buff[strspn(buff,"-0123456789")]=='\0') printf(".0"); in PrintConstant()
318 printf(LUA_INTEGER_FMT,ivalue(o)); in PrintConstant()
325 printf("?%d",ttypetag(o)); in PrintConstant()
337 const Instruction* code=f->code; in PrintCode()
338 int pc,n=f->sizecode; in PrintCode()
353 printf("\t%d\t",pc+1); in PrintCode()
354 if (line>0) printf("[%d]\t",line); else printf("[-]\t"); in PrintCode()
355 printf("%-9s\t",opnames[o]); in PrintCode()
359 printf("%d %d",a,b); in PrintCode()
362 printf("%d %d",a,sbx); in PrintCode()
365 printf("%d %d",a,sbx); in PrintCode()
368 printf("%d %d",a,bx); in PrintCode()
369 printf(COMMENT); PrintConstant(f,bx); in PrintCode()
372 printf("%d",a); in PrintCode()
373 printf(COMMENT); PrintConstant(f,EXTRAARG); in PrintCode()
376 printf("%d",a); in PrintCode()
379 printf("%d",a); in PrintCode()
382 printf("%d",a); in PrintCode()
385 printf("%d %d",a,b); in PrintCode()
386 printf(COMMENT "%d out",b+1); in PrintCode()
389 printf("%d %d",a,b); in PrintCode()
390 printf(COMMENT "%s",UPVALNAME(b)); in PrintCode()
393 printf("%d %d",a,b); in PrintCode()
394 printf(COMMENT "%s",UPVALNAME(b)); in PrintCode()
397 printf("%d %d %d",a,b,c); in PrintCode()
398 printf(COMMENT "%s",UPVALNAME(b)); in PrintCode()
399 printf(" "); PrintConstant(f,c); in PrintCode()
402 printf("%d %d %d",a,b,c); in PrintCode()
405 printf("%d %d %d",a,b,c); in PrintCode()
408 printf("%d %d %d",a,b,c); in PrintCode()
409 printf(COMMENT); PrintConstant(f,c); in PrintCode()
412 printf("%d %d %d%s",a,b,c,ISK); in PrintCode()
413 printf(COMMENT "%s",UPVALNAME(a)); in PrintCode()
414 printf(" "); PrintConstant(f,b); in PrintCode()
415 if (isk) { printf(" "); PrintConstant(f,c); } in PrintCode()
418 printf("%d %d %d%s",a,b,c,ISK); in PrintCode()
419 if (isk) { printf(COMMENT); PrintConstant(f,c); } in PrintCode()
422 printf("%d %d %d%s",a,b,c,ISK); in PrintCode()
423 if (isk) { printf(COMMENT); PrintConstant(f,c); } in PrintCode()
426 printf("%d %d %d%s",a,b,c,ISK); in PrintCode()
427 printf(COMMENT); PrintConstant(f,b); in PrintCode()
428 if (isk) { printf(" "); PrintConstant(f,c); } in PrintCode()
431 printf("%d %d %d",a,b,c); in PrintCode()
432 printf(COMMENT "%d",c+EXTRAARGC); in PrintCode()
435 printf("%d %d %d%s",a,b,c,ISK); in PrintCode()
436 if (isk) { printf(COMMENT); PrintConstant(f,c); } in PrintCode()
439 printf("%d %d %d",a,b,sc); in PrintCode()
442 printf("%d %d %d",a,b,c); in PrintCode()
443 printf(COMMENT); PrintConstant(f,c); in PrintCode()
446 printf("%d %d %d",a,b,c); in PrintCode()
447 printf(COMMENT); PrintConstant(f,c); in PrintCode()
450 printf("%d %d %d",a,b,c); in PrintCode()
451 printf(COMMENT); PrintConstant(f,c); in PrintCode()
454 printf("%d %d %d",a,b,c); in PrintCode()
455 printf(COMMENT); PrintConstant(f,c); in PrintCode()
458 printf("%d %d %d",a,b,c); in PrintCode()
459 printf(COMMENT); PrintConstant(f,c); in PrintCode()
462 printf("%d %d %d",a,b,c); in PrintCode()
463 printf(COMMENT); PrintConstant(f,c); in PrintCode()
466 printf("%d %d %d",a,b,c); in PrintCode()
467 printf(COMMENT); PrintConstant(f,c); in PrintCode()
470 printf("%d %d %d",a,b,c); in PrintCode()
471 printf(COMMENT); PrintConstant(f,c); in PrintCode()
474 printf("%d %d %d",a,b,c); in PrintCode()
475 printf(COMMENT); PrintConstant(f,c); in PrintCode()
478 printf("%d %d %d",a,b,c); in PrintCode()
479 printf(COMMENT); PrintConstant(f,c); in PrintCode()
482 printf("%d %d %d",a,b,sc); in PrintCode()
485 printf("%d %d %d",a,b,sc); in PrintCode()
488 printf("%d %d %d",a,b,c); in PrintCode()
491 printf("%d %d %d",a,b,c); in PrintCode()
494 printf("%d %d %d",a,b,c); in PrintCode()
497 printf("%d %d %d",a,b,c); in PrintCode()
500 printf("%d %d %d",a,b,c); in PrintCode()
503 printf("%d %d %d",a,b,c); in PrintCode()
506 printf("%d %d %d",a,b,c); in PrintCode()
509 printf("%d %d %d",a,b,c); in PrintCode()
512 printf("%d %d %d",a,b,c); in PrintCode()
515 printf("%d %d %d",a,b,c); in PrintCode()
518 printf("%d %d %d",a,b,c); in PrintCode()
521 printf("%d %d %d",a,b,c); in PrintCode()
524 printf("%d %d %d",a,b,c); in PrintCode()
525 printf(COMMENT "%s",eventname(c)); in PrintCode()
528 printf("%d %d %d %d",a,sb,c,isk); in PrintCode()
529 printf(COMMENT "%s",eventname(c)); in PrintCode()
530 if (isk) printf(" flip"); in PrintCode()
533 printf("%d %d %d %d",a,b,c,isk); in PrintCode()
534 printf(COMMENT "%s ",eventname(c)); PrintConstant(f,b); in PrintCode()
535 if (isk) printf(" flip"); in PrintCode()
538 printf("%d %d",a,b); in PrintCode()
541 printf("%d %d",a,b); in PrintCode()
544 printf("%d %d",a,b); in PrintCode()
547 printf("%d %d",a,b); in PrintCode()
550 printf("%d %d",a,b); in PrintCode()
553 printf("%d",a); in PrintCode()
556 printf("%d",a); in PrintCode()
559 printf("%d",GETARG_sJ(i)); in PrintCode()
560 printf(COMMENT "to %d",GETARG_sJ(i)+pc+2); in PrintCode()
563 printf("%d %d %d",a,b,isk); in PrintCode()
566 printf("%d %d %d",a,b,isk); in PrintCode()
569 printf("%d %d %d",a,b,isk); in PrintCode()
572 printf("%d %d %d",a,b,isk); in PrintCode()
573 printf(COMMENT); PrintConstant(f,b); in PrintCode()
576 printf("%d %d %d",a,sb,isk); in PrintCode()
579 printf("%d %d %d",a,sb,isk); in PrintCode()
582 printf("%d %d %d",a,sb,isk); in PrintCode()
585 printf("%d %d %d",a,sb,isk); in PrintCode()
588 printf("%d %d %d",a,sb,isk); in PrintCode()
591 printf("%d %d",a,isk); in PrintCode()
594 printf("%d %d %d",a,b,isk); in PrintCode()
597 printf("%d %d %d",a,b,c); in PrintCode()
598 printf(COMMENT); in PrintCode()
599 if (b==0) printf("all in "); else printf("%d in ",b-1); in PrintCode()
600 if (c==0) printf("all out"); else printf("%d out",c-1); in PrintCode()
603 printf("%d %d %d",a,b,c); in PrintCode()
604 printf(COMMENT "%d in",b-1); in PrintCode()
607 printf("%d %d %d",a,b,c); in PrintCode()
608 printf(COMMENT); in PrintCode()
609 if (b==0) printf("all out"); else printf("%d out",b-1); in PrintCode()
614 printf("%d",a); in PrintCode()
617 printf("%d %d",a,bx); in PrintCode()
618 printf(COMMENT "to %d",pc-bx+2); in PrintCode()
621 printf("%d %d",a,bx); in PrintCode()
622 printf(COMMENT "to %d",pc+bx+2); in PrintCode()
625 printf("%d %d",a,bx); in PrintCode()
626 printf(COMMENT "to %d",pc+bx+2); in PrintCode()
629 printf("%d %d",a,c); in PrintCode()
632 printf("%d %d",a,bx); in PrintCode()
633 printf(COMMENT "to %d",pc-bx+2); in PrintCode()
636 printf("%d %d %d",a,b,c); in PrintCode()
637 if (isk) printf(COMMENT "%d",c+EXTRAARGC); in PrintCode()
640 printf("%d %d",a,bx); in PrintCode()
641 printf(COMMENT "%p",VOID(f->p[bx])); in PrintCode()
644 printf("%d %d",a,c); in PrintCode()
645 printf(COMMENT); in PrintCode()
646 if (c==0) printf("all out"); else printf("%d out",c-1); in PrintCode()
649 printf("%d",a); in PrintCode()
652 printf("%d",ax); in PrintCode()
656 printf("%d %d %d",a,b,c); in PrintCode()
657 printf(COMMENT "not handled"); in PrintCode()
661 printf("\n"); in PrintCode()
671 const char* s=f->source ? getstr(f->source) : "=?"; in PrintHeader()
678 printf("\n%s <%s:%d,%d> (%d instruction%s at %p)\n", in PrintHeader()
679 (f->linedefined==0)?"main":"function",s, in PrintHeader()
680 f->linedefined,f->lastlinedefined, in PrintHeader()
681 S(f->sizecode),VOID(f)); in PrintHeader()
682 printf("%d%s param%s, %d slot%s, %d upvalue%s, ", in PrintHeader()
683 (int)(f->numparams),f->is_vararg?"+":"",SS(f->numparams), in PrintHeader()
684 S(f->maxstacksize),S(f->sizeupvalues)); in PrintHeader()
685 printf("%d local%s, %d constant%s, %d function%s\n", in PrintHeader()
686 S(f->sizelocvars),S(f->sizek),S(f->sizep)); in PrintHeader()
692 n=f->sizek; in PrintDebug()
693 printf("constants (%d) for %p:\n",n,VOID(f)); in PrintDebug()
696 printf("\t%d\t",i); in PrintDebug()
699 printf("\n"); in PrintDebug()
701 n=f->sizelocvars; in PrintDebug()
702 printf("locals (%d) for %p:\n",n,VOID(f)); in PrintDebug()
705 printf("\t%d\t%s\t%d\t%d\n", in PrintDebug()
706 i,getstr(f->locvars[i].varname),f->locvars[i].startpc+1,f->locvars[i].endpc+1); in PrintDebug()
708 n=f->sizeupvalues; in PrintDebug()
709 printf("upvalues (%d) for %p:\n",n,VOID(f)); in PrintDebug()
712 printf("\t%d\t%s\t%d\t%d\n", in PrintDebug()
713 i,UPVALNAME(i),f->upvalues[i].instack,f->upvalues[i].idx); in PrintDebug()
719 int i,n=f->sizep; in PrintFunction()
723 for (i=0; i<n; i++) PrintFunction(f->p[i],full); in PrintFunction()