Skip to content

Instantly share code, notes, and snippets.

@lopnor
Created February 26, 2011 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lopnor/844913 to your computer and use it in GitHub Desktop.
Save lopnor/844913 to your computer and use it in GitHub Desktop.
.sub test :main
.local pmc mysql
.local pmc client
.local pmc dbh
mysql = loadlib 'libmysqlclient'
$P0 = dlfunc mysql, 'mysql_init', 'pp'
$P1 = null
client = $P0($P1)
$P0 = dlfunc mysql, 'mysql_real_connect', 'ppttttiti'
$S0 = null
dbh = $P0(client, '127.0.0.1', 'root', '', 'journal', 3306, $S0, 0)
$I0 = defined dbh
unless $I0 goto ERR
branch END
ERR:
say 'error'
END:
say 'end'
.end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment