--- libaitsess/inc/defs.h 2011/04/30 22:02:59 1.2.2.1 +++ libaitsess/inc/defs.h 2011/09/07 15:52:35 1.3.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: defs.h,v 1.2.2.1 2011/04/30 22:02:59 misho Exp $ +* $Id: defs.h,v 1.3.2.1 2011/09/07 15:52:35 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -46,15 +46,16 @@ SUCH DAMAGE. #ifndef __DEFS_H #define __DEFS_H -#define MAX_STR 255 +#define STRSIZ 256 +#define SESS_AIT_MAGIC 0x3CC3 + #define MEM_MODE 0640 #define MEM_DELIM ":" #define LOGERR { \ - sessErrno = errno; \ - bzero(sessError, MAX_STR + 1); \ - strncpy(sessError, strerror(errno), MAX_STR); \ + sess_Errno = errno; \ + strlcpy(sess_Error, strerror(errno), sizeof sess_Error); \ } /* @@ -72,9 +73,14 @@ union semun { }; #endif +typedef struct _tagSessHdr { + uint16_t hdr_magic; + uint16_t hdr_argc; +} sess_hdr_t; -extern int sessErrno; -extern char sessError[]; + +extern int sess_Errno; +extern char sess_Error[STRSIZ]; #endif