ProviewR Programmer's Reference Manual  V6.1.4
Macros | Functions
rt_gdh.c File Reference

Functions for Gdh Global Data Handler. More...

#include <stdlib.h>
#include "co_array.h"
#include "co_dcli.h"
#include "co_string.h"
#include "co_time.h"
#include "rt_gdh_msg.h"
#include "rt_hash_msg.h"
#include "rt_pwr_msg.h"
#include "rt_gdh.h"
#include "rt_dvol.h"
#include "rt_cmvolc.h"
#include "rt_cvolc.h"
#include "rt_ndc.h"
#include "rt_subc.h"
#include "rt_sanc.h"
#include "rt_dl.h"
#include "rt_lck.h"
#include "pwr_baseclasses.h"

Go to the source code of this file.

Macros

#define STS_K_ERROR   2
 
#define STS_K_INFO   3
 

Functions

pwr_tStatus gdh_AttrrefToName (pwr_sAttrRef *arp, char *name, unsigned int size, pwr_tBitMask nametype)
 Translate an attribute referece to a name. More...
 
pwr_tStatus gdh_ArefANameToAref (pwr_sAttrRef *arp, const char *aname, pwr_sAttrRef *oarp)
 Get the attribute reference for an attribute in an object attribute reference, where the attribute is specified by an string. More...
 
pwr_tStatus gdh_AttrArefToObjectAref (pwr_sAttrRef *arp, pwr_sAttrRef *oarp)
 Get the attribute reference to an object or attribute object, from the attribute reference to an attribute in the object. More...
 
pwr_tStatus gdh_ClassAttrToAttrref (pwr_tClassId cid, const char *name, pwr_sAttrRef *arp)
 Converts a class and attribute string to attrref format. More...
 
pwr_tStatus gdh_ClassAttrrefToAttr (pwr_tClassId cid, pwr_sAttrRef *arp, char *name, int size)
 Get the attribute name from a class and attrref. More...
 
pwr_tStatus gdh_ClassNameToId (const char *name, pwr_tClassId *cid)
 Get the class identity corresponding to a class specified by name. More...
 
pwr_tStatus gdh_CreateObject (char *name, pwr_tClassId cid, unsigned int size, pwr_tObjid *oid, pwr_tObjid req_oid, pwr_tBitMask flags, pwr_tObjid soid)
 Create an object in a dynamic volume. More...
 
pwr_tStatus gdh_DeleteObject (pwr_tObjid oid)
 Remove a local object. More...
 
pwr_tStatus gdh_DeleteObjectTree (pwr_tObjid oid)
 Remove a local object tree. More...
 
pwr_tStatus gdh_DLRefObjectInfoAttrref (pwr_sAttrRef *arp, void **infop, pwr_tDlid *dlid)
 Request a direct link to the data denoted by an attribute reference. More...
 
pwr_tStatus gdh_DLUnrefObjectInfo (pwr_tDlid dlid)
 Terminate direct linking of an object or an object attribute. More...
 
void gdh_DLUnrefObjectInfoAll (void)
 Removes all direct links set up by this process.
 
pwr_tStatus gdh_GetAlarmInfo (pwr_tObjid oid, pwr_tUInt32 *a, pwr_tUInt32 *maxa, pwr_tUInt32 *b, pwr_tUInt32 *maxb, pwr_tUInt32 *alarmvisibility)
 Get the alarm status for a certain object. More...
 
pwr_tStatus gdh_GetNodeIndex (pwr_tNodeId *nid)
 Get the node identity of the local node. More...
 
pwr_tStatus gdh_GetObjectNodeIndex (pwr_tObjid oid, pwr_tNodeId *nid)
 Get the node identity of the owner node of an object. More...
 
pwr_tStatus gdh_GetObjectInfo (const char *name, pwr_tAddress bufp, pwr_tUInt32 bufsize)
 Fetch data from an object or an attribute. More...
 
pwr_tStatus gdh_GetObjectInfoAttrref (pwr_sAttrRef *arp, void *bufp, unsigned int bufsize)
 Fetch the data of an attribute or a whole object body. More...
 
pwr_tStatus gdh_GetObjectSize (pwr_tObjid oid, pwr_tUInt32 *size)
 Get the size of the body of an object. More...
 
pwr_tStatus gdh_GetDynamicAttrSize (pwr_tObjid oid, char *name, pwr_tUInt32 *size)
 Get the size of a dynamic attribute. More...
 
pwr_tStatus gdh_GetObjectClass (pwr_tObjid oid, pwr_tClassId *cid)
 Get the class identifier of an object. More...
 
