FreeTDS API: src/apps/fisql/handlers.h Source File

FreeTDS API

handlers.h
1 /* Free ISQL - An isql for DB-Library (C) 2007 Nicholas S. Castellano
2 *
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public
5 * License as published by the Free Software Foundation; either
6 * version 2 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Library General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 * Boston, MA 02111-1307, USA.
17 */
18
19 /* $Id: handlers.h,v 1.4 2007-01-20 06:32:27 castellano Exp $ */
20 extern int global_errorlevel;
21
22 int err_handler(DBPROCESS * dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr);
23
24 int msg_handler(DBPROCESS * dbproc, DBINT msgno, int msgstate,
25 int severity, char *msgtext, char *srvname, char *procname, int line);
dbsqlexec
RETCODE dbsqlexec(DBPROCESS *dbproc)
send the SQL command to the server and wait for an answer.
Definition: dblib.c:1424
sybdb.h
Primary include file for db-lib applications.
dbspr1row
RETCODE dbspr1row(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print a regular result row to a buffer.
Definition: dblib.c:3461
dbhasretstat
DBBOOL dbhasretstat(DBPROCESS *dbproc)
Determine if query generated a return status number.
Definition: dblib.c:4654
dbalttype
int dbalttype(DBPROCESS *dbproc, int computeid, int column)
Get datatype for a compute column.
Definition: dblib.c:4344
dbsprline
RETCODE dbsprline(DBPROCESS *dbproc, char *buffer, DBINT buf_len, DBCHAR line_char)
Get formatted string for underlining dbsprhead() column names.
Definition: dblib.c:3841
dbcmd
RETCODE dbcmd(DBPROCESS *dbproc, const char cmdstring[])
Append SQL to the command buffer.
Definition: dblib.c:1378
dbcolname
char * dbcolname(DBPROCESS *dbproc, int column)
Return name of a regular result column.
Definition: dblib.c:1876
dbcancel
RETCODE dbcancel(DBPROCESS *dbproc)
Cancel the current command batch.
Definition: dblib.c:3398
dbsprhead
RETCODE dbsprhead(DBPROCESS *dbproc, char *buffer, DBINT buf_len)
Print result set headings to a buffer.
Definition: dblib.c:3899
dbfreebuf
void dbfreebuf(DBPROCESS *dbproc)
Erase the command buffer, in case DBNOAUTOFREE was set with dbsetopt().
Definition: dblib.c:6064
dbconvert
DBINT dbconvert(DBPROCESS *dbproc, int srctype, const BYTE *src, DBINT srclen, int desttype, BYTE *dest, DBINT destlen)
cf.
Definition: dblib.c:2597
dbopen
DBPROCESS * dbopen(LOGINREC *login, const char *server)
Normally not used.
Definition: dbopen.c:36
dbsetinterrupt
void dbsetinterrupt(DBPROCESS *dbproc, DB_DBCHKINTR_FUNC chkintr, DB_DBHNDLINTR_FUNC hndlintr)
Set interrupt handler for db-lib to use while blocked against a read from the server.
Definition: dblib.c:4635
dbaltop
int dbaltop(DBPROCESS *dbproc, int computeid, int column)
Get aggregation operator for a compute column.
Definition: dblib.c:4448
DBSETLHOST
#define DBSETLHOST(x, y)
Set the (client) host name in the login packet.
Definition: sybdb.h:1247
dbprtype
const char * dbprtype(int token)
Print a token value's name to a buffer.
Definition: dblib.c:6451
dbsettime
RETCODE dbsettime(int seconds)
Set maximum seconds db-lib waits for a server response to query.
Definition: dblib.c:4196
dbspr1rowlen
DBINT dbspr1rowlen(DBPROCESS *dbproc)
Determine size buffer required to hold the results returned by dbsprhead(), dbsprline(),...
Definition: dblib.c:3423
dbcollen
DBINT dbcollen(DBPROCESS *dbproc, int column)
Get size of a regular result column.
Definition: dblib.c:3173
DBSETLPWD
#define DBSETLPWD(x, y)
Set the password in the login packet.
Definition: sybdb.h:1253
dbmsghandle
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler)
Set a message handler, for messages from the server.
Definition: dblib.c:5144
dbsetversion
RETCODE dbsetversion(DBINT version)
Specify a db-lib version level.
Definition: dblib.c:5980
dbsetifile
void dbsetifile(char *filename)
set name and location of the interfaces file FreeTDS should use to look up a servername.
Definition: dblib.c:2715
DBROWS
#define DBROWS(x)
Sybase macro mapping to the Microsoft (lower-case) function.
Definition: sybdb.h:875
dbexit
void dbexit()
Close server connections and free all related structures.
Definition: dblib.c:1557
dbinit
RETCODE dbinit(void)
Initialize db-lib.
Definition: dblib.c:665
dbadata
BYTE * dbadata(DBPROCESS *dbproc, int computeid, int column)
Get address of compute column data.
Definition: dblib.c:4419
DBSETLAPP
#define DBSETLAPP(x, y)
Set the (client) application name in the login packet.
Definition: sybdb.h:1260
DBSETLCHARSET
#define DBSETLCHARSET(x, y)
Set the client character set in the login packet.
Definition: sybdb.h:1275
dbaltcolid
int dbaltcolid(DBPROCESS *dbproc, int computeid, int column)
Get column ID of a compute column.
Definition: dblib.c:4288
DBSETLNATLANG
#define DBSETLNATLANG(x, y)
Set the language the server should use for messages.
Definition: sybdb.h:1266
dbprrow
RETCODE dbprrow(DBPROCESS *dbproc)
Print a result set to stdout.
Definition: dblib.c:3544
dbadlen
DBINT dbadlen(DBPROCESS *dbproc, int computeid, int column)
Get size of data in a compute column.
Definition: dblib.c:4314
dberrhandle
EHANDLEFUNC dberrhandle(EHANDLEFUNC handler)
Set an error handler, for messages from db-lib.
Definition: dblib.c:5125
tds_dblib_dbprocess
Definition: dblib.h:123
dbsetlogintime
RETCODE dbsetlogintime(int seconds)
Set maximum seconds db-lib waits for a server response to a login attempt.
Definition: dblib.c:4243
dbresults
RETCODE dbresults(DBPROCESS *dbproc)
Set up query results.
Definition: dblib.c:1698
dbsetopt
RETCODE dbsetopt(DBPROCESS *dbproc, int option, const char *char_param, int int_param)
Set db-lib or server option.
Definition: dblib.c:4475
dblogin
LOGINREC * dblogin(void)
Allocate a LOGINREC structure.
Definition: dblib.c:710
dbprhead
void dbprhead(DBPROCESS *dbproc)
Print result set headings to stdout.
Definition: dblib.c:3963
dbcoltype
int dbcoltype(DBPROCESS *dbproc, int column)
Get the datatype of a regular result set column.
Definition: dblib.c:2974
dbgetchar
char * dbgetchar(DBPROCESS *dbproc, int pos)
Get address of a position in the command buffer.
Definition: dblib.c:6314
DBSETLUSER
#define DBSETLUSER(x, y)
Set the username in the login packet.
Definition: sybdb.h:1250
DBSETLPACKET
#define DBSETLPACKET(x, y)
Set the packet size in the login packet for new connections.
Definition: sybdb.h:1277
DBSETLENCRYPT
#define DBSETLENCRYPT(x, y)
Enable (or not) network password encryption for Sybase servers version 10.0 or above.
Definition: sybdb.h:1280
dbnumalts
int dbnumalts(DBPROCESS *dbproc, int computeid)
Get count of columns in a compute row.
Definition: dblib.c:4944
dbretstatus
DBINT dbretstatus(DBPROCESS *dbproc)
Fetch status value returned by query or remote procedure call.
Definition: dblib.c:4678
DBDEAD
#define DBDEAD(x)
Sybase macro mapping to the Microsoft (lower-case) function.
Definition: sybdb.h:761
DBCOUNT
#define DBCOUNT(x)
Sybase macro mapping to the Microsoft (lower-case) function.
Definition: sybdb.h:747
LOGINREC
Definition: bsqlodbc.c:100