This package contains an API for programming mysql in ATS.
absvtype MYSQLptr (l:addr) = ptr
vtypedef MYSQLptr0 = [l:addr] MYSQLptr (l)
vtypedef MYSQLptr1 = [l:addr| l > null] MYSQLptr (l)
absvtype MYSQLRESptr (l:addr) = ptr
vtypedef MYSQLRESptr0 = [l:addr] MYSQLRESptr (l)
vtypedef MYSQLRESptr1 = [l:addr| l > null] MYSQLRESptr (l)
absvtype MYSQLFIELDptr (l1:addr, l2:addr) = ptr
vtypedef MYSQLFIELDptr0 (l1:addr) = [l2:addr] MYSQLFIELDptr (l1, l2)
vtypedef MYSQLFIELDptr1 (l1:addr) = [l2:addr| l2 > null] MYSQLFIELDptr (l1, l2)
absvtype MYSQLROW (l1:addr, l2:addr) = ptr
vtypedef MYSQLROW0 (l1:addr) = [l2:addr] MYSQLROW (l1, l2)
vtypedef MYSQLROW1 (l1:addr) = [l2:addr| l2 > null] MYSQLROW (l1, l2)
overload mysql_init with mysql_init0
overload mysql_init with mysql_init1
fun mysql_init0 ((*null*)): MYSQLptr0 = "mac#%"
fun mysql_init0_exn ((*null*)): MYSQLptr1 = "mac#%"
fun mysql_init1 {l:agz} (x: !MYSQLptr (l)): ptr (l) = "mac#%"
fun mysql_close (x: MYSQLptr0): void = "mac#%"
fun
mysql_real_connect
{l:agz} (
mysql: !MYSQLptr (l)
, host: NSH(stropt)
, user: NSH(stropt)
, passwd: NSH(stropt)
, dbname: NSH(stropt)
, port: uint
, socket: NSH(stropt)
, clientflag: ulint
) : Ptrnull (l) = "mac#%"
fun
mysql_change_user
{l:agz} (
mysql: !MYSQLptr l
, user: NSH(string)
, passwd: NSH(stropt)
, dbname: NSH(stropt)
) : int(*bool*) = "mac#%"
fun mysql_ping (mysql: !MYSQLptr1): int = "mac#%"
fun mysql_query
(mysql: !MYSQLptr1, q: query): int(*err*) = "mac#%"
fun mysql_list_dbs {l:agz} ( mysql: !MYSQLptr l, wild: NSH(stropt) ) : MYSQLRESptr0 = "mac#%" // endfun
fun mysql_list_fields {l:agz} ( mysql: !MYSQLptr l , table: NSH(string), wild: NSH(stropt) ) : MYSQLRESptr0 = "mac#%" // endfun
fun mysql_field_count (mysql: !MYSQLptr1): uint = "mac#%"
fun mysql_num_rows
{l:agz} (
res: !MYSQLRESptr l
) : [n:nat] (MYSQLRESnrow (l, n) | ullint n) = "mac#%"
fun mysql_num_fields
{l:agz} (
res: !MYSQLRESptr l
) : [n:nat] (MYSQLRESnfield (l, n) | int n) = "mac#%"
fun mysql_field_tell
{l:agz}{n:int} (
pf: MYSQLRESnfield (l, n) | res: !MYSQLRESptr l
) : natLte (n) = "mac#%"
fun mysql_field_seek
{l:agz}{n:int} (
pf: MYSQLRESnfield (l, n) | res: !MYSQLRESptr l, i: natLte (n)
) : natLte (n) = "mac#%"
fun mysql_affected_rows
{l:agz} (mysql: !MYSQLptr l): ullint = "mac#%"
fun mysql_use_result
{l:agz} (mysql: !MYSQLptr (l)): MYSQLRESptr0 = "mac#%"
fun mysql_store_result
{l:agz} (mysql: !MYSQLptr (l)): MYSQLRESptr0 = "mac#%"
fun mysql_free_result (result: MYSQLRESptr0): void = "mac#%"
fun mysql_data_seek
{l:agz} (result: !MYSQLRESptr l, ofs: ullint): void = "mac#%"
fun mysql_fetch_row
{l:agz} (res: !MYSQLRESptr (l)): MYSQLROW0 (l) = "mac#%"
prfun mysql_unfetch_row {l1,l2:addr} ( res: !MYSQLRESptr (l1), row: MYSQLROW (l1, l2) ) :<> void // end of [mysql_unfetch_row]
fun mysql_fetch_lengths
{l:agz} (res: !MYSQLRESptr (l)): MYSQLROWLEN0 (l) = "mac#%"
prfun mysql_unfetch_lengths {l1,l2:addr} ( res: !MYSQLRESptr l1, rowlen: MYSQLROWLEN (l1, l2) ) :<> void // end of [mysql_unfetch_rowlen]
fun mysqlrow_get_at {l1,l2:addr | l2 > null}{n:int} ( pfrow: MYSQLRESnfield (l1, n) | row: !MYSQLROW (l1, l2), i: natLt n ) : ptr = "mac#%" // endfun
fun mysqlrowlen_get_at {l1,l2:addr | l2 > null}{n:int} ( pfrow: MYSQLRESnfield (l1, n) | rowlen: !MYSQLROWLEN (l1, l2), i: natLt n ) : ulint = "mac#%" // endfun
fun mysql_fetch_field
{l:agz} (res: !MYSQLRESptr l): MYSQLFIELDptr0 (l) = "mac#%"
prfun
mysql_unfetch_field
{l1,l2:addr}
(res: !MYSQLRESptr (l1), field: MYSQLFIELDptr (l1, l2)): void
fun mysql_fetch_field_direct {l:agz}{n:int} ( pf: MYSQLRESnfield (l, n) | res: !MYSQLRESptr l, i: natLt n ) : MYSQLFIELDptr1 (l) = "mac#%" // endfun
fun mysql_fetch_fields {l:agz}{n:int} ( pf: MYSQLRESnfield (l, n) | res: !MYSQLRESptr l ) : [la:addr] ( array_v (MYSQLROW1 (l), la, n) , minus (MYSQLRESptr l, array_v (MYSQLROW1 (l), la, n)) | ptr la ) = "mac#%" // end of [mysql_fetch_fields]
fun mysqlfield_get_name
{l1,l2:addr | l2 > null}
(fld: !MYSQLFIELDptr (l1, l2)): ptr(*char*) = "mac#%"
fun mysqlfield_get_length
{l1,l2:addr | l2 > null} (fld: !MYSQLFIELDptr (l1, l2)): ulint = "mac#%"
fun mysqlfield_get_max_length
{l1,l2:addr | l2 > null} (fld: !MYSQLFIELDptr (l1, l2)): ulint = "mac#%"
fun mysql_info
{l:agz} (mysql: !MYSQLptr l): string = "mac#%"
fun mysql_stat
{l:agz} (mysql: !MYSQLptr l): string = "mac#%"
fun mysql_sqlstate (mysql: !MYSQLptr1): string = "mac#%"
fun mysql_get_host_info (mysql: !MYSQLptr1): string = "mac#%"
fun mysql_get_proto_info (mysql: !MYSQLptr1): uint = "mac#%"
fun mysql_get_server_info (mysql: !MYSQLptr1) : string = "mac#%"
fun mysql_get_server_version (mysql: !MYSQLptr1) : ulint = "mac#%"
fun mysql_get_client_info (): string = "mac#%"
// staload "mysql/SATS/mysql.sats" // implement main () = let val info = mysql_get_client_info () in printf ("MySQL client info: %s\n", @(info)) end // end of [main]
fun mysql_get_client_version (): ulint = "mac#%"
// staload "mysql/SATS/mysql.sats" // implement main () = let val version = mysql_get_client_version () in printf ("MySQL client version: %lu\n", @(version)) end // end of [main]
fun mysql_errno (mysql: !MYSQLptr1) : uint = "mac#%"
fun mysql_error (mysql: !MYSQLptr1) : string = "mac#%"
fun mysql_hex_string {lb:addr} {m,n:int | m >= 2*n+1} ( pf: b0ytes(m) @ lb | pbuf: ptr lb, src: NSH(string(n)), n: size_t n ) : sizeLt (m) = "mac#" // end of [mysql_hex_string]
fun mysql_escape_string {lb:addr} {m,n:int | m >= 2*n+1} ( pf: b0ytes(m) @ lb | pbuf: ptr lb, src: NSH(string(n)), n: size_t n ) : sizeLt (m) = "mac#%" // end of [mysql_escape_string]
fun mysql_real_escape_string {lb:addr} {m,n:int | m >= 2*n+1} ( pf: b0ytes(m) @ lb | mysql: !MYSQLptr1, pbuf: ptr lb, src: NSH(string(n)), n: size_t n ) : sizeLt (m) = "mac#%" // end of [mysql_real_escape_string]
fun{
} fprint_mysqlres{l:agz}
(out: FILEref, res: !MYSQLRESptr (l)): void
fun{
} fprint_mysqlres$sep1 (FILEref): void
fun{
} fprint_mysqlres$sep2 (FILEref): void
fun{ } fprint_mysqlres_sep{l:agz} ( out: FILEref , res: !MYSQLRESptr(l), sep1: NSH(string), sep2: NSH(string) ) : void // end of [fprint_mysqlres_sep]
fun{ } fprint_mysqlrow {l1,l2:addr | l2 > null}{n:int} ( pfrow: MYSQLRESnfield (l1, n) | out: FILEref, row: !MYSQLROW (l1, l2), n: int n ) : void // end of [fprint_mysqlrow]
fun{
} fprint_mysqlrow$sep (FILEref): void
fun{ } fprint_mysqlrow_sep {l1,l2:addr | l2 > null} {n:int} ( pfrow: MYSQLRESnfield (l1, n) | out: FILEref, row: !MYSQLROW (l1, l2), n: int n, sep: NSH(string) ) : void // end of [fprint_mysqlrow_sep]
overload ptrcast with MYSQLptr2ptr
overload ptrcast with MYSQLRESptr2ptr
overload ptrcast with MYSQLFIELDptr2ptr
overload ptrcast with MYSQLROW2ptr
overload fprint with fprint_mysqlres
overload fprint with fprint_mysqlres_sep
overload fprint with fprint_mysqlrow
overload fprint with fprint_mysqlrow_sep
This page is created with ATS by Hongwei Xi and also maintained by Hongwei Xi. |