diff --git a/doc/dynapi.texi b/doc/dynapi.texi index f35990b15..8c6f6eeb6 100644 --- a/doc/dynapi.texi +++ b/doc/dynapi.texi @@ -13796,10 +13796,10 @@ BD* struct _dwg_object_BLOCKSTRETCHACTION* @item bl95 BL, DXF 95 -@item bs76 +@item num_indexes BS, DXF 76 -@item bl94 -BL, DXF 94 +@item indexes +BL* @end vtable @end indentedblock diff --git a/include/dwg.h b/include/dwg.h index 5d3127684..da5df8283 100644 --- a/include/dwg.h +++ b/include/dwg.h @@ -7806,9 +7806,9 @@ typedef struct _dwg_BLOCKSTRETCHACTION_handles { typedef struct _dwg_BLOCKSTRETCHACTION_codes { struct _dwg_object_BLOCKSTRETCHACTION *parent; - BITCODE_BL bl95; // 95 - BITCODE_BS bs76; // 76 - BITCODE_BL bl94; // 94 + BITCODE_BL bl95; // 95 + BITCODE_BS num_indexes; // 76 + BITCODE_BL *indexes; // 94 } Dwg_BLOCKSTRETCHACTION_codes; typedef struct _dwg_object_BLOCKSTRETCHACTION diff --git a/src/config.h.in b/src/config.h.in index fe3ca5b16..6406f2598 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -48,7 +48,7 @@ /* Define if __attribute__((visibility("default"))) is supported. */ #undef HAVE_ATTRIBUTE_VISIBILITY_DEFAULT -/* Define to 1 if you have the `basename' function. */ +/* Define to 1 if you have the 'basename' function. */ #undef HAVE_BASENAME /* Define to 1 if be64toh is available in . */ @@ -81,7 +81,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H -/* Define to 1 if you have the `floor' function. */ +/* Define to 1 if you have the 'floor' function. */ #undef HAVE_FLOOR /* Define to 1 if the system has the `aligned' function attribute */ @@ -108,13 +108,13 @@ /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H -/* Define to 1 if you have the `getopt_long' function. */ +/* Define to 1 if you have the 'getopt_long' function. */ #undef HAVE_GETOPT_LONG -/* Define to 1 if you have the `gettimeofday' function. */ +/* Define to 1 if you have the 'gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY -/* Define to 1 if you have the `gmtime_r' function. */ +/* Define to 1 if you have the 'gmtime_r' function. */ #undef HAVE_GMTIME_R /* macOS 12.6.5 lies about its gperf version, using size_t as 3.0 */ @@ -156,7 +156,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H -/* Define to 1 if you have the `m' library (-lm). */ +/* Define to 1 if you have the 'm' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the header file. */ @@ -168,20 +168,20 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_ENDIAN_H -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and +/* Define to 1 if your system has a GNU libc compatible 'malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H -/* Define to 1 if you have the `memchr' function. */ +/* Define to 1 if you have the 'memchr' function. */ #undef HAVE_MEMCHR -/* Define to 1 if you have the `memmem' function. */ +/* Define to 1 if you have the 'memmem' function. */ #undef HAVE_MEMMEM -/* Define to 1 if you have the `memmove' function. */ +/* Define to 1 if you have the 'memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ @@ -196,26 +196,26 @@ /* If available, contains the Python version number currently in use. */ #undef HAVE_PYTHON -/* Define to 1 if your system has a GNU libc compatible `realloc' function, +/* Define to 1 if your system has a GNU libc compatible 'realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC -/* Define to 1 if you have the `scandir' function. */ +/* Define to 1 if you have the 'scandir' function. */ #undef HAVE_SCANDIR -/* Define to 1 if you have the `setenv' function. */ +/* Define to 1 if you have the 'setenv' function. */ #undef HAVE_SETENV -/* Define to 1 if you have the `sincos' function. */ +/* Define to 1 if you have the 'sincos' function. */ #undef HAVE_SINCOS -/* Define to 1 if you have the `sqrt' function. */ +/* Define to 1 if you have the 'sqrt' function. */ #undef HAVE_SQRT -/* Define to 1 if you have the `sscanf_s' function. */ +/* Define to 1 if you have the 'sscanf_s' function. */ #undef HAVE_SSCANF_S -/* Define to 1 if `stat' has the bug that it succeeds when given the +/* Define to 1 if 'stat' has the bug that it succeeds when given the zero-length file name argument. */ #undef HAVE_STAT_EMPTY_STRING_BUG @@ -231,13 +231,13 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H -/* Define to 1 if you have the `strcasecmp' function. */ +/* Define to 1 if you have the 'strcasecmp' function. */ #undef HAVE_STRCASECMP -/* Define to 1 if you have the `strcasestr' function. */ +/* Define to 1 if you have the 'strcasestr' function. */ #undef HAVE_STRCASESTR -/* Define to 1 if you have the `strchr' function. */ +/* Define to 1 if you have the 'strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the header file. */ @@ -246,25 +246,25 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the `strnlen' function. */ +/* Define to 1 if you have the 'strnlen' function. */ #undef HAVE_STRNLEN -/* Define to 1 if you have the `strrchr' function. */ +/* Define to 1 if you have the 'strrchr' function. */ #undef HAVE_STRRCHR -/* Define to 1 if you have the `strstr' function. */ +/* Define to 1 if you have the 'strstr' function. */ #undef HAVE_STRSTR -/* Define to 1 if you have the `strtol' function. */ +/* Define to 1 if you have the 'strtol' function. */ #undef HAVE_STRTOL -/* Define to 1 if you have the `strtoll' function. */ +/* Define to 1 if you have the 'strtoll' function. */ #undef HAVE_STRTOLL -/* Define to 1 if you have the `strtoul' function. */ +/* Define to 1 if you have the 'strtoul' function. */ #undef HAVE_STRTOUL -/* Define to 1 if you have the `strtoull' function. */ +/* Define to 1 if you have the 'strtoull' function. */ #undef HAVE_STRTOULL /* Define to 1 if you have the header file. */ @@ -294,19 +294,19 @@ /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H -/* Define to 1 if you have the `wcscmp' function. */ +/* Define to 1 if you have the 'wcscmp' function. */ #undef HAVE_WCSCMP -/* Define to 1 if you have the `wcscpy' function. */ +/* Define to 1 if you have the 'wcscpy' function. */ #undef HAVE_WCSCPY -/* Define to 1 if you have the `wcslen' function. */ +/* Define to 1 if you have the 'wcslen' function. */ #undef HAVE_WCSLEN -/* Define to 1 if you have the `wcsnlen' function. */ +/* Define to 1 if you have the 'wcsnlen' function. */ #undef HAVE_WCSNLEN -/* Define to 1 if you have the `wcsstr' function. */ +/* Define to 1 if you have the 'wcsstr' function. */ #undef HAVE_WCSSTR /* Define to 1 if you have the header file. */ @@ -321,7 +321,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_WINSOCK2_H -/* Define to 1 if the system has the type `_Bool'. */ +/* Define to 1 if the system has the type '_Bool'. */ #undef HAVE__BOOL /* Define as const if the declaration of iconv() needs const. */ @@ -331,7 +331,7 @@ DWG versions and objects. */ #undef IS_RELEASE -/* Define to 1 if `lstat' dereferences a symlink specified with a trailing +/* Define to 1 if 'lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK @@ -359,7 +359,7 @@ /* Define to the printf() modifier to use with size_t. */ #undef PRI_SIZE_T_MODIFIER -/* The size of `size_t', as computed by sizeof. */ +/* The size of 'size_t', as computed by sizeof. */ #undef SIZEOF_SIZE_T /* The number of bytes in type wchar_t */ @@ -373,7 +373,7 @@ STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION -/* Define to 1 if all of the C90 standard headers exist (not just the ones +/* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS @@ -412,7 +412,7 @@ /* Needed for cygwin strdup */ #undef __XSI_VISIBLE -/* Define to `__inline__' or `__inline' if that's what the C compiler +/* Define to '__inline__' or '__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline @@ -439,7 +439,7 @@ /* If restrict is broken with this C compiler */ #undef restrict -/* Define to `unsigned int' if does not define. */ +/* Define as 'unsigned int' if doesn't define. */ #undef size_t /* Define to the type of an unsigned integer type of width exactly 16 bits if diff --git a/src/dwg.spec b/src/dwg.spec index c30110a00..6504897a3 100644 --- a/src/dwg.spec +++ b/src/dwg.spec @@ -12428,8 +12428,7 @@ DWG_OBJECT (BLOCKSTRETCHACTION) REPEAT_BLOCK SUB_FIELD_HANDLE (hdls[rcount1], hdl, 0, 331); SUB_FIELD_BS (hdls[rcount1], num_indexes, 74); - SUB_FIELD_VALUE (hdls[rcount1], indexes) = (BITCODE_BL *)calloc (_obj->hdls[rcount1].num_indexes, sizeof (BITCODE_BL)); - SUB_FIELD_VECTOR_INL (hdls[rcount1], indexes, BL, _obj->hdls[rcount1].num_indexes, 94); + SUB_FIELD_VECTOR (hdls[rcount1], indexes, BL, num_indexes, 94); SET_PARENT_OBJ (hdls[rcount1]); END_REPEAT_BLOCK END_REPEAT (hdls) @@ -12437,8 +12436,8 @@ DWG_OBJECT (BLOCKSTRETCHACTION) REPEAT (num_codes, codes, Dwg_BLOCKSTRETCHACTION_codes) REPEAT_BLOCK SUB_FIELD_BL (codes[rcount1], bl95, 95); - SUB_FIELD_BS (codes[rcount1], bs76, 76); - SUB_FIELD_BL (codes[rcount1], bl94, 94); + SUB_FIELD_BS (codes[rcount1], num_indexes, 76); + SUB_FIELD_VECTOR (codes[rcount1], indexes, BL, num_indexes, 94); SET_PARENT_OBJ (codes[rcount1]); END_REPEAT_BLOCK END_REPEAT (codes) diff --git a/src/dynapi.c b/src/dynapi.c index 9e1d99886..329e62c8c 100644 --- a/src/dynapi.c +++ b/src/dynapi.c @@ -11242,10 +11242,10 @@ static const Dwg_DYNAPI_field _dwg_BLOCKSTRETCHACTION_codes_fields[] = { 1,1,0, 0 }, { "bl95", "BL", sizeof (BITCODE_BL), OFF (struct _dwg_BLOCKSTRETCHACTION_codes, bl95), 0,0,0, 95 }, - { "bs76", "BS", sizeof (BITCODE_BS), OFF (struct _dwg_BLOCKSTRETCHACTION_codes, bs76), + { "num_indexes", "BS", sizeof (BITCODE_BS), OFF (struct _dwg_BLOCKSTRETCHACTION_codes, num_indexes), 0,0,0, 76 }, - { "bl94", "BL", sizeof (BITCODE_BL), OFF (struct _dwg_BLOCKSTRETCHACTION_codes, bl94), - 0,0,0, 94 }, + { "indexes", "BL*", sizeof (BITCODE_BL*), OFF (struct _dwg_BLOCKSTRETCHACTION_codes, indexes), + 1,1,0, 0 }, {NULL, NULL, 0, 0, 0,0,0, 0}, }; /* from typedef struct _dwg_BLOCKSTRETCHACTION_handles: (sorted by offset) */ diff --git a/src/in_dxf.c b/src/in_dxf.c index 21cd2781c..3ab06269a 100644 --- a/src/in_dxf.c +++ b/src/in_dxf.c @@ -7906,18 +7906,24 @@ add_AcDbBlockStretchAction (Dwg_Object *restrict obj, Bit_Chain *restrict dat) dxf_free_pair (pair); pair = dxf_read_pair (dat); - EXPECT_DXF (obj->name, o->codes[i].bs76, 76); - o->codes[i].bs76 = pair->value.i; - LOG_TRACE ("%s.codes[%d].bs76 = %d [BS 76]\n", obj->name, i, - o->codes[i].bs76); + EXPECT_DXF (obj->name, o->codes[i].num_indexes, 76); + o->codes[i].num_indexes = pair->value.i; + LOG_TRACE ("%s.codes[%d].num_indexes = %d [BS 76]\n", obj->name, i, + o->codes[i].num_indexes); dxf_free_pair (pair); - pair = dxf_read_pair (dat); - EXPECT_DXF (obj->name, o->codes[i].bl94, 94); - o->codes[i].bl94 = pair->value.i; - LOG_TRACE ("%s.codes[%d].bl94 = %d [BL 94]\n", obj->name, i, - o->codes[i].bl94); - dxf_free_pair (pair); + if (o->codes[i].num_indexes) + { + for (unsigned j = 0; j < o->hdls[i].num_indexes; j++) + { + pair = dxf_read_pair (dat); + EXPECT_DXF (obj->name, o->codes[i].indexes[j], 94); + o->codes[i].indexes[j] = pair->value.i; + LOG_TRACE ("%s.codes[%d].indexes[%d] = %d [BL 94]\n", obj->name, i, j, + o->codes[i].indexes[j]); + dxf_free_pair (pair); + } + } } } diff --git a/test/unit-testing/blockstretchaction.c b/test/unit-testing/blockstretchaction.c index 162e3bf7e..5f0f39e55 100644 --- a/test/unit-testing/blockstretchaction.c +++ b/test/unit-testing/blockstretchaction.c @@ -47,8 +47,8 @@ api_process (dwg_object *obj) for (i = 0; i < num_codes; i++) { CHK_SUBCLASS_TYPE (_obj->codes[i], BLOCKSTRETCHACTION_codes, bl95, BL); - CHK_SUBCLASS_TYPE (_obj->codes[i], BLOCKSTRETCHACTION_codes, bs76, BS); - CHK_SUBCLASS_TYPE (_obj->codes[i], BLOCKSTRETCHACTION_codes, bl94, BL); + CHK_SUBCLASS_TYPE (_obj->codes[i], BLOCKSTRETCHACTION_codes, num_indexes, BS); + CHK_SUBCLASS_VECTOR_TYPE (_obj->codes[i], BLOCKSTRETCHACTION_codes, indexes, _obj->codes[i].num_indexes, BL); } CHK_ENTITY_TYPE (_obj, BLOCKSTRETCHACTION, action_offset_x, BD);