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

ole2frame.c

Go to the documentation of this file.
00001 
00043 #include "ole2frame.h"
00044 
00045 
00051 DxfOle2Frame *
00052 dxf_ole2frame_new ()
00053 {
00054 #if DEBUG
00055         DXF_DEBUG_BEGIN
00056 #endif
00057         DxfOle2Frame *ole2frame = NULL;
00058         size_t size;
00059 
00060         size = sizeof (DxfOle2Frame);
00061         /* avoid malloc of 0 bytes */
00062         if (size == 0) size = 1;
00063         if ((ole2frame = malloc (size)) == NULL)
00064         {
00065                 fprintf (stderr,
00066                   (_("Error in %s () could not allocate memory for a DxfOle2Frame struct.\n")),
00067                   __FUNCTION__);
00068                 ole2frame = NULL;
00069         }
00070         else
00071         {
00072                 memset (ole2frame, 0, size);
00073         }
00074 #if DEBUG
00075         DXF_DEBUG_END
00076 #endif
00077         return (ole2frame);
00078 }
00079 
00080 
00088 DxfOle2Frame *
00089 dxf_ole2frame_init
00090 (
00091         DxfOle2Frame *ole2frame
00093 )
00094 {
00095 #if DEBUG
00096         DXF_DEBUG_BEGIN
00097 #endif
00098         /* Do some basic checks. */
00099         if (ole2frame == NULL)
00100         {
00101                 fprintf (stderr,
00102                   (_("Warning in %s () a NULL pointer was passed.\n")),
00103                   __FUNCTION__);
00104                 ole2frame = dxf_ole2frame_new ();
00105         }
00106         if (ole2frame == NULL)
00107         {
00108               fprintf (stderr,
00109                 (_("Error in %s () could not allocate memory for a DxfOle2Frame struct.\n")),
00110                 __FUNCTION__);
00111               return (NULL);
00112         }
00113         ole2frame->id_code = 0;
00114         ole2frame->linetype = strdup (DXF_DEFAULT_LINETYPE);
00115         ole2frame->layer = strdup (DXF_DEFAULT_LAYER);
00116         ole2frame->elevation = 0.0;
00117         ole2frame->thickness = 0.0;
00118         ole2frame->linetype_scale = DXF_DEFAULT_LINETYPE_SCALE;
00119         ole2frame->visibility = DXF_DEFAULT_VISIBILITY;
00120         ole2frame->color = DXF_COLOR_BYLAYER;
00121         ole2frame->paperspace = DXF_MODELSPACE;
00122         ole2frame->dictionary_owner_soft = strdup ("");
00123         ole2frame->dictionary_owner_hard = strdup ("");
00124         ole2frame->end_of_data = strdup ("OLE");
00125         ole2frame->length_of_binary_data = strdup ("");
00126         dxf_ole2frame_set_p0 (ole2frame, dxf_point_new ());
00127         dxf_point_init ((DxfPoint *) dxf_ole2frame_get_p0 (ole2frame));
00128         ole2frame->p0->x0 = 0.0;
00129         ole2frame->p0->y0 = 0.0;
00130         ole2frame->p0->z0 = 0.0;
00131         dxf_ole2frame_set_p1 (ole2frame, dxf_point_new ());
00132         dxf_point_init ((DxfPoint *) dxf_ole2frame_get_p1 (ole2frame));
00133         ole2frame->p1->x0 = 0.0;
00134         ole2frame->p1->y0 = 0.0;
00135         ole2frame->p1->z0 = 0.0;
00136         ole2frame->ole_version_number = 1;
00137         ole2frame->ole_object_type = 0;
00138         ole2frame->tilemode_descriptor = 0;
00139         ole2frame->length = 0;
00140         ole2frame->binary_data = dxf_char_new ();
00141         ole2frame->binary_data = dxf_char_init (ole2frame->binary_data);
00142         ole2frame->binary_data->value = strdup ("");
00143         ole2frame->binary_data->length = 0;
00144         ole2frame->binary_data->next = NULL;
00145         ole2frame->next = NULL;
00146 #if DEBUG
00147         DXF_DEBUG_END
00148 #endif
00149         return (ole2frame);
00150 }
00151 
00152 
00164 DxfOle2Frame *
00165 dxf_ole2frame_read
00166 (
00167         DxfFile *fp,
00169         DxfOle2Frame *ole2frame
00171 )
00172 {
00173 #if DEBUG
00174         DXF_DEBUG_BEGIN
00175 #endif
00176         char *temp_string = NULL;
00177         DxfChar *iter = NULL;
00178 
00179         /* Do some basic checks. */
00180         if (fp == NULL)
00181         {
00182                 fprintf (stderr,
00183                   (_("Error in %s () a NULL file pointer was passed.\n")),
00184                   __FUNCTION__);
00185                 /* Clean up. */
00186                 free (temp_string);
00187                 return (NULL);
00188         }
00189         if (ole2frame == NULL)
00190         {
00191                 fprintf (stderr,
00192                   (_("Warning in %s () a NULL pointer was passed.\n")),
00193                   __FUNCTION__);
00194                 ole2frame = dxf_ole2frame_new ();
00195                 ole2frame = dxf_ole2frame_init (ole2frame);
00196         }
00197         iter = (DxfChar *) ole2frame->binary_data;
00198         (fp->line_number)++;
00199         fscanf (fp->fp, "%[^\n]", temp_string);
00200         while (strcmp (temp_string, "0") != 0)
00201         {
00202                 if (ferror (fp->fp))
00203                 {
00204                         fprintf (stderr,
00205                           (_("Error in %s () while reading from: %s in line: %d.\n")),
00206                           __FUNCTION__, fp->filename, fp->line_number);
00207                         fclose (fp->fp);
00208                         /* Clean up. */
00209                         free (temp_string);
00210                         return (NULL);
00211                 }
00212                 if (strcmp (temp_string, "1") == 0)
00213                 {
00214                         /* Now follows a string containing a End of Ole
00215                          * data marker. */
00216                         (fp->line_number)++;
00217                         fscanf (fp->fp, "%s\n", temp_string);
00218                         if (strcmp (temp_string, "OLE") != 0)
00219                         {
00220                                 fprintf (stderr,
00221                                   (_("Warning in %s () found a bad End of Ole data marker in: %s in line: %d.\n")),
00222                                   __FUNCTION__, fp->filename, fp->line_number);
00223                         }
00224                 }
00225                 if (strcmp (temp_string, "3") == 0)
00226                 {
00227                         /* Now follows a string containing the length of
00228                          * binary data. */
00229                         (fp->line_number)++;
00230                         fscanf (fp->fp, "%s\n", ole2frame->length_of_binary_data);
00231                 }
00232                 if (strcmp (temp_string, "5") == 0)
00233                 {
00234                         /* Now follows a string containing a sequential
00235                          * id number. */
00236                         (fp->line_number)++;
00237                         fscanf (fp->fp, "%x\n", &ole2frame->id_code);
00238                 }
00239                 else if (strcmp (temp_string, "6") == 0)
00240                 {
00241                         /* Now follows a string containing a linetype
00242                          * name. */
00243                         (fp->line_number)++;
00244                         fscanf (fp->fp, "%s\n", ole2frame->linetype);
00245                 }
00246                 else if (strcmp (temp_string, "8") == 0)
00247                 {
00248                         /* Now follows a string containing a layer name. */
00249                         (fp->line_number)++;
00250                         fscanf (fp->fp, "%s\n", ole2frame->layer);
00251                 }
00252                 else if (strcmp (temp_string, "10") == 0)
00253                 {
00254                         /* Now follows a string containing the
00255                          * X-coordinate of the insertion point. */
00256                         (fp->line_number)++;
00257                         fscanf (fp->fp, "%lf\n", &ole2frame->p0->x0);
00258                 }
00259                 else if (strcmp (temp_string, "20") == 0)
00260                 {
00261                         /* Now follows a string containing the
00262                          * Y-coordinate of the insertion point. */
00263                         (fp->line_number)++;
00264                         fscanf (fp->fp, "%lf\n", &ole2frame->p0->y0);
00265                 }
00266                 else if (strcmp (temp_string, "30") == 0)
00267                 {
00268                         /* Now follows a string containing the
00269                          * Z-coordinate of the insertion point. */
00270                         (fp->line_number)++;
00271                         fscanf (fp->fp, "%lf\n", &ole2frame->p0->z0);
00272                 }
00273                 else if (strcmp (temp_string, "11") == 0)
00274                 {
00275                         /* Now follows a string containing the
00276                          * X-coordinate of the direction vector. */
00277                         (fp->line_number)++;
00278                         fscanf (fp->fp, "%lf\n", &ole2frame->p1->x0);
00279                 }
00280                 else if (strcmp (temp_string, "21") == 0)
00281                 {
00282                         /* Now follows a string containing the
00283                          * Y-coordinate of the direction vector. */
00284                         (fp->line_number)++;
00285                         fscanf (fp->fp, "%lf\n", &ole2frame->p1->y0);
00286                 }
00287                 else if (strcmp (temp_string, "31") == 0)
00288                 {
00289                         /* Now follows a string containing the
00290                          * Z-coordinate of the direction vector. */
00291                         (fp->line_number)++;
00292                         fscanf (fp->fp, "%lf\n", &ole2frame->p1->z0);
00293                 }
00294                 else if ((fp->acad_version_number <= AutoCAD_11)
00295                         && (strcmp (temp_string, "38") == 0))
00296                 {
00297                         /* Now follows a string containing the
00298                          * elevation. */
00299                         (fp->line_number)++;
00300                         fscanf (fp->fp, "%lf\n", &ole2frame->elevation);
00301                 }
00302                 else if (strcmp (temp_string, "39") == 0)
00303                 {
00304                         /* Now follows a string containing the
00305                          * thickness. */
00306                         (fp->line_number)++;
00307                         fscanf (fp->fp, "%lf\n", &ole2frame->thickness);
00308                 }
00309                 else if (strcmp (temp_string, "48") == 0)
00310                 {
00311                         /* Now follows a string containing the linetype
00312                          * scale. */
00313                         (fp->line_number)++;
00314                         fscanf (fp->fp, "%lf\n", &ole2frame->linetype_scale);
00315                 }
00316                 else if (strcmp (temp_string, "60") == 0)
00317                 {
00318                         /* Now follows a string containing the
00319                          * visibility value. */
00320                         (fp->line_number)++;
00321                         fscanf (fp->fp, "%hd\n", &ole2frame->visibility);
00322                 }
00323                 else if (strcmp (temp_string, "62") == 0)
00324                 {
00325                         /* Now follows a string containing the
00326                          * color value. */
00327                         (fp->line_number)++;
00328                         fscanf (fp->fp, "%d\n", &ole2frame->color);
00329                 }
00330                 else if (strcmp (temp_string, "67") == 0)
00331                 {
00332                         /* Now follows a string containing the
00333                          * paperspace value. */
00334                         (fp->line_number)++;
00335                         fscanf (fp->fp, "%d\n", &ole2frame->paperspace);
00336                 }
00337                 else if (strcmp (temp_string, "70") == 0)
00338                 {
00339                         /* Now follows a string containing the ole
00340                          * version number. */
00341                         (fp->line_number)++;
00342                         fscanf (fp->fp, "%d\n", &ole2frame->ole_version_number);
00343                 }
00344                 else if (strcmp (temp_string, "71") == 0)
00345                 {
00346                         /* Now follows a string containing the ole
00347                          * object type. */
00348                         (fp->line_number)++;
00349                         fscanf (fp->fp, "%d\n", &ole2frame->ole_object_type);
00350                 }
00351                 else if (strcmp (temp_string, "72") == 0)
00352                 {
00353                         /* Now follows a string containing the tilemode
00354                          * descriptor. */
00355                         (fp->line_number)++;
00356                         fscanf (fp->fp, "%d\n", &ole2frame->tilemode_descriptor);
00357                 }
00358                 else if (strcmp (temp_string, "90") == 0)
00359                 {
00360                         /* Now follows a string containing the length of
00361                          * binary data. */
00362                         (fp->line_number)++;
00363                         fscanf (fp->fp, "%ld\n", &ole2frame->length);
00364                 }
00365                 else if ((fp->acad_version_number >= AutoCAD_13)
00366                         && (strcmp (temp_string, "100") == 0))
00367                 {
00368                         /* Now follows a string containing the
00369                          * subclass marker value. */
00370                         (fp->line_number)++;
00371                         fscanf (fp->fp, "%s\n", temp_string);
00372                         if ((strcmp (temp_string, "AcDbEntity") != 0)
00373                         && ((strcmp (temp_string, "AcDbOle2Frame") != 0)))
00374                         {
00375                                 fprintf (stderr,
00376                                   (_("Warning in %s () found a bad subclass marker in: %s in line: %d.\n")),
00377                                   __FUNCTION__, fp->filename, fp->line_number);
00378                         }
00379                 }
00380                 else if (strcmp (temp_string, "310") == 0)
00381                 {
00382                         /* Now follows a string containing binary data. */
00383                         (fp->line_number)++;
00384                         fscanf (fp->fp, "%s\n", iter->value);
00385                         iter->next = (struct DxfChar *) dxf_char_init ((DxfChar *) iter->next);
00386                         iter = (DxfChar *) iter->next;
00387                 }
00388                 else if (strcmp (temp_string, "330") == 0)
00389                 {
00390                         /* Now follows a string containing Soft-pointer
00391                          * ID/handle to owner dictionary. */
00392                         (fp->line_number)++;
00393                         fscanf (fp->fp, "%s\n", ole2frame->dictionary_owner_soft);
00394                 }
00395                 else if (strcmp (temp_string, "360") == 0)
00396                 {
00397                         /* Now follows a string containing Hard owner
00398                          * ID/handle to owner dictionary. */
00399                         (fp->line_number)++;
00400                         fscanf (fp->fp, "%s\n", ole2frame->dictionary_owner_hard);
00401                 }
00402                 else if (strcmp (temp_string, "999") == 0)
00403                 {
00404                         /* Now follows a string containing a comment. */
00405                         (fp->line_number)++;
00406                         fscanf (fp->fp, "%s\n", temp_string);
00407                         fprintf (stdout, "DXF comment: %s\n", temp_string);
00408                 }
00409                 else
00410                 {
00411                         fprintf (stderr,
00412                           (_("Warning in %s () unknown string tag found while reading from: %s in line: %d.\n")),
00413                           __FUNCTION__, fp->filename, fp->line_number);
00414                 }
00415         }
00416         /* Handle omitted members and/or illegal values. */
00417         if (strcmp (ole2frame->linetype, "") == 0)
00418         {
00419                 ole2frame->linetype = strdup (DXF_DEFAULT_LINETYPE);
00420         }
00421         if (strcmp (ole2frame->layer, "") == 0)
00422         {
00423                 ole2frame->layer = strdup (DXF_DEFAULT_LAYER);
00424         }
00425         /* Clean up. */
00426         free (temp_string);
00427 #if DEBUG
00428         DXF_DEBUG_END
00429 #endif
00430         return (ole2frame);
00431 }
00432 
00433 
00440 int
00441 dxf_ole2frame_write
00442 (
00443         DxfFile *fp,
00445         DxfOle2Frame *ole2frame
00447 )
00448 {
00449 #if DEBUG
00450         DXF_DEBUG_BEGIN
00451 #endif
00452         char *dxf_entity_name = strdup ("OLE2FRAME");
00453         DxfChar *iter = NULL;
00454 
00455         /* Do some basic checks. */
00456         if (fp == NULL)
00457         {
00458                 fprintf (stderr,
00459                   (_("Error in %s () a NULL file pointer was passed.\n")),
00460                   __FUNCTION__);
00461                 /* Clean up. */
00462                 free (dxf_entity_name);
00463                 return (EXIT_FAILURE);
00464         }
00465         if (ole2frame == NULL)
00466         {
00467                 fprintf (stderr,
00468                   (_("Error in %s () a NULL pointer was passed.\n")),
00469                   __FUNCTION__);
00470                 /* Clean up. */
00471                 free (dxf_entity_name);
00472                 return (EXIT_FAILURE);
00473         }
00474         if (fp->acad_version_number < AutoCAD_14)
00475         {
00476                 fprintf (stderr,
00477                   (_("Warning in %s () illegal DXF version for this entity.\n")),
00478                   __FUNCTION__);
00479         }
00480         if (strcmp (ole2frame->linetype, "") == 0)
00481         {
00482                 fprintf (stderr,
00483                   (_("Warning in %s () empty linetype string for the %s entity with id-code: %x\n")),
00484                   __FUNCTION__, dxf_entity_name, ole2frame->id_code);
00485                 fprintf (stderr,
00486                   (_("\t%s entity is reset to default linetype")),
00487                   dxf_entity_name);
00488                 ole2frame->linetype = strdup (DXF_DEFAULT_LINETYPE);
00489         }
00490         if (strcmp (ole2frame->layer, "") == 0)
00491         {
00492                 fprintf (stderr,
00493                   (_("Warning in %s () empty layer string for the %s entity with id-code: %x\n")),
00494                   __FUNCTION__, dxf_entity_name, ole2frame->id_code);
00495                 fprintf (stderr,
00496                   (_("\t%s entity is relocated to layer 0")),
00497                   dxf_entity_name);
00498                 ole2frame->layer = strdup (DXF_DEFAULT_LAYER);
00499         }
00500         /* Start writing output. */
00501         fprintf (fp->fp, "  0\n%s\n", dxf_entity_name);
00502         if (ole2frame->id_code != -1)
00503         {
00504                 fprintf (fp->fp, "  5\n%x\n", ole2frame->id_code);
00505         }
00516         if ((strcmp (ole2frame->dictionary_owner_soft, "") != 0)
00517           && (fp->acad_version_number >= AutoCAD_14))
00518         {
00519                 fprintf (fp->fp, "102\n{ACAD_REACTORS\n");
00520                 fprintf (fp->fp, "330\n%s\n", ole2frame->dictionary_owner_soft);
00521                 fprintf (fp->fp, "102\n}\n");
00522         }
00523         if ((strcmp (ole2frame->dictionary_owner_hard, "") != 0)
00524           && (fp->acad_version_number >= AutoCAD_14))
00525         {
00526                 fprintf (fp->fp, "102\n{ACAD_XDICTIONARY\n");
00527                 fprintf (fp->fp, "360\n%s\n", ole2frame->dictionary_owner_hard);
00528                 fprintf (fp->fp, "102\n}\n");
00529         }
00530         if (fp->acad_version_number >= AutoCAD_13)
00531         {
00532                 fprintf (fp->fp, "100\nAcDbEntity\n");
00533         }
00534         if (ole2frame->paperspace == DXF_PAPERSPACE)
00535         {
00536                 fprintf (fp->fp, " 67\n%d\n", DXF_PAPERSPACE);
00537         }
00538         fprintf (fp->fp, "  8\n%s\n", ole2frame->layer);
00539         if (strcmp (ole2frame->linetype, DXF_DEFAULT_LINETYPE) != 0)
00540         {
00541                 fprintf (fp->fp, "  6\n%s\n", ole2frame->linetype);
00542         }
00543         if ((fp->acad_version_number <= AutoCAD_11)
00544           && DXF_FLATLAND
00545           && (ole2frame->elevation != 0.0))
00546         {
00547                 fprintf (fp->fp, " 38\n%f\n", ole2frame->elevation);
00548         }
00549         if (ole2frame->color != DXF_COLOR_BYLAYER)
00550         {
00551                 fprintf (fp->fp, " 62\n%d\n", ole2frame->color);
00552         }
00553         if (ole2frame->linetype_scale != 1.0)
00554         {
00555                 fprintf (fp->fp, " 48\n%f\n", ole2frame->linetype_scale);
00556         }
00557         if (ole2frame->visibility != 0)
00558         {
00559                 fprintf (fp->fp, " 60\n%d\n", ole2frame->visibility);
00560         }
00561         if (fp->acad_version_number >= AutoCAD_13)
00562         {
00563                 fprintf (fp->fp, "100\nAcDbOle2Frame\n");
00564         }
00565         if (ole2frame->thickness != 0.0)
00566         {
00567                 fprintf (fp->fp, " 39\n%f\n", ole2frame->thickness);
00568         }
00569         fprintf (fp->fp, " 70\n%d\n", ole2frame->ole_version_number);
00570         fprintf (fp->fp, "  3\n%s\n", ole2frame->length_of_binary_data);
00571         fprintf (fp->fp, " 10\n%f\n", ole2frame->p0->x0);
00572         fprintf (fp->fp, " 20\n%f\n", ole2frame->p0->y0);
00573         fprintf (fp->fp, " 30\n%f\n", ole2frame->p0->z0);
00574         fprintf (fp->fp, " 11\n%f\n", ole2frame->p1->x0);
00575         fprintf (fp->fp, " 21\n%f\n", ole2frame->p1->y0);
00576         fprintf (fp->fp, " 31\n%f\n", ole2frame->p1->z0);
00577         fprintf (fp->fp, " 71\n%d\n", ole2frame->ole_object_type);
00578         fprintf (fp->fp, " 72\n%d\n", ole2frame->tilemode_descriptor);
00579         fprintf (fp->fp, " 90\n%ld\n", ole2frame->length);
00580         if (ole2frame->binary_data != NULL)
00581         {
00582                 iter = (DxfChar*) ole2frame->binary_data;
00583                 while ((iter != NULL) && (iter->value != NULL))
00584                 {
00585                         fprintf (fp->fp, "310\n%s\n", iter->value);
00586                         iter = (DxfChar*) iter->next;
00587                 }
00588         }
00589         else
00590         {
00591                 fprintf (fp->fp, "310\n\n");
00592         }
00593         fprintf (fp->fp, "  1\nOLE\n");
00594         /* Clean up. */
00595         free (dxf_entity_name);
00596 #if DEBUG
00597         DXF_DEBUG_END
00598 #endif
00599         return (EXIT_SUCCESS);
00600 }
00601 
00602 
00610 int
00611 dxf_ole2frame_free
00612 (
00613         DxfOle2Frame *ole2frame
00616 )
00617 {
00618 #if DEBUG
00619         DXF_DEBUG_BEGIN
00620 #endif
00621         /* Do some basic checks. */
00622         if (ole2frame == NULL)
00623         {
00624                 fprintf (stderr,
00625                   (_("Error in %s () a NULL pointer was passed.\n")),
00626                   __FUNCTION__);
00627                 return (EXIT_FAILURE);
00628         }
00629         if (ole2frame->next != NULL)
00630         {
00631                 fprintf (stderr,
00632                   (_("Error in %s () pointer to next was not NULL.\n")),
00633                   __FUNCTION__);
00634                 return (EXIT_FAILURE);
00635         }
00636         free (ole2frame->end_of_data);
00637         free (ole2frame->length_of_binary_data);
00638         free (ole2frame->linetype);
00639         free (ole2frame->layer);
00640         free (ole2frame->dictionary_owner_soft);
00641         free (ole2frame->dictionary_owner_hard);
00642         free (ole2frame->binary_data->value);
00644         free (ole2frame->binary_data);
00646         free (ole2frame);
00647         ole2frame = NULL;
00648 #if DEBUG
00649         DXF_DEBUG_END
00650 #endif
00651         return (EXIT_SUCCESS);
00652 }
00653 
00654 
00659 void
00660 dxf_ole2frame_free_chain
00661 (
00662         DxfOle2Frame *ole2frames
00664 )
00665 {
00666 #ifdef DEBUG
00667         DXF_DEBUG_BEGIN
00668 #endif
00669         if (ole2frames == NULL)
00670         {
00671                 fprintf (stderr,
00672                   (_("Warning in %s () a NULL pointer was passed.\n")),
00673                   __FUNCTION__);
00674         }
00675         while (ole2frames != NULL)
00676         {
00677                 struct DxfOle2Frame *iter = ole2frames->next;
00678                 dxf_ole2frame_free (ole2frames);
00679                 ole2frames = (DxfOle2Frame *) iter;
00680         }
00681 #if DEBUG
00682         DXF_DEBUG_END
00683 #endif
00684 }
00685 
00686 
00692 int
00693 dxf_ole2frame_get_id_code
00694 (
00695         DxfOle2Frame *ole2frame
00697 )
00698 {
00699 #if DEBUG
00700         DXF_DEBUG_BEGIN
00701 #endif
00702         /* Do some basic checks. */
00703         if (ole2frame == NULL)
00704         {
00705                 fprintf (stderr,
00706                   (_("Error in %s () a NULL pointer was passed.\n")),
00707                   __FUNCTION__);
00708                 return (EXIT_FAILURE);
00709         }
00710         if (ole2frame->id_code < 0)
00711         {
00712                 fprintf (stderr,
00713                   (_("Error in %s () a negative value was found.\n")),
00714                   __FUNCTION__);
00715                 return (EXIT_FAILURE);
00716         }
00717 #if DEBUG
00718         DXF_DEBUG_END
00719 #endif
00720         return (ole2frame->id_code);
00721 }
00722 
00723 
00727 DxfOle2Frame *
00728 dxf_ole2frame_set_id_code
00729 (
00730         DxfOle2Frame *ole2frame,
00732         int id_code
00736 )
00737 {
00738 #if DEBUG
00739         DXF_DEBUG_BEGIN
00740 #endif
00741         /* Do some basic checks. */
00742         if (ole2frame == NULL)
00743         {
00744                 fprintf (stderr,
00745                   (_("Error in %s () a NULL pointer was passed.\n")),
00746                   __FUNCTION__);
00747                 return (NULL);
00748         }
00749         if (id_code < 0)
00750         {
00751                 fprintf (stderr,
00752                   (_("Error in %s () a negative value was passed.\n")),
00753                   __FUNCTION__);
00754                 return (NULL);
00755         }
00756         ole2frame->id_code = id_code;
00757 #if DEBUG
00758         DXF_DEBUG_END
00759 #endif
00760         return (ole2frame);
00761 }
00762 
00763 
00769 char *
00770 dxf_ole2frame_get_linetype
00771 (
00772         DxfOle2Frame *ole2frame
00774 )
00775 {
00776 #if DEBUG
00777         DXF_DEBUG_BEGIN
00778 #endif
00779         /* Do some basic checks. */
00780         if (ole2frame == NULL)
00781         {
00782                 fprintf (stderr,
00783                   (_("Error in %s () a NULL pointer was passed.\n")),
00784                   __FUNCTION__);
00785                 return (NULL);
00786         }
00787         if (ole2frame->linetype ==  NULL)
00788         {
00789                 fprintf (stderr,
00790                   (_("Error in %s () a NULL pointer was found.\n")),
00791                   __FUNCTION__);
00792                 return (NULL);
00793         }
00794 #if DEBUG
00795         DXF_DEBUG_END
00796 #endif
00797         return (strdup (ole2frame->linetype));
00798 }
00799 
00800 
00804 DxfOle2Frame *
00805 dxf_ole2frame_set_linetype
00806 (
00807         DxfOle2Frame *ole2frame,
00809         char *linetype
00811 )
00812 {
00813 #if DEBUG
00814         DXF_DEBUG_BEGIN
00815 #endif
00816         /* Do some basic checks. */
00817         if (ole2frame == NULL)
00818         {
00819                 fprintf (stderr,
00820                   (_("Error in %s () a NULL pointer was passed.\n")),
00821                   __FUNCTION__);
00822                 return (NULL);
00823         }
00824         if (linetype == NULL)
00825         {
00826                 fprintf (stderr,
00827                   (_("Error in %s () a NULL pointer was passed.\n")),
00828                   __FUNCTION__);
00829                 return (NULL);
00830         }
00831         ole2frame->linetype = strdup (linetype);
00832 #if DEBUG
00833         DXF_DEBUG_END
00834 #endif
00835         return (ole2frame);
00836 }
00837 
00838 
00844 char *
00845 dxf_ole2frame_get_layer
00846 (
00847         DxfOle2Frame *ole2frame
00849 )
00850 {
00851 #if DEBUG
00852         DXF_DEBUG_BEGIN
00853 #endif
00854         /* Do some basic checks. */
00855         if (ole2frame == NULL)
00856         {
00857                 fprintf (stderr,
00858                   (_("Error in %s () a NULL pointer was passed.\n")),
00859                   __FUNCTION__);
00860                 return (NULL);
00861         }
00862         if (ole2frame->layer ==  NULL)
00863         {
00864                 fprintf (stderr,
00865                   (_("Error in %s () a NULL pointer was found.\n")),
00866                   __FUNCTION__);
00867                 return (NULL);
00868         }
00869 #if DEBUG
00870         DXF_DEBUG_END
00871 #endif
00872         return (strdup (ole2frame->layer));
00873 }
00874 
00875 
00879 DxfOle2Frame *
00880 dxf_ole2frame_set_layer
00881 (
00882         DxfOle2Frame *ole2frame,
00884         char *layer
00886 )
00887 {
00888 #if DEBUG
00889         DXF_DEBUG_BEGIN
00890 #endif
00891         /* Do some basic checks. */
00892         if (ole2frame == NULL)
00893         {
00894                 fprintf (stderr,
00895                   (_("Error in %s () a NULL pointer was passed.\n")),
00896                   __FUNCTION__);
00897                 return (NULL);
00898         }
00899         if (layer == NULL)
00900         {
00901                 fprintf (stderr,
00902                   (_("Error in %s () a NULL pointer was passed.\n")),
00903                   __FUNCTION__);
00904                 return (NULL);
00905         }
00906         ole2frame->layer = strdup (layer);
00907 #if DEBUG
00908         DXF_DEBUG_END
00909 #endif
00910         return (ole2frame);
00911 }
00912 
00913 
00919 double
00920 dxf_ole2frame_get_elevation
00921 (
00922         DxfOle2Frame *ole2frame
00924 )
00925 {
00926 #if DEBUG
00927         DXF_DEBUG_BEGIN
00928 #endif
00929         /* Do some basic checks. */
00930         if (ole2frame == NULL)
00931         {
00932                 fprintf (stderr,
00933                   (_("Error in %s () a NULL pointer was passed.\n")),
00934                   __FUNCTION__);
00935                 return (EXIT_FAILURE);
00936         }
00937 #if DEBUG
00938         DXF_DEBUG_END
00939 #endif
00940         return (ole2frame->elevation);
00941 }
00942 
00943 
00947 DxfOle2Frame *
00948 dxf_ole2frame_set_elevation
00949 (
00950         DxfOle2Frame *ole2frame,
00952         double elevation
00954 )
00955 {
00956 #if DEBUG
00957         DXF_DEBUG_BEGIN
00958 #endif
00959         /* Do some basic checks. */
00960         if (ole2frame == NULL)
00961         {
00962                 fprintf (stderr,
00963                   (_("Error in %s () a NULL pointer was passed.\n")),
00964                   __FUNCTION__);
00965                 return (NULL);
00966         }
00967         ole2frame->elevation = elevation;
00968 #if DEBUG
00969         DXF_DEBUG_END
00970 #endif
00971         return (ole2frame);
00972 }
00973 
00974 
00980 double
00981 dxf_ole2frame_get_thickness
00982 (
00983         DxfOle2Frame *ole2frame
00985 )
00986 {
00987 #if DEBUG
00988         DXF_DEBUG_BEGIN
00989 #endif
00990         /* Do some basic checks. */
00991         if (ole2frame == NULL)
00992         {
00993                 fprintf (stderr,
00994                   (_("Error in %s () a NULL pointer was passed.\n")),
00995                   __FUNCTION__);
00996                 return (EXIT_FAILURE);
00997         }
00998         if (ole2frame->thickness < 0.0)
00999         {
01000                 fprintf (stderr,
01001                   (_("Warning in %s () a negative value was found.\n")),
01002                   __FUNCTION__);
01003         }
01004 #if DEBUG
01005         DXF_DEBUG_END
01006 #endif
01007         return (ole2frame->thickness);
01008 }
01009 
01010 
01014 DxfOle2Frame *
01015 dxf_ole2frame_set_thickness
01016 (
01017         DxfOle2Frame *ole2frame,
01019         double thickness
01021 )
01022 {
01023 #if DEBUG
01024         DXF_DEBUG_BEGIN
01025 #endif
01026         /* Do some basic checks. */
01027         if (ole2frame == NULL)
01028         {
01029                 fprintf (stderr,
01030                   (_("Error in %s () a NULL pointer was passed.\n")),
01031                   __FUNCTION__);
01032                 return (NULL);
01033         }
01034         if (thickness < 0.0)
01035         {
01036                 fprintf (stderr,
01037                   (_("Error in %s () a negative value was passed.\n")),
01038                   __FUNCTION__);
01039                 return (NULL);
01040         }
01041         ole2frame->thickness = thickness;
01042 #if DEBUG
01043         DXF_DEBUG_END
01044 #endif
01045         return (ole2frame);
01046 }
01047 
01048 
01054 double
01055 dxf_ole2frame_get_linetype_scale
01056 (
01057         DxfOle2Frame *ole2frame
01059 )
01060 {
01061 #if DEBUG
01062         DXF_DEBUG_BEGIN
01063 #endif
01064         /* Do some basic checks. */
01065         if (ole2frame == NULL)
01066         {
01067                 fprintf (stderr,
01068                   (_("Error in %s () a NULL pointer was passed.\n")),
01069                   __FUNCTION__);
01070                 return (EXIT_FAILURE);
01071         }
01072         if (ole2frame->linetype_scale < 0.0)
01073         {
01074                 fprintf (stderr,
01075                   (_("Warning in %s () a negative value was found.\n")),
01076                   __FUNCTION__);
01077         }
01078 #if DEBUG
01079         DXF_DEBUG_END
01080 #endif
01081         return (ole2frame->linetype_scale);
01082 }
01083 
01084 
01088 DxfOle2Frame *
01089 dxf_ole2frame_set_linetype_scale
01090 (
01091         DxfOle2Frame *ole2frame,
01093         double linetype_scale
01095 )
01096 {
01097 #if DEBUG
01098         DXF_DEBUG_BEGIN
01099 #endif
01100         /* Do some basic checks. */
01101         if (ole2frame == NULL)
01102         {
01103                 fprintf (stderr,
01104                   (_("Error in %s () a NULL pointer was passed.\n")),
01105                   __FUNCTION__);
01106                 return (NULL);
01107         }
01108         if (linetype_scale < 0.0)
01109         {
01110                 fprintf (stderr,
01111                   (_("Warning in %s () a negative value was passed.\n")),
01112                   __FUNCTION__);
01113         }
01114         ole2frame->linetype_scale = linetype_scale;
01115 #if DEBUG
01116         DXF_DEBUG_END
01117 #endif
01118         return (ole2frame);
01119 }
01120 
01121 
01127 int16_t
01128 dxf_ole2frame_get_visibility
01129 (
01130         DxfOle2Frame *ole2frame
01132 )
01133 {
01134 #if DEBUG
01135         DXF_DEBUG_BEGIN
01136 #endif
01137         /* Do some basic checks. */
01138         if (ole2frame == NULL)
01139         {
01140                 fprintf (stderr,
01141                   (_("Error in %s () a NULL pointer was passed.\n")),
01142                   __FUNCTION__);
01143                 return (EXIT_FAILURE);
01144         }
01145         if (ole2frame->visibility < 0)
01146         {
01147                 fprintf (stderr,
01148                   (_("Warning in %s () a negative value was found.\n")),
01149                   __FUNCTION__);
01150         }
01151         if (ole2frame->visibility > 1)
01152         {
01153                 fprintf (stderr,
01154                   (_("Warning in %s () an out of range value was found.\n")),
01155                   __FUNCTION__);
01156         }
01157 #if DEBUG
01158         DXF_DEBUG_END
01159 #endif
01160         return (ole2frame->visibility);
01161 }
01162 
01163 
01167 DxfOle2Frame *
01168 dxf_ole2frame_set_visibility
01169 (
01170         DxfOle2Frame *ole2frame,
01172         int16_t visibility
01174 )
01175 {
01176 #if DEBUG
01177         DXF_DEBUG_BEGIN
01178 #endif
01179         /* Do some basic checks. */
01180         if (ole2frame == NULL)
01181         {
01182                 fprintf (stderr,
01183                   (_("Error in %s () a NULL pointer was passed.\n")),
01184                   __FUNCTION__);
01185                 return (NULL);
01186         }
01187         if (visibility < 0)
01188         {
01189                 fprintf (stderr,
01190                   (_("Warning in %s () a negative value was passed.\n")),
01191                   __FUNCTION__);
01192         }
01193         if (visibility > 1)
01194         {
01195                 fprintf (stderr,
01196                   (_("Warning in %s () an out of range value was passed.\n")),
01197                   __FUNCTION__);
01198         }
01199         ole2frame->visibility = visibility;
01200 #if DEBUG
01201         DXF_DEBUG_END
01202 #endif
01203         return (ole2frame);
01204 }
01205 
01206 
01212 int
01213 dxf_ole2frame_get_color
01214 (
01215         DxfOle2Frame *ole2frame
01217 )
01218 {
01219 #if DEBUG
01220         DXF_DEBUG_BEGIN
01221 #endif
01222         /* Do some basic checks. */
01223         if (ole2frame == NULL)
01224         {
01225                 fprintf (stderr,
01226                   (_("Error in %s () a NULL pointer was passed.\n")),
01227                   __FUNCTION__);
01228                 return (EXIT_FAILURE);
01229         }
01230         if (ole2frame->color < 0)
01231         {
01232                 fprintf (stderr,
01233                   (_("Warning in %s () a negative value was found.\n")),
01234                   __FUNCTION__);
01235         }
01236 #if DEBUG
01237         DXF_DEBUG_END
01238 #endif
01239         return (ole2frame->color);
01240 }
01241 
01242 
01246 DxfOle2Frame *
01247 dxf_ole2frame_set_color
01248 (
01249         DxfOle2Frame *ole2frame,
01251         int color
01253 )
01254 {
01255 #if DEBUG
01256         DXF_DEBUG_BEGIN
01257 #endif
01258         /* Do some basic checks. */
01259         if (ole2frame == NULL)
01260         {
01261                 fprintf (stderr,
01262                   (_("Error in %s () a NULL pointer was passed.\n")),
01263                   __FUNCTION__);
01264                 return (NULL);
01265         }
01266         if (color < 0)
01267         {
01268                 fprintf (stderr,
01269                   (_("Warning in %s () a negative value was passed.\n")),
01270                   __FUNCTION__);
01271         }
01272         ole2frame->color = color;
01273 #if DEBUG
01274         DXF_DEBUG_END
01275 #endif
01276         return (ole2frame);
01277 }
01278 
01279 
01285 int
01286 dxf_ole2frame_get_paperspace
01287 (
01288         DxfOle2Frame *ole2frame
01290 )
01291 {
01292 #if DEBUG
01293         DXF_DEBUG_BEGIN
01294 #endif
01295         /* Do some basic checks. */
01296         if (ole2frame == NULL)
01297         {
01298                 fprintf (stderr,
01299                   (_("Error in %s () a NULL pointer was passed.\n")),
01300                   __FUNCTION__);
01301                 return (EXIT_FAILURE);
01302         }
01303         if (ole2frame->paperspace < 0)
01304         {
01305                 fprintf (stderr,
01306                   (_("Warning in %s () a negative value was found.\n")),
01307                   __FUNCTION__);
01308         }
01309         if (ole2frame->paperspace > 1)
01310         {
01311                 fprintf (stderr,
01312                   (_("Warning in %s () an out of range value was found.\n")),
01313                   __FUNCTION__);
01314         }
01315 #if DEBUG
01316         DXF_DEBUG_END
01317 #endif
01318         return (ole2frame->paperspace);
01319 }
01320 
01321 
01325 DxfOle2Frame *
01326 dxf_ole2frame_set_paperspace
01327 (
01328         DxfOle2Frame *ole2frame,
01330         int paperspace
01332 )
01333 {
01334 #if DEBUG
01335         DXF_DEBUG_BEGIN
01336 #endif
01337         /* Do some basic checks. */
01338         if (ole2frame == NULL)
01339         {
01340                 fprintf (stderr,
01341                   (_("Error in %s () a NULL pointer was passed.\n")),
01342                   __FUNCTION__);
01343                 return (NULL);
01344         }
01345         if (paperspace < 0)
01346         {
01347                 fprintf (stderr,
01348                   (_("Warning in %s () a negative value was passed.\n")),
01349                   __FUNCTION__);
01350         }
01351         if (paperspace > 1)
01352         {
01353                 fprintf (stderr,
01354                   (_("Warning in %s () an out of range value was passed.\n")),
01355                   __FUNCTION__);
01356         }
01357         ole2frame->paperspace = paperspace;
01358 #if DEBUG
01359         DXF_DEBUG_END
01360 #endif
01361         return (ole2frame);
01362 }
01363 
01364 
01372 int
01373 dxf_ole2frame_get_graphics_data_size
01374 (
01375         DxfOle2Frame *ole2frame
01377 )
01378 {
01379 #if DEBUG
01380         DXF_DEBUG_BEGIN
01381 #endif
01382         /* Do some basic checks. */
01383         if (ole2frame == NULL)
01384         {
01385                 fprintf (stderr,
01386                   (_("Error in %s () a NULL pointer was passed.\n")),
01387                   __FUNCTION__);
01388                 return (EXIT_FAILURE);
01389         }
01390         if (ole2frame->graphics_data_size < 0)
01391         {
01392                 fprintf (stderr,
01393                   (_("Warning in %s () a negative value was found.\n")),
01394                   __FUNCTION__);
01395         }
01396         if (ole2frame->graphics_data_size == 0)
01397         {
01398                 fprintf (stderr,
01399                   (_("Warning in %s () a zero value was found.\n")),
01400                   __FUNCTION__);
01401         }
01402 #if DEBUG
01403         DXF_DEBUG_END
01404 #endif
01405         return (ole2frame->graphics_data_size);
01406 }
01407 
01408 
01416 DxfOle2Frame *
01417 dxf_ole2frame_set_graphics_data_size
01418 (
01419         DxfOle2Frame *ole2frame,
01421         int graphics_data_size
01424 )
01425 {
01426 #if DEBUG
01427         DXF_DEBUG_BEGIN
01428 #endif
01429         /* Do some basic checks. */
01430         if (ole2frame == NULL)
01431         {
01432                 fprintf (stderr,
01433                   (_("Error in %s () a NULL pointer was passed.\n")),
01434                   __FUNCTION__);
01435                 return (NULL);
01436         }
01437         if (graphics_data_size < 0)
01438         {
01439                 fprintf (stderr,
01440                   (_("Error in %s () a negative value was passed.\n")),
01441                   __FUNCTION__);
01442                 return (NULL);
01443         }
01444         if (graphics_data_size == 0)
01445         {
01446                 fprintf (stderr,
01447                   (_("Warning in %s () a zero value was passed.\n")),
01448                   __FUNCTION__);
01449         }
01450         ole2frame->graphics_data_size = graphics_data_size;
01451 #if DEBUG
01452         DXF_DEBUG_END
01453 #endif
01454         return (ole2frame);
01455 }
01456 
01457 
01464 int16_t
01465 dxf_ole2frame_get_shadow_mode
01466 (
01467         DxfOle2Frame *ole2frame
01469 )
01470 {
01471 #if DEBUG
01472         DXF_DEBUG_BEGIN
01473 #endif
01474         /* Do some basic checks. */
01475         if (ole2frame == NULL)
01476         {
01477                 fprintf (stderr,
01478                   (_("Error in %s () a NULL pointer was passed.\n")),
01479                   __FUNCTION__);
01480                 return (EXIT_FAILURE);
01481         }
01482         if (ole2frame->shadow_mode < 0)
01483         {
01484                 fprintf (stderr,
01485                   (_("Warning in %s () a negative value was found.\n")),
01486                   __FUNCTION__);
01487         }
01488         if (ole2frame->shadow_mode > 3)
01489         {
01490                 fprintf (stderr,
01491                   (_("Warning in %s () an out of range value was found.\n")),
01492                   __FUNCTION__);
01493         }
01494 #if DEBUG
01495         DXF_DEBUG_END
01496 #endif
01497         return (ole2frame->shadow_mode);
01498 }
01499 
01500 
01507 DxfOle2Frame *
01508 dxf_ole2frame_set_shadow_mode
01509 (
01510         DxfOle2Frame *ole2frame,
01512         int16_t shadow_mode
01514 )
01515 {
01516 #if DEBUG
01517         DXF_DEBUG_BEGIN
01518 #endif
01519         /* Do some basic checks. */
01520         if (ole2frame == NULL)
01521         {
01522                 fprintf (stderr,
01523                   (_("Error in %s () a NULL pointer was passed.\n")),
01524                   __FUNCTION__);
01525                 return (NULL);
01526         }
01527         if (shadow_mode < 0)
01528         {
01529                 fprintf (stderr,
01530                   (_("Warning in %s () a negative value was passed.\n")),
01531                   __FUNCTION__);
01532         }
01533         if (shadow_mode > 3)
01534         {
01535                 fprintf (stderr,
01536                   (_("Warning in %s () an out of range value was passed.\n")),
01537                   __FUNCTION__);
01538         }
01539         ole2frame->shadow_mode = shadow_mode;
01540 #if DEBUG
01541         DXF_DEBUG_END
01542 #endif
01543         return (ole2frame);
01544 }
01545 
01546 
01555 DxfBinaryGraphicsData *
01556 dxf_ole2frame_get_binary_graphics_data
01557 (
01558         DxfOle2Frame *ole2frame
01560 )
01561 {
01562 #if DEBUG
01563         DXF_DEBUG_BEGIN
01564 #endif
01565         /* Do some basic checks. */
01566         if (ole2frame == NULL)
01567         {
01568                 fprintf (stderr,
01569                   (_("Error in %s () a NULL pointer was passed.\n")),
01570                   __FUNCTION__);
01571                 return (NULL);
01572         }
01573         if (ole2frame->binary_graphics_data ==  NULL)
01574         {
01575                 fprintf (stderr,
01576                   (_("Error in %s () a NULL pointer was found.\n")),
01577                   __FUNCTION__);
01578                 return (NULL);
01579         }
01580 #if DEBUG
01581         DXF_DEBUG_END
01582 #endif
01583         return ((DxfBinaryGraphicsData *) ole2frame->binary_graphics_data);
01584 }
01585 
01586 
01591 DxfOle2Frame *
01592 dxf_ole2frame_set_binary_graphics_data
01593 (
01594         DxfOle2Frame *ole2frame,
01596         DxfBinaryGraphicsData *data
01599 )
01600 {
01601 #if DEBUG
01602         DXF_DEBUG_BEGIN
01603 #endif
01604         /* Do some basic checks. */
01605         if (ole2frame == NULL)
01606         {
01607                 fprintf (stderr,
01608                   (_("Error in %s () a NULL pointer was passed.\n")),
01609                   __FUNCTION__);
01610                 return (NULL);
01611         }
01612         if (data == NULL)
01613         {
01614                 fprintf (stderr,
01615                   (_("Error in %s () a NULL pointer was passed.\n")),
01616                   __FUNCTION__);
01617                 return (NULL);
01618         }
01619         ole2frame->binary_graphics_data = (DxfBinaryGraphicsData *) data;
01620 #if DEBUG
01621         DXF_DEBUG_END
01622 #endif
01623         return (ole2frame);
01624 }
01625 
01626 
01635 char *
01636 dxf_ole2frame_get_dictionary_owner_soft
01637 (
01638         DxfOle2Frame *ole2frame
01640 )
01641 {
01642 #if DEBUG
01643         DXF_DEBUG_BEGIN
01644 #endif
01645         /* Do some basic checks. */
01646         if (ole2frame == NULL)
01647         {
01648                 fprintf (stderr,
01649                   (_("Error in %s () a NULL pointer was passed.\n")),
01650                   __FUNCTION__);
01651                 return (NULL);
01652         }
01653         if (ole2frame->dictionary_owner_soft ==  NULL)
01654         {
01655                 fprintf (stderr,
01656                   (_("Error in %s () a NULL pointer was found.\n")),
01657                   __FUNCTION__);
01658                 return (NULL);
01659         }
01660 #if DEBUG
01661         DXF_DEBUG_END
01662 #endif
01663         return (strdup (ole2frame->dictionary_owner_soft));
01664 }
01665 
01666 
01671 DxfOle2Frame *
01672 dxf_ole2frame_set_dictionary_owner_soft
01673 (
01674         DxfOle2Frame *ole2frame,
01676         char *dictionary_owner_soft
01679 )
01680 {
01681 #if DEBUG
01682         DXF_DEBUG_BEGIN
01683 #endif
01684         /* Do some basic checks. */
01685         if (ole2frame == NULL)
01686         {
01687                 fprintf (stderr,
01688                   (_("Error in %s () a NULL pointer was passed.\n")),
01689                   __FUNCTION__);
01690                 return (NULL);
01691         }
01692         if (dictionary_owner_soft == NULL)
01693         {
01694                 fprintf (stderr,
01695                   (_("Error in %s () a NULL pointer was passed.\n")),
01696                   __FUNCTION__);
01697                 return (NULL);
01698         }
01699         ole2frame->dictionary_owner_soft = strdup (dictionary_owner_soft);
01700 #if DEBUG
01701         DXF_DEBUG_END
01702 #endif
01703         return (ole2frame);
01704 }
01705 
01706 
01716 char *
01717 dxf_ole2frame_get_material
01718 (
01719         DxfOle2Frame *ole2frame
01721 )
01722 {
01723 #if DEBUG
01724         DXF_DEBUG_BEGIN
01725 #endif
01726         /* Do some basic checks. */
01727         if (ole2frame == NULL)
01728         {
01729                 fprintf (stderr,
01730                   (_("Error in %s () a NULL pointer was passed.\n")),
01731                   __FUNCTION__);
01732                 return (NULL);
01733         }
01734         if (ole2frame->material ==  NULL)
01735         {
01736                 fprintf (stderr,
01737                   (_("Error in %s () a NULL pointer was found.\n")),
01738                   __FUNCTION__);
01739                 return (NULL);
01740         }
01741 #if DEBUG
01742         DXF_DEBUG_END
01743 #endif
01744         return (strdup (ole2frame->material));
01745 }
01746 
01747 
01755 DxfOle2Frame *
01756 dxf_ole2frame_set_material
01757 (
01758         DxfOle2Frame *ole2frame,
01760         char *material
01763 )
01764 {
01765 #if DEBUG
01766         DXF_DEBUG_BEGIN
01767 #endif
01768         /* Do some basic checks. */
01769         if (ole2frame == NULL)
01770         {
01771                 fprintf (stderr,
01772                   (_("Error in %s () a NULL pointer was passed.\n")),
01773                   __FUNCTION__);
01774                 return (NULL);
01775         }
01776         if (material == NULL)
01777         {
01778                 fprintf (stderr,
01779                   (_("Error in %s () a NULL pointer was passed.\n")),
01780                   __FUNCTION__);
01781                 return (NULL);
01782         }
01783         ole2frame->material = strdup (material);
01784 #if DEBUG
01785         DXF_DEBUG_END
01786 #endif
01787         return (ole2frame);
01788 }
01789 
01790 
01799 char *
01800 dxf_ole2frame_get_dictionary_owner_hard
01801 (
01802         DxfOle2Frame *ole2frame
01804 )
01805 {
01806 #if DEBUG
01807         DXF_DEBUG_BEGIN
01808 #endif
01809         /* Do some basic checks. */
01810         if (ole2frame == NULL)
01811         {
01812                 fprintf (stderr,
01813                   (_("Error in %s () a NULL pointer was passed.\n")),
01814                   __FUNCTION__);
01815                 return (NULL);
01816         }
01817         if (ole2frame->dictionary_owner_hard ==  NULL)
01818         {
01819                 fprintf (stderr,
01820                   (_("Error in %s () a NULL pointer was found.\n")),
01821                   __FUNCTION__);
01822                 return (NULL);
01823         }
01824 #if DEBUG
01825         DXF_DEBUG_END
01826 #endif
01827         return (strdup (ole2frame->dictionary_owner_hard));
01828 }
01829 
01830 
01835 DxfOle2Frame *
01836 dxf_ole2frame_set_dictionary_owner_hard
01837 (
01838         DxfOle2Frame *ole2frame,
01840         char *dictionary_owner_hard
01843 )
01844 {
01845 #if DEBUG
01846         DXF_DEBUG_BEGIN
01847 #endif
01848         /* Do some basic checks. */
01849         if (ole2frame == NULL)
01850         {
01851                 fprintf (stderr,
01852                   (_("Error in %s () a NULL pointer was passed.\n")),
01853                   __FUNCTION__);
01854                 return (NULL);
01855         }
01856         if (dictionary_owner_hard == NULL)
01857         {
01858                 fprintf (stderr,
01859                   (_("Error in %s () a NULL pointer was passed.\n")),
01860                   __FUNCTION__);
01861                 return (NULL);
01862         }
01863         ole2frame->dictionary_owner_hard = strdup (dictionary_owner_hard);
01864 #if DEBUG
01865         DXF_DEBUG_END
01866 #endif
01867         return (ole2frame);
01868 }
01869 
01870 
01877 int16_t
01878 dxf_ole2frame_get_lineweight
01879 (
01880         DxfOle2Frame *ole2frame
01882 )
01883 {
01884 #if DEBUG
01885         DXF_DEBUG_BEGIN
01886 #endif
01887         /* Do some basic checks. */
01888         if (ole2frame == NULL)
01889         {
01890                 fprintf (stderr,
01891                   (_("Error in %s () a NULL pointer was passed.\n")),
01892                   __FUNCTION__);
01893                 return (EXIT_FAILURE);
01894         }
01895 #if DEBUG
01896         DXF_DEBUG_END
01897 #endif
01898         return (ole2frame->lineweight);
01899 }
01900 
01901 
01908 DxfOle2Frame *
01909 dxf_ole2frame_set_lineweight
01910 (
01911         DxfOle2Frame *ole2frame,
01913         int16_t lineweight
01915 )
01916 {
01917 #if DEBUG
01918         DXF_DEBUG_BEGIN
01919 #endif
01920         /* Do some basic checks. */
01921         if (ole2frame == NULL)
01922         {
01923                 fprintf (stderr,
01924                   (_("Error in %s () a NULL pointer was passed.\n")),
01925                   __FUNCTION__);
01926                 return (NULL);
01927         }
01928         ole2frame->lineweight = lineweight;
01929 #if DEBUG
01930         DXF_DEBUG_END
01931 #endif
01932         return (ole2frame);
01933 }
01934 
01935 
01942 char *
01943 dxf_ole2frame_get_plot_style_name
01944 (
01945         DxfOle2Frame *ole2frame
01947 )
01948 {
01949 #if DEBUG
01950         DXF_DEBUG_BEGIN
01951 #endif
01952         /* Do some basic checks. */
01953         if (ole2frame == NULL)
01954         {
01955                 fprintf (stderr,
01956                   (_("Error in %s () a NULL pointer was passed.\n")),
01957                   __FUNCTION__);
01958                 return (NULL);
01959         }
01960         if (ole2frame->plot_style_name ==  NULL)
01961         {
01962                 fprintf (stderr,
01963                   (_("Error in %s () a NULL pointer was found.\n")),
01964                   __FUNCTION__);
01965                 return (NULL);
01966         }
01967 #if DEBUG
01968         DXF_DEBUG_END
01969 #endif
01970         return (strdup (ole2frame->plot_style_name));
01971 }
01972 
01973 
01980 DxfOle2Frame *
01981 dxf_ole2frame_set_plot_style_name
01982 (
01983         DxfOle2Frame *ole2frame,
01985         char *plot_style_name
01988 )
01989 {
01990 #if DEBUG
01991         DXF_DEBUG_BEGIN
01992 #endif
01993         /* Do some basic checks. */
01994         if (ole2frame == NULL)
01995         {
01996                 fprintf (stderr,
01997                   (_("Error in %s () a NULL pointer was passed.\n")),
01998                   __FUNCTION__);
01999                 return (NULL);
02000         }
02001         if (plot_style_name == NULL)
02002         {
02003                 fprintf (stderr,
02004                   (_("Error in %s () a NULL pointer was passed.\n")),
02005                   __FUNCTION__);
02006                 return (NULL);
02007         }
02008         ole2frame->plot_style_name = strdup (plot_style_name);
02009 #if DEBUG
02010         DXF_DEBUG_END
02011 #endif
02012         return (ole2frame);
02013 }
02014 
02015 
02022 long
02023 dxf_ole2frame_get_color_value
02024 (
02025         DxfOle2Frame *ole2frame
02027 )
02028 {
02029 #if DEBUG
02030         DXF_DEBUG_BEGIN
02031 #endif
02032         /* Do some basic checks. */
02033         if (ole2frame == NULL)
02034         {
02035                 fprintf (stderr,
02036                   (_("Error in %s () a NULL pointer was passed.\n")),
02037                   __FUNCTION__);
02038                 return (EXIT_FAILURE);
02039         }
02040 #if DEBUG
02041         DXF_DEBUG_END
02042 #endif
02043         return (ole2frame->color_value);
02044 }
02045 
02046 
02053 DxfOle2Frame *
02054 dxf_ole2frame_set_color_value
02055 (
02056         DxfOle2Frame *ole2frame,
02058         long color_value
02060 )
02061 {
02062 #if DEBUG
02063         DXF_DEBUG_BEGIN
02064 #endif
02065         /* Do some basic checks. */
02066         if (ole2frame == NULL)
02067         {
02068                 fprintf (stderr,
02069                   (_("Error in %s () a NULL pointer was passed.\n")),
02070                   __FUNCTION__);
02071                 return (NULL);
02072         }
02073         ole2frame->color_value = color_value;
02074 #if DEBUG
02075         DXF_DEBUG_END
02076 #endif
02077         return (ole2frame);
02078 }
02079 
02080 
02087 char *
02088 dxf_ole2frame_get_color_name
02089 (
02090         DxfOle2Frame *ole2frame
02092 )
02093 {
02094 #if DEBUG
02095         DXF_DEBUG_BEGIN
02096 #endif
02097         /* Do some basic checks. */
02098         if (ole2frame == NULL)
02099         {
02100                 fprintf (stderr,
02101                   (_("Error in %s () a NULL pointer was passed.\n")),
02102                   __FUNCTION__);
02103                 return (NULL);
02104         }
02105         if (ole2frame->color_name ==  NULL)
02106         {
02107                 fprintf (stderr,
02108                   (_("Error in %s () a NULL pointer was found.\n")),
02109                   __FUNCTION__);
02110                 return (NULL);
02111         }
02112 #if DEBUG
02113         DXF_DEBUG_END
02114 #endif
02115         return (strdup (ole2frame->color_name));
02116 }
02117 
02118 
02125 DxfOle2Frame *
02126 dxf_ole2frame_set_color_name
02127 (
02128         DxfOle2Frame *ole2frame,
02130         char *color_name
02133 )
02134 {
02135 #if DEBUG
02136         DXF_DEBUG_BEGIN
02137 #endif
02138         /* Do some basic checks. */
02139         if (ole2frame == NULL)
02140         {
02141                 fprintf (stderr,
02142                   (_("Error in %s () a NULL pointer was passed.\n")),
02143                   __FUNCTION__);
02144                 return (NULL);
02145         }
02146         if (color_name == NULL)
02147         {
02148                 fprintf (stderr,
02149                   (_("Error in %s () a NULL pointer was passed.\n")),
02150                   __FUNCTION__);
02151                 return (NULL);
02152         }
02153         ole2frame->color_name = strdup (color_name);
02154 #if DEBUG
02155         DXF_DEBUG_END
02156 #endif
02157         return (ole2frame);
02158 }
02159 
02160 
02167 long
02168 dxf_ole2frame_get_transparency
02169 (
02170         DxfOle2Frame *ole2frame
02172 )
02173 {
02174 #if DEBUG
02175         DXF_DEBUG_BEGIN
02176 #endif
02177         /* Do some basic checks. */
02178         if (ole2frame == NULL)
02179         {
02180                 fprintf (stderr,
02181                   (_("Error in %s () a NULL pointer was passed.\n")),
02182                   __FUNCTION__);
02183                 return (EXIT_FAILURE);
02184         }
02185 #if DEBUG
02186         DXF_DEBUG_END
02187 #endif
02188         return (ole2frame->transparency);
02189 }
02190 
02191 
02198 DxfOle2Frame *
02199 dxf_ole2frame_set_transparency
02200 (
02201         DxfOle2Frame *ole2frame,
02203         long transparency
02205 )
02206 {
02207 #if DEBUG
02208         DXF_DEBUG_BEGIN
02209 #endif
02210         /* Do some basic checks. */
02211         if (ole2frame == NULL)
02212         {
02213                 fprintf (stderr,
02214                   (_("Error in %s () a NULL pointer was passed.\n")),
02215                   __FUNCTION__);
02216                 return (NULL);
02217         }
02218         ole2frame->transparency = transparency;
02219 #if DEBUG
02220         DXF_DEBUG_END
02221 #endif
02222         return (ole2frame);
02223 }
02224 
02225 
02232 char *
02233 dxf_ole2frame_get_end_of_data
02234 (
02235         DxfOle2Frame *ole2frame
02237 )
02238 {
02239 #if DEBUG
02240         DXF_DEBUG_BEGIN
02241 #endif
02242         /* Do some basic checks. */
02243         if (ole2frame == NULL)
02244         {
02245                 fprintf (stderr,
02246                   (_("Error in %s () a NULL pointer was passed.\n")),
02247                   __FUNCTION__);
02248                 return (NULL);
02249         }
02250         if (ole2frame->end_of_data ==  NULL)
02251         {
02252                 fprintf (stderr,
02253                   (_("Error in %s () a NULL pointer was found.\n")),
02254                   __FUNCTION__);
02255                 return (NULL);
02256         }
02257 #if DEBUG
02258         DXF_DEBUG_END
02259 #endif
02260         return (strdup (ole2frame->end_of_data));
02261 }
02262 
02263 
02270 DxfOle2Frame *
02271 dxf_ole2frame_set_end_of_data
02272 (
02273         DxfOle2Frame *ole2frame,
02275         char *end_of_data
02278 )
02279 {
02280 #if DEBUG
02281         DXF_DEBUG_BEGIN
02282 #endif
02283         /* Do some basic checks. */
02284         if (ole2frame == NULL)
02285         {
02286                 fprintf (stderr,
02287                   (_("Error in %s () a NULL pointer was passed.\n")),
02288                   __FUNCTION__);
02289                 return (NULL);
02290         }
02291         if (end_of_data == NULL)
02292         {
02293                 fprintf (stderr,
02294                   (_("Error in %s () a NULL pointer was passed.\n")),
02295                   __FUNCTION__);
02296                 return (NULL);
02297         }
02298         ole2frame->end_of_data = strdup (end_of_data);
02299 #if DEBUG
02300         DXF_DEBUG_END
02301 #endif
02302         return (ole2frame);
02303 }
02304 
02305 
02312 char *
02313 dxf_ole2frame_get_length_of_binary_data
02314 (
02315         DxfOle2Frame *ole2frame
02317 )
02318 {
02319 #if DEBUG
02320         DXF_DEBUG_BEGIN
02321 #endif
02322         /* Do some basic checks. */
02323         if (ole2frame == NULL)
02324         {
02325                 fprintf (stderr,
02326                   (_("Error in %s () a NULL pointer was passed.\n")),
02327                   __FUNCTION__);
02328                 return (NULL);
02329         }
02330         if (ole2frame->length_of_binary_data ==  NULL)
02331         {
02332                 fprintf (stderr,
02333                   (_("Error in %s () a NULL pointer was found.\n")),
02334                   __FUNCTION__);
02335                 return (NULL);
02336         }
02337 #if DEBUG
02338         DXF_DEBUG_END
02339 #endif
02340         return (strdup (ole2frame->length_of_binary_data));
02341 }
02342 
02343 
02350 DxfOle2Frame *
02351 dxf_ole2frame_set_length_of_binary_data
02352 (
02353         DxfOle2Frame *ole2frame,
02355         char *length_of_binary_data
02358 )
02359 {
02360 #if DEBUG
02361         DXF_DEBUG_BEGIN
02362 #endif
02363         /* Do some basic checks. */
02364         if (ole2frame == NULL)
02365         {
02366                 fprintf (stderr,
02367                   (_("Error in %s () a NULL pointer was passed.\n")),
02368                   __FUNCTION__);
02369                 return (NULL);
02370         }
02371         if (length_of_binary_data == NULL)
02372         {
02373                 fprintf (stderr,
02374                   (_("Error in %s () a NULL pointer was passed.\n")),
02375                   __FUNCTION__);
02376                 return (NULL);
02377         }
02378         ole2frame->length_of_binary_data = strdup (length_of_binary_data);
02379 #if DEBUG
02380         DXF_DEBUG_END
02381 #endif
02382         return (ole2frame);
02383 }
02384 
02385 
02391 DxfPoint *
02392 dxf_ole2frame_get_p0
02393 (
02394         DxfOle2Frame *ole2frame
02396 )
02397 {
02398 #ifdef DEBUG
02399         DXF_DEBUG_BEGIN
02400 #endif
02401         /* Do some basic checks. */
02402         if (ole2frame == NULL)
02403         {
02404                 fprintf (stderr,
02405                   (_("Error in %s () a NULL pointer was passed.\n")),
02406                   __FUNCTION__);
02407                 return (NULL);
02408         }
02409         if (ole2frame->p0 == NULL)
02410         {
02411                 fprintf (stderr,
02412                   (_("Error in %s () a NULL pointer was found.\n")),
02413                   __FUNCTION__);
02414                 return (NULL);
02415         }
02416 #if DEBUG
02417         DXF_DEBUG_END
02418 #endif
02419         return (ole2frame->p0);
02420 }
02421 
02422 
02428 DxfOle2Frame *
02429 dxf_ole2frame_set_p0
02430 (
02431         DxfOle2Frame *ole2frame,
02433         DxfPoint *p0
02435 )
02436 {
02437 #ifdef DEBUG
02438         DXF_DEBUG_BEGIN
02439 #endif
02440         /* Do some basic checks. */
02441         if (ole2frame == NULL)
02442         {
02443                 fprintf (stderr,
02444                   (_("Error in %s () a NULL pointer was passed.\n")),
02445                   __FUNCTION__);
02446                 return (NULL);
02447         }
02448         if (p0 == NULL)
02449         {
02450                 fprintf (stderr,
02451                   (_("Error in %s () a NULL pointer was passed.\n")),
02452                   __FUNCTION__);
02453                 return (NULL);
02454         }
02455         ole2frame->p0 = p0;
02456 #if DEBUG
02457         DXF_DEBUG_END
02458 #endif
02459         return (ole2frame);
02460 }
02461 
02462 
02469 double
02470 dxf_ole2frame_get_x0
02471 (
02472         DxfOle2Frame *ole2frame
02474 )
02475 {
02476 #ifdef DEBUG
02477         DXF_DEBUG_BEGIN
02478 #endif
02479 
02480         /* Do some basic checks. */
02481         if (ole2frame == NULL)
02482         {
02483                 fprintf (stderr,
02484                   (_("Error in %s () a NULL pointer was passed.\n")),
02485                   __FUNCTION__);
02486                 return (EXIT_FAILURE);
02487         }
02488         if (ole2frame->p0 == NULL)
02489         {
02490                 fprintf (stderr,
02491                   (_("Error in %s () a NULL pointer was found.\n")),
02492                   __FUNCTION__);
02493                 return (EXIT_FAILURE);
02494         }
02495 #if DEBUG
02496         DXF_DEBUG_END
02497 #endif
02498         return (ole2frame->p0->x0);
02499 }
02500 
02501 
02509 DxfOle2Frame *
02510 dxf_ole2frame_set_x0
02511 (
02512         DxfOle2Frame *ole2frame,
02514         double x0
02517 )
02518 {
02519 #ifdef DEBUG
02520         DXF_DEBUG_BEGIN
02521 #endif
02522         /* Do some basic checks. */
02523         if (ole2frame == NULL)
02524         {
02525                 fprintf (stderr,
02526                   (_("Error in %s () a NULL pointer was passed.\n")),
02527                   __FUNCTION__);
02528                 return (NULL);
02529         }
02530         if (ole2frame->p0 == NULL)
02531         {
02532                 fprintf (stderr,
02533                   (_("Error in %s () a NULL pointer was found.\n")),
02534                   __FUNCTION__);
02535                 return (NULL);
02536         }
02537         ole2frame->p0->x0 = x0;
02538 #if DEBUG
02539         DXF_DEBUG_END
02540 #endif
02541         return (ole2frame);
02542 }
02543 
02544 
02551 double
02552 dxf_ole2frame_get_y0
02553 (
02554         DxfOle2Frame *ole2frame
02556 )
02557 {
02558 #ifdef DEBUG
02559         DXF_DEBUG_BEGIN
02560 #endif
02561 
02562         /* Do some basic checks. */
02563         if (ole2frame == NULL)
02564         {
02565                 fprintf (stderr,
02566                   (_("Error in %s () a NULL pointer was passed.\n")),
02567                   __FUNCTION__);
02568                 return (EXIT_FAILURE);
02569         }
02570         if (ole2frame->p0 == NULL)
02571         {
02572                 fprintf (stderr,
02573                   (_("Error in %s () a NULL pointer was found.\n")),
02574                   __FUNCTION__);
02575                 return (EXIT_FAILURE);
02576         }
02577 #if DEBUG
02578         DXF_DEBUG_END
02579 #endif
02580         return (ole2frame->p0->y0);
02581 }
02582 
02583 
02591 DxfOle2Frame *
02592 dxf_ole2frame_set_y0
02593 (
02594         DxfOle2Frame *ole2frame,
02596         double y0
02599 )
02600 {
02601 #ifdef DEBUG
02602         DXF_DEBUG_BEGIN
02603 #endif
02604         /* Do some basic checks. */
02605         if (ole2frame == NULL)
02606         {
02607                 fprintf (stderr,
02608                   (_("Error in %s () a NULL pointer was passed.\n")),
02609                   __FUNCTION__);
02610                 return (NULL);
02611         }
02612         if (ole2frame->p0 == NULL)
02613         {
02614                 fprintf (stderr,
02615                   (_("Error in %s () a NULL pointer was found.\n")),
02616                   __FUNCTION__);
02617                 return (NULL);
02618         }
02619         ole2frame->p0->y0 = y0;
02620 #if DEBUG
02621         DXF_DEBUG_END
02622 #endif
02623         return (ole2frame);
02624 }
02625 
02626 
02633 double
02634 dxf_ole2frame_get_z0
02635 (
02636         DxfOle2Frame *ole2frame
02638 )
02639 {
02640 #ifdef DEBUG
02641         DXF_DEBUG_BEGIN
02642 #endif
02643 
02644         /* Do some basic checks. */
02645         if (ole2frame == NULL)
02646         {
02647                 fprintf (stderr,
02648                   (_("Error in %s () a NULL pointer was passed.\n")),
02649                   __FUNCTION__);
02650                 return (EXIT_FAILURE);
02651         }
02652         if (ole2frame->p0 == NULL)
02653         {
02654                 fprintf (stderr,
02655                   (_("Error in %s () a NULL pointer was found.\n")),
02656                   __FUNCTION__);
02657                 return (EXIT_FAILURE);
02658         }
02659 #if DEBUG
02660         DXF_DEBUG_END
02661 #endif
02662         return (ole2frame->p0->z0);
02663 }
02664 
02665 
02673 DxfOle2Frame *
02674 dxf_ole2frame_set_z0
02675 (
02676         DxfOle2Frame *ole2frame,
02678         double z0
02681 )
02682 {
02683 #ifdef DEBUG
02684         DXF_DEBUG_BEGIN
02685 #endif
02686         /* Do some basic checks. */
02687         if (ole2frame == NULL)
02688         {
02689                 fprintf (stderr,
02690                   (_("Error in %s () a NULL pointer was passed.\n")),
02691                   __FUNCTION__);
02692                 return (NULL);
02693         }
02694         if (ole2frame->p0 == NULL)
02695         {
02696                 fprintf (stderr,
02697                   (_("Error in %s () a NULL pointer was found.\n")),
02698                   __FUNCTION__);
02699                 return (NULL);
02700         }
02701         ole2frame->p0->z0 = z0;
02702 #if DEBUG
02703         DXF_DEBUG_END
02704 #endif
02705         return (ole2frame);
02706 }
02707 
02708 
02714 DxfPoint *
02715 dxf_ole2frame_get_p1
02716 (
02717         DxfOle2Frame *ole2frame
02719 )
02720 {
02721 #ifdef DEBUG
02722         DXF_DEBUG_BEGIN
02723 #endif
02724         /* Do some basic checks. */
02725         if (ole2frame == NULL)
02726         {
02727                 fprintf (stderr,
02728                   (_("Error in %s () a NULL pointer was passed.\n")),
02729                   __FUNCTION__);
02730                 return (NULL);
02731         }
02732         if (ole2frame->p1 == NULL)
02733         {
02734                 fprintf (stderr,
02735                   (_("Error in %s () a NULL pointer was found.\n")),
02736                   __FUNCTION__);
02737                 return (NULL);
02738         }
02739 #if DEBUG
02740         DXF_DEBUG_END
02741 #endif
02742         return (ole2frame->p1);
02743 }
02744 
02745 
02751 DxfOle2Frame *
02752 dxf_ole2frame_set_p1
02753 (
02754         DxfOle2Frame *ole2frame,
02756         DxfPoint *p1
02758 )
02759 {
02760 #ifdef DEBUG
02761         DXF_DEBUG_BEGIN
02762 #endif
02763         /* Do some basic checks. */
02764         if (ole2frame == NULL)
02765         {
02766                 fprintf (stderr,
02767                   (_("Error in %s () a NULL pointer was passed.\n")),
02768                   __FUNCTION__);
02769                 return (NULL);
02770         }
02771         if (p1 == NULL)
02772         {
02773                 fprintf (stderr,
02774                   (_("Error in %s () a NULL pointer was passed.\n")),
02775                   __FUNCTION__);
02776                 return (NULL);
02777         }
02778         ole2frame->p1 = p1;
02779 #if DEBUG
02780         DXF_DEBUG_END
02781 #endif
02782         return (ole2frame);
02783 }
02784 
02785 
02792 double
02793 dxf_ole2frame_get_x1
02794 (
02795         DxfOle2Frame *ole2frame
02797 )
02798 {
02799 #ifdef DEBUG
02800         DXF_DEBUG_BEGIN
02801 #endif
02802 
02803         /* Do some basic checks. */
02804         if (ole2frame == NULL)
02805         {
02806                 fprintf (stderr,
02807                   (_("Error in %s () a NULL pointer was passed.\n")),
02808                   __FUNCTION__);
02809                 return (EXIT_FAILURE);
02810         }
02811         if (ole2frame->p1 == NULL)
02812         {
02813                 fprintf (stderr,
02814                   (_("Error in %s () a NULL pointer was found.\n")),
02815                   __FUNCTION__);
02816                 return (EXIT_FAILURE);
02817         }
02818 #if DEBUG
02819         DXF_DEBUG_END
02820 #endif
02821         return (ole2frame->p1->x0);
02822 }
02823 
02824 
02832 DxfOle2Frame *
02833 dxf_ole2frame_set_x1
02834 (
02835         DxfOle2Frame *ole2frame,
02837         double x1
02840 )
02841 {
02842 #ifdef DEBUG
02843         DXF_DEBUG_BEGIN
02844 #endif
02845         /* Do some basic checks. */
02846         if (ole2frame == NULL)
02847         {
02848                 fprintf (stderr,
02849                   (_("Error in %s () a NULL pointer was passed.\n")),
02850                   __FUNCTION__);
02851                 return (NULL);
02852         }
02853         if (ole2frame->p1 == NULL)
02854         {
02855                 fprintf (stderr,
02856                   (_("Error in %s () a NULL pointer was found.\n")),
02857                   __FUNCTION__);
02858                 return (NULL);
02859         }
02860         ole2frame->p1->x0 = x1;
02861 #if DEBUG
02862         DXF_DEBUG_END
02863 #endif
02864         return (ole2frame);
02865 }
02866 
02867 
02874 double
02875 dxf_ole2frame_get_y1
02876 (
02877         DxfOle2Frame *ole2frame
02879 )
02880 {
02881 #ifdef DEBUG
02882         DXF_DEBUG_BEGIN
02883 #endif
02884 
02885         /* Do some basic checks. */
02886         if (ole2frame == NULL)
02887         {
02888                 fprintf (stderr,
02889                   (_("Error in %s () a NULL pointer was passed.\n")),
02890                   __FUNCTION__);
02891                 return (EXIT_FAILURE);
02892         }
02893         if (ole2frame->p1 == NULL)
02894         {
02895                 fprintf (stderr,
02896                   (_("Error in %s () a NULL pointer was found.\n")),
02897                   __FUNCTION__);
02898                 return (EXIT_FAILURE);
02899         }
02900 #if DEBUG
02901         DXF_DEBUG_END
02902 #endif
02903         return (ole2frame->p1->y0);
02904 }
02905 
02906 
02914 DxfOle2Frame *
02915 dxf_ole2frame_set_y1
02916 (
02917         DxfOle2Frame *ole2frame,
02919         double y1
02922 )
02923 {
02924 #ifdef DEBUG
02925         DXF_DEBUG_BEGIN
02926 #endif
02927         /* Do some basic checks. */
02928         if (ole2frame == NULL)
02929         {
02930                 fprintf (stderr,
02931                   (_("Error in %s () a NULL pointer was passed.\n")),
02932                   __FUNCTION__);
02933                 return (NULL);
02934         }
02935         if (ole2frame->p1 == NULL)
02936         {
02937                 fprintf (stderr,
02938                   (_("Error in %s () a NULL pointer was found.\n")),
02939                   __FUNCTION__);
02940                 return (NULL);
02941         }
02942         ole2frame->p1->y0 = y1;
02943 #if DEBUG
02944         DXF_DEBUG_END
02945 #endif
02946         return (ole2frame);
02947 }
02948 
02949 
02956 double
02957 dxf_ole2frame_get_z1
02958 (
02959         DxfOle2Frame *ole2frame
02961 )
02962 {
02963 #ifdef DEBUG
02964         DXF_DEBUG_BEGIN
02965 #endif
02966 
02967         /* Do some basic checks. */
02968         if (ole2frame == NULL)
02969         {
02970                 fprintf (stderr,
02971                   (_("Error in %s () a NULL pointer was passed.\n")),
02972                   __FUNCTION__);
02973                 return (EXIT_FAILURE);
02974         }
02975         if (ole2frame->p1 == NULL)
02976         {
02977                 fprintf (stderr,
02978                   (_("Error in %s () a NULL pointer was found.\n")),
02979                   __FUNCTION__);
02980                 return (EXIT_FAILURE);
02981         }
02982 #if DEBUG
02983         DXF_DEBUG_END
02984 #endif
02985         return (ole2frame->p1->z0);
02986 }
02987 
02988 
02996 DxfOle2Frame *
02997 dxf_ole2frame_set_z1
02998 (
02999         DxfOle2Frame *ole2frame,
03001         double z1
03004 )
03005 {
03006 #ifdef DEBUG
03007         DXF_DEBUG_BEGIN
03008 #endif
03009         /* Do some basic checks. */
03010         if (ole2frame == NULL)
03011         {
03012                 fprintf (stderr,
03013                   (_("Error in %s () a NULL pointer was passed.\n")),
03014                   __FUNCTION__);
03015                 return (NULL);
03016         }
03017         if (ole2frame->p1 == NULL)
03018         {
03019                 fprintf (stderr,
03020                   (_("Error in %s () a NULL pointer was found.\n")),
03021                   __FUNCTION__);
03022                 return (NULL);
03023         }
03024         ole2frame->p1->z0 = z1;
03025 #if DEBUG
03026         DXF_DEBUG_END
03027 #endif
03028         return (ole2frame);
03029 }
03030 
03031 
03037 int
03038 dxf_ole2frame_get_ole_version_number
03039 (
03040         DxfOle2Frame *ole2frame
03042 )
03043 {
03044 #if DEBUG
03045         DXF_DEBUG_BEGIN
03046 #endif
03047         /* Do some basic checks. */
03048         if (ole2frame == NULL)
03049         {
03050                 fprintf (stderr,
03051                   (_("Error in %s () a NULL pointer was passed.\n")),
03052                   __FUNCTION__);
03053                 return (EXIT_FAILURE);
03054         }
03055         if (ole2frame->ole_version_number < 0)
03056         {
03057                 fprintf (stderr,
03058                   (_("Warning in %s () a negative value was found.\n")),
03059                   __FUNCTION__);
03060         }
03061 #if DEBUG
03062         DXF_DEBUG_END
03063 #endif
03064         return (ole2frame->ole_version_number);
03065 }
03066 
03067 
03071 DxfOle2Frame *
03072 dxf_ole2frame_set_ole_version_number
03073 (
03074         DxfOle2Frame *ole2frame,
03076         int ole_version_number
03078 )
03079 {
03080 #if DEBUG
03081         DXF_DEBUG_BEGIN
03082 #endif
03083         /* Do some basic checks. */
03084         if (ole2frame == NULL)
03085         {
03086                 fprintf (stderr,
03087                   (_("Error in %s () a NULL pointer was passed.\n")),
03088                   __FUNCTION__);
03089                 return (NULL);
03090         }
03091         if (ole_version_number < 0)
03092         {
03093                 fprintf (stderr,
03094                   (_("Warning in %s () a negative value was passed.\n")),
03095                   __FUNCTION__);
03096         }
03097         ole2frame->ole_version_number = ole_version_number;
03098 #if DEBUG
03099         DXF_DEBUG_END
03100 #endif
03101         return (ole2frame);
03102 }
03103 
03104 
03110 int
03111 dxf_ole2frame_get_ole_object_type
03112 (
03113         DxfOle2Frame *ole2frame
03115 )
03116 {
03117 #if DEBUG
03118         DXF_DEBUG_BEGIN
03119 #endif
03120         /* Do some basic checks. */
03121         if (ole2frame == NULL)
03122         {
03123                 fprintf (stderr,
03124                   (_("Error in %s () a NULL pointer was passed.\n")),
03125                   __FUNCTION__);
03126                 return (EXIT_FAILURE);
03127         }
03128         if (ole2frame->ole_object_type < 1)
03129         {
03130                 fprintf (stderr,
03131                   (_("Warning in %s () a too small value was found.\n")),
03132                   __FUNCTION__);
03133         }
03134         if (ole2frame->ole_object_type > 3)
03135         {
03136                 fprintf (stderr,
03137                   (_("Warning in %s () a too large value was found.\n")),
03138                   __FUNCTION__);
03139         }
03140 #if DEBUG
03141         DXF_DEBUG_END
03142 #endif
03143         return (ole2frame->ole_object_type);
03144 }
03145 
03146 
03150 DxfOle2Frame *
03151 dxf_ole2frame_set_ole_object_type
03152 (
03153         DxfOle2Frame *ole2frame,
03155         int ole_object_type
03157 )
03158 {
03159 #if DEBUG
03160         DXF_DEBUG_BEGIN
03161 #endif
03162         /* Do some basic checks. */
03163         if (ole2frame == NULL)
03164         {
03165                 fprintf (stderr,
03166                   (_("Error in %s () a NULL pointer was passed.\n")),
03167                   __FUNCTION__);
03168                 return (NULL);
03169         }
03170         if (ole_object_type < 1)
03171         {
03172                 fprintf (stderr,
03173                   (_("Warning in %s () a too small value was passed.\n")),
03174                   __FUNCTION__);
03175         }
03176         if (ole_object_type > 3)
03177         {
03178                 fprintf (stderr,
03179                   (_("Warning in %s () a too large value was passed.\n")),
03180                   __FUNCTION__);
03181         }
03182         ole2frame->ole_object_type = ole_object_type;
03183 #if DEBUG
03184         DXF_DEBUG_END
03185 #endif
03186         return (ole2frame);
03187 }
03188 
03189 
03195 int
03196 dxf_ole2frame_get_tilemode_descriptor
03197 (
03198         DxfOle2Frame *ole2frame
03200 )
03201 {
03202 #if DEBUG
03203         DXF_DEBUG_BEGIN
03204 #endif
03205         /* Do some basic checks. */
03206         if (ole2frame == NULL)
03207         {
03208                 fprintf (stderr,
03209                   (_("Error in %s () a NULL pointer was passed.\n")),
03210                   __FUNCTION__);
03211                 return (EXIT_FAILURE);
03212         }
03213         if (ole2frame->tilemode_descriptor < 0)
03214         {
03215                 fprintf (stderr,
03216                   (_("Warning in %s () a negative value was found.\n")),
03217                   __FUNCTION__);
03218         }
03219         if (ole2frame->tilemode_descriptor > 1)
03220         {
03221                 fprintf (stderr,
03222                   (_("Warning in %s () an out of range value was found.\n")),
03223                   __FUNCTION__);
03224         }
03225 #if DEBUG
03226         DXF_DEBUG_END
03227 #endif
03228         return (ole2frame->tilemode_descriptor);
03229 }
03230 
03231 
03235 DxfOle2Frame *
03236 dxf_ole2frame_set_tilemode_descriptor
03237 (
03238         DxfOle2Frame *ole2frame,
03240         int tilemode_descriptor
03242 )
03243 {
03244 #if DEBUG
03245         DXF_DEBUG_BEGIN
03246 #endif
03247         /* Do some basic checks. */
03248         if (ole2frame == NULL)
03249         {
03250                 fprintf (stderr,
03251                   (_("Error in %s () a NULL pointer was passed.\n")),
03252                   __FUNCTION__);
03253                 return (NULL);
03254         }
03255         if (tilemode_descriptor < 0)
03256         {
03257                 fprintf (stderr,
03258                   (_("Warning in %s () a negative value was passed.\n")),
03259                   __FUNCTION__);
03260         }
03261         if (tilemode_descriptor > 1)
03262         {
03263                 fprintf (stderr,
03264                   (_("Warning in %s () an out of range value was passed.\n")),
03265                   __FUNCTION__);
03266         }
03267         ole2frame->tilemode_descriptor = tilemode_descriptor;
03268 #if DEBUG
03269         DXF_DEBUG_END
03270 #endif
03271         return (ole2frame);
03272 }
03273 
03274 
03281 long
03282 dxf_ole2frame_get_length
03283 (
03284         DxfOle2Frame *ole2frame
03286 )
03287 {
03288 #if DEBUG
03289         DXF_DEBUG_BEGIN
03290 #endif
03291         /* Do some basic checks. */
03292         if (ole2frame == NULL)
03293         {
03294                 fprintf (stderr,
03295                   (_("Error in %s () a NULL pointer was passed.\n")),
03296                   __FUNCTION__);
03297                 return (EXIT_FAILURE);
03298         }
03299 #if DEBUG
03300         DXF_DEBUG_END
03301 #endif
03302         return (ole2frame->length);
03303 }
03304 
03305 
03312 DxfOle2Frame *
03313 dxf_ole2frame_set_length
03314 (
03315         DxfOle2Frame *ole2frame,
03317         long length
03319 )
03320 {
03321 #if DEBUG
03322         DXF_DEBUG_BEGIN
03323 #endif
03324         /* Do some basic checks. */
03325         if (ole2frame == NULL)
03326         {
03327                 fprintf (stderr,
03328                   (_("Error in %s () a NULL pointer was passed.\n")),
03329                   __FUNCTION__);
03330                 return (NULL);
03331         }
03332         ole2frame->length = length;
03333 #if DEBUG
03334         DXF_DEBUG_END
03335 #endif
03336         return (ole2frame);
03337 }
03338 
03339 
03348 DxfChar *
03349 dxf_ole2frame_get_binary_data
03350 (
03351         DxfOle2Frame *ole2frame
03353 )
03354 {
03355 #if DEBUG
03356         DXF_DEBUG_BEGIN
03357 #endif
03358         /* Do some basic checks. */
03359         if (ole2frame == NULL)
03360         {
03361                 fprintf (stderr,
03362                   (_("Error in %s () a NULL pointer was passed.\n")),
03363                   __FUNCTION__);
03364                 return (NULL);
03365         }
03366         if (ole2frame->binary_data ==  NULL)
03367         {
03368                 fprintf (stderr,
03369                   (_("Error in %s () a NULL pointer was found.\n")),
03370                   __FUNCTION__);
03371                 return (NULL);
03372         }
03373 #if DEBUG
03374         DXF_DEBUG_END
03375 #endif
03376         return (ole2frame->binary_data);
03377 }
03378 
03379 
03388 DxfOle2Frame *
03389 dxf_ole2frame_set_binary_data
03390 (
03391         DxfOle2Frame *ole2frame,
03393         DxfChar *binary_data
03396 )
03397 {
03398 #if DEBUG
03399         DXF_DEBUG_BEGIN
03400 #endif
03401         /* Do some basic checks. */
03402         if (ole2frame == NULL)
03403         {
03404                 fprintf (stderr,
03405                   (_("Error in %s () a NULL pointer was passed.\n")),
03406                   __FUNCTION__);
03407                 return (NULL);
03408         }
03409         if (binary_data == NULL)
03410         {
03411                 fprintf (stderr,
03412                   (_("Error in %s () a NULL pointer was passed.\n")),
03413                   __FUNCTION__);
03414                 return (NULL);
03415         }
03416         ole2frame->binary_data = binary_data;
03417 #if DEBUG
03418         DXF_DEBUG_END
03419 #endif
03420         return (ole2frame);
03421 }
03422 
03423 
03432 DxfOle2Frame *
03433 dxf_ole2frame_get_next
03434 (
03435         DxfOle2Frame *ole2frame
03437 )
03438 {
03439 #if DEBUG
03440         DXF_DEBUG_BEGIN
03441 #endif
03442         /* Do some basic checks. */
03443         if (ole2frame == NULL)
03444         {
03445                 fprintf (stderr,
03446                   (_("Error in %s () a NULL pointer was passed.\n")),
03447                   __FUNCTION__);
03448                 return (NULL);
03449         }
03450         if (ole2frame->next == NULL)
03451         {
03452                 fprintf (stderr,
03453                   (_("Error in %s () a NULL pointer was found.\n")),
03454                   __FUNCTION__);
03455                 return (NULL);
03456         }
03457 #if DEBUG
03458         DXF_DEBUG_END
03459 #endif
03460         return ((DxfOle2Frame *) ole2frame->next);
03461 }
03462 
03463 
03468 DxfOle2Frame *
03469 dxf_ole2frame_set_next
03470 (
03471         DxfOle2Frame *ole2frame,
03473         DxfOle2Frame *next
03475 )
03476 {
03477 #if DEBUG
03478         DXF_DEBUG_BEGIN
03479 #endif
03480         /* Do some basic checks. */
03481         if (ole2frame == NULL)
03482         {
03483                 fprintf (stderr,
03484                   (_("Error in %s () a NULL pointer was passed.\n")),
03485                   __FUNCTION__);
03486                 return (NULL);
03487         }
03488         if (next == NULL)
03489         {
03490                 fprintf (stderr,
03491                   (_("Error in %s () a NULL pointer was passed.\n")),
03492                   __FUNCTION__);
03493                 return (NULL);
03494         }
03495         ole2frame->next = (struct DxfOle2Frame *) next;
03496 #if DEBUG
03497         DXF_DEBUG_END
03498 #endif
03499         return (ole2frame);
03500 }
03501 
03502 
03511 DxfOle2Frame *
03512 dxf_ole2frame_get_last
03513 (
03514         DxfOle2Frame *ole2frame
03516 )
03517 {
03518 #if DEBUG
03519         DXF_DEBUG_BEGIN
03520 #endif
03521         /* Do some basic checks. */
03522         if (ole2frame == NULL)
03523         {
03524                 fprintf (stderr,
03525                   (_("Error in %s () a NULL pointer was passed.\n")),
03526                   __FUNCTION__);
03527                 return (NULL);
03528         }
03529         if (ole2frame->next == NULL)
03530         {
03531                 fprintf (stderr,
03532                   (_("Warning in %s () a NULL pointer was found.\n")),
03533                   __FUNCTION__);
03534                 return ((DxfOle2Frame *) ole2frame);
03535         }
03536         DxfOle2Frame *iter = (DxfOle2Frame *) ole2frame->next;
03537         while (iter->next != NULL)
03538         {
03539                 iter = (DxfOle2Frame *) iter->next;
03540         }
03541 #if DEBUG
03542         DXF_DEBUG_END
03543 #endif
03544         return ((DxfOle2Frame *) iter);
03545 }
03546 
03547 
03548 /* EOF */