(root)/
libredwg-0.13/
test/
unit-testing/
ltype_control.c
       1  #define DWG_TYPE DWG_TYPE_LTYPE_CONTROL
       2  #include "common.c"
       3  
       4  void
       5  api_process (dwg_object *obj)
       6  {
       7    int error, isnew;
       8    BITCODE_BS i, num_entries;
       9    BITCODE_H *entries, *hdls;
      10    BITCODE_H bylayer;
      11    BITCODE_H byblock;
      12  
      13    dwg_obj_ltype_control *ctrl = dwg_object_to_LTYPE_CONTROL (obj);
      14  
      15    CHK_ENTITY_TYPE (ctrl, LTYPE_CONTROL, num_entries, BS);
      16    entries = dwg_object_tablectrl_get_entries (obj, &error);
      17    if (!dwg_dynapi_entity_value (ctrl, "LTYPE_CONTROL", "entries", &hdls, NULL))
      18      fail ("LTYPE_CONTROL.entries");
      19    else
      20      for (i = 0; i < num_entries; i++)
      21        {
      22          if (hdls[i] == entries[i])
      23            {
      24              if (entries[i])
      25                ok ("LTYPE_CONTROL.entries[%d]: " FORMAT_REF, i,
      26                    ARGS_REF (entries[i]));
      27              else
      28                ok ("LTYPE_CONTROL.entries[%d]: NULL", i);
      29            }
      30          else
      31            {
      32              if (entries[i])
      33                fail ("LTYPE_CONTROL.entries[%d]: " FORMAT_REF, i,
      34                      ARGS_REF (entries[i]));
      35              else
      36                fail ("LTYPE_CONTROL.entries[%d]: NULL", i);
      37            }
      38        }
      39    CHK_ENTITY_H (ctrl, LTYPE_CONTROL, bylayer);
      40    CHK_ENTITY_H (ctrl, LTYPE_CONTROL, byblock);
      41  }