2004-02-21 13:00:33 +00:00
|
|
|
#ifndef _NZG_IDS
|
|
|
|
#define _NZG_IDS 1
|
|
|
|
|
|
|
|
#include "libnazgul.h"
|
2004-02-23 18:50:52 +00:00
|
|
|
#include "ids.h"
|
2004-02-21 13:00:33 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2004-02-23 10:30:02 +00:00
|
|
|
int msgPoolDataTabSemIdIntern(
|
|
|
|
msgPoolSemId destSemId,
|
|
|
|
const msgSpaceId externId){
|
|
|
|
if (strlen(externId)>MSGSPACE_ID_LEN*4){
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
/* sprintf(resNzgId,"/tmp/.nzg-%s",(char *)spaceId); */
|
|
|
|
#ifdef _NZG_REALFILEID
|
|
|
|
sprintf(destSemId,"/tmp/nzgPoolDTSem-%s",(char *)externId);
|
|
|
|
#else
|
|
|
|
sprintf(destSemId,"/nzgPoolDTSem-%s",(char *)externId);
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
2004-02-21 14:46:24 +00:00
|
|
|
int msgPoolSemIdIntern(
|
|
|
|
msgPoolSemId destSemId,
|
|
|
|
const msgSpaceId srcPoolId,
|
|
|
|
int poolIdx){
|
2004-02-21 13:17:47 +00:00
|
|
|
if (strlen(srcPoolId)>MSGSPACE_ID_LEN*4){
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
/* sprintf(resNzgId,"/tmp/.nzg-%s",(char *)spaceId); */
|
|
|
|
#ifdef _NZG_REALFILEID
|
2004-02-21 21:07:40 +00:00
|
|
|
sprintf(destSemId,"/tmp/nzgPoolSem-%s-%d",(char *)srcPoolId,poolIdx);
|
2004-02-21 13:17:47 +00:00
|
|
|
#else
|
2004-02-21 21:07:40 +00:00
|
|
|
sprintf(destSemId,"/nzgPoolSem-%s-%d",(char *)srcPoolId,poolIdx);
|
2004-02-21 13:17:47 +00:00
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-09-17 12:44:44 +00:00
|
|
|
int msgPoolDataIdIntern(msgPoolDataTabId dest,const msgSpaceId src ){
|
2004-02-21 13:00:33 +00:00
|
|
|
if (strlen(src)>MSGSPACE_ID_LEN){
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
/* sprintf(resNzgId,"/tmp/.nzg-%s",(char *)spaceId); */
|
|
|
|
#ifdef _NZG_REALFILEID
|
2004-02-21 21:07:40 +00:00
|
|
|
sprintf(dest,"/tmp/nzgPoolData-%s",(char *)src);
|
2004-02-21 13:00:33 +00:00
|
|
|
#else
|
2004-02-21 21:07:40 +00:00
|
|
|
sprintf(dest,"/nzgPoolData-%s",(char *)src);
|
2004-02-21 13:00:33 +00:00
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-02-21 21:07:40 +00:00
|
|
|
int msgPoolIdIntern(msgPoolId dest,msgPoolId src, int num){
|
2004-02-21 13:00:33 +00:00
|
|
|
if (strlen(src)>MSGSPACE_ID_LEN){
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
#ifdef _NZG_REALFILEID
|
2004-02-21 21:07:40 +00:00
|
|
|
sprintf(dest,"/tmp/nzgPool-%s-%d",(char *)src,num);
|
2004-02-21 13:00:33 +00:00
|
|
|
#else
|
2004-02-21 21:07:40 +00:00
|
|
|
sprintf(dest,"/nzgPool-%s-%d",(char *)src,num);
|
2004-02-21 13:00:33 +00:00
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-02-22 12:51:17 +00:00
|
|
|
int msgBufferInfoTabIdIntern(
|
|
|
|
msgBufferInfoTabId dest,
|
|
|
|
msgSpaceId src,
|
|
|
|
int num){
|
|
|
|
if (strlen(src)>MSGSPACE_ID_LEN){
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
#ifdef _NZG_REALFILEID
|
|
|
|
sprintf(dest,"/tmp/nzgBufferInfo-%s-%d",(char *)src,num);
|
|
|
|
#else
|
|
|
|
sprintf(dest,"/nzgBufferInfo-%s-%d",(char *)src,num);
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-02-21 13:00:33 +00:00
|
|
|
|
|
|
|
#endif
|