61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
+
|
sqlite3_vtab_cursor super;
int pos;
} Cursor;
static Uint8 cur_type;
static Uint8 gsizes[16];
static Picture*cur_pic;
static Picture*spare_page;
static void fn_valid_name(sqlite3_context*cxt,int argc,sqlite3_value**argv) {
const char*s=sqlite3_value_text(*argv);
if(!s || !*s || s[strspn(s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-0123456789")]) {
sqlite3_result_error(cxt,"Invalid name",-1);
return;
}
|
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
|
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
case SDLK_RIGHT: case SDLK_KP6: ++cc; goto redraw;
case SDLK_UP: case SDLK_KP8: cc-=16; goto redraw;
case SDLK_DOWN: case SDLK_KP2: cc+=16; goto redraw;
case SDLK_HOME: case SDLK_KP7: cc=0; goto redraw;
case SDLK_F12:
p=(Uint8*)screen_prompt("<SQL>");
if(p) sqlite3_exec(userdb,p,response_cb,0,0);
goto redraw;
case SDLK_EQUALS: case SDLK_BACKQUOTE:
if(!spare_page) {
spare_page=malloc(sizeof(Picture)+(picture_size+1)*picture_size);
if(!spare_page) fatal("Allocation failed\n");
spare_page->size=picture_size;
memset(spare_page->data,0,(picture_size+1)*picture_size);
}
if(spare_page->size!=cur_pic->size) {
m.x=m.y=m.w=m.h=0;
xx=yy=-1;
}
pict[sel]=spare_page;
spare_page=cur_pic;
goto redraw;
}
break;
case SDL_VIDEOEXPOSE:
goto redraw;
}
}
|