EssListObjects

Description

EssListObjects() 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);
ESS_HCTX_ThCtx
ESS_OBJTYPE_TObjType
ESS_STR_TAppName
ESS_STR_TDbName
ESS_PUSHORT_TpCount
ESS_PPOBJINFO_T ppObjList

Parameters

hCtxEssbase API context handle. Can be local context handle returned by EssCreateLocalContext().
ObjTypeObject type (may be multiple types OR'ed together). Refer to Bitmask Data Types for a list of possible values.
AppNameApplication name.
DbNamedatabasename. If NULL, lists objects in the application subdirectory.
pCountAddress of variable to receive the count of objects of the appropriate type(s).
ppObjListAddress of pointer to receive allocated array of object info structures.

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.

Notes

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

EssGetObject()
EssGetObjectInfo()