comparison src/mysql.sml @ 889:bcad392e288e

Tweaking demos a bit
author Adam Chlipala <adamc@hcoop.net>
date Fri, 17 Jul 2009 18:13:02 -0400
parents ba3569f4fe89
children 034eeb099564
comparison
equal deleted inserted replaced
888:ba3569f4fe89 889:bcad392e288e
669 string "struct tm t = {mt->second, mt->minute, mt->hour, mt->day, mt->month-1, mt->year, 0, 0, -1};", 669 string "struct tm t = {mt->second, mt->minute, mt->hour, mt->day, mt->month-1, mt->year, 0, 0, -1};",
670 newline, 670 newline,
671 string "mktime(&t);", 671 string "mktime(&t);",
672 newline, 672 newline,
673 string "})"] 673 string "})"]
674 | Channel => box [string "({",
675 string "uw_Basis_channel ch = {buffer",
676 string (Int.toString i),
677 string " >> 32, buffer",
678 string (Int.toString i),
679 string " & 0xFFFFFFFF};",
680 newline,
681 string "ch;",
682 newline,
683 string "})"]
674 | _ => box [string "buffer", 684 | _ => box [string "buffer",
675 string (Int.toString i)] 685 string (Int.toString i)]
676 in 686 in
677 case t of 687 case t of
678 Nullable t => box [string "(is_null", 688 Nullable t => box [string "(is_null",
737 newline] 747 newline]
738 | Time => box [string "MYSQL_TIME buffer", 748 | Time => box [string "MYSQL_TIME buffer",
739 string (Int.toString i), 749 string (Int.toString i),
740 string ";", 750 string ";",
741 newline] 751 newline]
752 | Channel => box [string "unsigned long long buffer",
753 string (Int.toString i),
754 string ";",
755 newline]
742 | _ => box [string (p_sql_ctype t), 756 | _ => box [string (p_sql_ctype t),
743 space, 757 space,
744 string "buffer", 758 string "buffer",
745 string (Int.toString i), 759 string (Int.toString i),
746 string ";", 760 string ";",
904 string (Int.toString i), 918 string (Int.toString i),
905 string ";", 919 string ";",
906 newline] 920 newline]
907 | Time => box [string "MYSQL_TIME in_buffer", 921 | Time => box [string "MYSQL_TIME in_buffer",
908 string (Int.toString i), 922 string (Int.toString i),
909 string ";", 923 string ";", newline]
910 newline]
911 | _ => box [] 924 | _ => box []
912 in 925 in
913 box [case t of 926 box [case t of
914 Nullable t => box [string "my_bool in_is_null", 927 Nullable t => box [string "my_bool in_is_null",
915 string (Int.toString i), 928 string (Int.toString i),
1060 string "].buffer = &in_buffer", 1073 string "].buffer = &in_buffer",
1061 string (Int.toString i), 1074 string (Int.toString i),
1062 string ";", 1075 string ";",
1063 newline] 1076 newline]
1064 end 1077 end
1078 | Channel => box [string "in_buffer",
1079 string (Int.toString i),
1080 string " = ((unsigned long long)arg",
1081 string (Int.toString (i + 1)),
1082 string ".cli << 32) | arg",
1083 string (Int.toString (i + 1)),
1084 string ".chn;",
1085 newline,
1086 string "in[",
1087 string (Int.toString i),
1088 string "].buffer = &in_buffer",
1089 string (Int.toString i),
1090 string ";",
1091 newline]
1065 1092
1066 | _ => box [string "in[", 1093 | _ => box [string "in[",
1067 string (Int.toString i), 1094 string (Int.toString i),
1068 string "].buffer = &arg", 1095 string "].buffer = &arg",
1069 string (Int.toString (i + 1)), 1096 string (Int.toString (i + 1)),
1189 newline] 1216 newline]
1190 | Time => box [string "MYSQL_TIME in_buffer", 1217 | Time => box [string "MYSQL_TIME in_buffer",
1191 string (Int.toString i), 1218 string (Int.toString i),
1192 string ";", 1219 string ";",
1193 newline] 1220 newline]
1221 | Channel => box [string "unsigned long long in_buffer",
1222 string (Int.toString i),
1223 string ";",
1224 newline]
1194 | _ => box [] 1225 | _ => box []
1195 in 1226 in
1196 box [case t of 1227 box [case t of
1197 Nullable t => box [string "my_bool in_is_null", 1228 Nullable t => box [string "my_bool in_is_null",
1198 string (Int.toString i), 1229 string (Int.toString i),
1318 string "].buffer = &in_buffer", 1349 string "].buffer = &in_buffer",
1319 string (Int.toString i), 1350 string (Int.toString i),
1320 string ";", 1351 string ";",
1321 newline] 1352 newline]
1322 end 1353 end
1354 | Channel => box [string "in_buffer",
1355 string (Int.toString i),
1356 string " = ((unsigned long long)arg",
1357 string (Int.toString (i + 1)),
1358 string ".cli << 32) | arg",
1359 string (Int.toString (i + 1)),
1360 string ".chn;",
1361 newline,
1362 string "in[",
1363 string (Int.toString i),
1364 string "].buffer = &in_buffer",
1365 string (Int.toString i),
1366 string ";",
1367 newline]
1323 1368
1324 | _ => box [string "in[", 1369 | _ => box [string "in[",
1325 string (Int.toString i), 1370 string (Int.toString i),
1326 string "].buffer = &arg", 1371 string "].buffer = &arg",
1327 string (Int.toString (i + 1)), 1372 string (Int.toString (i + 1)),
1332 string (Int.toString i), 1377 string (Int.toString i),
1333 string "].buffer_type = ", 1378 string "].buffer_type = ",
1334 string (p_buffer_type t), 1379 string (p_buffer_type t),
1335 string ";", 1380 string ";",
1336 newline, 1381 newline,
1382
1383 case t of
1384 Channel => box [string "in[",
1385 string (Int.toString i),
1386 string "].is_unsigned = 1;",
1387 newline]
1388 | _ => box [],
1337 1389
1338 case t of 1390 case t of
1339 Nullable t => box [string "in[", 1391 Nullable t => box [string "in[",
1340 string (Int.toString i), 1392 string (Int.toString i),
1341 string "].is_null = &in_is_null", 1393 string "].is_null = &in_is_null",