From b6c68da0392fb7feea98b98af7e23b92c7e35dda Mon Sep 17 00:00:00 2001 From: glenux Date: Sat, 21 Feb 2004 13:00:33 +0000 Subject: [PATCH] =?UTF-8?q?*=20d=C3=A9coupage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nzg_ids.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/nzg_ids.c diff --git a/src/nzg_ids.c b/src/nzg_ids.c new file mode 100644 index 0000000..d9429ba --- /dev/null +++ b/src/nzg_ids.c @@ -0,0 +1,47 @@ +#ifndef _NZG_IDS +#define _NZG_IDS 1 + +#include "libnazgul.h" +#include "nzg_ids.h" + +int msgSpaceIdIntern(msgSpaceId dest,const msgSpaceId src ){ + if (strlen(src)>MSGSPACE_ID_LEN){ + return -1; + } + /* sprintf(resNzgId,"/tmp/.nzg-%s",(char *)spaceId); */ +#ifdef _NZG_REALFILEID + sprintf(dest,"/tmp/nzgSpace%s",(char *)src); +#else + sprintf(dest,"/nzgSpace%s",(char *)src); +#endif + return 0; +} + +int msgPoolDataIdIntern(msgSpaceId dest,const msgSpaceId src ){ + if (strlen(src)>MSGSPACE_ID_LEN){ + return -1; + } + /* sprintf(resNzgId,"/tmp/.nzg-%s",(char *)spaceId); */ +#ifdef _NZG_REALFILEID + sprintf(dest,"/tmp/nzgSpacePoolData%s",(char *)src); +#else + sprintf(dest,"/nzgSpacePoolData%s",(char *)src); +#endif + return 0; +} + + +int msgSpacePoolId2nzgPoolId(msgSpacePoolId dest,msgSpacePoolId src, int num){ + if (strlen(src)>MSGSPACE_ID_LEN){ + return -1; + } +#ifdef _NZG_REALFILEID + sprintf(dest,"/tmp/nzgSpacePool%s%d",(char *)src,num); +#else + sprintf(dest,"/nzgSpacePool%s%d",(char *)src,num); +#endif + return 0; +} + + +#endif