PSI sics-cvs-psi-2006
This commit is contained in:
76
obdes.c
76
obdes.c
@@ -66,6 +66,7 @@
|
||||
return NULL;
|
||||
}
|
||||
pRes->name = strdup(name);
|
||||
pRes->pKeys = NULL;
|
||||
pRes->SaveStatus = DefaultSave;
|
||||
pRes->GetInterface = DefaultGetInterface;
|
||||
return pRes;
|
||||
@@ -74,10 +75,8 @@
|
||||
void DeleteDescriptor(pObjectDescriptor self)
|
||||
{
|
||||
assert(self);
|
||||
|
||||
if(self->name)
|
||||
free(self->name);
|
||||
|
||||
if(self->name) free(self->name);
|
||||
if(self->pKeys) IFDeleteOptions(self->pKeys);
|
||||
free(self);
|
||||
|
||||
}
|
||||
@@ -134,11 +133,64 @@
|
||||
return 0;
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
pObjectDescriptor FindDescriptor(void *pData)
|
||||
{
|
||||
pDummy pDum = NULL;
|
||||
|
||||
assert(pData);
|
||||
pDum = (pDummy)pData;
|
||||
return pDum->pDescriptor;
|
||||
}
|
||||
pObjectDescriptor FindDescriptor(void *pData)
|
||||
{
|
||||
pDummy pDum = NULL;
|
||||
|
||||
assert(pData);
|
||||
pDum = (pDummy)pData;
|
||||
return pDum->pDescriptor;
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
void SetDescriptorKey(pObjectDescriptor self, char *keyName, char *eltValue)
|
||||
{
|
||||
if(NULL!=self)
|
||||
{
|
||||
IFSetOption(self->pKeys,keyName,eltValue);
|
||||
}
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
void SetDescriptorGroup(pObjectDescriptor self, char *group)
|
||||
{
|
||||
if(NULL==self)
|
||||
{
|
||||
return;
|
||||
}
|
||||
IFSetOption(self->pKeys,"group",group);
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
void SetDescriptorDescription(pObjectDescriptor self, char *description)
|
||||
{
|
||||
if(NULL==self)
|
||||
{
|
||||
return;
|
||||
}
|
||||
IFSetOption(self->pKeys,"description", description);
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
char * GetDescriptorKey(pObjectDescriptor self, char *keyName)
|
||||
{
|
||||
if(NULL==self)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return IFindOption(self->pKeys,keyName);
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
char * GetDescriptorGroup(pObjectDescriptor self)
|
||||
{
|
||||
if(NULL==self)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return IFindOption(self->pKeys,"group");
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
char *GetDescriptorDescription(pObjectDescriptor self)
|
||||
{
|
||||
if(NULL==self)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return IFindOption(self->pKeys,"description");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user