EssOtlFreeStructure

Description

EssOtlFreeStructure() frees memory dynamically allocated by EssOtlGetAttributeInfo() and EssOtlGetMemberInfo() for string type attribute information.

Syntax

ESS_FUNC_M EssOtlFreeStructure (hOutline, count, structId, structPtr);

ESS_HOUTLINE_ThOutline;
ESS_ULONG_Tcount;
ESS_ULONG_TstructId;
ESS_PVOID_TstructPtr;

Parameters

hOutlineHandle to the outline
countNumber of structures
structIdOne of the following constant identifiers for the structure:
  • ESS_DT_STRUCT_ATTRIBUTEINFO
  • ESS_DT_STRUCT_ATTRSPECS
  • ESS_DT_STRUCT_MEMBERINFO
structPtrPointer to memory

Return Value

Notes

Access

Example

void  ESS_OtlGetAssociatedAttributes()
{
   ESS_STS_T        sts = ESS_STS_NOERR;
   ESS_SHORT_T      index;
   ESS_USHORT_T     count;
   ESS_OBJDEF_T     Object;
   ESS_APPNAME_T    szAppName;
   ESS_DBNAME_T     szDbName;
   ESS_OBJNAME_T    szFileName;
   ESS_HOUTLINE_T   hOutline;
   ESS_PPHMEMBER_T  hMember;
   ESS_PPHMEMBER_T  phMember;
   ESS_PPMBRINFO_T  phMemberInfo;
   ESS_MBRNAME_T    mbrName;

   memset(&Object, '\0', sizeof(Object));
   Object.hCtx = hCtx;
   Object.ObjType = ESS_OBJTYPE_OUTLINE;
   strcpy(szAppName, "Sample");
   strcpy(szDbName, "Basic");
   strcpy(szFileName, "Basic");
   Object.AppName = szAppName;
   Object.DbName = szDbName;
   Object.FileName = szFileName;

   sts = EssOtlOpenOutline(hCtx, &Object, ESS_TRUE, ESS_TRUE, &hOutline);
   printf("EssOtlOpenOutline() sts: %ld\n",sts);

   sts = EssOtlFindMember(hOutline, "100-10", &hMember);
   printf("EssOtlFindMember() sts: %ld\n",sts);

   sts = EssOtlGetAssociatedAttributes(hOutline, hMember, &count, &phMember);
   printf("EssOtlGetAssociatedAttributes() sts: %ld\n",sts);

   /* Allocate memory for an array of memberinfo structs */
   sts = EssAlloc(hInst,count * (sizeof(ESS_MBRINFO_T)), (ESS_PPVOID_T)&phMemberInfo);
   if (!sts)
   {
      for(index = 0; index < count; index++)
      {
         /* Step through array of member handles, and assign member */
         sts = EssOtlGetMemberInfo(hOutline,phMember[index],&phMemberInfo[index]);
         printf("EssOtlGetMemberInfo() sts: %ld\n",sts);
         strcpy(mbrName,phMemberInfo[index]->szMember);
         printf("Associated attribute member name #%d is: %s\n",(index + 1),mbrName);
      }
      EssFree(hInst, phMember);
      EssOtlFreeStructure(hOutline, 1, ESS_DT_STRUCT_ATTRSPECS, phMemberInfo);
   }

   printf("\n  Attributes associated :%ld\n\n", count);
}

See Also

EssCheckAttributes()
EssFreeStructure()
EssGetAssociatedAttributesInfo()
EssGetAttributeInfo()
EssGetAttributeSpecifications()
EssOtlAssociateAttributeDimension()
EssOtlAssociateAttributeMember()
EssOtlDisassociateAttributeDimension()
EssOtlDisassociateAttributeMember()
EssOtlFindAttributeMembers()
EssOtlGetAssociatedAttributes()
EssOtlGetAttributeInfo()
EssOtlGetAttributeSpecifications()
EssOtlQueryAttributes()
EssOtlSetAttributeSpecifications()