Lists all objects of the specified types on the server or locally on the client.
Syntax
ESS_FUNC_M EssListObjects (hCtx, ObjType, AppName, DbName, pCount, ppObjList);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle. Can be local context handle returned by EssCreateLocalContext(). |
ObjType | ESS_OBJTYPE_T | Object type (may be multiple types joined by bitwise OR ( | )). Refer to Bitmask Data Types (C) for a list of possible values. |
AppName | ESS_STR_T | Application name. |
DbName | ESS_STR_T | databasename. If NULL, lists objects in the application subdirectory. |
pCount | ESS_PUSHORT_T | Address of variable to receive the count of objects of the appropriate type(s). |
ppObjList | ESS_OBJINFO_T | Address of pointer to receive allocated array of object info structures. |
Notes
The memory allocated for ppObjList should be freed using EssFree().
This function does not guarantee a consistent order of the returned objects, as this may vary by operating system.
Return Value
If successful, returns a count of the number of objects of the appropriate type(s) in pCount, and an array of matching object structures in ppObjList.
Access
This function requires no special privileges; note however that server objects will only be listed if the caller has the appropriate level of access to the application and/or database (depending on the object type).
Example
ESS_FUNC_M ESS_ListObjects (ESS_HCTX_T hCtx, ESS_HINST_T hInst ) { ESS_FUNC_M sts = ESS_STS_NOERR; ESS_POBJINFO_T pObject, pNextObject = NULL; ESS_SHORT_T objType = 0; ESS_USHORT_T objCnt; ESS_USHORT_T objInd; ESS_STR_T AppName; ESS_STR_T DbName; Appname = "Sample"; DbName = "Basic"; objType = ESS_OBJTYPE_OUTLINE; sts = EssListObjects (hCtx, objType, AppName, DbName, &objCnt, &pObject); if (!sts) { if (objCnt && pObject) { pNextObject = pObject; for (objInd = 0; objInd < objCnt; objInd++) { if (pNextObject) { printf ("Name: %s \r\nUser: %s\r\nTime Stamp: %ld\r\n", pNextObject->Name, pNextObject->User, pNextObject->TimeStamp); pNextObject = pNextObject + 1; } } EssFree (hInst, pObject); } else printf ("\r\nObject List is Empty\r\n\r\n"); } return(sts); }
See Also