| top | | | ^ | Definition continued at: 65. | | | | | section top | |
int numberAsterisks = 0;
int intype=0,intype1=0,inmod=0,outtype=0,outtype1=0,outmod=0;
int suffix=0;
chars input;
| ^ | Definition continued at: 66, 73, 75. | | | | | section top | |
while (*f!=0 && *f!='{' && !isalpha(*f)) {
numberAsterisks += *f=='*';
Tcl_AppendToObj(format1,f,1); f+=1;
}
if (f[0]=='{' && f[1]=='}') {
f += 2;
while (*f && (!isalpha(*f) || tolower(*f)=='h' || tolower(*f)=='l')) {
Tcl_AppendToObj(format1,f,1); f+=1;
}
continue;
}
if (*f=='{') {
chars F = strchr(f+1,'}');
input = f+1;
f = F ? F+1 : f+1;
}else {
input = "";
}
if (tolower(*f)=='h') {
outmod = 1; Tcl_AppendToObj(format1,f,1); f+=1;
}else if (tolower(*f)=='l') {
outmod = 2; Tcl_AppendToObj(format1,f,1); f+=1;
}
if (isalpha(*f)) {
outtype = *f; Tcl_AppendToObj(format1,f,1); f+=1;
}
if (isalpha(*input)) {
if (tolower(*input)=='h') {
inmod = 1; input+=1;
}else if (tolower(*input)=='l') {
inmod = 2; input+=1;
}
if (isalpha(*input)) {
intype = *input; input+=1;
}
}else {
intype = outtype; inmod = inmod;
}
if (*input=='+' || *input=='-') {
suffix = *input++;
}
| ^ | | | | | | section top | |
while (numberAsterisks-->0) {
Obj count = Tcl_NewIntObj(va_arg(args,int));
Tcl_ListObjAppendList(0,list,count);
}
| ^ | | | | | | section top | | | ^ | | | | | | section top | |
enum {i=1,u=2,r=3,s=4,n=5,y=6,z=7,i0=10,u0=20,r0=30,s0=40,n0=50,y0=60,z0=70};
enum {ii=i0+i,iu=i0+u,ir=i0+r,is=i0+s};
enum {ui=u0+i,uu=u0+u,ur=u0+r,us=u0+s};
enum {ri=r0+i,ru=r0+u,rr=r0+r};
enum {ss=s0+s};
enum {ns=n0+s};
enum {yi=y0+i,yu=y0+u,yr=y0+r,ys=y0+s};
enum {zi=z0+i,zu=z0+u,zr=z0+r,zs=z0+s};
#if defined(ASCII)
static unsigned char baseType[] = {
//a b c d e f g h i j k l m n o p q r s t u v w x y z
0,0,0,0,0,r,0,r,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i,0,0,0,0,0,0,0,
0,0,0,i,i,r,r,r,0,i,0,0,0,0,n,i,0,0,z,s,0,u,0,0,i,y,0,0,0,0,0
};
enum {zerochar = '@',limitchar = 0x7f};
#define printable(ch) (' '<=(ch) && (ch)<0x7F)
#else
#error Unknown character set.
#endif
Obj arg; bool decrement;
| ^ | Definition continued at: 73, 75. | | | | | section top | | - Obj list—The list of values to given to the Tcl format.
|
|
Obj list = incr(Tcl_NewObj());
| ^ | Definition continued at: 82, 88. | | | | | section top | | | ^ | | | | | | section top | | | ^ | | | | | | section top | |
switch (inmod) {
case 0:
arg = incr(Tcl_NewIntObj(va_arg(args,int)));
decrement = true;
break;
case 1:
arg = incr(Tcl_NewIntObj((short)va_arg(args,int)));
decrement = true;
break;
case 2:
arg = incr(Tcl_NewLongObj(va_arg(args,long)));
decrement = true;
break;
}
| ^ | | | | | | section top | |
switch (inmod) {
case 0:
arg = incr(Tcl_NewIntObj((int)va_arg(args,unsigned)));
decrement = true;
break;
case 1:
arg = incr(Tcl_NewIntObj((int)(unsigned short)va_arg(args,unsigned)));
decrement = true;
break;
case 2:
arg = incr(Tcl_NewLongObj((long)va_arg(args,unsigned long)));
decrement = true;
break;
}
| ^ | | | | | | section top | |
arg = incr(Tcl_NewDoubleObj(va_arg(args,double)));
decrement = true;
| ^ | | | | | | section top | |
char conv[sizeof( unsigned long)+1],*pconv;
unsigned long ival;
int lival;
| ^ | Definition continued at: 75. | | | | | section top | |
switch (intype1) {
case i:
switch (inmod) {
case 0: ival = (unsigned long)va_arg(args,int); lival = sizeof(int); break;
case 1: ival = (unsigned long)va_arg(args,int); lival = sizeof(int); break;
case 2: ival = (unsigned long)va_arg(args,long); lival = sizeof(long); break;
}
break;
case u:
switch (inmod) {
case 0: ival = (unsigned long)va_arg(args,unsigned); lival = sizeof(unsigned); break;
case 1: ival = (unsigned long)va_arg(args,unsigned int); lival = sizeof(unsigned int); break;
case 2: ival = (unsigned long)va_arg(args,unsigned long); lival = sizeof(unsigned long); break;
}
break;
}
pconv = conv+sizeof( unsigned long);
*pconv = 0; stringlen = 0;
while (pconv>conv && lival>0 && ival!=0) {
*--pconv = ival; ival >>= 8; lival++; stringlen++;
}
string = pconv;
goto string;
| ^ | | | | | | section top | |
chars string; int stringlen;
| ^ | | | | | | section top | |
string = va_arg(args,chars); stringlen = -1;
string:
if (suffix=='+') {
chars copy; int xstring;
if (stringlen<0) stringlen = strlen(string);
copy = nheap(stringlen,char);
for (xstring=0; xstring<stringlen; xstring++) {
copy[xstring] = printable(string[xstring]) ? string[xstring] : '.';
}
arg = incr(Tcl_NewStringObj(copy,stringlen));
dispose(copy);
} else {
arg = incr(Tcl_NewStringObj(string,stringlen));
}
decrement = true;
| ^ | | | | | | section top | |
{
stringlen = va_arg(args,int);
stri |
|