(root)/
libredwg-0.13/
test/
unit-testing/
dictionary.c
       1  #define DWG_TYPE DWG_TYPE_DICTIONARY
       2  #include "common.c"
       3  
       4  void
       5  api_process (dwg_object *obj)
       6  {
       7    int error;
       8    BITCODE_BL i, numitems;
       9    BITCODE_BS cloning;
      10    BITCODE_RC is_hardowner;
      11    BITCODE_TV *texts;
      12    BITCODE_H *itemhandles, *hdls;
      13    BITCODE_RC cloning_r14;
      14  
      15    dwg_obj_dictionary *dictionary = dwg_object_to_DICTIONARY (obj);
      16  
      17    CHK_ENTITY_TYPE (dictionary, DICTIONARY, numitems, BL);
      18    CHK_ENTITY_TYPE (dictionary, DICTIONARY, cloning, BS);
      19    CHK_ENTITY_TYPE (dictionary, DICTIONARY, is_hardowner, RC);
      20    if (!dwg_dynapi_entity_value (dictionary, "DICTIONARY", "texts", &texts,
      21                                  NULL))
      22      fail ("DICTIONARY.texts");
      23    if (!dwg_dynapi_entity_value (dictionary, "DICTIONARY", "itemhandles",
      24                                  &itemhandles, NULL))
      25      fail ("DICTIONARY.itemhandles");
      26    hdls = dictionary->itemhandles;
      27    for (i = 0; i < numitems; i++)
      28      {
      29        ok ("DICTIONARY.texts[%d]: %s", i, texts[i]);
      30        if (hdls[i] == itemhandles[i])
      31          ok ("DICTIONARY.itemhandles[%d]: " FORMAT_REF, i,
      32              ARGS_REF (itemhandles[i]));
      33        else
      34          fail ("DICTIONARY.itemhandles[%d]: " FORMAT_REF, i,
      35                ARGS_REF (itemhandles[i]));
      36      }
      37  }