本文整理汇总了C++中putErrmsg函数的典型用法代码示例。如果您正苦于以下问题:C++ putErrmsg函数的具体用法?C++ putErrmsg怎么用?C++ putErrmsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了putErrmsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dtn2_destroyDirective
void dtn2_destroyDirective(FwdDirective *directive)
{
Sdr sdr = getIonsdr();
CHKVOID(directive);
if (directive->action == fwd)
{
CHKVOID(sdr_begin_xn(sdr));
sdr_free(sdr, directive->eid);
if (sdr_end_xn(sdr) < 0)
{
putErrmsg("Can't destroy directive EID.", NULL);
}
return;
}
if (directive->action == xmit)
{
if (directive->destDuctName)
{
CHKVOID(sdr_begin_xn(sdr));
sdr_free(sdr, directive->destDuctName);
if (sdr_end_xn(sdr) < 0)
{
putErrmsg("Can't destroy destDuctName.", NULL);
}
}
}
}
示例2: manageMtusize
static void manageMtusize(int tokenCount, char **tokens)
{
Sdr sdr = getIonsdr();
Object cfdpdbObj = getCfdpDbObject();
CfdpDB cfdpdb;
int newMtusize;
if (tokenCount != 3)
{
SYNTAX_ERROR;
}
newMtusize = atoi(tokens[2]);
if (newMtusize < 0)
{
putErrmsg("mtuSize invalid.", tokens[2]);
return;
}
sdr_begin_xn(sdr);
sdr_stage(sdr, (char *) &cfdpdb, cfdpdbObj, sizeof(CfdpDB));
cfdpdb.mtuSize = newMtusize;
sdr_write(sdr, cfdpdbObj, (char *) &cfdpdb, sizeof(CfdpDB));
if (sdr_end_xn(sdr) < 0)
{
putErrmsg("Can't change mtuSize.", NULL);
}
}
示例3: ionDropVdb
void ionDropVdb()
{
PsmPartition wm = getIonwm();
char *ionvdbName = _ionvdbName();
PsmAddress vdbAddress;
PsmAddress elt;
char *stop = NULL;
if (psm_locate(wm, ionvdbName, &vdbAddress, &elt) < 0)
{
putErrmsg("Failed searching for vdb.", NULL);
return;
}
if (elt)
{
dropVdb(wm, vdbAddress); /* Destroy Vdb. */
psm_free(wm, vdbAddress);
if (psm_uncatlg(wm, ionvdbName) < 0)
{
putErrmsg("Failed uncataloging vdb.", NULL);
}
}
oK(_ionvdb(&stop)); /* Forget old Vdb. */
}
示例4: Sm_list_create
PsmAddress Sm_list_create(const char *fileName, int lineNbr,
PsmPartition partition)
{
sm_SemId lock;
PsmAddress list;
SmList *listBuffer;
lock = sm_SemCreate(SM_NO_KEY, SM_SEM_FIFO);
if (lock < 0)
{
putErrmsg("Can't create semaphore for list.", NULL);
return 0;
}
list = Psm_zalloc(fileName, lineNbr, partition, sizeof(SmList));
if (list == 0)
{
sm_SemDelete(lock);
putErrmsg("Can't allocate space for list header.", NULL);
return 0;
}
listBuffer = (SmList *) psp(partition, list);
eraseList(listBuffer);
listBuffer->lock = lock;
return list;
}
示例5: udpComputeCsepName
static int udpComputeCsepName(char *endpointSpec, char *endpointName)
{
unsigned short portNbr;
unsigned int ipAddress;
char hostName[MAXHOSTNAMELEN + 1];
if (endpointName == NULL)
{
putErrmsg(BadParmsMemo, NULL);
return -1;
}
parseSocketSpec(endpointSpec, &portNbr, &ipAddress);
if (portNbr == 0)
{
portNbr = 2357; /* Default. */
}
if (ipAddress == 0) /* Default to local host. */
{
getNameOfHost(hostName, sizeof hostName);
ipAddress = getInternetAddress(hostName);
}
else
{
if (getInternetHostName(ipAddress, hostName) == NULL)
{
putErrmsg("Unknown host in endpoint.", endpointSpec);
return -1;
}
}
isprintf(endpointName, MAX_EP_NAME + 1, "%s:%hu", hostName, portNbr);
return 0;
}
示例6: manageDiscard
static void manageDiscard(int tokenCount, char **tokens)
{
Sdr sdr = getIonsdr();
Object cfdpdbObj = getCfdpDbObject();
CfdpDB cfdpdb;
int newDiscard;
if (tokenCount != 3)
{
SYNTAX_ERROR;
}
newDiscard = atoi(tokens[2]);
if (newDiscard != 0 && newDiscard != 1)
{
putErrmsg("discardIncompleteFile switch invalid.", tokens[2]);
return;
}
sdr_begin_xn(sdr);
sdr_stage(sdr, (char *) &cfdpdb, cfdpdbObj, sizeof(CfdpDB));
cfdpdb.discardIncompleteFile = newDiscard;
sdr_write(sdr, cfdpdbObj, (char *) &cfdpdb, sizeof(CfdpDB));
if (sdr_end_xn(sdr) < 0)
{
putErrmsg("Can't change discardIncompleteFile switch.", NULL);
}
}
示例7: manageMaxtrnbr
static void manageMaxtrnbr(int tokenCount, char **tokens)
{
Sdr sdr = getIonsdr();
Object cfdpdbObj = getCfdpDbObject();
CfdpDB cfdpdb;
int newMaxtrnbr;
if (tokenCount != 3)
{
SYNTAX_ERROR;
}
newMaxtrnbr = atoi(tokens[2]);
if (newMaxtrnbr < 0)
{
putErrmsg("maxTransactionNbr invalid.", tokens[2]);
return;
}
sdr_begin_xn(sdr);
sdr_stage(sdr, (char *) &cfdpdb, cfdpdbObj, sizeof(CfdpDB));
cfdpdb.maxTransactionNbr = newMaxtrnbr;
sdr_write(sdr, cfdpdbObj, (char *) &cfdpdb, sizeof(CfdpDB));
if (sdr_end_xn(sdr) < 0)
{
putErrmsg("Can't change maxTransactionNbr.", NULL);
}
}
示例8: manageFillchar
static void manageFillchar(int tokenCount, char **tokens)
{
Sdr sdr = getIonsdr();
Object cfdpdbObj = getCfdpDbObject();
CfdpDB cfdpdb;
int newFillchar;
char *trailing;
if (tokenCount != 3)
{
SYNTAX_ERROR;
}
newFillchar = strtol(tokens[2], &trailing, 16);
if (*trailing != '\0')
{
putErrmsg("fillCharacter invalid.", tokens[2]);
return;
}
sdr_begin_xn(sdr);
sdr_stage(sdr, (char *) &cfdpdb, cfdpdbObj, sizeof(CfdpDB));
cfdpdb.fillCharacter = newFillchar;
sdr_write(sdr, cfdpdbObj, (char *) &cfdpdb, sizeof(CfdpDB));
if (sdr_end_xn(sdr) < 0)
{
putErrmsg("Can't change fillCharacter.", NULL);
}
}
示例9: manageMaxtimeouts
static void manageMaxtimeouts(int tokenCount, char **tokens)
{
Sdr sdr = getIonsdr();
Object cfdpdbObj = getCfdpDbObject();
CfdpDB cfdpdb;
int newMaxtimeouts;
if (tokenCount != 3)
{
SYNTAX_ERROR;
}
newMaxtimeouts = atoi(tokens[2]);
if (newMaxtimeouts < 0)
{
putErrmsg("checkTimeoutLimit invalid.", tokens[2]);
return;
}
sdr_begin_xn(sdr);
sdr_stage(sdr, (char *) &cfdpdb, cfdpdbObj, sizeof(CfdpDB));
cfdpdb.checkTimeoutLimit = newMaxtimeouts;
sdr_write(sdr, cfdpdbObj, (char *) &cfdpdb, sizeof(CfdpDB));
if (sdr_end_xn(sdr) < 0)
{
putErrmsg("Can't change checkTimerPeriod.", NULL);
}
}
示例10: acquireBundles
static int acquireBundles(AcqWorkArea *work, Object zco,
unsigned long senderEngineNbr)
{
char engineNbrString[21];
char senderEidBuffer[SDRSTRING_BUFSZ];
char *senderEid;
isprintf(engineNbrString, sizeof engineNbrString, "%lu",
senderEngineNbr);
senderEid = senderEidBuffer;
getSenderEid(&senderEid, engineNbrString);
if (bpBeginAcq(work, 0, senderEid) < 0)
{
putErrmsg("Can't begin acquisition of bundle(s).", NULL);
return -1;
}
if (bpLoadAcq(work, zco) < 0)
{
putErrmsg("Can't continue bundle acquisition.", NULL);
return -1;
}
if (bpEndAcq(work) < 0)
{
putErrmsg("Can't end acquisition of bundle(s).", NULL);
return -1;
}
return 0;
}
示例11: manageRequirecrc
static void manageRequirecrc(int tokenCount, char **tokens)
{
Sdr sdr = getIonsdr();
Object cfdpdbObj = getCfdpDbObject();
CfdpDB cfdpdb;
int newRequirecrc;
if (tokenCount != 3)
{
SYNTAX_ERROR;
}
newRequirecrc = atoi(tokens[2]);
if (newRequirecrc != 0 && newRequirecrc != 1)
{
putErrmsg("crcRequired switch invalid.", tokens[2]);
return;
}
sdr_begin_xn(sdr);
sdr_stage(sdr, (char *) &cfdpdb, cfdpdbObj, sizeof(CfdpDB));
cfdpdb.crcRequired = newRequirecrc;
sdr_write(sdr, cfdpdbObj, (char *) &cfdpdb, sizeof(CfdpDB));
if (sdr_end_xn(sdr) < 0)
{
putErrmsg("Can't change crcRequired switch.", NULL);
}
}
示例12: Sm_list_insert_after
PsmAddress Sm_list_insert_after(const char *fileName, int lineNbr,
PsmPartition partition, PsmAddress oldElt,
PsmAddress data)
{
SmListElt *oldEltBuffer;
PsmAddress list;
SmList *listBuffer;
CHKZERO(partition);
CHKZERO(oldElt);
oldEltBuffer = (SmListElt *) psp(partition, oldElt);
CHKZERO(oldEltBuffer);
if ((list = oldEltBuffer->list) == 0)
{
putErrmsg(_noListMsg(), NULL);
return 0;
}
listBuffer = (SmList *) psp(partition, list);
if (lockSmlist(listBuffer) == ERROR)
{
putErrmsg(_cannotLockMsg(), NULL);
return 0;
}
return finishInsertingAfter(fileName, lineNbr, partition, oldElt,
oldEltBuffer, list, listBuffer, data);
}
示例13: reforwardStrandedBundles
static int reforwardStrandedBundles()
{
Sdr sdr = getIonsdr();
BpDB *bpConstants = getBpConstants();
Object elt;
Object nextElt;
CHKERR(sdr_begin_xn(sdr));
for (elt = sdr_list_first(sdr, bpConstants->limboQueue); elt;
elt = nextElt)
{
nextElt = sdr_list_next(sdr, elt);
if (releaseFromLimbo(elt, 0) < 0)
{
putErrmsg("Failed releasing bundle from limbo.", NULL);
sdr_cancel_xn(sdr);
return -1;
}
}
if (sdr_end_xn(sdr) < 0)
{
putErrmsg("brss failed limbo release on client connect.", NULL);
return -1;
}
return 0;
}
示例14: getIonwm
IonNode *addNode(IonVdb *ionvdb, uvast nodeNbr)
{
PsmPartition ionwm = getIonwm();
PsmAddress addr;
PsmAddress elt;
IonNode *node;
addr = psm_zalloc(ionwm, sizeof(IonNode));
if (addr == 0)
{
putErrmsg("Can't add node.", NULL);
return NULL;
}
node = (IonNode *) psp(ionwm, addr);
CHKNULL(node);
memset((char *) node, 0, sizeof(IonNode));
node->nodeNbr = nodeNbr;
elt = sm_rbt_insert(ionwm, ionvdb->nodes, addr, rfx_order_nodes, node);
if (elt == 0)
{
psm_free(ionwm, addr);
putErrmsg("Can't add node.", NULL);
return NULL;
}
node->embargoes = sm_list_create(ionwm);
return node;
}
示例15: Sm_rbt_create
PsmAddress Sm_rbt_create(char *file, int line, PsmPartition partition)
{
sm_SemId lock;
PsmAddress rbt;
SmRbt *rbtPtr;
lock = sm_SemCreate(SM_NO_KEY, SM_SEM_FIFO);
if (lock < 0)
{
putErrmsg("Can't create semaphore for rbt.", NULL);
return 0;
}
rbt = Psm_zalloc(file, line, partition, sizeof(SmRbt));
if (rbt == 0)
{
sm_SemDelete(lock);
putErrmsg("Can't allocate space for rbt object.", NULL);
return 0;
}
rbtPtr = (SmRbt *) psp(partition, rbt);
eraseTree(rbtPtr);
rbtPtr->lock = lock;
return rbt;
}