* découpage

This commit is contained in:
glenux 2004-02-21 13:00:33 +00:00
parent 1693b6a5d5
commit 983e92b66c

47
src/nzg_ids.c Normal file
View file

@ -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