00001 /* 00002 openisis - an open implementation of the CDS/ISIS database 00003 Version 0.8.x (patchlevel see file Version) 00004 Copyright (C) 2001-2003 by Erik Grziwotz, erik@openisis.org 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either 00009 version 2.1 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public 00017 License along with this library; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 00020 see README for more information 00021 EOH */ 00022 #ifndef LSES_H 00023 00024 /* 00025 $Id: lses.h,v 1.8 2003/04/10 13:43:44 kripke Exp $ 00026 session 00027 */ 00028 00029 #include "loi.h" 00030 #include "lio.h" 00031 00032 enum { 00033 LSES_FILE_MAX = 16 00034 }; 00035 00036 typedef struct Ses { 00037 int id; 00038 char name[64]; 00039 Ios *io[LSES_FILE_MAX]; 00040 int hash; /* -value of name */ 00041 struct Ses *nxt; /* chain in hash */ 00042 int accnt; /* # accesses */ 00043 Tm ctime; 00044 Tm mtime; 00045 Tm atime; 00046 00047 Rec *prop; /* session state */ 00048 Rec *res; /* a reusable result */ 00049 struct Con *cur; /* current connection */ 00050 struct Con *que; /* connection queue */ 00051 /* actually this is followed by internal members ... */ 00052 } Ses; 00053 00054 00059 extern Ses *sGet (); 00060 extern void sSet ( Ses *ses ); 00061 00062 #ifdef _REENTRANT 00063 #define SESDECL Session ses = sGet(); 00064 #define SESGET() sGet() 00065 #define SESSET(s) sSet(s) 00066 #else 00067 extern Ses *ses; 00068 #define SESDECL 00069 #define SESGET() ses 00070 #define SESSET(s) do { ses = (s); } while (0) 00071 #endif 00072 00073 extern void lses_init (); 00074 extern void lses_fini (); 00075 00076 00083 extern Ses *cSesByName ( char *name, int nlen, Tm *now, Tm *expire ); 00084 00085 00086 #define LSES_H 00087 #endif /* LSES_H */