本文整理汇总了C++中pwr_Return函数的典型用法代码示例。如果您正苦于以下问题:C++ pwr_Return函数的具体用法?C++ pwr_Return怎么用?C++ pwr_Return使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pwr_Return函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: dbs_Address
void *
dbs_Address(pwr_tStatus *sts, const dbs_sVenv *vep, dbs_tRef r)
{
dbs_uRefBits bits;
if (r == dbs_cNref)
return NULL;
if (!vep->mp->flags.b.isMapped)
pwr_Return(NULL, sts, DBS__NOTMAPPED);
if (vep->index != 0) {
/*printf("index: %d, name %s\n", vep->index, vep->vp->name)*/;
}
bits.m = r;
if (bits.b.sect > dbs_eSect_)
pwr_Return(NULL, sts, DBS__BADSECT);
if (bits.b.offs >= vep->sect[bits.b.sect].size)
pwr_Return(NULL, sts, DBS__BADOFFS);
return (void *)(vep->base + vep->sect[bits.b.sect].offset + bits.b.offs);
}
开发者ID:jordibrus,项目名称:proview,代码行数:26,代码来源:co_dbs.c
示例2: gdb_AddNode
gdb_sNode *
gdb_AddNode (
pwr_tStatus *sts,
pwr_tNodeId nid,
pwr_tBitMask flags
)
{
gdb_sNode *np;
gdb_AssumeLocked;
np = hash_Search(sts, gdbroot->nid_ht, &nid);
if (np != NULL) return np;
if (np != NULL) {
if (flags & gdb_mAdd_failIfAdded)
pwr_Return(NULL, sts, GDB__DUPLADD);
else
pwr_Return(np, sts, GDB__ALRADD);
}
np = pool_Alloc(sts, gdbroot->pool, sizeof(*np));
if (np == NULL) return NULL;
np->nid = nid;
np->buf_id = 1; /* Next available buffer id */
pool_Qinit(NULL, gdbroot->pool, &np->nid_htl);
pool_Qinit(NULL, gdbroot->pool, &np->nod_ll);
pool_Qinit(NULL, gdbroot->pool, &np->own_lh);
pool_Qinit(NULL, gdbroot->pool, &np->ccvol_lh);
pool_Qinit(NULL, gdbroot->pool, &np->nodms_lh);
pool_Qinit(NULL, gdbroot->pool, &np->nodmo_lh);
pool_Qinit(NULL, gdbroot->pool, &np->subc_lh);
pool_Qinit(NULL, gdbroot->pool, &np->nodsubs_lh);
pool_Qinit(NULL, gdbroot->pool, &np->nodsubb_lh);
pool_Qinit(NULL, gdbroot->pool, &np->sansAct_lh);
pool_Qinit(NULL, gdbroot->pool, &np->sansUpd_lh);
pool_Qinit(NULL, gdbroot->pool, &np->sancAdd_lh);
pool_Qinit(NULL, gdbroot->pool, &np->sancRem_lh);
pool_Qinit(NULL, gdbroot->pool, &np->sancAct_lh);
pool_Qinit(NULL, gdbroot->pool, &np->cacheNode.lh);
#if defined OS_ELN
np->cacheNode.lc_max = 100;
#else
np->cacheNode.lc_max = 200;
#endif
np->cacheNode.flags.b.cacheNode = 1;
np->cacheNode.next = pool_Reference(NULL, gdbroot->pool, &gdbroot->db->cacheCom);
np = hash_Insert(sts, gdbroot->nid_ht, np);
if (np == NULL) errh_Bugcheck(GDH__WEIRD, "adding new node");
pool_QinsertPred(NULL, gdbroot->pool, &np->nod_ll, &gdbroot->db->nod_lh);
return np;
}
开发者ID:hfuhuang,项目名称:proview,代码行数:58,代码来源:rt_gdb.c
示例3: tree_Predecessor
void *
tree_Predecessor(pwr_tStatus *sts, tree_sTable *tp, void *np)
{
np = predecessorNode(tp, np);
if (np == tp->null) {
pwr_Return(NULL, sts, TREE__NOTFOUND);
} else {
pwr_Return(np, sts, TREE__FOUND);
}
}
开发者ID:Strongc,项目名称:proview,代码行数:11,代码来源:co_tree.c
示例4: tree_Minimum
void *
tree_Minimum(pwr_tStatus *sts, tree_sTable*tp)
{
tree_sNode *np;
np = minimumNode(tp, tp->root);
if (np == tp->null) {
pwr_Return(NULL, sts, TREE__NOTFOUND);
} else {
pwr_Return((void *)np, sts, TREE__FOUND);
}
}
开发者ID:Strongc,项目名称:proview,代码行数:12,代码来源:co_tree.c
示例5: tree_Find
void *
tree_Find(pwr_tStatus *sts, tree_sTable *tp, void *key)
{
tree_sNode *np;
np = findNode(tp, key);
if (np == tp->null) {
pwr_Return(NULL, sts, TREE__NOTFOUND);
} else {
pwr_Return((void *)np, sts, TREE__FOUND);
}
}
开发者ID:Strongc,项目名称:proview,代码行数:12,代码来源:co_tree.c
示例6: ptree_Predecessor
void* ptree_Predecessor(pwr_tStatus* sts, ptree_sTable* tp, void* np)
{
pool_tRef nr = pool_Reference(sts, tp->php, np);
nr = predecessorNode(tp, nr);
if (nr == tp->g->null)
pwr_Return(NULL, sts, TREE__NOTFOUND);
np = pool_Address(sts, tp->php, nr);
pwr_Return(np, sts, TREE__FOUND);
}
开发者ID:siamect,项目名称:proview,代码行数:12,代码来源:rt_ptree.c
示例7: createTree
static tree_sTable *
createTree(
pwr_tStatus *sts,
size_t keySize,
ptrdiff_t keyOffset,
size_t recordSize,
unsigned int allocCount,
int (*compareFunc) (tree_sTable *tp, tree_sNode *x, tree_sNode *y))
{
tree_sTable *tp;
tp = (tree_sTable *) calloc(1, sizeof(*tp));
if (tp == NULL)
pwr_Return(NULL, sts, TREE__INSVIRMEM);
tp->keySize = keySize;
tp->keyOffset = keyOffset;
tp->recordSize = recordSize;
tp->allocCount = allocCount;
tp->compareFunc = compareFunc;
tp->null = allocNode(tp, NULL);
tp->key = allocNode(tp, NULL);
tp->root = tp->null;
tp->null->bal = 0;
tp->null->left = tp->null;
tp->null->right = tp->null;
tp->null->parent = tp->null;
return tp;
}
开发者ID:Strongc,项目名称:proview,代码行数:32,代码来源:co_tree.c
示例8: dbs_AlignedRead
pwr_tBoolean
dbs_AlignedRead(pwr_tStatus *sts, void *buf, pwr_tUInt32 size, const dbs_sEnv *ep)
{
int offset;
*sts = DBS__SUCCESS;
if (fread(buf, size, 1, ep->f) == 0)
pwr_Return(NO, sts, errno_GetStatus());
if ((offset = dbs_dPadding(size)) > 0)
if(fseek(ep->f, offset, SEEK_CUR))
pwr_Return(NO, sts, errno_GetStatus());
return YES;
}
开发者ID:jordibrus,项目名称:proview,代码行数:16,代码来源:co_dbs.c
示例9: cloneTree
static tree_sTable *
cloneTree(pwr_tStatus *sts, tree_sTable *otp)
{
tree_sTable *ntp;
ntp = (tree_sTable *) calloc(1, sizeof(*ntp));
if (ntp == NULL)
pwr_Return(NULL, sts, TREE__INSVIRMEM);
ntp->keySize = otp->keySize;
ntp->keyOffset = otp->keyOffset;
ntp->recordSize = otp->recordSize;
ntp->allocCount = otp->allocCount;
ntp->null = allocNode(ntp, NULL);
ntp->compareFunc = otp->compareFunc;
ntp->key = allocNode(ntp, NULL);
ntp->null->bal = 0;
ntp->null->left = ntp->null;
ntp->null->right = ntp->null;
ntp->null->parent = ntp->null;
ntp->root = copyNodes(ntp, ntp->null, otp, otp->root);
ntp->nNode = otp->nNode;
return ntp;
}
开发者ID:Strongc,项目名称:proview,代码行数:27,代码来源:co_tree.c
示例10: gdb_AddAliasServer
gdb_sAliasServer *
gdb_AddAliasServer (
pwr_tStatus *sts,
pwr_tObjid soid,
pwr_tBitMask flags
)
{
gdb_sAliasServer *asp;
gdb_sObject *op = NULL;
gdb_AssumeLocked;
pwr_Assert(cdh_ObjidIsNotNull(soid));
asp = hash_Search(sts, gdbroot->as_ht, &soid);
if (asp != NULL) {
if (flags & gdb_mAdd_failIfAdded)
pwr_Return(NULL, sts, GDB__DUPLADD);
else
pwr_Return(asp, sts, GDB__ALRADD);
}
asp = pool_Alloc(sts, gdbroot->pool, sizeof(*asp));
if (asp == NULL) return NULL;
asp->oid = soid;
pool_Qinit(NULL, gdbroot->pool, &asp->as_htl);
pool_Qinit(NULL, gdbroot->pool, &asp->as_ll);
pool_Qinit(NULL, gdbroot->pool, &asp->cli_lh);
asp = hash_Insert(sts, gdbroot->as_ht, asp);
if (asp == NULL) errh_Bugcheck(GDH__WEIRD, "adding new alias server");
pool_QinsertPred(NULL, gdbroot->pool, &asp->as_ll, &gdbroot->db->as_lh);
op = hash_Search(sts, gdbroot->oid_ht, &soid);
if (op == NULL) errh_Bugcheck(GDH__WEIRD, "getting alias server object");
op->g.flags.b.isAliasServer = 1;
return asp;
}
开发者ID:hfuhuang,项目名称:proview,代码行数:43,代码来源:rt_gdb.c
示例11: csup_Init
/*_*
@aref cyclesup CycleSup
*/
lst_sEntry *
csup_Init (
pwr_tStatus *status,
pwr_tObjid tid,
float scanTime
)
{
lst_sEntry *lh;
pwr_tObjid cid;
pwr_tObjid pid;
csup_sObject *cp;
int tv_sec;
pwr_tFloat32 max_delay;
pwr_dStatus(sts, status, CSUP__SUCCESS);
lh = calloc(1, sizeof(*lh));
if (lh == NULL)
pwr_Return(NULL, sts, CSUP__INSVIRMEM);
lst_Init(NULL, lh, NULL);
for (
*sts = gdh_GetClassList(pwr_cClass_CycleSup, &cid);
ODD(*sts);
*sts = gdh_GetNextObject(cid, &cid)
) {
cp = calloc(1, sizeof(*cp));
cp->aref.Objid = cid;
*sts = gdh_DLRefObjectInfoAttrref(&cp->aref, (void**)&cp->o, &cp->dlid);
if (EVEN(*sts))
goto error;
if ( ODD(gdh_GetParent( cid, &pid)) && cdh_ObjidIsEqual( pid, tid))
cp->is_owner = 1;
lst_InsertSucc(NULL, lh, &cp->le, cp);
max_delay = cp->o->MaxDelay;
cp->o->DelayLimit.tv_sec = tv_sec = (int)max_delay;
cp->o->DelayLimit.tv_nsec = (int)((max_delay - (float)tv_sec + FLT_EPSILON) * 1.0e9);
// printf("maxdelay: %f, tv_sec: %d, tv_nsec: %d\n", cp->o->MaxDelay, cp->o->DelayLimit.tv_sec, cp->o->DelayLimit.tv_nsec);
errh_Info("maxdelay: %f, tv_sec: %d, tv_nsec: %d", cp->o->MaxDelay,
cp->o->DelayLimit.tv_sec, cp->o->DelayLimit.tv_nsec);
}
if (lst_IsEmpty(NULL, lh))
goto error;
return lh;
error:
csup_Exit(NULL, lh);
return NULL;
}
开发者ID:jordibrus,项目名称:proview,代码行数:57,代码来源:rt_csup.c
示例12: tree_Insert
void *
tree_Insert(pwr_tStatus *sts, tree_sTable *tp, void *key)
{
tree_sNode *np;
tree_sNode *op;
np = findNode(tp, key);
if (np != tp->null)
pwr_Return((void *)np, sts, TREE__FOUND);
np = allocNode(tp, key);
if (np == NULL) return NULL;
op = insertNode(tp, np);
if (np == op) {
pwr_Return((void *)np, sts, TREE__INSERTED);
} else {
freeNode(tp, np);
pwr_Return(NULL, sts, TREE__ERROR);
}
}
开发者ID:Strongc,项目名称:proview,代码行数:20,代码来源:co_tree.c
示例13: gdb_AddVolume
gdb_sVolume *
gdb_AddVolume (
pwr_tStatus *sts,
pwr_tVolumeId vid,
pwr_tBitMask flags
)
{
gdb_sVolume *vp;
gdb_AssumeLocked;
vp = hash_Search(sts, gdbroot->vid_ht, &vid);
if (vp != NULL) {
if (flags & gdb_mAdd_failIfAdded)
pwr_Return(NULL, sts, GDB__DUPLADD);
else
pwr_Return(vp, sts, GDB__ALRADD);
}
vp = pool_Alloc(sts, gdbroot->pool, sizeof(*vp));
if (vp == NULL) return NULL;
vp->g.vid = vid;
vp->g.oid.vid = vid;
pool_Qinit(NULL, gdbroot->pool, &vp->l.vid_htl);
pool_Qinit(NULL, gdbroot->pool, &vp->l.vn_htl);
pool_Qinit(NULL, gdbroot->pool, &vp->l.vol_ll);
pool_Qinit(NULL, gdbroot->pool, &vp->l.own_ll);
pool_Qinit(NULL, gdbroot->pool, &vp->l.obj_lh);
pool_Qinit(NULL, gdbroot->pool, &vp->l.volms_lh);
hash_Insert(sts, gdbroot->vid_ht, vp);
vp->l.flags.b.inVidTable = 1;
pool_QinsertPred(sts, gdbroot->pool, &vp->l.vol_ll, &gdbroot->db->vol_lh);
vp->l.flags.b.inVolList = 1;
return vp;
}
开发者ID:hfuhuang,项目名称:proview,代码行数:40,代码来源:rt_gdb.c
示例14: gdb_AddMountServer
gdb_sMountServer *
gdb_AddMountServer (
pwr_tStatus *sts,
pwr_tObjid soid,
pwr_tBitMask flags
)
{
gdb_sMountServer *msp;
gdb_AssumeLocked;
// pwr_Assert(cdh_ObjidIsNotNull(soid));
if (cdh_ObjidIsNull(soid)) return NULL;
msp = hash_Search(sts, gdbroot->ms_ht, &soid);
if (msp != NULL) {
if (flags & gdb_mAdd_failIfAdded)
pwr_Return(NULL, sts, GDB__DUPLADD);
else
pwr_Return(msp, sts, GDB__ALRADD);
}
msp = pool_Alloc(sts, gdbroot->pool, sizeof(*msp));
if (msp == NULL) return NULL;
msp->oid = soid;
pool_Qinit(NULL, gdbroot->pool, &msp->ms_htl);
pool_Qinit(NULL, gdbroot->pool, &msp->ms_ll);
pool_Qinit(NULL, gdbroot->pool, &msp->nodms_ll);
pool_Qinit(NULL, gdbroot->pool, &msp->volms_ll);
pool_Qinit(NULL, gdbroot->pool, &msp->cli_lh);
msp = hash_Insert(sts, gdbroot->ms_ht, msp);
if (msp == NULL) errh_Bugcheck(GDH__WEIRD, "adding new mount server");
pool_QinsertPred(NULL, gdbroot->pool, &msp->ms_ll, &gdbroot->db->ms_lh);
return msp;
}
开发者ID:hfuhuang,项目名称:proview,代码行数:40,代码来源:rt_gdb.c
示例15: ConvertGet
static pwr_tBoolean
ConvertGet (
pwr_tStatus *sts,
qcom_sGet *get,
void *data
)
{
pwr_tStatus lsts;
XDR xdrs;
qdb_sNode *np;
tFuncXdr fXdr;
gdb_sNode *gnp;
pwr_tUInt32 netver;
if (get->type.b != net_cMsgClass)
pwr_Return(FALSE, sts, NET__XDRFAILED);
np = hash_Search(&lsts, &qdb->nid_ht, &get->sender.nid);
if (np == NULL) pwr_Return(FALSE, sts, lsts);
if ((int)get->type.s <= (int)net_eMsg__ || (int)get->type.s >= (int)net_eMsg_)
pwr_Return(FALSE, sts, NET__NOSUCHQCOMSUBT);
/* This is a simple way to fix the net_sGvolume difference between
* Neth version 7 and later. If this is needed for more messages
* then a generic solution must be implemented.
*/
fXdr = func_xdr[(int)get->type.s];
if (get->type.s == (qcom_eStype)net_eMsg_volumes) {
gdb_ScopeLock {
gnp = hash_Search(&lsts, gdbroot->nid_ht, &np->nid);
netver = gnp->netver;
} gdb_ScopeUnlock;
if (netver == 7) {
get->type.s = net_eMsg_volumes7;
fXdr = xdr_net_sVolumes7;
}
}
开发者ID:jordibrus,项目名称:proview,代码行数:39,代码来源:rt_net.c
示例16: gdb_AddClass
gdb_sClass *
gdb_AddClass (
pwr_tStatus *sts,
pwr_tClassId cid,
pwr_tBitMask flags
)
{
gdb_sClass *cp;
#if 0
pwr_Assert(cid != pwr_cNClassId);
#endif
gdb_AssumeLocked;
cp = hash_Search(sts, gdbroot->cid_ht, &cid);
if (cp != NULL) {
if (flags & gdb_mAdd_failIfAdded)
pwr_Return(NULL, sts, GDB__DUPLADD);
else
pwr_Return(cp, sts, GDB__ALRADD);
}
cp = pool_Alloc(sts, gdbroot->pool, sizeof(*cp));
if (cp == NULL) return NULL;
cp->cid = cid;
pool_Qinit(NULL, gdbroot->pool, &cp->cid_htl);
pool_Qinit(NULL, gdbroot->pool, &cp->cid_lh);
pool_Qinit(NULL, gdbroot->pool, &cp->class_ll);
cp = hash_Insert(sts, gdbroot->cid_ht, cp);
if (cp == NULL) errh_Bugcheck(GDH__WEIRD, "adding new class");
pool_QinsertPred(NULL, gdbroot->pool, &cp->class_ll, &gdbroot->db->class_lh);
return cp;
}
开发者ID:hfuhuang,项目名称:proview,代码行数:39,代码来源:rt_gdb.c
示例17: ptree_Insert
pool_tRef ptree_Insert(pwr_tStatus* sts, ptree_sTable* tp, void* key)
{
pool_tRef nr;
pool_tRef or ;
nr = findNode(tp, key);
if (nr != tp->g->null)
pwr_Return(nr, sts, TREE__FOUND);
nr = allocNode(tp, key);
if (nr == pool_cNRef)
pwr_Return(pool_cNRef, sts, TREE__ERROR);
or = insertNode(tp, nr);
if (nr == or) {
pwr_Return(nr, sts, TREE__INSERTED);
} else {
freeNode(tp, nr);
pwr_Return(pool_cNRef, sts, TREE__ERROR);
}
}
开发者ID:siamect,项目名称:proview,代码行数:22,代码来源:rt_ptree.c
示例18: dvol_RenameObject
gdb_sObject *
dvol_RenameObject (
pwr_tStatus *sts,
pwr_tObjid oid,
cdh_sParseName *pn
)
{
static cvol_sNotify rm; /* Cannot be on the stack for VAXELN */
gdb_sObject *op;
gdb_sObject *tmp_op;
gdb_AssumeLocked;
op = hash_Search(sts, gdbroot->oid_ht, &oid);
if (op == NULL) return NULL;
if (!op->l.flags.b.dynamic)
pwr_Return(NULL, sts, GDH__STATICVOL);
tmp_op = vol_FamilyToObject(sts, pn->object[0].name.orig, op->g.f.poid);
if (tmp_op != NULL && tmp_op != op)
pwr_Return(NULL, sts, GDH__DUPLNAME);
hash_Remove(sts, gdbroot->family_ht, op);
op->g.f.name = pn->object[0].name;
hash_Insert(sts, gdbroot->family_ht, op);
cvols_InitNotify(op, &rm, net_eMsg_renameObject);
rm.msg.r.f.name = op->g.f.name;
cvols_Notify(&rm);
pwr_Return(op, sts, GDH__SUCCESS);
}
开发者ID:hfuhuang,项目名称:proview,代码行数:38,代码来源:rt_dvol.c
示例19: tree_FindSuccessor
void *
tree_FindSuccessor(pwr_tStatus *sts, tree_sTable *tp, void *key)
{
tree_sNode *np;
np = findNearNode(tp, key);
if (tp->last == tp->null)
pwr_Return(NULL, sts, TREE__NOTFOUND);
if (np != tp->null) {
np = successorNode(tp, np);
} else if (tp->lastComp < 0) {
np = tp->last;
} else {
np = successorNode(tp, tp->last);
}
if (np == tp->null) {
pwr_Return(NULL, sts, TREE__NOTFOUND);
} else {
pwr_Return((void *)np, sts, TREE__FOUND);
}
}
开发者ID:Strongc,项目名称:proview,代码行数:24,代码来源:co_tree.c
示例20: dvol_DeleteObject
pwr_tBoolean
dvol_DeleteObject (
pwr_tStatus *sts,
pwr_tObjid oid
)
{
static cvol_sNotify dm; /* Cannot be on the stack for VAXELN */
gdb_sObject *op;
gdb_sObject *p_op;
gdb_sVolume *vp;
gdb_AssumeLocked;
if (oid.oix == pwr_cNObjectIx)
pwr_Return(FALSE, sts, GDH__VOLDELETE);
op = vol_OidToObject(sts, oid, gdb_mLo_dynamic, vol_mTrans_none, cvol_eHint_none);
if (op == NULL) return FALSE;
if (op->g.flags.b.isParent && cdh_ObjidIsNotNull(op->g.soid))
pwr_Return(FALSE, sts, GDH__CHILDREN);
p_op = pool_Address(NULL, gdbroot->pool, op->l.por);
vp = pool_Address(NULL, gdbroot->pool, op->l.vr);
cvols_InitNotify(op, &dm, net_eMsg_deleteObject);
unadoptObject(sts, op, p_op, &dm);
vol_UnlinkObject(sts, vp, op, vol_mLink_delete);
cvols_Notify(&dm);
pwr_Return(TRUE, sts, GDH__SUCCESS);
}
开发者ID:hfuhuang,项目名称:proview,代码行数:36,代码来源:rt_dvol.c
注:本文中的pwr_Return函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论