libDXF 0.0.1
A library with DXF related functions written in C.

acad_proxy_entity.c

Go to the documentation of this file.
00001 
00055 #include "acad_proxy_entity.h"
00056 
00057 
00066 DxfAcadProxyEntity *
00067 dxf_acad_proxy_entity_new ()
00068 {
00069 #if DEBUG
00070         DXF_DEBUG_BEGIN
00071 #endif
00072         DxfAcadProxyEntity *acad_proxy_entity = NULL;
00073         size_t size;
00074 
00075         size = sizeof (DxfAcadProxyEntity);
00076         /* avoid malloc of 0 bytes */
00077         if (size == 0) size = 1;
00078         if ((acad_proxy_entity = malloc (size)) == NULL)
00079         {
00080                 fprintf (stderr,
00081                   (_("Error in %s () could not allocate memory for a DxfAcadProxyEntity struct.\n")),
00082                   __FUNCTION__);
00083                 acad_proxy_entity = NULL;
00084         }
00085         else
00086         {
00087                 memset (acad_proxy_entity, 0, size);
00088         }
00089 #if DEBUG
00090         DXF_DEBUG_END
00091 #endif
00092         return (acad_proxy_entity);
00093 }
00094 
00095 
00103 DxfAcadProxyEntity *
00104 dxf_acad_proxy_entity_init
00105 (
00106         DxfAcadProxyEntity *acad_proxy_entity
00108 )
00109 {
00110 #if DEBUG
00111         DXF_DEBUG_BEGIN
00112 #endif
00113         /* Do some basic checks. */
00114         if (acad_proxy_entity == NULL)
00115         {
00116                 fprintf (stderr,
00117                   (_("Warning in %s () a NULL pointer was passed.\n")),
00118                   __FUNCTION__);
00119                 acad_proxy_entity = dxf_acad_proxy_entity_new ();
00120         }
00121         if (acad_proxy_entity == NULL)
00122         {
00123                 fprintf (stderr,
00124                   (_("Error in %s () could not allocate memory for a DxfAcadProxyEntity struct.\n")),
00125                   __FUNCTION__);
00126                 return (NULL);
00127         }
00128         dxf_acad_proxy_entity_set_id_code (acad_proxy_entity, 0);
00129         dxf_acad_proxy_entity_set_linetype (acad_proxy_entity, strdup (DXF_DEFAULT_LINETYPE));
00130         dxf_acad_proxy_entity_set_layer (acad_proxy_entity, strdup (DXF_DEFAULT_LAYER));
00131         dxf_acad_proxy_entity_set_elevation (acad_proxy_entity, 0.0);
00132         dxf_acad_proxy_entity_set_thickness (acad_proxy_entity, 0.0);
00133         dxf_acad_proxy_entity_set_linetype_scale (acad_proxy_entity, DXF_DEFAULT_LINETYPE_SCALE);
00134         dxf_acad_proxy_entity_set_visibility (acad_proxy_entity, 0);
00135         dxf_acad_proxy_entity_set_color (acad_proxy_entity, DXF_COLOR_BYLAYER);
00136         dxf_acad_proxy_entity_set_paperspace (acad_proxy_entity, DXF_PAPERSPACE);
00137         dxf_acad_proxy_entity_set_shadow_mode (acad_proxy_entity, 0);
00138         dxf_acad_proxy_entity_set_dictionary_owner_soft (acad_proxy_entity, strdup (""));
00139         dxf_acad_proxy_entity_set_material (acad_proxy_entity, strdup (""));
00140         dxf_acad_proxy_entity_set_dictionary_owner_hard (acad_proxy_entity, strdup (""));
00141         dxf_acad_proxy_entity_set_lineweight (acad_proxy_entity, 0);
00142         dxf_acad_proxy_entity_set_plot_style_name (acad_proxy_entity, strdup (""));
00143         dxf_acad_proxy_entity_set_color_value (acad_proxy_entity, 0);
00144         dxf_acad_proxy_entity_set_color_name (acad_proxy_entity, strdup (""));
00145         dxf_acad_proxy_entity_set_transparency (acad_proxy_entity, 0);
00146         dxf_acad_proxy_entity_set_original_custom_object_data_format (acad_proxy_entity, 1);
00147         dxf_acad_proxy_entity_set_proxy_entity_class_id (acad_proxy_entity, DXF_DEFAULT_PROXY_ENTITY_ID);
00148         dxf_acad_proxy_entity_set_application_entity_class_id (acad_proxy_entity, 0);
00149         dxf_acad_proxy_entity_set_graphics_data_size (acad_proxy_entity, 0);
00150         dxf_acad_proxy_entity_set_entity_data_size (acad_proxy_entity, 0);
00151         dxf_acad_proxy_entity_set_object_drawing_format (acad_proxy_entity, 0);
00152         dxf_acad_proxy_entity_set_binary_graphics_data (acad_proxy_entity, (DxfBinaryGraphicsData *) dxf_binary_graphics_data_new ());
00153         dxf_binary_graphics_data_init ((DxfBinaryGraphicsData *) dxf_acad_proxy_entity_get_binary_graphics_data (acad_proxy_entity));
00154         dxf_acad_proxy_entity_set_binary_entity_data (acad_proxy_entity, (DxfBinaryEntityData *) dxf_binary_entity_data_new ());
00155         dxf_binary_entity_data_init (dxf_acad_proxy_entity_get_binary_entity_data (acad_proxy_entity));
00156         dxf_acad_proxy_entity_set_object_id (acad_proxy_entity, (DxfObjectId *) dxf_object_id_new ());
00157         dxf_object_id_set_data (dxf_acad_proxy_entity_get_object_id (acad_proxy_entity), strdup (""));
00158         dxf_acad_proxy_entity_set_next (acad_proxy_entity, NULL);
00159 #if DEBUG
00160         DXF_DEBUG_END
00161 #endif
00162         return (acad_proxy_entity);
00163 }
00164 
00165 
00178 DxfAcadProxyEntity *
00179 dxf_acad_proxy_entity_read
00180 (
00181         DxfFile *fp,
00183         DxfAcadProxyEntity *acad_proxy_entity
00185 )
00186 {
00187 #if DEBUG
00188         DXF_DEBUG_BEGIN
00189 #endif
00190         char *temp_string = NULL;
00191         int i; /* flags whether group code 330, 340, 350 or 360 has been
00192                 * parsed for a first time. */
00193 
00194         /* Do some basic checks. */
00195         if (fp == NULL)
00196         {
00197                 fprintf (stderr,
00198                   (_("Error in %s () a NULL file pointer was passed.\n")),
00199                   __FUNCTION__);
00200                 /* Clean up. */
00201                 free (temp_string);
00202                 return (NULL);
00203         }
00204         if (fp->acad_version_number < AutoCAD_13)
00205         {
00206                 fprintf (stderr,
00207                   (_("Warning in %s () illegal DXF version for this entity.\n")),
00208                   __FUNCTION__);
00209         }
00210         if (!acad_proxy_entity)
00211         {
00212                 fprintf (stderr,
00213                   (_("Warning in %s () a NULL pointer was passed.\n")),
00214                   __FUNCTION__);
00215                 acad_proxy_entity = dxf_acad_proxy_entity_new ();
00216                 acad_proxy_entity = dxf_acad_proxy_entity_init (acad_proxy_entity);
00217         }
00218         i = 0;
00219         (fp->line_number)++;
00220         fscanf (fp->fp, "%[^\n]", temp_string);
00221         while (strcmp (temp_string, "0") != 0)
00222         {
00223                 if (ferror (fp->fp))
00224                 {
00225                         fprintf (stderr,
00226                           (_("Error in %s () while reading from: %s in line: %d.\n")),
00227                           __FUNCTION__, fp->filename, fp->line_number);
00228                         /* Clean up. */
00229                         free (temp_string);
00230                         fclose (fp->fp);
00231                         return (NULL);
00232                 }
00233                 else if (strcmp (temp_string, "5") == 0)
00234                 {
00235                         /* Now follows a string containing a sequential
00236                          * id number. */
00237                         (fp->line_number)++;
00238                         fscanf (fp->fp, "%x\n", &acad_proxy_entity->id_code);
00239                 }
00240                 else if (strcmp (temp_string, "6") == 0)
00241                 {
00242                         /* Now follows a string containing the linetype
00243                          * name. */
00244                         (fp->line_number)++;
00245                         fscanf (fp->fp, "%s\n", acad_proxy_entity->linetype);
00246                 }
00247                 else if (strcmp (temp_string, "8") == 0)
00248                 {
00249                         /* Now follows a string containing the layer
00250                          * name. */
00251                         (fp->line_number)++;
00252                         fscanf (fp->fp, "%s\n", acad_proxy_entity->layer);
00253                 }
00254                 else if ((fp->acad_version_number <= AutoCAD_11)
00255                   && DXF_FLATLAND
00256                   && (strcmp (temp_string, "38") == 0)
00257                   && (acad_proxy_entity->elevation != 0.0))
00258                 {
00259                         /* Now follows a string containing the
00260                          * elevation. */
00261                         (fp->line_number)++;
00262                         fscanf (fp->fp, "%lf\n", &acad_proxy_entity->elevation);
00263                 }
00264                 else if (strcmp (temp_string, "39") == 0)
00265                 {
00266                         /* Now follows a string containing the
00267                          * thickness. */
00268                         (fp->line_number)++;
00269                         fscanf (fp->fp, "%lf\n", &acad_proxy_entity->thickness);
00270                 }
00271                 else if (strcmp (temp_string, "48") == 0)
00272                 {
00273                         /* Now follows a string containing the linetype
00274                          * scale value. */
00275                         (fp->line_number)++;
00276                         fscanf (fp->fp, "%lf\n", &acad_proxy_entity->linetype_scale);
00277                 }
00278                 else if (strcmp (temp_string, "60") == 0)
00279                 {
00280                         /* Now follows a string containing the object
00281                          * visability value. */
00282                         (fp->line_number)++;
00283                         fscanf (fp->fp, "%d\n", &acad_proxy_entity->visibility);
00284                 }
00285                 else if (strcmp (temp_string, "62") == 0)
00286                 {
00287                         /* Now follows a string containing the
00288                          * color value. */
00289                         (fp->line_number)++;
00290                         fscanf (fp->fp, "%d\n", &acad_proxy_entity->color);
00291                 }
00292                 else if ((fp->acad_version_number >= AutoCAD_2000)
00293                   && (strcmp (temp_string, "70") == 0))
00294                 {
00295                         /* Now follows a string containing the original
00296                          * custom object data format value. */
00297                         (fp->line_number)++;
00298                         fscanf (fp->fp, "%d\n", &acad_proxy_entity->original_custom_object_data_format);
00299                         if (acad_proxy_entity->original_custom_object_data_format != 1)
00300                         {
00301                                 fprintf (stderr,
00302                                   (_("Error in %s () found a bad original custom object data format value in: %s in line: %d.\n")),
00303                                   __FUNCTION__, fp->filename, fp->line_number);
00304                         }
00305                 }
00306                 else if (strcmp (temp_string, "90") == 0)
00307                 {
00308                         /* Now follows a string containing the proxy
00309                          * entity ID value. */
00310                         (fp->line_number)++;
00311                         fscanf (fp->fp, "%d\n", &acad_proxy_entity->proxy_entity_class_id);
00312                         if (acad_proxy_entity->proxy_entity_class_id != DXF_DEFAULT_PROXY_ENTITY_ID)
00313                         {
00314                                 fprintf (stderr,
00315                                   (_("Warning in %s () found a bad proxy entity class ID in: %s in line: %d.\n")),
00316                                   __FUNCTION__, fp->filename, fp->line_number);
00317                         }
00318                 }
00319                 else if (strcmp (temp_string, "91") == 0)
00320                 {
00321                         /* Now follows a string containing the application
00322                          * entity ID value. */
00323                         (fp->line_number)++;
00324                         fscanf (fp->fp, "%d\n", &acad_proxy_entity->application_entity_class_id);
00325                         if (acad_proxy_entity->application_entity_class_id < 500)
00326                         {
00327                                 fprintf (stderr,
00328                                   (_("Warning in %s () found a bad value in application entity class ID in: %s in line: %d.\n")),
00329                                   __FUNCTION__, fp->filename, fp->line_number);
00330                         }
00331                 }
00332                 else if (strcmp (temp_string, "92") == 0)
00333                 {
00334                         /* Now follows a string containing the graphics
00335                          * data size value (bytes). */
00336                         (fp->line_number)++;
00337                         fscanf (fp->fp, "%d\n", &acad_proxy_entity->graphics_data_size);
00338                 }
00339                 else if (strcmp (temp_string, "93") == 0)
00340                 {
00341                         /* Now follows a string containing the entity
00342                          * data size value (bits). */
00343                         (fp->line_number)++;
00344                         fscanf (fp->fp, "%d\n", &acad_proxy_entity->graphics_data_size);
00345                 }
00346                 else if ((fp->acad_version_number >= AutoCAD_2000)
00347                   && (strcmp (temp_string, "95") == 0))
00348                 {
00349                         /* Now follows a string containing the object
00350                          * drawing format value. */
00351                         (fp->line_number)++;
00352                         fscanf (fp->fp, "%ld\n", &acad_proxy_entity->object_drawing_format);
00353                 }
00354                 else if ((fp->acad_version_number >= AutoCAD_13)
00355                   && (strcmp (temp_string, "100") == 0))
00356                 {
00357                         /* Now follows a string containing the
00358                          * subclass marker value. */
00359                         (fp->line_number)++;
00360                         fscanf (fp->fp, "%s\n", temp_string);
00361                         if ((strcmp (temp_string, "AcDbEntity") != 0)
00362                           && ((strcmp (temp_string, "AcDbZombieEntity") != 0))
00363                           && ((strcmp (temp_string, "AcDbProxyEntity") != 0)))
00364                         {
00365                                 fprintf (stderr,
00366                                   (_("Warning in %s () found a bad subclass marker in: %s in line: %d.\n")),
00367                                   __FUNCTION__, fp->filename, fp->line_number);
00368                         }
00369                 }
00370                 else if (strcmp (temp_string, "284") == 0)
00371                 {
00372                         /* Now follows a string containing the shadow
00373                          * mode value. */
00374                         (fp->line_number)++;
00375                         fscanf (fp->fp, "%hd\n", &acad_proxy_entity->shadow_mode);
00376                 }
00377                 else if (strcmp (temp_string, "310") == 0)
00378                 {
00379                         /* Now follows a string containing binary
00380                          * graphics data. */
00381                         (fp->line_number)++;
00382                         fscanf (fp->fp, "%s\n", acad_proxy_entity->binary_graphics_data->data_line);
00383                         dxf_binary_graphics_data_init ((DxfBinaryGraphicsData *) acad_proxy_entity->binary_graphics_data->next);
00384                         acad_proxy_entity->binary_graphics_data = (DxfBinaryGraphicsData *) acad_proxy_entity->binary_graphics_data->next;
00385                 }
00386                 else if (strcmp (temp_string, "330") == 0)
00387                 {
00388                         /* Now follows a string containing Soft-pointer
00389                          * ID/handle to owner dictionary. */
00390                         (fp->line_number)++;
00391                         fscanf (fp->fp, "%s\n", acad_proxy_entity->dictionary_owner_soft);
00392                         i++;
00393                 }
00394                 else if ((strcmp (temp_string, "330") == 0)
00395                   || (strcmp (temp_string, "340") == 0)
00396                   || (strcmp (temp_string, "350") == 0)
00397                   || (strcmp (temp_string, "360") == 0))
00398                 {
00399                         if (!i) /* For the very first object_id. */
00400                         {
00401                                 dxf_object_id_set_group_code (acad_proxy_entity->object_id, atoi (temp_string));
00402                                 /* Now follows a string containing an object id line of data. */
00403                                 (fp->line_number)++;
00404                                 fscanf (fp->fp, "%s\n", acad_proxy_entity->object_id->data);
00405                         }
00406                         else /* For following object_id's. */
00407                         {
00408                                 DxfObjectId *iter = dxf_object_id_get_last ((DxfObjectId *) acad_proxy_entity->object_id);
00409                                 iter = dxf_object_id_init ((DxfObjectId *) iter->next);
00410                                 dxf_object_id_set_group_code (iter, atoi (temp_string));
00411                                 /* Now follows a string containing an object id line of data. */
00412                                 (fp->line_number)++;
00413                                 fscanf (fp->fp, "%s\n", iter->data);
00414                         }
00415                         i++;
00416                 }
00417                 else if (strcmp (temp_string, "347") == 0)
00418                 {
00419                         /* Now follows a string containing a
00420                          * hard-pointer ID/handle to material object. */
00421                         (fp->line_number)++;
00422                         fscanf (fp->fp, "%s\n", acad_proxy_entity->material);
00423                 }
00424                 else if (strcmp (temp_string, "360") == 0)
00425                 {
00426                         /* Now follows a string containing Hard owner
00427                          * ID/handle to owner dictionary. */
00428                         (fp->line_number)++;
00429                         fscanf (fp->fp, "%s\n", acad_proxy_entity->dictionary_owner_hard);
00430                 }
00431                 else if (strcmp (temp_string, "370") == 0)
00432                 {
00433                         /* Now follows a string containing the lineweight
00434                          * value. */
00435                         (fp->line_number)++;
00436                         fscanf (fp->fp, "%hd\n", &acad_proxy_entity->lineweight);
00437                 }
00438                 else if (strcmp (temp_string, "390") == 0)
00439                 {
00440                         /* Now follows a string containing a plot style
00441                          * name value. */
00442                         (fp->line_number)++;
00443                         fscanf (fp->fp, "%s\n", acad_proxy_entity->plot_style_name);
00444                 }
00445                 else if (strcmp (temp_string, "420") == 0)
00446                 {
00447                         /* Now follows a string containing a color value. */
00448                         (fp->line_number)++;
00449                         fscanf (fp->fp, "%ld\n", &acad_proxy_entity->color_value);
00450                 }
00451                 else if (strcmp (temp_string, "430") == 0)
00452                 {
00453                         /* Now follows a string containing a color
00454                          * name value. */
00455                         (fp->line_number)++;
00456                         fscanf (fp->fp, "%s\n", acad_proxy_entity->color_name);
00457                 }
00458                 else if (strcmp (temp_string, "440") == 0)
00459                 {
00460                         /* Now follows a string containing a transparency
00461                          * value. */
00462                         (fp->line_number)++;
00463                         fscanf (fp->fp, "%ld\n", &acad_proxy_entity->transparency);
00464                 }
00465                 else if (strcmp (temp_string, "999") == 0)
00466                 {
00467                         /* Now follows a string containing a comment. */
00468                         (fp->line_number)++;
00469                         fscanf (fp->fp, "%s\n", temp_string);
00470                         fprintf (stdout, "DXF comment: %s\n", temp_string);
00471                 }
00472                 else
00473                 {
00474                         fprintf (stderr,
00475                           (_("Warning in %s () unknown string tag found while reading from: %s in line: %d.\n")),
00476                           __FUNCTION__, fp->filename, fp->line_number);
00477                 }
00478         }
00479         /* Clean up. */
00480         free (temp_string);
00481 #if DEBUG
00482         fprintf (stderr,
00483           (_("Information from %s() read %d object_id's from %s.\n")),
00484           __FUNCTION__, i, fp->filename);
00485         DXF_DEBUG_END
00486 #endif
00487         return (acad_proxy_entity);
00488 }
00489 
00490 
00497 int
00498 dxf_acad_proxy_entity_write
00499 (
00500         DxfFile *fp,
00502         DxfAcadProxyEntity *acad_proxy_entity
00504 )
00505 {
00506 #if DEBUG
00507         DXF_DEBUG_BEGIN
00508 #endif
00509         char *dxf_entity_name = NULL;
00510 
00511         /* Do some basic checks. */
00512         if (fp == NULL)
00513         {
00514                 fprintf (stderr,
00515                   (_("Error in %s () a NULL file pointer was passed.\n")),
00516                   __FUNCTION__);
00517                 /* Clean up. */
00518                 free (dxf_entity_name);
00519                 return (EXIT_FAILURE);
00520         }
00521         if (acad_proxy_entity == NULL)
00522         {
00523                 fprintf (stderr,
00524                   (_("Error in %s () a NULL pointer was passed.\n")),
00525                   __FUNCTION__);
00526                 /* Clean up. */
00527                 free (dxf_entity_name);
00528                 return (EXIT_FAILURE);
00529         }
00530         if (fp->acad_version_number < AutoCAD_13)
00531         {
00532                 if (fp->follow_strict_version_rules)
00533                 {
00534                         fprintf (stderr,
00535                           (_("Error in %s () illegal DXF version for this entity.\n")),
00536                           __FUNCTION__);
00537                         fprintf (stderr,
00538                           (_("\t entity %s with ID code %d is omitted from output.\n")),
00539                           dxf_entity_name, dxf_acad_proxy_entity_get_id_code (acad_proxy_entity));
00540                         return (EXIT_FAILURE);
00541                 }
00542                 else
00543                 {
00544                         fprintf (stderr,
00545                           (_("Warning in %s () illegal DXF version for this entity.\n")),
00546                           __FUNCTION__);
00547                 }
00548         }
00549         if (fp->acad_version_number <= AutoCAD_13)
00550         {
00551                 dxf_entity_name = strdup ("ACAD_ZOMBIE_ENTITY");
00552         }
00553         else if (fp->acad_version_number >= AutoCAD_14)
00554         {
00555                 dxf_entity_name = strdup ("ACAD_PROXY_ENTITY");
00556         }
00557         if ((strcmp (dxf_acad_proxy_entity_get_layer (acad_proxy_entity), "") == 0)
00558           || (dxf_acad_proxy_entity_get_layer (acad_proxy_entity) == NULL))
00559         {
00560                 fprintf (stderr,
00561                   (_("Warning in %s () invalid layer string for the %s entity with id-code: %x\n")),
00562                   __FUNCTION__, dxf_entity_name, dxf_acad_proxy_entity_get_id_code (acad_proxy_entity));
00563                 fprintf (stderr,
00564                   (_("    %s entity is relocated to layer 0\n")),
00565                   dxf_entity_name);
00566                 dxf_acad_proxy_entity_set_layer (acad_proxy_entity, DXF_DEFAULT_LAYER);
00567         }
00568         if (dxf_acad_proxy_entity_get_linetype (acad_proxy_entity) == NULL)
00569         {
00570                 fprintf (stderr,
00571                   (_("Warning in %s () invalid linetype string for the %s entity with id-code: %x\n")),
00572                   __FUNCTION__, dxf_entity_name, dxf_acad_proxy_entity_get_id_code (acad_proxy_entity));
00573                 fprintf (stderr,
00574                   (_("\t%s linetype is set to %s\n")),
00575                   dxf_entity_name, DXF_DEFAULT_LINETYPE);
00576                 dxf_acad_proxy_entity_set_linetype (acad_proxy_entity, DXF_DEFAULT_LINETYPE);
00577         }
00578         /* Start writing output. */
00579         fprintf (fp->fp, "  0\n%s\n", dxf_entity_name);
00580         if (dxf_acad_proxy_entity_get_id_code (acad_proxy_entity) != -1)
00581         {
00582                 fprintf (fp->fp, "  5\n%x\n", dxf_acad_proxy_entity_get_id_code (acad_proxy_entity));
00583         }
00594         if ((strcmp (dxf_acad_proxy_entity_get_dictionary_owner_soft (acad_proxy_entity), "") != 0)
00595           && (fp->acad_version_number >= AutoCAD_14))
00596         {
00597                 fprintf (fp->fp, "102\n{ACAD_REACTORS\n");
00598                 fprintf (fp->fp, "330\n%s\n", dxf_acad_proxy_entity_get_dictionary_owner_soft (acad_proxy_entity));
00599                 fprintf (fp->fp, "102\n}\n");
00600         }
00601         if ((strcmp (dxf_acad_proxy_entity_get_dictionary_owner_hard (acad_proxy_entity), "") != 0)
00602           && (fp->acad_version_number >= AutoCAD_14))
00603         {
00604                 fprintf (fp->fp, "102\n{ACAD_XDICTIONARY\n");
00605                 fprintf (fp->fp, "360\n%s\n", dxf_acad_proxy_entity_get_dictionary_owner_hard (acad_proxy_entity));
00606                 fprintf (fp->fp, "102\n}\n");
00607         }
00608         if (fp->acad_version_number >= AutoCAD_13)
00609         {
00610                 fprintf (fp->fp, "100\nAcDbEntity\n");
00611         }
00612         if (dxf_acad_proxy_entity_get_paperspace (acad_proxy_entity) == DXF_PAPERSPACE)
00613         {
00614                 fprintf (fp->fp, " 67\n%d\n", DXF_PAPERSPACE);
00615         }
00616         fprintf (fp->fp, "  8\n%s\n", dxf_acad_proxy_entity_get_layer (acad_proxy_entity));
00617         if (strcmp (dxf_acad_proxy_entity_get_linetype (acad_proxy_entity), DXF_DEFAULT_LINETYPE) != 0)
00618         {
00619                 fprintf (fp->fp, "  6\n%s\n", dxf_acad_proxy_entity_get_linetype (acad_proxy_entity));
00620         }
00621         if ((fp->acad_version_number >= AutoCAD_2008)
00622           && (strcmp (dxf_acad_proxy_entity_get_material (acad_proxy_entity), "") != 0))
00623         {
00624                 fprintf (fp->fp, "347\n%s\n", dxf_acad_proxy_entity_get_material (acad_proxy_entity));
00625         }
00626         if (dxf_acad_proxy_entity_get_color (acad_proxy_entity) != DXF_COLOR_BYLAYER)
00627         {
00628                 fprintf (fp->fp, " 62\n%d\n", dxf_acad_proxy_entity_get_color (acad_proxy_entity));
00629         }
00630         if (fp->acad_version_number >= AutoCAD_2002)
00631         {
00632                 fprintf (fp->fp, "370\n%d\n", dxf_acad_proxy_entity_get_lineweight (acad_proxy_entity));
00633         }
00634         if ((fp->acad_version_number <= AutoCAD_11)
00635           && DXF_FLATLAND
00636           && (dxf_acad_proxy_entity_get_elevation (acad_proxy_entity) != 0.0))
00637         {
00638                 fprintf (fp->fp, " 38\n%f\n", dxf_acad_proxy_entity_get_elevation (acad_proxy_entity));
00639         }
00640         if ((fp->acad_version_number <= AutoCAD_13)
00641           && (dxf_acad_proxy_entity_get_thickness (acad_proxy_entity) != 0.0))
00642         {
00643                 fprintf (fp->fp, " 39\n%f\n", dxf_acad_proxy_entity_get_thickness (acad_proxy_entity));
00644         }
00645         fprintf (fp->fp, " 48\n%f\n", dxf_acad_proxy_entity_get_linetype_scale (acad_proxy_entity));
00646         fprintf (fp->fp, " 60\n%d\n", dxf_acad_proxy_entity_get_visibility (acad_proxy_entity));
00647         if (fp->acad_version_number >= AutoCAD_2004)
00648         {
00649                 fprintf (fp->fp, "420\n%ld\n", dxf_acad_proxy_entity_get_color_value (acad_proxy_entity));
00650                 fprintf (fp->fp, "430\n%s\n", dxf_acad_proxy_entity_get_color_name (acad_proxy_entity));
00651                 fprintf (fp->fp, "440\n%ld\n", dxf_acad_proxy_entity_get_transparency (acad_proxy_entity));
00652         }
00653         if (fp->acad_version_number >= AutoCAD_2009)
00654         {
00655                 fprintf (fp->fp, "390\n%s\n", dxf_acad_proxy_entity_get_plot_style_name (acad_proxy_entity));
00656                 fprintf (fp->fp, "284\n%d\n", dxf_acad_proxy_entity_get_shadow_mode (acad_proxy_entity));
00657         }
00658         if (fp->acad_version_number == AutoCAD_13)
00659         {
00660                 fprintf (fp->fp, "100\nAcDbZombieEntity\n");
00661         }
00662         if (fp->acad_version_number >= AutoCAD_14)
00663         {
00664                 fprintf (fp->fp, "100\nAcDbProxyEntity\n");
00665         }
00666         if (fp->acad_version_number >= AutoCAD_2000)
00667         {
00668                 fprintf (fp->fp, " 70\n%d\n", dxf_acad_proxy_entity_get_original_custom_object_data_format (acad_proxy_entity));
00669         }
00670         fprintf (fp->fp, " 90\n%d\n", dxf_acad_proxy_entity_get_proxy_entity_class_id (acad_proxy_entity));
00671         fprintf (fp->fp, " 91\n%d\n", dxf_acad_proxy_entity_get_application_entity_class_id (acad_proxy_entity));
00672         if (fp->acad_version_number >= AutoCAD_14)
00673         {
00674 #ifdef BUILD_64
00675                 fprintf (fp->fp, "160\n%d\n", dxf_acad_proxy_entity_get_graphics_data_size (acad_proxy_entity));
00676 #else
00677                 fprintf (fp->fp, " 92\n%d\n", dxf_acad_proxy_entity_get_graphics_data_size (acad_proxy_entity));
00678 #endif
00679                 if (dxf_acad_proxy_entity_get_binary_graphics_data (acad_proxy_entity) != NULL)
00680                 {
00681                         DxfBinaryGraphicsData *iter;
00682                         iter = dxf_acad_proxy_entity_get_binary_graphics_data (acad_proxy_entity);
00683                         while (iter != NULL)
00684                         {
00685                                 fprintf (fp->fp, "310\n%s\n", dxf_binary_graphics_data_get_data_line (iter));
00686                                 iter = (DxfBinaryGraphicsData *) dxf_binary_graphics_data_get_next (iter);
00687                         }
00688                 }
00689         }
00690         fprintf (fp->fp, " 93\n%d\n", dxf_acad_proxy_entity_get_entity_data_size (acad_proxy_entity));
00691         if (dxf_object_id_get_data (dxf_acad_proxy_entity_get_object_id (acad_proxy_entity)) != NULL)
00692         {
00693                 DxfObjectId *object_id_iter;
00694                 object_id_iter = dxf_acad_proxy_entity_get_object_id (acad_proxy_entity);
00695                         while (object_id_iter != NULL)
00696                         {
00697                                 fprintf (fp->fp, "%d\n%s\n",
00698                                         dxf_object_id_get_group_code (dxf_acad_proxy_entity_get_object_id (acad_proxy_entity)),
00699                                         dxf_object_id_get_data (dxf_acad_proxy_entity_get_object_id (acad_proxy_entity)));
00700                                 object_id_iter = (DxfObjectId *) dxf_object_id_get_next (object_id_iter);
00701                         }
00702         }
00703         fprintf (fp->fp, " 94\n  0\n");
00704         if (fp->acad_version_number >= AutoCAD_2000)
00705         {
00706                 fprintf (fp->fp, " 95\n%ld\n", dxf_acad_proxy_entity_get_object_drawing_format (acad_proxy_entity));
00707         }
00708         if (fp->acad_version_number >= AutoCAD_2000)
00709         {
00710                 fprintf (fp->fp, " 70\n%d\n", dxf_acad_proxy_entity_get_original_custom_object_data_format (acad_proxy_entity));
00711         }
00712         /* Clean up. */
00713         free (dxf_entity_name);
00714 #if DEBUG
00715         DXF_DEBUG_END
00716 #endif
00717         return (EXIT_SUCCESS);
00718 }
00719 
00720 
00728 int
00729 dxf_acad_proxy_entity_free
00730 (
00731         DxfAcadProxyEntity *acad_proxy_entity
00734 )
00735 {
00736 #if DEBUG
00737         DXF_DEBUG_BEGIN
00738 #endif
00739         int i;
00740 
00741         if (acad_proxy_entity == NULL)
00742         {
00743                 fprintf (stderr,
00744                   (_("Error in %s () a NULL pointer was passed.\n")),
00745                   __FUNCTION__);
00746                 return (EXIT_FAILURE);
00747         }
00748         if (acad_proxy_entity->next != NULL)
00749         {
00750                 fprintf (stderr,
00751                   (_("Error in %s () pointer to next was not NULL.\n")),
00752                   __FUNCTION__);
00753                 return (EXIT_FAILURE);
00754         }
00755         free (dxf_acad_proxy_entity_get_linetype (acad_proxy_entity));
00756         free (dxf_acad_proxy_entity_get_layer (acad_proxy_entity));
00757         free (dxf_acad_proxy_entity_get_dictionary_owner_soft (acad_proxy_entity));
00758         free (dxf_acad_proxy_entity_get_material (acad_proxy_entity));
00759         free (dxf_acad_proxy_entity_get_dictionary_owner_hard (acad_proxy_entity));
00760         free (dxf_acad_proxy_entity_get_plot_style_name (acad_proxy_entity));
00761         free (dxf_acad_proxy_entity_get_color_name (acad_proxy_entity));
00762         dxf_binary_graphics_data_free_chain (dxf_acad_proxy_entity_get_binary_graphics_data (acad_proxy_entity));
00763         for (i = 0; i < DXF_MAX_PARAM; i++)
00764         {
00765                 free (acad_proxy_entity->object_id);
00766         }
00767         free (acad_proxy_entity);
00768         acad_proxy_entity = NULL;
00769 #if DEBUG
00770         DXF_DEBUG_END
00771 #endif
00772         return (EXIT_SUCCESS);
00773 }
00774 
00775 
00780 void
00781 dxf_acad_proxy_entity_free_chain
00782 (
00783         DxfAcadProxyEntity *acad_proxy_entities
00785 )
00786 {
00787 #ifdef DEBUG
00788         DXF_DEBUG_BEGIN
00789 #endif
00790         if (acad_proxy_entities == NULL)
00791         {
00792                 fprintf (stderr,
00793                   (_("Warning in %s () a NULL pointer was passed.\n")),
00794                   __FUNCTION__);
00795         }
00796         while (acad_proxy_entities != NULL)
00797         {
00798                 struct DxfAcadProxyEntity *iter = acad_proxy_entities->next;
00799                 dxf_acad_proxy_entity_free (acad_proxy_entities);
00800                 acad_proxy_entities = (DxfAcadProxyEntity *) iter;
00801         }
00802 #if DEBUG
00803         DXF_DEBUG_END
00804 #endif
00805 }
00806 
00807 
00813 int
00814 dxf_acad_proxy_entity_get_id_code
00815 (
00816         DxfAcadProxyEntity *acad_proxy_entity
00818 )
00819 {
00820 #if DEBUG
00821         DXF_DEBUG_BEGIN
00822 #endif
00823         /* Do some basic checks. */
00824         if (acad_proxy_entity == NULL)
00825         {
00826                 fprintf (stderr,
00827                   (_("Error in %s () a NULL pointer was passed.\n")),
00828                   __FUNCTION__);
00829                 return (EXIT_FAILURE);
00830         }
00831         if (acad_proxy_entity->id_code < 0)
00832         {
00833                 fprintf (stderr,
00834                   (_("Error in %s () a negative value was found in the id_code member.\n")),
00835                   __FUNCTION__);
00836                 return (EXIT_FAILURE);
00837         }
00838 #if DEBUG
00839         DXF_DEBUG_END
00840 #endif
00841         return (acad_proxy_entity->id_code);
00842 }
00843 
00844 
00848 DxfAcadProxyEntity *
00849 dxf_acad_proxy_entity_set_id_code
00850 (
00851         DxfAcadProxyEntity *acad_proxy_entity,
00853         int id_code
00857 )
00858 {
00859 #if DEBUG
00860         DXF_DEBUG_BEGIN
00861 #endif
00862         /* Do some basic checks. */
00863         if (acad_proxy_entity == NULL)
00864         {
00865                 fprintf (stderr,
00866                   (_("Error in %s () a NULL pointer was passed.\n")),
00867                   __FUNCTION__);
00868                 return (NULL);
00869         }
00870         if (id_code < 0)
00871         {
00872                 fprintf (stderr,
00873                   (_("Error in %s () a negative id_code value was passed.\n")),
00874                   __FUNCTION__);
00875                 return (NULL);
00876         }
00877         acad_proxy_entity->id_code = id_code;
00878 #if DEBUG
00879         DXF_DEBUG_END
00880 #endif
00881         return (acad_proxy_entity);
00882 }
00883 
00884 
00890 char *
00891 dxf_acad_proxy_entity_get_linetype
00892 (
00893         DxfAcadProxyEntity *acad_proxy_entity
00895 )
00896 {
00897 #if DEBUG
00898         DXF_DEBUG_BEGIN
00899 #endif
00900         /* Do some basic checks. */
00901         if (acad_proxy_entity == NULL)
00902         {
00903                 fprintf (stderr,
00904                   (_("Error in %s () a NULL pointer was passed.\n")),
00905                   __FUNCTION__);
00906                 return (NULL);
00907         }
00908         if (acad_proxy_entity->linetype ==  NULL)
00909         {
00910                 fprintf (stderr,
00911                   (_("Error in %s () a NULL pointer was found in the linetype member.\n")),
00912                   __FUNCTION__);
00913                 return (NULL);
00914         }
00915 #if DEBUG
00916         DXF_DEBUG_END
00917 #endif
00918         return (strdup (acad_proxy_entity->linetype));
00919 }
00920 
00921 
00925 DxfAcadProxyEntity *
00926 dxf_acad_proxy_entity_set_linetype
00927 (
00928         DxfAcadProxyEntity *acad_proxy_entity,
00930         char *linetype
00932 )
00933 {
00934 #if DEBUG
00935         DXF_DEBUG_BEGIN
00936 #endif
00937         /* Do some basic checks. */
00938         if (acad_proxy_entity == NULL)
00939         {
00940                 fprintf (stderr,
00941                   (_("Error in %s () a NULL pointer was passed.\n")),
00942                   __FUNCTION__);
00943                 return (NULL);
00944         }
00945         if (linetype == NULL)
00946         {
00947                 fprintf (stderr,
00948                   (_("Error in %s () a NULL pointer was passed.\n")),
00949                   __FUNCTION__);
00950                 return (NULL);
00951         }
00952         acad_proxy_entity->linetype = strdup (linetype);
00953 #if DEBUG
00954         DXF_DEBUG_END
00955 #endif
00956         return (acad_proxy_entity);
00957 }
00958 
00959 
00965 char *
00966 dxf_acad_proxy_entity_get_layer
00967 (
00968         DxfAcadProxyEntity *acad_proxy_entity
00970 )
00971 {
00972 #if DEBUG
00973         DXF_DEBUG_BEGIN
00974 #endif
00975         /* Do some basic checks. */
00976         if (acad_proxy_entity == NULL)
00977         {
00978                 fprintf (stderr,
00979                   (_("Error in %s () a NULL pointer was passed.\n")),
00980                   __FUNCTION__);
00981                 return (NULL);
00982         }
00983         if (acad_proxy_entity->layer ==  NULL)
00984         {
00985                 fprintf (stderr,
00986                   (_("Error in %s () a NULL pointer was found in the layer member.\n")),
00987                   __FUNCTION__);
00988                 return (NULL);
00989         }
00990 #if DEBUG
00991         DXF_DEBUG_END
00992 #endif
00993         return (strdup (acad_proxy_entity->layer));
00994 }
00995 
00996 
01000 DxfAcadProxyEntity *
01001 dxf_acad_proxy_entity_set_layer
01002 (
01003         DxfAcadProxyEntity *acad_proxy_entity,
01005         char *layer
01007 )
01008 {
01009 #if DEBUG
01010         DXF_DEBUG_BEGIN
01011 #endif
01012         /* Do some basic checks. */
01013         if (acad_proxy_entity == NULL)
01014         {
01015                 fprintf (stderr,
01016                   (_("Error in %s () a NULL pointer was passed.\n")),
01017                   __FUNCTION__);
01018                 return (NULL);
01019         }
01020         if (layer == NULL)
01021         {
01022                 fprintf (stderr,
01023                   (_("Error in %s () a NULL pointer was passed.\n")),
01024                   __FUNCTION__);
01025                 return (NULL);
01026         }
01027         acad_proxy_entity->layer = strdup (layer);
01028 #if DEBUG
01029         DXF_DEBUG_END
01030 #endif
01031         return (acad_proxy_entity);
01032 }
01033 
01034 
01040 double
01041 dxf_acad_proxy_entity_get_elevation
01042 (
01043         DxfAcadProxyEntity *acad_proxy_entity
01045 )
01046 {
01047 #if DEBUG
01048         DXF_DEBUG_BEGIN
01049 #endif
01050         /* Do some basic checks. */
01051         if (acad_proxy_entity == NULL)
01052         {
01053                 fprintf (stderr,
01054                   (_("Error in %s () a NULL pointer was passed.\n")),
01055                   __FUNCTION__);
01056                 return (EXIT_FAILURE);
01057         }
01058 #if DEBUG
01059         DXF_DEBUG_END
01060 #endif
01061         return (acad_proxy_entity->elevation);
01062 }
01063 
01064 
01071 DxfAcadProxyEntity *
01072 dxf_acad_proxy_entity_set_elevation
01073 (
01074         DxfAcadProxyEntity *acad_proxy_entity,
01076         double elevation
01078 )
01079 {
01080 #if DEBUG
01081         DXF_DEBUG_BEGIN
01082 #endif
01083         /* Do some basic checks. */
01084         if (acad_proxy_entity == NULL)
01085         {
01086                 fprintf (stderr,
01087                   (_("Error in %s () a NULL pointer was passed.\n")),
01088                   __FUNCTION__);
01089                 return (NULL);
01090         }
01091         acad_proxy_entity->elevation = elevation;
01092 #if DEBUG
01093         DXF_DEBUG_END
01094 #endif
01095         return (acad_proxy_entity);
01096 }
01097 
01098 
01104 double
01105 dxf_acad_proxy_entity_get_thickness
01106 (
01107         DxfAcadProxyEntity *acad_proxy_entity
01109 )
01110 {
01111 #if DEBUG
01112         DXF_DEBUG_BEGIN
01113 #endif
01114         /* Do some basic checks. */
01115         if (acad_proxy_entity == NULL)
01116         {
01117                 fprintf (stderr,
01118                   (_("Error in %s () a NULL pointer was passed.\n")),
01119                   __FUNCTION__);
01120                 return (EXIT_FAILURE);
01121         }
01122         if (acad_proxy_entity->thickness < 0.0)
01123         {
01124                 fprintf (stderr,
01125                   (_("Warning in %s () a negative value was found in the thickness member.\n")),
01126                   __FUNCTION__);
01127         }
01128 #if DEBUG
01129         DXF_DEBUG_END
01130 #endif
01131         return (acad_proxy_entity->thickness);
01132 }
01133 
01134 
01141 DxfAcadProxyEntity *
01142 dxf_acad_proxy_entity_set_thickness
01143 (
01144         DxfAcadProxyEntity *acad_proxy_entity,
01146         double thickness
01148 )
01149 {
01150 #if DEBUG
01151         DXF_DEBUG_BEGIN
01152 #endif
01153         /* Do some basic checks. */
01154         if (acad_proxy_entity == NULL)
01155         {
01156                 fprintf (stderr,
01157                   (_("Error in %s () a NULL pointer was passed.\n")),
01158                   __FUNCTION__);
01159                 return (NULL);
01160         }
01161         if (thickness < 0.0)
01162         {
01163                 fprintf (stderr,
01164                   (_("Warning in %s () a negative thickness value was passed.\n")),
01165                   __FUNCTION__);
01166         }
01167         acad_proxy_entity->thickness = thickness;
01168 #if DEBUG
01169         DXF_DEBUG_END
01170 #endif
01171         return (acad_proxy_entity);
01172 }
01173 
01174 
01180 double
01181 dxf_acad_proxy_entity_get_linetype_scale
01182 (
01183         DxfAcadProxyEntity *acad_proxy_entity
01185 )
01186 {
01187 #if DEBUG
01188         DXF_DEBUG_BEGIN
01189 #endif
01190         /* Do some basic checks. */
01191         if (acad_proxy_entity == NULL)
01192         {
01193                 fprintf (stderr,
01194                   (_("Error in %s () a NULL pointer was passed.\n")),
01195                   __FUNCTION__);
01196                 return (EXIT_FAILURE);
01197         }
01198         if (acad_proxy_entity->linetype_scale < 0.0)
01199         {
01200                 fprintf (stderr,
01201                   (_("Error in %s () a negative value was found in the linetype scale member.\n")),
01202                   __FUNCTION__);
01203                 return (EXIT_FAILURE);
01204         }
01205 #if DEBUG
01206         DXF_DEBUG_END
01207 #endif
01208         return (acad_proxy_entity->linetype_scale);
01209 }
01210 
01211 
01215 DxfAcadProxyEntity *
01216 dxf_acad_proxy_entity_set_linetype_scale
01217 (
01218         DxfAcadProxyEntity *acad_proxy_entity,
01220         double linetype_scale
01222 )
01223 {
01224 #if DEBUG
01225         DXF_DEBUG_BEGIN
01226 #endif
01227         /* Do some basic checks. */
01228         if (acad_proxy_entity == NULL)
01229         {
01230                 fprintf (stderr,
01231                   (_("Error in %s () a NULL pointer was passed.\n")),
01232                   __FUNCTION__);
01233                 return (NULL);
01234         }
01235         if (linetype_scale < 0.0)
01236         {
01237                 fprintf (stderr,
01238                   (_("Error in %s () a negative linetype scale value was passed.\n")),
01239                   __FUNCTION__);
01240                 return (NULL);
01241         }
01242         acad_proxy_entity->linetype_scale = linetype_scale;
01243 #if DEBUG
01244         DXF_DEBUG_END
01245 #endif
01246         return (acad_proxy_entity);
01247 }
01248 
01249 
01255 int16_t
01256 dxf_acad_proxy_entity_get_visibility
01257 (
01258         DxfAcadProxyEntity *acad_proxy_entity
01260 )
01261 {
01262 #if DEBUG
01263         DXF_DEBUG_BEGIN
01264 #endif
01265         /* Do some basic checks. */
01266         if (acad_proxy_entity == NULL)
01267         {
01268                 fprintf (stderr,
01269                   (_("Error in %s () a NULL pointer was passed.\n")),
01270                   __FUNCTION__);
01271                 return (EXIT_FAILURE);
01272         }
01273         if (acad_proxy_entity->visibility < 0)
01274         {
01275                 fprintf (stderr,
01276                   (_("Error in %s () a negative value was found in the visibility member.\n")),
01277                   __FUNCTION__);
01278                 return (EXIT_FAILURE);
01279         }
01280         if (acad_proxy_entity->visibility > 1)
01281         {
01282                 fprintf (stderr,
01283                   (_("Error in %s () an out of range value was found in the visibility member.\n")),
01284                   __FUNCTION__);
01285                 return (EXIT_FAILURE);
01286         }
01287 #if DEBUG
01288         DXF_DEBUG_END
01289 #endif
01290         return (acad_proxy_entity->visibility);
01291 }
01292 
01293 
01297 DxfAcadProxyEntity *
01298 dxf_acad_proxy_entity_set_visibility
01299 (
01300         DxfAcadProxyEntity *acad_proxy_entity,
01302         int16_t visibility
01304 )
01305 {
01306 #if DEBUG
01307         DXF_DEBUG_BEGIN
01308 #endif
01309         /* Do some basic checks. */
01310         if (acad_proxy_entity == NULL)
01311         {
01312                 fprintf (stderr,
01313                   (_("Error in %s () a NULL pointer was passed.\n")),
01314                   __FUNCTION__);
01315                 return (NULL);
01316         }
01317         if (visibility < 0)
01318         {
01319                 fprintf (stderr,
01320                   (_("Error in %s () a negative visibility value was passed.\n")),
01321                   __FUNCTION__);
01322                 return (NULL);
01323         }
01324         if (visibility > 1)
01325         {
01326                 fprintf (stderr,
01327                   (_("Error in %s () an out of range visibility value was passed.\n")),
01328                   __FUNCTION__);
01329                 return (NULL);
01330         }
01331         acad_proxy_entity->visibility = visibility;
01332 #if DEBUG
01333         DXF_DEBUG_END
01334 #endif
01335         return (acad_proxy_entity);
01336 }
01337 
01338 
01344 int
01345 dxf_acad_proxy_entity_get_color
01346 (
01347         DxfAcadProxyEntity *acad_proxy_entity
01349 )
01350 {
01351 #if DEBUG
01352         DXF_DEBUG_BEGIN
01353 #endif
01354         /* Do some basic checks. */
01355         if (acad_proxy_entity == NULL)
01356         {
01357                 fprintf (stderr,
01358                   (_("Error in %s () a NULL pointer was passed.\n")),
01359                   __FUNCTION__);
01360                 return (EXIT_FAILURE);
01361         }
01362         if (acad_proxy_entity->color < 0)
01363         {
01364                 fprintf (stderr,
01365                   (_("Warning in %s () a negative value was found in the color member.\n")),
01366                   __FUNCTION__);
01367         }
01368 #if DEBUG
01369         DXF_DEBUG_END
01370 #endif
01371         return (acad_proxy_entity->color);
01372 }
01373 
01374 
01378 DxfAcadProxyEntity *
01379 dxf_acad_proxy_entity_set_color
01380 (
01381         DxfAcadProxyEntity *acad_proxy_entity,
01383         int color
01385 )
01386 {
01387 #if DEBUG
01388         DXF_DEBUG_BEGIN
01389 #endif
01390         /* Do some basic checks. */
01391         if (acad_proxy_entity == NULL)
01392         {
01393                 fprintf (stderr,
01394                   (_("Error in %s () a NULL pointer was passed.\n")),
01395                   __FUNCTION__);
01396                 return (NULL);
01397         }
01398         if (color < 0)
01399         {
01400                 fprintf (stderr,
01401                   (_("Warning in %s () a negative color value was passed.\n")),
01402                   __FUNCTION__);
01403                 fprintf (stderr,
01404                   (_("\teffectively turning this entity it's visibility off.\n")));
01405         }
01406         acad_proxy_entity->color = color;
01407 #if DEBUG
01408         DXF_DEBUG_END
01409 #endif
01410         return (acad_proxy_entity);
01411 }
01412 
01413 
01420 int
01421 dxf_acad_proxy_entity_get_paperspace
01422 (
01423         DxfAcadProxyEntity *acad_proxy_entity
01425 )
01426 {
01427 #if DEBUG
01428         DXF_DEBUG_BEGIN
01429 #endif
01430         /* Do some basic checks. */
01431         if (acad_proxy_entity == NULL)
01432         {
01433                 fprintf (stderr,
01434                   (_("Error in %s () a NULL pointer was passed.\n")),
01435                   __FUNCTION__);
01436                 return (EXIT_FAILURE);
01437         }
01438         if (acad_proxy_entity->paperspace < 0)
01439         {
01440                 fprintf (stderr,
01441                   (_("Warning in %s () a negative value was found in the paperspace member.\n")),
01442                   __FUNCTION__);
01443         }
01444         if (acad_proxy_entity->paperspace > 1)
01445         {
01446                 fprintf (stderr,
01447                   (_("Warning in %s () an out of range value was found in the paperspace member.\n")),
01448                   __FUNCTION__);
01449         }
01450 #if DEBUG
01451         DXF_DEBUG_END
01452 #endif
01453         return (acad_proxy_entity->paperspace);
01454 }
01455 
01456 
01460 DxfAcadProxyEntity *
01461 dxf_acad_proxy_entity_set_paperspace
01462 (
01463         DxfAcadProxyEntity *acad_proxy_entity,
01465         int paperspace
01467 )
01468 {
01469 #if DEBUG
01470         DXF_DEBUG_BEGIN
01471 #endif
01472         /* Do some basic checks. */
01473         if (acad_proxy_entity == NULL)
01474         {
01475                 fprintf (stderr,
01476                   (_("Error in %s () a NULL pointer was passed.\n")),
01477                   __FUNCTION__);
01478                 return (NULL);
01479         }
01480         if (paperspace < 0)
01481         {
01482                 fprintf (stderr,
01483                   (_("Error in %s () a negative paperspace value was passed.\n")),
01484                   __FUNCTION__);
01485                 return (NULL);
01486         }
01487         if (paperspace > 1)
01488         {
01489                 fprintf (stderr,
01490                   (_("Error in %s () an out of range paperspace value was passed.\n")),
01491                   __FUNCTION__);
01492                 return (NULL);
01493         }
01494         acad_proxy_entity->paperspace = paperspace;
01495 #if DEBUG
01496         DXF_DEBUG_END
01497 #endif
01498         return (acad_proxy_entity);
01499 }
01500 
01501 
01508 int16_t
01509 dxf_acad_proxy_entity_get_shadow_mode
01510 (
01511         DxfAcadProxyEntity *acad_proxy_entity
01513 )
01514 {
01515 #if DEBUG
01516         DXF_DEBUG_BEGIN
01517 #endif
01518         /* Do some basic checks. */
01519         if (acad_proxy_entity == NULL)
01520         {
01521                 fprintf (stderr,
01522                   (_("Error in %s () a NULL pointer was passed.\n")),
01523                   __FUNCTION__);
01524                 return (EXIT_FAILURE);
01525         }
01526         if (acad_proxy_entity->shadow_mode < 0)
01527         {
01528                 fprintf (stderr,
01529                   (_("Error in %s () a negative value was found in the shadow_mode member.\n")),
01530                   __FUNCTION__);
01531                 return (EXIT_FAILURE);
01532         }
01533         if (acad_proxy_entity->shadow_mode > 3)
01534         {
01535                 fprintf (stderr,
01536                   (_("Error in %s () an out of range value was found in the shadow_mode member.\n")),
01537                   __FUNCTION__);
01538                 return (EXIT_FAILURE);
01539         }
01540 #if DEBUG
01541         DXF_DEBUG_END
01542 #endif
01543         return (acad_proxy_entity->shadow_mode);
01544 }
01545 
01546 
01553 DxfAcadProxyEntity *
01554 dxf_acad_proxy_entity_set_shadow_mode
01555 (
01556         DxfAcadProxyEntity *acad_proxy_entity,
01558         int16_t shadow_mode
01560 )
01561 {
01562 #if DEBUG
01563         DXF_DEBUG_BEGIN
01564 #endif
01565         /* Do some basic checks. */
01566         if (acad_proxy_entity == NULL)
01567         {
01568                 fprintf (stderr,
01569                   (_("Error in %s () a NULL pointer was passed.\n")),
01570                   __FUNCTION__);
01571                 return (NULL);
01572         }
01573         if (shadow_mode < 0)
01574         {
01575                 fprintf (stderr,
01576                   (_("Error in %s () a negative shadow_mode value was passed.\n")),
01577                   __FUNCTION__);
01578                 return (NULL);
01579         }
01580         if (shadow_mode > 3)
01581         {
01582                 fprintf (stderr,
01583                   (_("Error in %s () an out of range shadow_mode value was passed.\n")),
01584                   __FUNCTION__);
01585                 return (NULL);
01586         }
01587         acad_proxy_entity->shadow_mode = shadow_mode;
01588 #if DEBUG
01589         DXF_DEBUG_END
01590 #endif
01591         return (acad_proxy_entity);
01592 }
01593 
01594 
01603 char *
01604 dxf_acad_proxy_entity_get_dictionary_owner_soft
01605 (
01606         DxfAcadProxyEntity *acad_proxy_entity
01608 )
01609 {
01610 #if DEBUG
01611         DXF_DEBUG_BEGIN
01612 #endif
01613         /* Do some basic checks. */
01614         if (acad_proxy_entity == NULL)
01615         {
01616                 fprintf (stderr,
01617                   (_("Error in %s () a NULL pointer was passed.\n")),
01618                   __FUNCTION__);
01619                 return (NULL);
01620         }
01621         if (acad_proxy_entity->dictionary_owner_soft ==  NULL)
01622         {
01623                 fprintf (stderr,
01624                   (_("Error in %s () a NULL pointer was found in the dictionary_owner_soft member.\n")),
01625                   __FUNCTION__);
01626                 return (NULL);
01627         }
01628 #if DEBUG
01629         DXF_DEBUG_END
01630 #endif
01631         return (strdup (acad_proxy_entity->dictionary_owner_soft));
01632 }
01633 
01634 
01639 DxfAcadProxyEntity *
01640 dxf_acad_proxy_entity_set_dictionary_owner_soft
01641 (
01642         DxfAcadProxyEntity *acad_proxy_entity,
01644         char *dictionary_owner_soft
01647 )
01648 {
01649 #if DEBUG
01650         DXF_DEBUG_BEGIN
01651 #endif
01652         /* Do some basic checks. */
01653         if (acad_proxy_entity == NULL)
01654         {
01655                 fprintf (stderr,
01656                   (_("Error in %s () a NULL pointer was passed.\n")),
01657                   __FUNCTION__);
01658                 return (NULL);
01659         }
01660         if (dictionary_owner_soft == NULL)
01661         {
01662                 fprintf (stderr,
01663                   (_("Error in %s () a NULL pointer was passed.\n")),
01664                   __FUNCTION__);
01665                 return (NULL);
01666         }
01667         acad_proxy_entity->dictionary_owner_soft = strdup (dictionary_owner_soft);
01668 #if DEBUG
01669         DXF_DEBUG_END
01670 #endif
01671         return (acad_proxy_entity);
01672 }
01673 
01674 
01683 char *
01684 dxf_acad_proxy_entity_get_material
01685 (
01686         DxfAcadProxyEntity *acad_proxy_entity
01688 )
01689 {
01690 #if DEBUG
01691         DXF_DEBUG_BEGIN
01692 #endif
01693         /* Do some basic checks. */
01694         if (acad_proxy_entity == NULL)
01695         {
01696                 fprintf (stderr,
01697                   (_("Error in %s () a NULL pointer was passed.\n")),
01698                   __FUNCTION__);
01699                 return (NULL);
01700         }
01701         if (acad_proxy_entity->material ==  NULL)
01702         {
01703                 fprintf (stderr,
01704                   (_("Error in %s () a NULL pointer was found in the material member.\n")),
01705                   __FUNCTION__);
01706                 return (NULL);
01707         }
01708 #if DEBUG
01709         DXF_DEBUG_END
01710 #endif
01711         return (strdup (acad_proxy_entity->material));
01712 }
01713 
01714 
01722 DxfAcadProxyEntity *
01723 dxf_acad_proxy_entity_set_material
01724 (
01725         DxfAcadProxyEntity *acad_proxy_entity,
01727         char *material
01730 )
01731 {
01732 #if DEBUG
01733         DXF_DEBUG_BEGIN
01734 #endif
01735         /* Do some basic checks. */
01736         if (acad_proxy_entity == NULL)
01737         {
01738                 fprintf (stderr,
01739                   (_("Error in %s () a NULL pointer was passed.\n")),
01740                   __FUNCTION__);
01741                 return (NULL);
01742         }
01743         if (material == NULL)
01744         {
01745                 fprintf (stderr,
01746                   (_("Error in %s () a NULL pointer was passed.\n")),
01747                   __FUNCTION__);
01748                 return (NULL);
01749         }
01750         acad_proxy_entity->material = strdup (material);
01751 #if DEBUG
01752         DXF_DEBUG_END
01753 #endif
01754         return (acad_proxy_entity);
01755 }
01756 
01757 
01766 char *
01767 dxf_acad_proxy_entity_get_dictionary_owner_hard
01768 (
01769         DxfAcadProxyEntity *acad_proxy_entity
01771 )
01772 {
01773 #if DEBUG
01774         DXF_DEBUG_BEGIN
01775 #endif
01776         /* Do some basic checks. */
01777         if (acad_proxy_entity == NULL)
01778         {
01779                 fprintf (stderr,
01780                   (_("Error in %s () a NULL pointer was passed.\n")),
01781                   __FUNCTION__);
01782                 return (NULL);
01783         }
01784         if (acad_proxy_entity->dictionary_owner_hard ==  NULL)
01785         {
01786                 fprintf (stderr,
01787                   (_("Error in %s () a NULL pointer was found in the dictionary_owner_hard member.\n")),
01788                   __FUNCTION__);
01789                 return (NULL);
01790         }
01791 #if DEBUG
01792         DXF_DEBUG_END
01793 #endif
01794         return (strdup (acad_proxy_entity->dictionary_owner_hard));
01795 }
01796 
01797 
01802 DxfAcadProxyEntity *
01803 dxf_acad_proxy_entity_set_dictionary_owner_hard
01804 (
01805         DxfAcadProxyEntity *acad_proxy_entity,
01807         char *dictionary_owner_hard
01810 )
01811 {
01812 #if DEBUG
01813         DXF_DEBUG_BEGIN
01814 #endif
01815         /* Do some basic checks. */
01816         if (acad_proxy_entity == NULL)
01817         {
01818                 fprintf (stderr,
01819                   (_("Error in %s () a NULL pointer was passed.\n")),
01820                   __FUNCTION__);
01821                 return (NULL);
01822         }
01823         if (dictionary_owner_hard == NULL)
01824         {
01825                 fprintf (stderr,
01826                   (_("Error in %s () a NULL pointer was passed.\n")),
01827                   __FUNCTION__);
01828                 return (NULL);
01829         }
01830         acad_proxy_entity->dictionary_owner_hard = strdup (dictionary_owner_hard);
01831 #if DEBUG
01832         DXF_DEBUG_END
01833 #endif
01834         return (acad_proxy_entity);
01835 }
01836 
01837 
01844 int16_t
01845 dxf_acad_proxy_entity_get_lineweight
01846 (
01847         DxfAcadProxyEntity *acad_proxy_entity
01849 )
01850 {
01851 #if DEBUG
01852         DXF_DEBUG_BEGIN
01853 #endif
01854         /* Do some basic checks. */
01855         if (acad_proxy_entity == NULL)
01856         {
01857                 fprintf (stderr,
01858                   (_("Error in %s () a NULL pointer was passed.\n")),
01859                   __FUNCTION__);
01860                 return (EXIT_FAILURE);
01861         }
01862 #if DEBUG
01863         DXF_DEBUG_END
01864 #endif
01865         return (acad_proxy_entity->lineweight);
01866 }
01867 
01868 
01875 DxfAcadProxyEntity *
01876 dxf_acad_proxy_entity_set_lineweight
01877 (
01878         DxfAcadProxyEntity *acad_proxy_entity,
01880         int16_t lineweight
01882 )
01883 {
01884 #if DEBUG
01885         DXF_DEBUG_BEGIN
01886 #endif
01887         /* Do some basic checks. */
01888         if (acad_proxy_entity == NULL)
01889         {
01890                 fprintf (stderr,
01891                   (_("Error in %s () a NULL pointer was passed.\n")),
01892                   __FUNCTION__);
01893                 return (NULL);
01894         }
01895         acad_proxy_entity->lineweight = lineweight;
01896 #if DEBUG
01897         DXF_DEBUG_END
01898 #endif
01899         return (acad_proxy_entity);
01900 }
01901 
01902 
01910 char *
01911 dxf_acad_proxy_entity_get_plot_style_name
01912 (
01913         DxfAcadProxyEntity *acad_proxy_entity
01915 )
01916 {
01917 #if DEBUG
01918         DXF_DEBUG_BEGIN
01919 #endif
01920         /* Do some basic checks. */
01921         if (acad_proxy_entity == NULL)
01922         {
01923                 fprintf (stderr,
01924                   (_("Error in %s () a NULL pointer was passed.\n")),
01925                   __FUNCTION__);
01926                 return (NULL);
01927         }
01928         if (acad_proxy_entity->plot_style_name ==  NULL)
01929         {
01930                 fprintf (stderr,
01931                   (_("Error in %s () a NULL pointer was found in the plot_style_name member.\n")),
01932                   __FUNCTION__);
01933                 return (NULL);
01934         }
01935 #if DEBUG
01936         DXF_DEBUG_END
01937 #endif
01938         return (strdup (acad_proxy_entity->plot_style_name));
01939 }
01940 
01941 
01948 DxfAcadProxyEntity *
01949 dxf_acad_proxy_entity_set_plot_style_name
01950 (
01951         DxfAcadProxyEntity *acad_proxy_entity,
01953         char *plot_style_name
01956 )
01957 {
01958 #if DEBUG
01959         DXF_DEBUG_BEGIN
01960 #endif
01961         /* Do some basic checks. */
01962         if (acad_proxy_entity == NULL)
01963         {
01964                 fprintf (stderr,
01965                   (_("Error in %s () a NULL pointer was passed.\n")),
01966                   __FUNCTION__);
01967                 return (NULL);
01968         }
01969         if (plot_style_name == NULL)
01970         {
01971                 fprintf (stderr,
01972                   (_("Error in %s () a NULL pointer was passed.\n")),
01973                   __FUNCTION__);
01974                 return (NULL);
01975         }
01976         acad_proxy_entity->plot_style_name = strdup (plot_style_name);
01977 #if DEBUG
01978         DXF_DEBUG_END
01979 #endif
01980         return (acad_proxy_entity);
01981 }
01982 
01983 
01990 long
01991 dxf_acad_proxy_entity_get_color_value
01992 (
01993         DxfAcadProxyEntity *acad_proxy_entity
01995 )
01996 {
01997 #if DEBUG
01998         DXF_DEBUG_BEGIN
01999 #endif
02000         /* Do some basic checks. */
02001         if (acad_proxy_entity == NULL)
02002         {
02003                 fprintf (stderr,
02004                   (_("Error in %s () a NULL pointer was passed.\n")),
02005                   __FUNCTION__);
02006                 return (EXIT_FAILURE);
02007         }
02008 #if DEBUG
02009         DXF_DEBUG_END
02010 #endif
02011         return (acad_proxy_entity->color_value);
02012 }
02013 
02014 
02021 DxfAcadProxyEntity *
02022 dxf_acad_proxy_entity_set_color_value
02023 (
02024         DxfAcadProxyEntity *acad_proxy_entity,
02026         long color_value
02028 )
02029 {
02030 #if DEBUG
02031         DXF_DEBUG_BEGIN
02032 #endif
02033         /* Do some basic checks. */
02034         if (acad_proxy_entity == NULL)
02035         {
02036                 fprintf (stderr,
02037                   (_("Error in %s () a NULL pointer was passed.\n")),
02038                   __FUNCTION__);
02039                 return (NULL);
02040         }
02041         acad_proxy_entity->color_value = color_value;
02042 #if DEBUG
02043         DXF_DEBUG_END
02044 #endif
02045         return (acad_proxy_entity);
02046 }
02047 
02048 
02055 char *
02056 dxf_acad_proxy_entity_get_color_name
02057 (
02058         DxfAcadProxyEntity *acad_proxy_entity
02060 )
02061 {
02062 #if DEBUG
02063         DXF_DEBUG_BEGIN
02064 #endif
02065         /* Do some basic checks. */
02066         if (acad_proxy_entity == NULL)
02067         {
02068                 fprintf (stderr,
02069                   (_("Error in %s () a NULL pointer was passed.\n")),
02070                   __FUNCTION__);
02071                 return (NULL);
02072         }
02073         if (acad_proxy_entity->color_name ==  NULL)
02074         {
02075                 fprintf (stderr,
02076                   (_("Error in %s () a NULL pointer was found in the color_name member.\n")),
02077                   __FUNCTION__);
02078                 return (NULL);
02079         }
02080 #if DEBUG
02081         DXF_DEBUG_END
02082 #endif
02083         return (strdup (acad_proxy_entity->color_name));
02084 }
02085 
02086 
02093 DxfAcadProxyEntity *
02094 dxf_acad_proxy_entity_set_color_name
02095 (
02096         DxfAcadProxyEntity *acad_proxy_entity,
02098         char *color_name
02101 )
02102 {
02103 #if DEBUG
02104         DXF_DEBUG_BEGIN
02105 #endif
02106         /* Do some basic checks. */
02107         if (acad_proxy_entity == NULL)
02108         {
02109                 fprintf (stderr,
02110                   (_("Error in %s () a NULL pointer was passed.\n")),
02111                   __FUNCTION__);
02112                 return (NULL);
02113         }
02114         if (color_name == NULL)
02115         {
02116                 fprintf (stderr,
02117                   (_("Error in %s () a NULL pointer was passed.\n")),
02118                   __FUNCTION__);
02119                 return (NULL);
02120         }
02121         acad_proxy_entity->color_name = strdup (color_name);
02122 #if DEBUG
02123         DXF_DEBUG_END
02124 #endif
02125         return (acad_proxy_entity);
02126 }
02127 
02128 
02135 long
02136 dxf_acad_proxy_entity_get_transparency
02137 (
02138         DxfAcadProxyEntity *acad_proxy_entity
02140 )
02141 {
02142 #if DEBUG
02143         DXF_DEBUG_BEGIN
02144 #endif
02145         /* Do some basic checks. */
02146         if (acad_proxy_entity == NULL)
02147         {
02148                 fprintf (stderr,
02149                   (_("Error in %s () a NULL pointer was passed.\n")),
02150                   __FUNCTION__);
02151                 return (EXIT_FAILURE);
02152         }
02153 #if DEBUG
02154         DXF_DEBUG_END
02155 #endif
02156         return (acad_proxy_entity->transparency);
02157 }
02158 
02159 
02166 DxfAcadProxyEntity *
02167 dxf_acad_proxy_entity_set_transparency
02168 (
02169         DxfAcadProxyEntity *acad_proxy_entity,
02171         long transparency
02173 )
02174 {
02175 #if DEBUG
02176         DXF_DEBUG_BEGIN
02177 #endif
02178         /* Do some basic checks. */
02179         if (acad_proxy_entity == NULL)
02180         {
02181                 fprintf (stderr,
02182                   (_("Error in %s () a NULL pointer was passed.\n")),
02183                   __FUNCTION__);
02184                 return (NULL);
02185         }
02186         acad_proxy_entity->transparency = transparency;
02187 #if DEBUG
02188         DXF_DEBUG_END
02189 #endif
02190         return (acad_proxy_entity);
02191 }
02192 
02193 
02200 int
02201 dxf_acad_proxy_entity_get_original_custom_object_data_format
02202 (
02203         DxfAcadProxyEntity *acad_proxy_entity
02205 )
02206 {
02207 #if DEBUG
02208         DXF_DEBUG_BEGIN
02209 #endif
02210         /* Do some basic checks. */
02211         if (acad_proxy_entity == NULL)
02212         {
02213                 fprintf (stderr,
02214                   (_("Error in %s () a NULL pointer was passed.\n")),
02215                   __FUNCTION__);
02216                 return (EXIT_FAILURE);
02217         }
02218         if (acad_proxy_entity->original_custom_object_data_format < 0)
02219         {
02220                 fprintf (stderr,
02221                   (_("Warning in %s () a negative value was found in the original_custom_object_data_format member.\n")),
02222                   __FUNCTION__);
02223         }
02224         if (acad_proxy_entity->original_custom_object_data_format > 1)
02225         {
02226                 fprintf (stderr,
02227                   (_("Warning in %s () an out of range value was found in the original_custom_object_data_format member.\n")),
02228                   __FUNCTION__);
02229         }
02230 #if DEBUG
02231         DXF_DEBUG_END
02232 #endif
02233         return (acad_proxy_entity->original_custom_object_data_format);
02234 }
02235 
02236 
02241 DxfAcadProxyEntity *
02242 dxf_acad_proxy_entity_set_original_custom_object_data_format
02243 (
02244         DxfAcadProxyEntity *acad_proxy_entity,
02246         int original_custom_object_data_format
02248 )
02249 {
02250 #if DEBUG
02251         DXF_DEBUG_BEGIN
02252 #endif
02253         /* Do some basic checks. */
02254         if (acad_proxy_entity == NULL)
02255         {
02256                 fprintf (stderr,
02257                   (_("Error in %s () a NULL pointer was passed.\n")),
02258                   __FUNCTION__);
02259                 return (NULL);
02260         }
02261         if (original_custom_object_data_format < 0)
02262         {
02263                 fprintf (stderr,
02264                   (_("Error in %s () a negative original custom object data format value was passed.\n")),
02265                   __FUNCTION__);
02266                 return (NULL);
02267         }
02268         if (original_custom_object_data_format > 1)
02269         {
02270                 fprintf (stderr,
02271                   (_("Error in %s () an out of range original custom object data format value was passed.\n")),
02272                   __FUNCTION__);
02273                 return (NULL);
02274         }
02275         acad_proxy_entity->original_custom_object_data_format = original_custom_object_data_format;
02276 #if DEBUG
02277         DXF_DEBUG_END
02278 #endif
02279         return (acad_proxy_entity);
02280 }
02281 
02282 
02289 int
02290 dxf_acad_proxy_entity_get_proxy_entity_class_id
02291 (
02292         DxfAcadProxyEntity *acad_proxy_entity
02294 )
02295 {
02296 #if DEBUG
02297         DXF_DEBUG_BEGIN
02298 #endif
02299         /* Do some basic checks. */
02300         if (acad_proxy_entity == NULL)
02301         {
02302                 fprintf (stderr,
02303                   (_("Error in %s () a NULL pointer was passed.\n")),
02304                   __FUNCTION__);
02305                 return (EXIT_FAILURE);
02306         }
02307         if (acad_proxy_entity->proxy_entity_class_id != 498)
02308         {
02309                 fprintf (stderr,
02310                   (_("Warning in %s () an invalid value was found in the proxy_entity_class_id member.\n")),
02311                   __FUNCTION__);
02312         }
02313 #if DEBUG
02314         DXF_DEBUG_END
02315 #endif
02316         return (acad_proxy_entity->proxy_entity_class_id);
02317 }
02318 
02319 
02324 DxfAcadProxyEntity *
02325 dxf_acad_proxy_entity_set_proxy_entity_class_id
02326 (
02327         DxfAcadProxyEntity *acad_proxy_entity,
02329         int proxy_entity_class_id
02332 )
02333 {
02334 #if DEBUG
02335         DXF_DEBUG_BEGIN
02336 #endif
02337         /* Do some basic checks. */
02338         if (acad_proxy_entity == NULL)
02339         {
02340                 fprintf (stderr,
02341                   (_("Error in %s () a NULL pointer was passed.\n")),
02342                   __FUNCTION__);
02343                 return (NULL);
02344         }
02345         if (proxy_entity_class_id != 498)
02346         {
02347                 fprintf (stderr,
02348                   (_("Error in %s () an invalid value was passed.\n")),
02349                   __FUNCTION__);
02350                 return (NULL);
02351         }
02352         acad_proxy_entity->proxy_entity_class_id = proxy_entity_class_id;
02353 #if DEBUG
02354         DXF_DEBUG_END
02355 #endif
02356         return (acad_proxy_entity);
02357 }
02358 
02359 
02366 int
02367 dxf_acad_proxy_entity_get_application_entity_class_id
02368 (
02369         DxfAcadProxyEntity *acad_proxy_entity
02371 )
02372 {
02373 #if DEBUG
02374         DXF_DEBUG_BEGIN
02375 #endif
02376         /* Do some basic checks. */
02377         if (acad_proxy_entity == NULL)
02378         {
02379                 fprintf (stderr,
02380                   (_("Error in %s () a NULL pointer was passed.\n")),
02381                   __FUNCTION__);
02382                 return (EXIT_FAILURE);
02383         }
02384         if (acad_proxy_entity->application_entity_class_id < 500)
02385         {
02386                 fprintf (stderr,
02387                   (_("Warning in %s () an invalid value was found in the proxy_entity_class_id member.\n")),
02388                   __FUNCTION__);
02389         }
02390 #if DEBUG
02391         DXF_DEBUG_END
02392 #endif
02393         return (acad_proxy_entity->application_entity_class_id);
02394 }
02395 
02396 
02401 DxfAcadProxyEntity *
02402 dxf_acad_proxy_entity_set_application_entity_class_id
02403 (
02404         DxfAcadProxyEntity *acad_proxy_entity,
02406         int application_entity_class_id
02409 )
02410 {
02411 #if DEBUG
02412         DXF_DEBUG_BEGIN
02413 #endif
02414         /* Do some basic checks. */
02415         if (acad_proxy_entity == NULL)
02416         {
02417                 fprintf (stderr,
02418                   (_("Error in %s () a NULL pointer was passed.\n")),
02419                   __FUNCTION__);
02420                 return (NULL);
02421         }
02422         if (application_entity_class_id < 500)
02423         {
02424                 fprintf (stderr,
02425                   (_("Error in %s () an invalid value was passed.\n")),
02426                   __FUNCTION__);
02427                 return (NULL);
02428         }
02429         acad_proxy_entity->application_entity_class_id = application_entity_class_id;
02430 #if DEBUG
02431         DXF_DEBUG_END
02432 #endif
02433         return (acad_proxy_entity);
02434 }
02435 
02436 
02443 int
02444 dxf_acad_proxy_entity_get_graphics_data_size
02445 (
02446         DxfAcadProxyEntity *acad_proxy_entity
02448 )
02449 {
02450 #if DEBUG
02451         DXF_DEBUG_BEGIN
02452 #endif
02453         /* Do some basic checks. */
02454         if (acad_proxy_entity == NULL)
02455         {
02456                 fprintf (stderr,
02457                   (_("Error in %s () a NULL pointer was passed.\n")),
02458                   __FUNCTION__);
02459                 return (EXIT_FAILURE);
02460         }
02461         if (acad_proxy_entity->graphics_data_size < 0)
02462         {
02463                 fprintf (stderr,
02464                   (_("Error in %s () an invalid graphics data size value was passed.\n")),
02465                   __FUNCTION__);
02466                 return (EXIT_FAILURE);
02467         }
02468 #if DEBUG
02469         DXF_DEBUG_END
02470 #endif
02471         return (acad_proxy_entity->graphics_data_size);
02472 }
02473 
02474 
02479 DxfAcadProxyEntity *
02480 dxf_acad_proxy_entity_set_graphics_data_size
02481 (
02482         DxfAcadProxyEntity *acad_proxy_entity,
02484         int graphics_data_size
02487 )
02488 {
02489 #if DEBUG
02490         DXF_DEBUG_BEGIN
02491 #endif
02492         /* Do some basic checks. */
02493         if (acad_proxy_entity == NULL)
02494         {
02495                 fprintf (stderr,
02496                   (_("Error in %s () a NULL pointer was passed.\n")),
02497                   __FUNCTION__);
02498                 return (NULL);
02499         }
02500         if (graphics_data_size < 0)
02501         {
02502                 fprintf (stderr,
02503                   (_("Error in %s () an invalid graphics data size value was passed.\n")),
02504                   __FUNCTION__);
02505                 return (NULL);
02506         }
02507         acad_proxy_entity->graphics_data_size = graphics_data_size;
02508 #if DEBUG
02509         DXF_DEBUG_END
02510 #endif
02511         return (acad_proxy_entity);
02512 }
02513 
02514 
02521 int
02522 dxf_acad_proxy_entity_get_entity_data_size
02523 (
02524         DxfAcadProxyEntity *acad_proxy_entity
02526 )
02527 {
02528 #if DEBUG
02529         DXF_DEBUG_BEGIN
02530 #endif
02531         /* Do some basic checks. */
02532         if (acad_proxy_entity == NULL)
02533         {
02534                 fprintf (stderr,
02535                   (_("Error in %s () a NULL pointer was passed.\n")),
02536                   __FUNCTION__);
02537                 return (EXIT_FAILURE);
02538         }
02539         if (acad_proxy_entity->entity_data_size < 0)
02540         {
02541                 fprintf (stderr,
02542                   (_("Error in %s () an invalid entity data size value was passed.\n")),
02543                   __FUNCTION__);
02544                 return (EXIT_FAILURE);
02545         }
02546 #if DEBUG
02547         DXF_DEBUG_END
02548 #endif
02549         return (acad_proxy_entity->entity_data_size);
02550 }
02551 
02552 
02557 DxfAcadProxyEntity *
02558 dxf_acad_proxy_entity_set_entity_data_size
02559 (
02560         DxfAcadProxyEntity *acad_proxy_entity,
02562         int entity_data_size
02565 )
02566 {
02567 #if DEBUG
02568         DXF_DEBUG_BEGIN
02569 #endif
02570         /* Do some basic checks. */
02571         if (acad_proxy_entity == NULL)
02572         {
02573                 fprintf (stderr,
02574                   (_("Error in %s () a NULL pointer was passed.\n")),
02575                   __FUNCTION__);
02576                 return (NULL);
02577         }
02578         if (entity_data_size < 0)
02579         {
02580                 fprintf (stderr,
02581                   (_("Error in %s () an invalid graphics data size value was passed.\n")),
02582                   __FUNCTION__);
02583                 return (NULL);
02584         }
02585         acad_proxy_entity->entity_data_size = entity_data_size;
02586 #if DEBUG
02587         DXF_DEBUG_END
02588 #endif
02589         return (acad_proxy_entity);
02590 }
02591 
02592 
02599 ulong
02600 dxf_acad_proxy_entity_get_object_drawing_format
02601 (
02602         DxfAcadProxyEntity *acad_proxy_entity
02604 )
02605 {
02606 #if DEBUG
02607         DXF_DEBUG_BEGIN
02608 #endif
02609         /* Do some basic checks. */
02610         if (acad_proxy_entity == NULL)
02611         {
02612                 fprintf (stderr,
02613                   (_("Error in %s () a NULL pointer was passed.\n")),
02614                   __FUNCTION__);
02615                 return (EXIT_FAILURE);
02616         }
02617         if (acad_proxy_entity->object_drawing_format < 0)
02618         {
02619                 fprintf (stderr,
02620                   (_("Error in %s () an invalid object drawing format value was passed.\n")),
02621                   __FUNCTION__);
02622                 return (EXIT_FAILURE);
02623         }
02624 #if DEBUG
02625         DXF_DEBUG_END
02626 #endif
02627         return (acad_proxy_entity->object_drawing_format);
02628 }
02629 
02630 
02635 DxfAcadProxyEntity *
02636 dxf_acad_proxy_entity_set_object_drawing_format
02637 (
02638         DxfAcadProxyEntity *acad_proxy_entity,
02640         ulong object_drawing_format
02643 )
02644 {
02645 #if DEBUG
02646         DXF_DEBUG_BEGIN
02647 #endif
02648         /* Do some basic checks. */
02649         if (acad_proxy_entity == NULL)
02650         {
02651                 fprintf (stderr,
02652                   (_("Error in %s () a NULL pointer was passed.\n")),
02653                   __FUNCTION__);
02654                 return (NULL);
02655         }
02656         acad_proxy_entity->object_drawing_format = object_drawing_format;
02657 #if DEBUG
02658         DXF_DEBUG_END
02659 #endif
02660         return (acad_proxy_entity);
02661 }
02662 
02663 
02672 DxfBinaryGraphicsData *
02673 dxf_acad_proxy_entity_get_binary_graphics_data
02674 (
02675         DxfAcadProxyEntity *acad_proxy_entity
02677 )
02678 {
02679 #if DEBUG
02680         DXF_DEBUG_BEGIN
02681 #endif
02682         /* Do some basic checks. */
02683         if (acad_proxy_entity == NULL)
02684         {
02685                 fprintf (stderr,
02686                   (_("Error in %s () a NULL pointer was passed.\n")),
02687                   __FUNCTION__);
02688                 return (NULL);
02689         }
02690         if (acad_proxy_entity->binary_graphics_data ==  NULL)
02691         {
02692                 fprintf (stderr,
02693                   (_("Error in %s () a NULL pointer was found in the binary_graphics_data member.\n")),
02694                   __FUNCTION__);
02695                 return (NULL);
02696         }
02697 #if DEBUG
02698         DXF_DEBUG_END
02699 #endif
02700         return ((DxfBinaryGraphicsData *) acad_proxy_entity->binary_graphics_data);
02701 }
02702 
02703 
02708 DxfAcadProxyEntity *
02709 dxf_acad_proxy_entity_set_binary_graphics_data
02710 (
02711         DxfAcadProxyEntity *acad_proxy_entity,
02713         DxfBinaryGraphicsData *data
02716 )
02717 {
02718 #if DEBUG
02719         DXF_DEBUG_BEGIN
02720 #endif
02721         /* Do some basic checks. */
02722         if (acad_proxy_entity == NULL)
02723         {
02724                 fprintf (stderr,
02725                   (_("Error in %s () a NULL pointer was passed.\n")),
02726                   __FUNCTION__);
02727                 return (NULL);
02728         }
02729         if (data == NULL)
02730         {
02731                 fprintf (stderr,
02732                   (_("Error in %s () a NULL pointer was passed.\n")),
02733                   __FUNCTION__);
02734                 return (NULL);
02735         }
02736         acad_proxy_entity->binary_graphics_data = (DxfBinaryGraphicsData *) data;
02737 #if DEBUG
02738         DXF_DEBUG_END
02739 #endif
02740         return (acad_proxy_entity);
02741 }
02742 
02743 
02752 DxfBinaryEntityData *
02753 dxf_acad_proxy_entity_get_binary_entity_data
02754 (
02755         DxfAcadProxyEntity *acad_proxy_entity
02757 )
02758 {
02759 #if DEBUG
02760         DXF_DEBUG_BEGIN
02761 #endif
02762         /* Do some basic checks. */
02763         if (acad_proxy_entity == NULL)
02764         {
02765                 fprintf (stderr,
02766                   (_("Error in %s () a NULL pointer was passed.\n")),
02767                   __FUNCTION__);
02768                 return (NULL);
02769         }
02770         if (acad_proxy_entity->binary_entity_data ==  NULL)
02771         {
02772                 fprintf (stderr,
02773                   (_("Error in %s () a NULL pointer was found in the binary_entity_data member.\n")),
02774                   __FUNCTION__);
02775                 return (NULL);
02776         }
02777 #if DEBUG
02778         DXF_DEBUG_END
02779 #endif
02780         return ((DxfBinaryEntityData *) acad_proxy_entity->binary_entity_data);
02781 }
02782 
02783 
02788 DxfAcadProxyEntity *
02789 dxf_acad_proxy_entity_set_binary_entity_data
02790 (
02791         DxfAcadProxyEntity *acad_proxy_entity,
02793         DxfBinaryEntityData *data
02796 )
02797 {
02798 #if DEBUG
02799         DXF_DEBUG_BEGIN
02800 #endif
02801         /* Do some basic checks. */
02802         if (acad_proxy_entity == NULL)
02803         {
02804                 fprintf (stderr,
02805                   (_("Error in %s () a NULL pointer was passed.\n")),
02806                   __FUNCTION__);
02807                 return (NULL);
02808         }
02809         if (data == NULL)
02810         {
02811                 fprintf (stderr,
02812                   (_("Error in %s () a NULL pointer was passed.\n")),
02813                   __FUNCTION__);
02814                 return (NULL);
02815         }
02816         acad_proxy_entity->binary_entity_data = (DxfBinaryEntityData *) data;
02817 #if DEBUG
02818         DXF_DEBUG_END
02819 #endif
02820         return (acad_proxy_entity);
02821 }
02822 
02823 
02832 DxfObjectId *
02833 dxf_acad_proxy_entity_get_object_id
02834 (
02835         DxfAcadProxyEntity *acad_proxy_entity
02837 )
02838 {
02839 #if DEBUG
02840         DXF_DEBUG_BEGIN
02841 #endif
02842         /* Do some basic checks. */
02843         if (acad_proxy_entity == NULL)
02844         {
02845                 fprintf (stderr,
02846                   (_("Error in %s () a NULL pointer was passed.\n")),
02847                   __FUNCTION__);
02848                 return (NULL);
02849         }
02850         if (acad_proxy_entity->object_id ==  NULL)
02851         {
02852                 fprintf (stderr,
02853                   (_("Error in %s () a NULL pointer was found in the object_id member.\n")),
02854                   __FUNCTION__);
02855                 return (NULL);
02856         }
02857 #if DEBUG
02858         DXF_DEBUG_END
02859 #endif
02860         return ((DxfObjectId *) acad_proxy_entity->object_id);
02861 }
02862 
02863 
02868 DxfAcadProxyEntity *
02869 dxf_acad_proxy_entity_set_object_id
02870 (
02871         DxfAcadProxyEntity *acad_proxy_entity,
02873         DxfObjectId *object_id
02876 )
02877 {
02878 #if DEBUG
02879         DXF_DEBUG_BEGIN
02880 #endif
02881         /* Do some basic checks. */
02882         if (acad_proxy_entity == NULL)
02883         {
02884                 fprintf (stderr,
02885                   (_("Error in %s () a NULL pointer was passed.\n")),
02886                   __FUNCTION__);
02887                 return (NULL);
02888         }
02889         if (object_id == NULL)
02890         {
02891                 fprintf (stderr,
02892                   (_("Error in %s () a NULL pointer was passed.\n")),
02893                   __FUNCTION__);
02894                 return (NULL);
02895         }
02896         acad_proxy_entity->object_id = (DxfObjectId *) object_id;
02897 #if DEBUG
02898         DXF_DEBUG_END
02899 #endif
02900         return (acad_proxy_entity);
02901 }
02902 
02903 
02912 DxfAcadProxyEntity *
02913 dxf_acad_proxy_entity_get_next
02914 (
02915         DxfAcadProxyEntity *acad_proxy_entity
02917 )
02918 {
02919 #if DEBUG
02920         DXF_DEBUG_BEGIN
02921 #endif
02922         /* Do some basic checks. */
02923         if (acad_proxy_entity == NULL)
02924         {
02925                 fprintf (stderr,
02926                   (_("Error in %s () a NULL pointer was passed.\n")),
02927                   __FUNCTION__);
02928                 return (NULL);
02929         }
02930         if (acad_proxy_entity->next == NULL)
02931         {
02932                 fprintf (stderr,
02933                   (_("Error in %s () a NULL pointer was found in the next member.\n")),
02934                   __FUNCTION__);
02935                 return (NULL);
02936         }
02937 #if DEBUG
02938         DXF_DEBUG_END
02939 #endif
02940         return ((DxfAcadProxyEntity *) acad_proxy_entity->next);
02941 }
02942 
02943 
02948 DxfAcadProxyEntity *
02949 dxf_acad_proxy_entity_set_next
02950 (
02951         DxfAcadProxyEntity *acad_proxy_entity,
02953         DxfAcadProxyEntity *next
02955 )
02956 {
02957 #if DEBUG
02958         DXF_DEBUG_BEGIN
02959 #endif
02960         /* Do some basic checks. */
02961         if (acad_proxy_entity == NULL)
02962         {
02963                 fprintf (stderr,
02964                   (_("Error in %s () a NULL pointer was passed.\n")),
02965                   __FUNCTION__);
02966                 return (NULL);
02967         }
02968         if (next == NULL)
02969         {
02970                 fprintf (stderr,
02971                   (_("Error in %s () a NULL pointer was passed.\n")),
02972                   __FUNCTION__);
02973                 return (NULL);
02974         }
02975         acad_proxy_entity->next = (struct DxfAcadProxyEntity *) next;
02976 #if DEBUG
02977         DXF_DEBUG_END
02978 #endif
02979         return (acad_proxy_entity);
02980 }
02981 
02982 
02991 DxfAcadProxyEntity *
02992 dxf_acad_proxy_entity_get_last
02993 (
02994         DxfAcadProxyEntity *acad_proxy_entity
02996 )
02997 {
02998 #if DEBUG
02999         DXF_DEBUG_BEGIN
03000 #endif
03001         /* Do some basic checks. */
03002         if (acad_proxy_entity == NULL)
03003         {
03004                 fprintf (stderr,
03005                   (_("Error in %s () a NULL pointer was passed.\n")),
03006                   __FUNCTION__);
03007                 return (NULL);
03008         }
03009         if (acad_proxy_entity->next == NULL)
03010         {
03011                 fprintf (stderr,
03012                   (_("Warning in %s () a NULL pointer was found in the next member.\n")),
03013                   __FUNCTION__);
03014                 return ((DxfAcadProxyEntity *) acad_proxy_entity);
03015         }
03016         DxfAcadProxyEntity *iter = (DxfAcadProxyEntity *) acad_proxy_entity->next;
03017         while (iter->next != NULL)
03018         {
03019                 iter = (DxfAcadProxyEntity *) iter->next;
03020         }
03021 #if DEBUG
03022         DXF_DEBUG_END
03023 #endif
03024         return ((DxfAcadProxyEntity *) iter);
03025 }
03026 
03027 
03028 /* EOF */