📄 rvmegacoobjects.c
字号:
{returns: A pointer to the constructed object, or NULL if construction failed.}
}
$*/
RvMegacoTerminationId *rvMegacoTerminationIdConstructRootA(RvMegacoTerminationId *x, RvAlloc *alloc)
{
rvStringConstruct(&x->name, "ROOT", alloc);
return x;
}
/*$
{function:
{name: rvMegacoTerminationIdConstructCopy}
{class: RvMegacoTerminationId}
{include: rvmegacoobjects.h}
{description:
{p: Constructs a copy of a termination id object.}
}
{proto: RvMegacoTerminationId *rvMegacoTerminationIdConstructCopy(RvMegacoTerminationId *d, const RvMegacoTerminationId *s, RvAlloc *alloc);}
{params:
{param: {n:d} {d:The destination termination id object.}}
{param: {n:s} {d:The termination id object to copy.}}
{param: {n:alloc} {d:The allocator to use.}}
}
{returns: A pointer to the constructed object, or NULL if construction failed.}
}
$*/
RvMegacoTerminationId *rvMegacoTerminationIdConstructCopy(RvMegacoTerminationId *d, const RvMegacoTerminationId *s, RvAlloc *alloc)
{
rvStringConstructCopy(&d->name, &s->name, alloc);
return d;
}
/*$
{function:
{name: rvMegacoTerminationIdDestruct}
{class: RvMegacoTerminationId}
{include: rvmegacoobjects.h}
{description:
{p: Destroys a termination id object.}
}
{proto: void rvMegacoTerminationIdDestruct(RvMegacoTerminationId *x);}
{params:
{param: {n:x} {d:The termination id object.}}
}
}
$*/
void rvMegacoTerminationIdDestruct(RvMegacoTerminationId *x)
{
rvStringDestruct(&x->name);
}
/*$
{function:
{name: rvMegacoTerminationIdCopy}
{class: RvMegacoTerminationId}
{include: rvmegacoobjects.h}
{description:
{p: Copies the value of one termination id object to another.}
}
{proto: RvMegacoTerminationId *rvMegacoTerminationIdCopy(RvMegacoTerminationId *d, const RvMegacoTerminationId *s);}
{params:
{param: {n:d} {d:The destination termination id object.}}
{param: {n:s} {d:The termination id object to copy.}}
}
{returns: A pointer to the destination object, or NULL if the copy failed.}
}
$*/
RvMegacoTerminationId *rvMegacoTerminationIdCopy(RvMegacoTerminationId *d, const RvMegacoTerminationId *s)
{
rvStringCopy(&d->name, &s->name);
return d;
}
/*$
{function:
{name: rvMegacoTerminationIdEqual}
{class: RvMegacoTerminationId}
{include: rvmegacoobjects.h}
{description:
{p: Compares two termination id objects for equality.}
}
{proto: RvBool rvMegacoTerminationIdEqual(const RvMegacoTerminationId *a, const RvMegacoTerminationId *b);}
{params:
{param: {n:a} {d:The first termination id object.}}
{param: {n:b} {d:The second termination id object.}}
}
{returns: rvTrue if the objects are equal, rvFalse if not.}
}
$*/
RvBool rvMegacoTerminationIdEqual(const RvMegacoTerminationId *a, const RvMegacoTerminationId *b)
{
return rvStringEqualIgnoreCase(&a->name, &b->name);
}
/*$
{function:
{name: rvMegacoTerminationIdGetId}
{class: RvMegacoTerminationId}
{include: rvmegacoobjects.h}
{description:
{p: Gets the id of the termination id object.}
}
{proto: const char *rvMegacoTerminationIdGetId(const RvMegacoTerminationId *x);}
{params:
{param: {n:x} {d:The termination id object.}}
}
{returns: The id.}
{notes:
{note: The termination id object must have the type RV_MEGACOTERMINATIONID_NORMAL.}
}
}
$*/
const char *rvMegacoTerminationIdGetId(const RvMegacoTerminationId *x)
{
return rvStringGetData(&x->name);
}
/*$
{function:
{name: rvMegacoTerminationIdIsNormal}
{class: RvMegacoTerminationId}
{include: rvmegacoobjects.h}
{description:
{p: Checks if a termination identifier represents a single, fully-specified termination other than ROOT.}
}
{proto: RvBool rvMegacoTerminationIdIsNormal(const RvMegacoTerminationId *x);}
{params:
{param: {n:x} {d:The termination id object.}}
}
{returns: rvTrue if the termination id represents a normal termination, rvFalse if it is ROOT
or contains wildcards or choose characters.}
}
$*/
RvBool rvMegacoTerminationIdIsNormal(const RvMegacoTerminationId *x)
{
return !rvMegacoTerminationIdIsWild(x)
&& !rvMegacoTerminationIdIsChoose(x)
&& !rvMegacoTerminationIdIsRoot(x);
}
/*$
{function:
{name: rvMegacoTerminationIdIsRoot}
{class: RvMegacoTerminationId}
{include: rvmegacoobjects.h}
{description:
{p: Checks if a termination is the root termination.}
}
{proto: RvBool rvMegacoTerminationIdIsRoot(const RvMegacoTerminationId *x);}
{params:
{param: {n:x} {d:The termination id object.}}
}
{returns: rvTrue if the termination is the root termination, rvFalse if not.}
}
$*/
RvBool rvMegacoTerminationIdIsRoot(const RvMegacoTerminationId *x)
{
return rvStrIcmp(rvStringGetData(&x->name), "ROOT") == 0;
}
/*$
{function:
{name: rvMegacoTerminationIdIsWild}
{class: RvMegacoTerminationId}
{include: rvmegacoobjects.h}
{description:
{p: Checks if a termination identifier contains a wildcard.}
}
{proto: RvBool rvMegacoTerminationIdIsWild(const RvMegacoTerminationId *x);}
{params:
{param: {n:x} {d:The termination id object.}}
}
{returns: rvTrue if the termination identifier contains a wildcard, rvFalse if not.}
}
$*/
RvBool rvMegacoTerminationIdIsWild(const RvMegacoTerminationId *x)
{
return strchr(rvStringGetData(&x->name), '*') != NULL;
}
/*$
{function:
{name: rvMegacoTerminationIdIsChoose}
{class: RvMegacoTerminationId}
{include: rvmegacoobjects.h}
{description:
{p: Checks if a termination identifier contains the choose symbol.}
}
{proto: RvBool rvMegacoTerminationIdIsChoose(const RvMegacoTerminationId *x);}
{params:
{param: {n:x} {d:The termination id object.}}
}
{returns: rvTrue if the termination identifier contains the choose symbol, rvFalse if not.}
}
$*/
RvBool rvMegacoTerminationIdIsChoose(const RvMegacoTerminationId *x)
{
return strchr(rvStringGetData(&x->name), '$') != NULL;
}
/*$
{function:
{name: rvMegacoContextIdConstruct}
{class: RvMegacoContextId}
{include: rvmegacoobjects.h}
{description:
{p: Constructs a context id object.}
}
{proto: RvMegacoContextId *rvMegacoContextIdConstruct(RvMegacoContextId *x, unsigned int id);}
{params:
{param: {n:x} {d:The context id object.}}
{param: {n:id} {d:The context id.}}
}
{returns: A pointer to the constructed object, or NULL if construction failed.}
{notes:
{note: Use rvMegacoContextIdConstructSpecial to construct null (-), choose (\$), or all (*).}
}
}
$*/
RvMegacoContextId *rvMegacoContextIdConstruct(RvMegacoContextId *x, unsigned int id)
{
x->id = id;
x->type = RV_MEGACOCONTEXTID_NORMAL;
return x;
}
/*$
{function:
{name: rvMegacoContextIdConstructSpecial}
{class: RvMegacoContextId}
{include: rvmegacoobjects.h}
{description:
{p: Constructs a special type of context id object.}
}
{proto: RvMegacoContextId *rvMegacoContextIdConstructSpecial(RvMegacoContextId *x, RvMegacoContextIdType type);}
{params:
{param: {n:x} {d:The context id object.}}
{param: {n:type} {d:The special type: null, choose, or all.}}
}
{returns: A pointer to the constructed object, or NULL if construction failed.}
}
$*/
RvMegacoContextId *rvMegacoContextIdConstructSpecial(RvMegacoContextId *x, RvMegacoContextIdType type)
{
assert(type != RV_MEGACOCONTEXTID_NORMAL);
x->id = 0;
x->type = type;
return x;
}
/*$
{function:
{name: rvMegacoContextIdEqual}
{class: RvMegacoContextId}
{include: rvmegacoobjects.h}
{description:
{p: Compares two context id objects for equality.}
}
{proto: RvBool rvMegacoContextIdEqual(const RvMegacoContextId *a, const RvMegacoContextId *b);}
{params:
{param: {n:a} {d:The first context id object.}}
{param: {n:b} {d:The second context id object.}}
}
{returns: rvTrue if the objects are equal, rvFalse if not.}
}
$*/
RvBool rvMegacoContextIdEqual(const RvMegacoContextId *a, const RvMegacoContextId *b)
{
return a->type == b->type && a->id == b->id;
}
/*$
{function:
{name: rvMegacoContextIdGetId}
{class: RvMegacoContextId}
{include: rvmegacoobjects.h}
{description:
{p: Gets the id of the context id object.}
}
{proto: unsigned int rvMegacoContextIdGetId(const RvMegacoContextId *x);}
{params:
{param: {n:x} {d:The context id object.}}
}
{returns: The id.}
{notes:
{note: The context id object must have the type RV_MEGACOCONTEXTID_NORMAL.}
}
}
$*/
unsigned int rvMegacoContextIdGetId(const RvMegacoContextId *x)
{
return x->id;
}
/*$
{function:
{name: rvMegacoContextIdGetType}
{class: RvMegacoContextId}
{include: rvmegacoobjects.h}
{description:
{p: Gets the type of the context id object.}
}
{proto: RvMegacoContextIdType rvMegacoContextIdGetType(const RvMegacoContextId *x);}
{params:
{param: {n:x} {d:The context id object.}}
}
{returns: The type.}
}
$*/
RvMegacoContextIdType rvMegacoContextIdGetType(const RvMegacoContextId *x)
{
return x->type;
}
/*$
{function:
{name: rvMegacoPackageItemConstruct}
{class: RvMegacoPackageItem}
{include: rvmegacoobjects.h}
{description:
{p: Constructs a package item object.}
}
{proto: RvMegacoPackageItem *rvMegacoPackageItemConstruct(RvMegacoPackageItem *x, const char *pkg, const char *item);}
{params:
{param: {n:x} {d:The package item object.}}
{param: {n:pkg} {d:The name of the package the item belongs to.}}
{param: {n:item} {d:The name of the item.}}
}
{returns: A pointer to the constructed object, or NULL if construction failed.}
}
$*/
RvMegacoPackageItem *rvMegacoPackageItemConstruct(RvMegacoPackageItem *x, const char *pkg, const char *item)
{
return rvMegacoPackageItemConstructA(x, pkg, item, &rvDefaultAlloc);
}
/*$
{function:
{name: rvMegacoPackageItemConstructA}
{class: RvMegacoPackageItem}
{include: rvmegacoobjects.h}
{description:
{p: Constructs a package item object.}
}
{proto: RvMegacoPackageItem *rvMegacoPackageItemConstructA(RvMegacoPackageItem *x, const char *pkg, const char *item, RvAlloc *alloc);}
{params:
{param: {n:x} {d:The package item object.}}
{param: {n:pkg} {d:The name of the package the item belongs to.}}
{param: {n:item} {d:The name of the item.}}
{param: {n:alloc} {d:The allocator to use.}}
}
{returns: A pointer to the constructed object, or NULL if construction failed.}
}
$*/
RvMegacoPackageItem *rvMegacoPackageItemConstructA(RvMegacoPackageItem *x, const char *pkg, const char *item, RvAlloc *alloc)
{
rvStringConstruct(&x->package, pkg, alloc);
rvStringConstruct(&x->item, item, alloc);
return x;
}
/*$
{function:
{name: rvMegacoPackageItemConstructCopy}
{class: RvMegacoPackageItem}
{include: rvmegacoobjects.h}
{description:
{p: Constructs a copy of a package item object.}
}
{proto: RvMegacoPackageItem *rvMegacoPackageItemConstructCopy(RvMegacoPackageItem *d, const RvMegacoPackageItem *s, RvAlloc *alloc);}
{params:
{param: {n:d} {d:The destination package item object.}}
{param: {n:s} {d:The package item object to copy.}}
{param: {n:alloc} {d:The allocator to use.}}
}
{returns: A pointer to the constructed object, or NULL if construction failed.}
}
$*/
RvMegacoPackageItem *rvMegacoPackageItemConstructCopy(RvMegacoPackageItem *d, const RvMegacoPackageItem *s, RvAlloc *alloc)
{
rvStringConstructCopy(&d->package, &s->package, alloc);
rvStringConstructCopy(&d->item, &s->item, alloc);
return d;
}
/*$
{function:
{name: rvMegacoPackageItemDestruct}
{class: RvMegacoPackageItem}
{include: rvmegacoobjects.h}
{description:
{p: Destroys a package item object.}
}
{proto: void rvMegacoPackageItemDestruct(RvMegacoPackageItem *x);}
{params:
{param: {n:x} {d:The package item object.}}
}
}
$*/
void rvMegacoPackageItemDestruct(RvMegacoPackageItem *x)
{
rvStringDestruct(&x->package);
rvStringDestruct(&x->item);
}
/*$
{function:
{name: rvMegacoPackageItemCopy}
{class: RvMegacoPackageItem}
{include: rvmegacoobjects.h}
{description:
{p: Copies the value of one package item object to another.}
}
{proto: RvMegacoPackageItem *rvMegacoPackageItemCopy(RvMegacoPackageItem *d, const RvMegacoPackageItem *s);}
{params:
{param: {n:d} {d:The destination package item object.}}
{param: {n:s} {d:The package item object to copy.}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -