⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rvmegacoobjects.c

📁 h.248协议源码
💻 C
📖 第 1 页 / 共 5 页
字号:
		{p: Gets the value of the parameter value object.}
	}
	{proto: const char *rvMegacoParameterValueGetValue(const RvMegacoParameterValue *x);}
	{params:
		{param: {n:x} {d:The parameter value object.}}
	}
	{returns: The value.}
	{notes:
		{note: Not valid for lists and ranges.}
	}
}
$*/
const char *rvMegacoParameterValueGetValue(const RvMegacoParameterValue *x)
{
	assert(x->type != RV_RELATION_AND && x->type != RV_RELATION_OR && x->type != RV_RELATION_RANGE);
	return rvStringListGetElem(&x->values, 0);
}


/*$
{function:
	{name: rvMegacoParameterValueGetRangeMin}
	{class: RvMegacoParameterValue}
	{include: rvmegacoobjects.h}
	{description:
		{p: Gets the minimum value of a parameter value object that is a range.}
	}
	{proto: const char *rvMegacoParameterValueGetRangeMin(const RvMegacoParameterValue *x);}
	{params:
		{param: {n:x} {d:The parameter value object.}}
	}
	{returns: The minimum value.}
}
$*/
const char *rvMegacoParameterValueGetRangeMin(const RvMegacoParameterValue *x)
{
	assert(x->type == RV_RELATION_RANGE);
	return rvStringListGetElem(&x->values, 0);
}


/*$
{function:
	{name: rvMegacoParameterValueGetRangeMax}
	{class: RvMegacoParameterValue}
	{include: rvmegacoobjects.h}
	{description:
		{p: Gets the maximum value of a parameter value object that is a range.}
	}
	{proto: const char *rvMegacoParameterValueGetRangeMax(const RvMegacoParameterValue *x);}
	{params:
		{param: {n:x} {d:The parameter value object.}}
	}
	{returns: The maximum value.}
}
$*/
const char *rvMegacoParameterValueGetRangeMax(const RvMegacoParameterValue *x)
{
	assert(x->type == RV_RELATION_RANGE);
	return rvStringListGetElem(&x->values, 1);
}


/*$
{function:
	{name: rvMegacoParameterValueGetListSize}
	{class: RvMegacoParameterValue}
	{include: rvmegacoobjects.h}
	{description:
		{p: Gets the number of possible values for a parameter value object that is a list.}
	}
	{proto: size_t rvMegacoParameterValueGetListSize(const RvMegacoParameterValue *x);}
	{params:
		{param: {n:x} {d:The parameter value object.}}
	}
	{returns: The list size.}
}
$*/
size_t rvMegacoParameterValueGetListSize(const RvMegacoParameterValue *x)
{
	assert(x->type == RV_RELATION_AND || x->type == RV_RELATION_OR);
	return rvStringListGetSize(&x->values);
}


/*$
{function:
	{name: rvMegacoParameterValueGetListValue}
	{class: RvMegacoParameterValue}
	{include: rvmegacoobjects.h}
	{description:
		{p: Gets one value of a parameter value object that is a list.}
	}
	{proto: const char *rvMegacoParameterValueGetListValue(const RvMegacoParameterValue *x, size_t index);}
	{params:
		{param: {n:x} {d:The parameter value object.}}
		{param: {n:index} {d:The index.}}
	}
	{returns: The value.}
}
$*/
const char *rvMegacoParameterValueGetListValue(const RvMegacoParameterValue *x, size_t index)
{
	assert(x->type == RV_RELATION_AND || x->type == RV_RELATION_OR);
	return rvStringListGetElem(&x->values, index);
}


/*  IS THIS CLASS NECESSARY?
{function:
	{name: rvMegacoParameterConstruct}
	{class: RvMegacoParameter}
	{include: rvmegacoobjects.h}
	{description:
		{p: Constructs a parameter object.}
	}
	{proto: RvMegacoParameter *rvMegacoParameterConstruct(RvMegacoParameter *x, const RvMegacoPackageItem *name, const RvMegacoParameterValue *value);}
	{params:
		{param: {n:x} {d:The parameter object.}}
		{param: {n:name} {d:The parameter name.}}
		{param: {n:value} {d:The parameter value.}}
	}
	{returns: A pointer to the constructed object, or NULL if construction failed.}
}
*/
RvMegacoParameter *rvMegacoParameterConstruct(RvMegacoParameter *x, const RvMegacoPackageItem *name, const RvMegacoParameterValue *value)
{
	return rvMegacoParameterConstructA(x, name, value, &rvDefaultAlloc);
}


/* IS THIS CLASS NECESSARY?
{function:
	{name: rvMegacoParameterConstructA}
	{class: RvMegacoParameter}
	{include: rvmegacoobjects.h}
	{description:
		{p: Constructs a parameter object.}
	}
	{proto: RvMegacoParameter *rvMegacoParameterConstructA(RvMegacoParameter *x, const RvMegacoPackageItem *name, const RvMegacoParameterValue *value, RvAlloc *alloc);}
	{params:
		{param: {n:x} {d:The parameter object.}}
		{param: {n:name} {d:The parameter name.}}
		{param: {n:value} {d:The parameter value.}}
		{param: {n:alloc} {d:The allocator to use.}}
	}
	{returns: A pointer to the constructed object, or NULL if construction failed.}
}
*/
RvMegacoParameter *rvMegacoParameterConstructA(RvMegacoParameter *x, const RvMegacoPackageItem *name, const RvMegacoParameterValue *value, RvAlloc *alloc)
{
	rvMegacoPackageItemConstructCopy(&x->name, name, alloc);
	rvMegacoParameterValueConstructCopy(&x->value, value, alloc);
	return x;
}


/* IS THIS CLASS NECESSARY?
{function:
	{name: rvMegacoParameterConstructCopy}
	{class: RvMegacoParameter}
	{include: rvmegacoobjects.h}
	{description:
		{p: Constructs a copy of a parameter object.}
	}
	{proto: RvMegacoParameter *rvMegacoParameterConstructCopy(RvMegacoParameter *d, const RvMegacoParameter *s, RvAlloc *alloc);}
	{params:
		{param: {n:d} {d:The destination parameter object.}}
		{param: {n:s} {d:The parameter object to copy.}}
		{param: {n:alloc} {d:The allocator to use.}}
	}
	{returns: A pointer to the constructed object, or NULL if construction failed.}
}
*/
RvMegacoParameter *rvMegacoParameterConstructCopy(RvMegacoParameter *d, const RvMegacoParameter *s, RvAlloc *alloc)
{
	rvMegacoPackageItemConstructCopy(&d->name, &s->name, alloc);
	rvMegacoParameterValueConstructCopy(&d->value, &s->value, alloc);
	return d;
}


/* IS THIS CLASS NECESSARY?
{function:
	{name: rvMegacoParameterDestruct}
	{class: RvMegacoParameter}
	{include: rvmegacoobjects.h}
	{description:
		{p: Destroys a parameter object.}
	}
	{proto: void rvMegacoParameterDestruct(RvMegacoParameter *x);}
	{params:
		{param: {n:x} {d:The parameter object.}}
	}
}
*/
void rvMegacoParameterDestruct(RvMegacoParameter *x)
{
	rvMegacoPackageItemDestruct(&x->name);
	rvMegacoParameterValueDestruct(&x->value);
}


/* IS THIS CLASS NECESSARY?
{function:
	{name: rvMegacoParameterCopy}
	{class: RvMegacoParameter}
	{include: rvmegacoobjects.h}
	{description:
		{p: Copies the value of one parameter object to another.}
	}
	{proto: RvMegacoParameter *rvMegacoParameterCopy(RvMegacoParameter *d, const RvMegacoParameter *s);}
	{params:
		{param: {n:d} {d:The destination parameter object.}}
		{param: {n:s} {d:The parameter object to copy.}}
	}
	{returns: A pointer to the destination object, or NULL if the copy failed.}
}
*/
RvMegacoParameter *rvMegacoParameterCopy(RvMegacoParameter *d, const RvMegacoParameter *s)
{
	rvMegacoPackageItemCopy(&d->name, &s->name);
	rvMegacoParameterValueCopy(&d->value, &s->value);
	return d;
}


/* IS THIS CLASS NECESSARY?
{function:
	{name: rvMegacoParameterGetName}
	{class: RvMegacoParameter}
	{include: rvmegacoobjects.h}
	{description:
		{p: Gets the name of the parameter object.}
	}
	{proto: const RvMegacoPackageItem *rvMegacoParameterGetName(const RvMegacoParameter *x);}
	{params:
		{param: {n:x} {d:The parameter object.}}
	}
	{returns: The name.}
}
*/
const RvMegacoPackageItem *rvMegacoParameterGetName(const RvMegacoParameter *x)
{
	return &x->name;
}


/* IS THIS CLASS NECESSARY?
{function:
	{name: rvMegacoParameterGetValue}
	{class: RvMegacoParameter}
	{include: rvmegacoobjects.h}
	{description:
		{p: Gets the value of the parameter object.}
	}
	{proto: const RvMegacoParameterValue *rvMegacoParameterGetValue(const RvMegacoParameter *x);}
	{params:
		{param: {n:x} {d:The parameter object.}}
	}
	{returns: The value.}
}
*/
const RvMegacoParameterValue *rvMegacoParameterGetValue(const RvMegacoParameter *x)
{
	return &x->value;
}


/*$
{function:
	{name: rvMegacoParameterListConstruct}
	{class: RvMegacoParameterList}
	{include: rvmegacoobjects.h}
	{description:
		{p: Constructs a parameter list object.}
	}
	{proto: RvMegacoParameterList *rvMegacoParameterListConstruct(RvMegacoParameterList *x);}
	{params:
		{param: {n:x} {d:The parameter list object.}}
	}
	{returns: A pointer to the constructed object, or NULL if construction failed.}
}
$*/
RvMegacoParameterList *rvMegacoParameterListConstruct(RvMegacoParameterList *x)
{
	return rvMegacoParameterListConstructA(x, &rvDefaultAlloc);
}


/*$
{function:
	{name: rvMegacoParameterListConstructA}
	{class: RvMegacoParameterList}
	{include: rvmegacoobjects.h}
	{description:
		{p: Constructs a parameter list object.}
	}
	{proto: RvMegacoParameterList *rvMegacoParameterListConstructA(RvMegacoParameterList *x, RvAlloc *alloc);}
	{params:
		{param: {n:x} {d:The parameter list object.}}
		{param: {n:alloc} {d:The allocator to use.}}
	}
	{returns: A pointer to the constructed object, or NULL if construction failed.}
}
$*/
RvMegacoParameterList *rvMegacoParameterListConstructA(RvMegacoParameterList *x, RvAlloc *alloc)
{
	rvMapConstruct(RvMegacoPackageItem, RvMegacoParameterValue)(&x->list, alloc); 
	return x;
}


/*$
{function:
	{name: rvMegacoParameterListConstructCopy}
	{class: RvMegacoParameterList}
	{include: rvmegacoobjects.h}
	{description:
		{p: Constructs a copy of a parameter list object.}
	}
	{proto: RvMegacoParameterList *rvMegacoParameterListConstructCopy(RvMegacoParameterList *d, const RvMegacoParameterList *s, RvAlloc *alloc);}
	{params:
		{param: {n:d} {d:The destination parameter list object.}}
		{param: {n:s} {d:The parameter list object to copy.}}
		{param: {n:alloc} {d:The allocator to use.}}
	}
	{returns: A pointer to the constructed object, or NULL if construction failed.}
}
$*/
RvMegacoParameterList *rvMegacoParameterListConstructCopy(RvMegacoParameterList *d, const RvMegacoParameterList *s, RvAlloc *alloc)
{
	rvMapConstructCopy(&d->list, &s->list, alloc);
	return d;
}


/*$
{function:
	{name: rvMegacoParameterListDestruct}
	{class: RvMegacoParameterList}
	{include: rvmegacoobjects.h}
	{description:
		{p: Destroys a parameter list object.}
	}
	{proto: void rvMegacoParameterListDestruct(RvMegacoParameterList *x);}
	{params:
		{param: {n:x} {d:The parameter list object.}}
	}
}
$*/
void rvMegacoParameterListDestruct(RvMegacoParameterList *x)
{
	rvMapDestruct(&x->list); 
}


/*$
{function:
	{name: rvMegacoParameterListCopy}
	{class: RvMegacoParameterList}
	{include: rvmegacoobjects.h}
	{description:
		{p: Copies the value of one parameter list object to another.}
	}
	{proto: RvMegacoParameterList *rvMegacoParameterListCopy(RvMegacoParameterList *d, const RvMegacoParameterList *s);}
	{params:
		{param: {n:d} {d:The destination parameter list object.}}
		{param: {n:s} {d:The parameter list object to copy.}}
	}
	{returns: A pointer to the destination object, or NULL if the copy failed.}
}
$*/
RvMegacoParameterList *rvMegacoParameterListCopy(RvMegacoParameterList *d, const RvMegacoParameterList *s)
{
	rvMapCopy(&d->list, &s->list);
	return d;
}


/*$
{function:
	{name: rvMegacoParameterListSet}
	{class: RvMegacoParameterList}
	{include: rvmegacoobjects.h}
	{description:
		{p: Sets a parameter in a parameter list object.}
	}
	{proto: void rvMegacoParameterListSet(RvMegacoParameterList *x, const RvMegacoPackageItem *name, const RvMegacoParameterValue *value);}
	{params:
		{param: {n:x} {d:The parameter list object.}}
		{param: {n:name} {d:The parameter name.}}
		{param: {n:value} {d:The parameter value.}}
	}
}
$*/
void rvMegacoParameterListSet(RvMegacoParameterList *x, const RvMegacoPackageItem *name, const RvMegacoParameterValue *value)
{
	rvMapSetValue(RvMegacoPackageItem, RvMegacoParameterValue)(&x->list, name, value);
}


/* PRIVATE
{function:
	{name: rvMegacoParameterListSet2}
	{class: RvMegacoParameterList}
	{include: rvmegacoobjects.h}
	{description:
		{p: Sets a parameter in a parameter list object.}
	}
	{proto: void rvMegacoParameterListSet2(RvMegacoParameterList *x, const char *name, const RvMegacoParameterValue *value);}
	{params:
		{param: {n:x} {d:The parameter list object.}}
		{param: {n:name} {d:The parameter name.}}
		{param: {n:value} {d:The parameter value.}}
	}
}
*/
void rvMegacoParameterListSet2(RvMegacoParameterList *x, const char *name, const RvMegacoParameterValue *value)
{
	RvMegacoPackageItem item;
	rvMegacoPackageItemConstruct(&item, "", name);
	rvMegacoParameterListSet(x, &item, value);
	rvMegacoPackageItemDestruct(&item);
}


void rvMegacoParameterListAnd(RvMegacoParameterList *x, const RvMegacoPackageItem *name, const char *value)
{
	RvMegacoParameterValue *curValue = rvMapFindValue(RvMegacoPackageItem, RvMegacoParameterValue)(&x->list, name);

	if(curValue == NULL)
	{
		RvMegacoParameterValue pv;
		

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -