2 openisis - an open implementation of the CDS/ISIS database
3 Version 0.8.x (patchlevel see file Version)
4 Copyright (C) 2001-2003 by Erik Grziwotz, erik@openisis.org
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 see README for more information
24 $Id: ois.c,v 1.9 2003/06/30 09:50:15 kripke Exp $
28 #include <string.h> /* mem* */
33 /* the db srv application */
34 static int dbsrv (Con *con, int task) {
38 con->grp = 0; /* single threaded */
44 sMsg( LOG_INFO, "dbs %d: %d fields from %s",
45 svCur()->id, con->req->len, con->nam);
46 rt = ldspProcess (con->req, &(con->ses->res), 0, 0);
47 sMsg( LOG_INFO, "dbs %d: %d fields to %s (%d)",
48 svCur()->id, con->ses->res->len, con->nam, rt);
54 int main ( int argc, const char **argv )
56 const char *arg0 = *argv;
57 /* should we ask federico for his fhc 1499 ? */
58 /* or use unassigned 5433 = postgresql++ ? */
59 const char *port = "2042"; /* isis :) */
64 memset( &dbs, 0, sizeof(dbs) );
71 const char *arg = *++argv;
72 if ( '0' <= *arg && *arg <= '9' )
75 rec = rSet (rec, 0, OPENISIS_RQS_TYPE, "1", OPENISIS_COM_DBN, arg, 0 );
76 openIsisNSend (stub0, rec, 0, 0, 0);
79 /* else sMsg( LOG_ERROR, "could not open db '%s'", arg ); */
83 sMsg( LOG_ERROR, "usage: %s db [db ...] [port]", arg0 );
86 return svRun( &dbs, port );