pwr_tStatus gdh_GetAttrRefTid (pwr_sAttrRef *arp, pwr_tTid *tid)
 Get the type or class identifier of an attribute reference. More...
 
pwr_tStatus gdh_GetObjectLocation (pwr_tObjid oid, pwr_tBoolean *location)
 Return the location of an object. More...
 
pwr_tStatus gdh_GetObjectDLCount (pwr_tObjid oid, pwr_tUInt32 *count)
 Gets the direct link count of an object. More...
 
pwr_tStatus gdh_GetParent (pwr_tObjid oid, pwr_tObjid *new_oid)
 Get the object identity of the parent of an object. More...
 
pwr_tStatus gdh_GetLocalParent (pwr_tObjid oid, pwr_tObjid *new_oid)
 Get the object identity of the local parent of an object. More...
 
pwr_tStatus gdh_GetSubscriptionOldness (pwr_tSubid sid, pwr_tBoolean *old, pwr_tTime *lastupdate, pwr_tStatus *status)
 Checks the oldness of a certain subscription. More...
 
pwr_tStatus gdh_GetChild (pwr_tObjid oid, pwr_tObjid *new_oid)
 Get the object identity of the first child of an object. More...
 
pwr_tStatus gdh_GetNextSibling (pwr_tObjid oid, pwr_tObjid *new_oid)
 Get the object identity of the next sibling (i.e. the next object with the same parent). More...
 
pwr_tStatus gdh_GetPreviousSibling (pwr_tObjid oid, pwr_tObjid *new_oid)
 Get the object identity of the previous sibling (i.e. the previous object with the same parent). More...
 
pwr_tStatus gdh_GetRootList (pwr_tObjid *oid)
 Get the first root object in the object tree. More...
 
pwr_tStatus gdh_GetClassList (pwr_tClassId cid, pwr_tObjid *oid)
 Get the object identity of the first object in the list of objects of a specified class. More...
 
pwr_tStatus gdh_GetNextObject (pwr_tObjid oid, pwr_tObjid *new_oid)
 Get the object identity of the next object in the list of objects of a certain class. More...
 
pwr_tStatus gdh_GetClassListAttrRef (pwr_tClassId cid, pwr_sAttrRef *arp)
 Get the attribute reference of the first object in the list of objects of a specified class. The object can be a solitary object or an attribute object. More...
 
pwr_tStatus gdh_GetNextAttrRef (pwr_tClassId cid, pwr_sAttrRef *arp, pwr_sAttrRef *new_arp)
 Get the attrref of the next object in the list of objects of a certain class. The object can be a solitary object or an attribute object. More...
 
pwr_tStatus gdh_GetObjectClassList (pwr_tCid cid, pwr_tOid oid, pwr_sAttrRef *arp)
 Get the attribute reference of the first attribute object of a specified class in the specified object. More...
 
pwr_tStatus gdh_GetNextObjectAttrRef (pwr_tClassId cid, pwr_sAttrRef *arp, pwr_sAttrRef *new_arp)
 Get the attrref of the next attribute object of a specified class in a specified object. More...
 
pwr_tStatus gdh_GetNodeObject (pwr_tNodeId nid, pwr_tObjid *oid)
 Return the objid of the node object for a node identified by a node identifier (of type pwr_tNodeId). More...
 
pwr_tStatus gdh_GetNodeInfo (pwr_tNodeId nid, gdh_sNodeInfo *ip)
 Return info for a node identified by a node identifier (of type pwr_tNodeId). More...
 
pwr_tStatus gdh_GetAttributeCharacteristics (char *name, pwr_tTypeId *tid, pwr_tUInt32 *size, pwr_tUInt32 *offs, pwr_tUInt32 *elem)
 Get the characteristics of an attribute, given its name and the class it belongs to. More...
 
pwr_tStatus gdh_GetAttributeCharAttrref (pwr_sAttrRef *arp, pwr_tTypeId *tid, unsigned int *size, unsigned int *offs, unsigned int *elem)
 Get the characteristics of an attribute. More...
 
pwr_tStatus gdh_GetAttributeFlags (pwr_sAttrRef *arp, unsigned int *flags)
 Get the flags of an attribute. More...
 
pwr_tStatus gdh_GetPreviousObject (pwr_tObjid oid, pwr_tObjid *new_oid)
 Get the object identity of the previous object in the list of objects of a certain class. More...
 
pwr_tStatus gdh_Init (const char *name)
 Initialize the process to the Proview runtime environment. More...
 
pwr_tStatus gdh_MoveObject (pwr_tObjid oid, pwr_tObjid poid)
 Move a local object. More...
 
pwr_tStatus gdh_NameToObjid (const char *name, pwr_tObjid *oid)
 Get the object identity of an object with name 'name'. More...
 
