l3.libnazgul/src/nzg_ids.c

48 lines
1 KiB
C
Raw Normal View History

2004-02-21 13:00:33 +00:00
#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