printf(
"%d: row type %s bind len %d\n", line, vartype_name,
bind_len);
24fprintf(stderr,
"error: dbcmd\n");
30fprintf(stderr,
"error: expected a result set, none returned.\n");
34memset(
str,
'$',
sizeof(
str));
35 str[
sizeof(
str) - 1] = 0;
37fprintf(stderr,
"Had problem with bind\n");
41fprintf(stderr,
"Failed. Expected a row\n");
48 char*p = strchr(
str,
'$');
49 i= p ? p -
str:
sizeof(
str);
52 char*p = strchr(
str, 0);
55 for(;
i<
sizeof(
str)-1; ++
i) {
60printf(
"str '%s'\n",
str);
62fprintf(stderr,
"Expected '%s' string\n",
expected);
67fprintf(stderr,
"Was expecting no more rows\n");
73 #define row(bind, expected) test_row(bind, #bind, expected, __LINE__) 76 main(
intargc,
char**argv)
84printf(
"Starting %s\n", argv[0]);
91printf(
"About to logon as \"%s\"\n",
USER);
98printf(
"About to open \"%s\"\n",
SERVER);
102fprintf(stderr,
"Unable to connect to %s\n",
SERVER);
CS_RETCODE read_login_info(void)
int syb_err_handler(DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr)
int syb_msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, int severity, char *msgtext, char *srvname, char *procname, int line)
void set_malloc_options(void)
static const char * expected[]
static const char * str(char *buf, int n)
#define DBSETLPWD(x, y)
Set the password in the login packet.
#define DBSETLAPP(x, y)
Set the (client) application name in the login packet.
#define DBSETLUSER(x, y)
Set the username in the login packet.
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
RETCODE dbinit(void)
Initialize db-lib.
RETCODE dbbind(DBPROCESS *dbproc, int column, int vartype, DBINT varlen, BYTE *varaddr)
Tie a host variable to a resultset column.
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
void dbsetuserdata(DBPROCESS *dbproc, BYTE *ptr)
Associate client-allocated (and defined) data with a DBPROCESS.
void dbloginfree(LOGINREC *login)
free the LOGINREC
void dbexit()
Close server connections and free all related structures.
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
void dbclose(DBPROCESS *dbproc)
Close a connection to the server and free associated resources.
int strcmp(const char *str1, const char *str2)
static DBPROCESS * dbproc
#define row(bind, expected)
int main(int argc, char **argv)
static int expected_error
static void test_row(int vartype, const char *vartype_name, const char *expected, int line)
static const char * select_cmd
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4