pwr_tStatus gdh_NameToPointer (const char *name, void **p)
 Get the address of the data of an object, given its name. More...
 
pwr_tStatus gdh_NethandlerRunning (void)
 Check if the Nethandler has started. More...
 
pwr_tStatus gdh_NameToAttrref (pwr_tObjid poid, const char *name, pwr_sAttrRef *arp)
 Converts from name string to attribute reference. More...
 
pwr_tStatus gdh_ObjidToName (pwr_tObjid oid, char *namebuf, pwr_tUInt32 size, pwr_tBitMask nametype)
 Get the name of an object identified by its object identity. More...
 
pwr_tStatus gdh_ObjidToPointer (pwr_tObjid oid, void **p)
 Gets the address of the data of an object, given its object identity. More...
 
pwr_tStatus gdh_MountObjidToPointer (pwr_tObjid oid, void **p)
 Get a pointer to a mount object. More...
 
pwr_tStatus gdh_AttrRefToPointer (pwr_sAttrRef *arp, void **p)
 Gets the address of the data of an attribute reference. More...
 
pwr_tStatus gdh_RenameObject (pwr_tObjid oid, char *name)
 Rename a local object. More...
 
pwr_tStatus gdh_SetObjectInfo (const char *name, void *bufp, unsigned int bufsize)
 Change the value of an attribute or the whole body of an object. More...
 
pwr_tStatus gdh_SetObjectInfoAttrref (pwr_sAttrRef *arp, void *bufp, unsigned int bufsize)
 Change the data of an object or an attribute. More...
 
pwr_tStatus gdh_SubRefObjectInfoList (unsigned int nentries, void *object[], pwr_tBoolean is_aref[], pwr_tSubid subid[])
 Sets up a list of subscriptions to an object/attribute. More...
 
pwr_tStatus gdh_SubRefObjectInfoAttrref (pwr_sAttrRef *aref, pwr_tSubid *sid)
 This routine returns a subid to the information that is denoted by 'aref'. The name can be either an object or an object attribute. More...
 
pwr_tStatus gdh_SubRefObjectInfoName (char *name, pwr_tSubid *sid)
 Get the address of the data that is denoted by 'name'. More...
 
pwr_tStatus gdh_SubUnrefObjectInfoList (unsigned int nentries, pwr_tSubid *sid)
 Terminates a list of subscriptions. More...
 
pwr_tStatus gdh_SubUnrefObjectInfo (pwr_tSubid sid)
 Terminates subscription of an object or an attribute. More...
 
void gdh_SubUnrefObjectInfoAll (void)
 Terminates all subscriptions set up by this user (job/process).
 
pwr_tStatus gdh_SubData (pwr_tSubid sid, void *bp, unsigned int bsize)
 Fetch the data associated with a subscription. More...
 
pwr_tStatus gdh_SubSize (pwr_tSubid sid, unsigned int *size)
 Fetch the data size associated with a subscription. More...
 
pwr_tStatus gdh_SubAssociateBuffer (pwr_tSubid sid, void **buffer, unsigned int buffersize)
 Associate a buffer with the subscription. More...
 
pwr_tStatus gdh_SetSubscriptionDefaults (pwr_tInt32 dt, pwr_tInt32 tmo)
 Sets default subscription timers for future subscription requests. More...
 
pwr_tStatus gdh_RefObjectInfoList (unsigned int n, gdh_sObjRef *objref, pwr_tSubid *sid)
 This routine returns addresses to the information that is denoted by "objref[].fullname". More...
 
pwr_tStatus gdh_RefObjectInfo (char *name, void **infop, pwr_tSubid *sid, unsigned int size)
 The routine returns an address to the data that is denoted by Name. The name can be either an object or an object attribute. More...
 
pwr_tStatus gdh_UnrefObjectInfo (pwr_tSubid sid)
 Terminates the subscription defined by the subscription identity. More...
 
pwr_tStatus gdh_UnrefObjectInfoAll (void)
 Terminates all subscriptions set up by this process. More...
 
pwr_tStatus gdh_SetAlarmLevel (pwr_tObjid oid, pwr_tUInt32 alarmlevel)
 This routine sets the alarm level for a certain object. More...
 
pwr_tStatus gdh_SetAlarmBlockLevel (pwr_tObjid oid, pwr_tUInt32 blocklevel)
 Sets the alarm block level for a certain object. More...
 
void gdh_StoreRtdbPointer (unsigned long *rp, void *p)
 Convert pointer to rtdb relative pointer.
 
void * gdh_TranslateRtdbPointer (unsigned long r)
 Convert rtdb relative pointer to absolute pointer. More...
 
pwr_tStatus gdh_GetVolumeList (pwr_tVid *vid)
 Get the first volume. More...
 
pwr_tStatus gdh_GetNextVolume (pwr_tVid pvid, pwr_tVid *vid)
 Get the next volume in the volume list. More...
 
pwr_tStatus gdh_VolumeIdToName (pwr_tVid vid, char *name, int size)
 Get the name for a volume denoted by volume identity. More...
 
pwr_tStatus gdh_GetVolumeInfo (pwr_tVid vid, gdh_sVolumeInfo *info)
 Get info for a volume. More...
 
pwr_tStatus gdh_GetRootVolume (pwr_tVid *vid)
 Get info for a volume. More...
 
pwr_tStatus gdh_GetSuperClass (pwr_tCid cid, pwr_tCid *supercid, pwr_tObjid oid)
 Get the superclass for a class. More...
 
pwr_tStatus gdh_GetEnumValueDef (pwr_tTid tid, gdh_sValueDef **vd, int *rows)
 Get definition information for an enumeration type. More...
 
pwr_tStatus gdh_GetMaskBitDef (pwr_tTid tid, gdh_sBitDef **bd, int *rows)
 Get definition information for a mask type. More...
 
pwr_tStatus gdh_ArefDisabled (pwr_sAttrRef *arp, pwr_tDisableAttr *disabled)
 Check if an attribute is disabled. More...
 
pwr_tStatus gdh_FWriteObject (char *filename, pwr_tAttrRef *arp)
 Write the content of an object to textfile. More...
 
pwr_tStatus gdh_FReadObject (char *filename, pwr_tAttrRef *arp)
 Read a textfile into an object. More...
 
pwr_tStatus gdh_AttrValueToString (pwr_eType type_id, pwr_tTid tid, void *value_ptr, char *str, int size, int *len, char *format)
 Convert a string to attribute value. More...
 
pwr_tStatus gdh_AttrStringToValue (int type_id, char *value_str, void *buffer_ptr, int buff_size, int attr_size)
 Convert an attribute string to value. More...
 
pwr_tStatus gdh_GetSecurityInfo (pwr_sSecurity *security)
 Get security information. More...
 
void gdh_GetTimeDL (pwr_tTime *atp, pwr_tTime *time)
 Thread save function to fetch a direct linked absolute time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
void gdh_SetTimeDL (pwr_tTime *atp, pwr_tTime *time)
 Thread save function to store a direct linked absolute time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
void gdh_GetDeltaTimeDL (pwr_tDeltaTime *dtp, pwr_tDeltaTime *time)
 Thread save function to fetch a direct linked delta time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
void gdh_SetDeltaTimeDL (pwr_tDeltaTime *dtp, pwr_tDeltaTime *time)
 Thread save function to store a direct linked delta time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
void gdh_GetStrDL (char *sp, char *str, int size)
 Thread save function to fetch a direct linked string value. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str). More...
 
void gdh_SetStrDL (char *sp, const char *str, int size)
 Thread save function to store a direct linked string value. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str). More...
 
pwr_tStatus gdh_GetObjectInfoTime (const char *name, pwr_tTime *time)
 Fetch an absolute time value from an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
pwr_tStatus gdh_SetObjectInfoTime (const char *name, pwr_tTime *time)
 Store an absolute time value in an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
pwr_tStatus gdh_GetObjectInfoDeltaTime (const char *name, pwr_tDeltaTime *time)
 Fetch an delta time value from an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
pwr_tStatus gdh_SetObjectInfoDeltaTime (const char *name, pwr_tDeltaTime *time)
 Store a delta time value in an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
pwr_tStatus gdh_GetObjectInfoStr (const char *name, char *str, int size)
 Fetch a string value from an attribute. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str). More...
 
pwr_tStatus gdh_SetObjectInfoStr (const char *name, const char *str, int size)
 Store a string value in an attribute. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str). More...
 
pwr_tStatus gdh_GetClassInfo (pwr_tCid cid, gdh_sClassInfo *info)
 Get class info. Returns information from $ClassDef object. More...
 
pwr_tBoolean gdh_IsInitialized ()
 Check if gdh is initialized. Returns TRUE if gdh is initialized, else FALSE. More...
 

Detailed Description

Functions for Gdh Global Data Handler.

Definition in file rt_gdh.c.

Macro Definition Documentation

◆ STS_K_ERROR

#define STS_K_ERROR   2

ERROR

Definition at line 94 of file rt_gdh.c.

◆ STS_K_INFO

#define STS_K_INFO   3

INFORMATION

Definition at line 95 of file rt_gdh.c.