2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
|
Throw("Type mismatch");
}
}
return NVALUE(r);
}
static void v_set_popup(Uint32 from,int argc) {
const unsigned char*t;
const unsigned char*u;
sqlite3_str*s;
Value v;
int argi=1;
const unsigned char*at=0;
int ax;
Value av;
if(argc>32 || argc<0) Throw("Too many arguments");
vstackptr-=argc;
v=Pop();
if(quiz_text) return;
if(argc) {
argc++;
if(v.t!=TY_STRING && v.t!=TY_LEVELSTRING) Throw("Type mismatch");
s=sqlite3_str_new(userdb);
t=value_string_ptr(v);
while(*t) {
if(u=strchr(t,'%')) {
sqlite3_str_append(s,t,u-t);
t=u+2;
switch(u[1]) {
case 0:
t=u+1;
break;
case 'c':
if(argi==argc) break;
v=vstack[vstackptr+argi++];
if(v.t==TY_NUMBER) {
sqlite3_str_appendchar(s,1,31);
sqlite3_str_appendchar(s,1,v.u&255?:255);
}
break;
case 'C':
if(argi==argc) break;
v=vstack[vstackptr+argi++];
|
>
>
>
>
|
>
>
>
>
|
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
|
Throw("Type mismatch");
}
}
return NVALUE(r);
}
static void v_set_popup(Uint32 from,int argc) {
unsigned char y='%';
const unsigned char*t;
const unsigned char*u;
sqlite3_str*s;
Value v;
int argi=1;
const unsigned char*at=0;
int ax;
Value av;
if(argc>32 || argc<0) Throw("Too many arguments");
vstackptr-=argc;
v=Pop();
if(quiz_text) return;
if(argc) {
argc++;
if(v.t!=TY_STRING && v.t!=TY_LEVELSTRING) Throw("Type mismatch");
s=sqlite3_str_new(userdb);
t=value_string_ptr(v);
#ifndef CONFIG_OMIT_MBCS
if(has_mbcs && *t==0xFE) y=0x7F;
#endif
while(*t) {
if(u=strchr(t,y)) {
sqlite3_str_append(s,t,u-t);
t=u+2;
#ifndef CONFIG_OMIT_MBCS
if(y==0x7F) sqlite3_str_appendchar(s,1,0xFF);
#endif
switch(u[1]) {
case 0:
t=u+1;
break;
case 'c':
if(argi==argc) break;
v=vstack[vstackptr+argi++];
if(v.t==TY_NUMBER) {
ascii:
sqlite3_str_appendchar(s,1,31);
sqlite3_str_appendchar(s,1,v.u&255?:255);
}
break;
case 'C':
if(argi==argc) break;
v=vstack[vstackptr+argi++];
|
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
|
sqlite3_str_appendf(s,"%s",classes[v.u]->name);
break;
case TY_MESSAGE:
sqlite3_str_appendf(s,"%s",v.u<256?standard_message_names[v.u]:messages[v.u-256]);
break;
}
break;
case 'u':
if(argi==argc) break;
v=vstack[vstackptr+argi++];
if(v.t==TY_NUMBER) sqlite3_str_appendf(s,"%u",(unsigned int)v.u);
break;
case 'x':
if(argi==argc) break;
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
|
sqlite3_str_appendf(s,"%s",classes[v.u]->name);
break;
case TY_MESSAGE:
sqlite3_str_appendf(s,"%s",v.u<256?standard_message_names[v.u]:messages[v.u-256]);
break;
}
break;
#ifndef CONFIG_OMIT_MBCS
case 'T':
if(argi==argc) break;
v=vstack[vstackptr+argi++];
if(v.t==TY_NUMBER) {
if(v.u<256) goto ascii;
if(((v.u>>16)&0xFF)<0x21 || ((v.u>>16)&0xFF)==0x7F || ((v.u>>16)&0xFF)>0xFD) break;
if(((v.u>>8)&0xFF)<0x21 || ((v.u>>8)&0xFF)==0x7F || ((v.u>>8)&0xFF)>0xFD) break;
if(((v.u>>0)&0xFF)<0x21 || ((v.u>>0)&0xFF)==0x7F || ((v.u>>0)&0xFF)>0xFD) break;
sqlite3_str_appendchar(s,((v.u)>>24)+1,0xFE);
sqlite3_str_appendchar(s,1,v.u>>16);
sqlite3_str_appendchar(s,1,v.u>>8);
sqlite3_str_appendchar(s,1,v.u>>0);
}
break;
#endif
case 'u':
if(argi==argc) break;
v=vstack[vstackptr+argi++];
if(v.t==TY_NUMBER) sqlite3_str_appendf(s,"%u",(unsigned int)v.u);
break;
case 'x':
if(argi==argc) break;
|