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

leader.c

Go to the documentation of this file.
00001 
00043 #include "leader.h"
00044 
00045 
00054 DxfLeader *
00055 dxf_leader_new ()
00056 {
00057 #if DEBUG
00058         DXF_DEBUG_BEGIN
00059 #endif
00060         DxfLeader *leader = NULL;
00061         size_t size;
00062 
00063         size = sizeof (DxfLeader);
00064         /* avoid malloc of 0 bytes */
00065         if (size == 0) size = 1;
00066         if ((leader = malloc (size)) == NULL)
00067         {
00068                 fprintf (stderr,
00069                   (_("Error in %s () could not allocate memory for a DxfArc struct.\n")),
00070                   __FUNCTION__);
00071                 leader = NULL;
00072         }
00073         else
00074         {
00075                 memset (leader, 0, size);
00076         }
00077 #if DEBUG
00078         DXF_DEBUG_END
00079 #endif
00080         return (leader);
00081 }
00082 
00083 
00091 DxfLeader *
00092 dxf_leader_init
00093 (
00094         DxfLeader *leader
00096 )
00097 {
00098 #if DEBUG
00099         DXF_DEBUG_BEGIN
00100 #endif
00101         /* Do some basic checks. */
00102         if (leader == NULL)
00103         {
00104                 fprintf (stderr,
00105                   (_("Warning in %s () a NULL pointer was passed.\n")),
00106                   __FUNCTION__);
00107                 leader = dxf_leader_new ();
00108         }
00109         if (leader == NULL)
00110         {
00111                 fprintf (stderr,
00112                   (_("Error in %s () could not allocate memory.\n")),
00113                   __FUNCTION__);
00114                 return (NULL);
00115         }
00116         leader->id_code = 0;
00117         leader->linetype = strdup (DXF_DEFAULT_LINETYPE);
00118         leader->layer = strdup (DXF_DEFAULT_LAYER);
00119         leader->elevation = 0.0;
00120         leader->thickness = 0.0;
00121         leader->linetype_scale = DXF_DEFAULT_LINETYPE_SCALE;
00122         leader->visibility = DXF_DEFAULT_VISIBILITY;
00123         leader->color = DXF_COLOR_BYLAYER;
00124         leader->paperspace = DXF_MODELSPACE;
00125         leader->dictionary_owner_soft = strdup ("");
00126         leader->dictionary_owner_hard = strdup ("");
00127         leader->dimension_style_name = strdup ("");
00128         leader->p0 = dxf_point_new ();
00129         leader->p0->x0 = 0.0;
00130         leader->p0->y0 = 0.0;
00131         leader->p0->z0 = 0.0;
00132         leader->text_annotation_height = 0.0;
00133         leader->text_annotation_width = 0.0;
00134         leader->arrow_head_flag = 0;
00135         leader->path_type = 0;
00136         leader->creation_flag = 0;
00137         leader->hookline_direction_flag = 0;
00138         leader->hookline_flag = 0;
00139         leader->number_vertices = 0;
00140         leader->leader_color = 0;
00141         leader->extr_x0 = 0.0;
00142         leader->extr_y0 = 0.0;
00143         leader->extr_z0 = 0.0;
00144         leader->p1 = dxf_point_new ();
00145         leader->p1->x0 = 0.0;
00146         leader->p1->y0 = 0.0;
00147         leader->p1->z0 = 0.0;
00148         leader->p2 = dxf_point_new ();
00149         leader->p2->x0 = 0.0;
00150         leader->p2->y0 = 0.0;
00151         leader->p2->z0 = 0.0;
00152         leader->p3 = dxf_point_new ();
00153         leader->p3->x0 = 0.0;
00154         leader->p3->y0 = 0.0;
00155         leader->p3->z0 = 0.0;
00156         leader->annotation_reference_hard = strdup ("");
00157         leader->next = NULL;
00158 #if DEBUG
00159         DXF_DEBUG_END
00160 #endif
00161         return (leader);
00162 }
00163 
00164 
00176 DxfLeader *
00177 dxf_leader_read
00178 (
00179         DxfFile *fp,
00181         DxfLeader *leader
00183 )
00184 {
00185 #if DEBUG
00186         DXF_DEBUG_BEGIN
00187 #endif
00188         char *temp_string = NULL;
00189         DxfPoint *iter;
00190         int i;
00191 
00192         /* Do some basic checks. */
00193         if (fp == NULL)
00194         {
00195                 fprintf (stderr,
00196                   (_("Error in %s () a NULL file pointer was passed.\n")),
00197                   __FUNCTION__);
00198                 /* Clean up. */
00199                 free (temp_string);
00200                 return (NULL);
00201         }
00202         if (fp->acad_version_number < AutoCAD_13)
00203         {
00204                 fprintf (stderr,
00205                   (_("Warning in %s () illegal DXF version for this entity.\n")),
00206                   __FUNCTION__);
00207         }
00208         if (leader == NULL)
00209         {
00210                 fprintf (stderr,
00211                   (_("Warning in %s () a NULL pointer was passed.\n")),
00212                   __FUNCTION__);
00213                 leader = dxf_leader_new ();
00214                 leader = dxf_leader_init (leader);
00215         }
00216         i = 0; /* Number of found vertices. */
00217         iter = (DxfPoint *) leader->p0; /* Pointer to first vertex */
00218         (fp->line_number)++;
00219         fscanf (fp->fp, "%[^\n]", temp_string);
00220         while (strcmp (temp_string, "0") != 0)
00221         {
00222                 if (ferror (fp->fp))
00223                 {
00224                         fprintf (stderr,
00225                           (_("Error in %s () while reading from: %s in line: %d.\n")),
00226                           __FUNCTION__, fp->filename, fp->line_number);
00227                         /* Clean up. */
00228                         free (temp_string);
00229                         fclose (fp->fp);
00230                         return (NULL);
00231                 }
00232                 else if (strcmp (temp_string, "  3") == 0)
00233                 {
00234                         /* Now follows a string containing additional
00235                          * proprietary data. */
00236                         (fp->line_number)++;
00237                         fscanf (fp->fp, "%s\n", leader->dimension_style_name);
00238                 }
00239                 if (strcmp (temp_string, "5") == 0)
00240                 {
00241                         /* Now follows a string containing a sequential
00242                          * id number. */
00243                         (fp->line_number)++;
00244                         fscanf (fp->fp, "%x\n", &leader->id_code);
00245                 }
00246                 else if (strcmp (temp_string, "6") == 0)
00247                 {
00248                         /* Now follows a string containing a linetype
00249                          * name. */
00250                         (fp->line_number)++;
00251                         fscanf (fp->fp, "%s\n", leader->linetype);
00252                 }
00253                 else if (strcmp (temp_string, "8") == 0)
00254                 {
00255                         /* Now follows a string containing a layer name. */
00256                         (fp->line_number)++;
00257                         fscanf (fp->fp, "%s\n", leader->layer);
00258                 }
00259                 else if ((strcmp (temp_string, "10") == 0)
00260                   || (strcmp (temp_string, "20") == 0)
00261                   || (strcmp (temp_string, "30") == 0))
00262                 {
00263                         if (strcmp (temp_string, "10") == 0)
00264                         {
00265                                 /* Now follows a string containing the X-value
00266                                  * of the Vertex coordinates (one entry for each
00267                                  * vertex). */
00268                                 if (i > 0) /* Create a pointer for the next vertex. */
00269                                 {
00270                                         dxf_point_init ((DxfPoint *) iter->next);
00271                                         iter = (DxfPoint *) iter->next;
00272                                 }
00273                                 (fp->line_number)++;
00274                                 fscanf (fp->fp, "%lf\n", &iter->x0);
00275                         }
00276                         else if (strcmp (temp_string, "20") == 0)
00277                         {
00278                                 /* Now follows a string containing the Y-value
00279                                  * of the Vertex coordinates (one entry for each
00280                                  * vertex). */
00281                                 (fp->line_number)++;
00282                                 fscanf (fp->fp, "%lf\n", &iter->y0);
00283                         }
00284                         else if (strcmp (temp_string, "30") == 0)
00285                         {
00286                                 /* Now follows a string containing the Z-value
00287                                  * of the Vertex coordinates (one entry for each
00288                                  * vertex). */
00289                                 (fp->line_number)++;
00290                                 fscanf (fp->fp, "%lf\n", &iter->z0);
00291                                 i++; /* Increase the number of found vertices. */
00292                         }
00293                 }
00294                 else if ((fp->acad_version_number <= AutoCAD_11)
00295                   && DXF_FLATLAND
00296                   && (strcmp (temp_string, "38") == 0))
00297                 {
00298                         /* Now follows a string containing the
00299                          * elevation. */
00300                         (fp->line_number)++;
00301                         fscanf (fp->fp, "%lf\n", &leader->elevation);
00302                 }
00303                 else if (strcmp (temp_string, "39") == 0)
00304                 {
00305                         /* Now follows a string containing the
00306                          * thickness. */
00307                         (fp->line_number)++;
00308                         fscanf (fp->fp, "%lf\n", &leader->thickness);
00309                 }
00310                 else if (strcmp (temp_string, "40") == 0)
00311                 {
00312                         /* Now follows a string containing the text
00313                          * annotation height. */
00314                         (fp->line_number)++;
00315                         fscanf (fp->fp, "%lf\n", &leader->text_annotation_height);
00316                 }
00317                 else if (strcmp (temp_string, "41") == 0)
00318                 {
00319                         /* Now follows a string containing the text
00320                          * annotation width. */
00321                         (fp->line_number)++;
00322                         fscanf (fp->fp, "%lf\n", &leader->text_annotation_width);
00323                 }
00324                 else if (strcmp (temp_string, "48") == 0)
00325                 {
00326                         /* Now follows a string containing the linetype
00327                          * scale. */
00328                         (fp->line_number)++;
00329                         fscanf (fp->fp, "%lf\n", &leader->linetype_scale);
00330                 }
00331                 else if (strcmp (temp_string, "60") == 0)
00332                 {
00333                         /* Now follows a string containing the
00334                          * visibility value. */
00335                         (fp->line_number)++;
00336                         fscanf (fp->fp, "%hd\n", &leader->visibility);
00337                 }
00338                 else if (strcmp (temp_string, "62") == 0)
00339                 {
00340                         /* Now follows a string containing the
00341                          * color value. */
00342                         (fp->line_number)++;
00343                         fscanf (fp->fp, "%d\n", &leader->color);
00344                 }
00345                 else if (strcmp (temp_string, "67") == 0)
00346                 {
00347                         /* Now follows a string containing the
00348                          * paperspace value. */
00349                         (fp->line_number)++;
00350                         fscanf (fp->fp, "%d\n", &leader->paperspace);
00351                 }
00352                 else if (strcmp (temp_string, "71") == 0)
00353                 {
00354                         /* Now follows a string containing the arrow
00355                          * head flag. */
00356                         (fp->line_number)++;
00357                         fscanf (fp->fp, "%d\n", &leader->arrow_head_flag);
00358                 }
00359                 else if (strcmp (temp_string, "72") == 0)
00360                 {
00361                         /* Now follows a string containing the path type. */
00362                         (fp->line_number)++;
00363                         fscanf (fp->fp, "%d\n", &leader->path_type);
00364                 }
00365                 else if (strcmp (temp_string, "73") == 0)
00366                 {
00367                         /* Now follows a string containing the creation
00368                          * flag. */
00369                         (fp->line_number)++;
00370                         fscanf (fp->fp, "%d\n", &leader->creation_flag);
00371                 }
00372                 else if (strcmp (temp_string, "74") == 0)
00373                 {
00374                         /* Now follows a string containing the hookline
00375                          * direction flag. */
00376                         (fp->line_number)++;
00377                         fscanf (fp->fp, "%d\n", &leader->hookline_direction_flag);
00378                 }
00379                 else if (strcmp (temp_string, "75") == 0)
00380                 {
00381                         /* Now follows a string containing the hookline
00382                          * flag. */
00383                         (fp->line_number)++;
00384                         fscanf (fp->fp, "%d\n", &leader->hookline_flag);
00385                 }
00386                 else if (strcmp (temp_string, "76") == 0)
00387                 {
00388                         /* Now follows a string containing the number of
00389                          * vertices. */
00390                         (fp->line_number)++;
00391                         fscanf (fp->fp, "%d\n", &leader->number_vertices);
00392                 }
00393                 else if (strcmp (temp_string, "77") == 0)
00394                 {
00395                         /* Now follows a string containing the leader
00396                          * color. */
00397                         (fp->line_number)++;
00398                         fscanf (fp->fp, "%d\n", &leader->leader_color);
00399                 }
00400                 else if ((fp->acad_version_number >= AutoCAD_13)
00401                         && (strcmp (temp_string, "100") == 0))
00402                 {
00403                         /* Now follows a string containing the
00404                          * subclass marker value. */
00405                         (fp->line_number)++;
00406                         fscanf (fp->fp, "%s\n", temp_string);
00407                         if (strcmp (temp_string, "AcDbLeader") != 0)
00408                         {
00409                                 fprintf (stderr,
00410                                   (_("Warning in %s () found a bad subclass marker in: %s in line: %d.\n")),
00411                                   __FUNCTION__, fp->filename, fp->line_number);
00412                         }
00413                 }
00414                 else if (strcmp (temp_string, "210") == 0)
00415                 {
00416                         /* Now follows a string containing the
00417                          * X-value of the extrusion vector. */
00418                         (fp->line_number)++;
00419                         fscanf (fp->fp, "%lf\n", &leader->extr_x0);
00420                 }
00421                 else if (strcmp (temp_string, "220") == 0)
00422                 {
00423                         /* Now follows a string containing the
00424                          * Y-value of the extrusion vector. */
00425                         (fp->line_number)++;
00426                         fscanf (fp->fp, "%lf\n", &leader->extr_y0);
00427                 }
00428                 else if (strcmp (temp_string, "230") == 0)
00429                 {
00430                         /* Now follows a string containing the
00431                          * Z-value of the extrusion vector. */
00432                         (fp->line_number)++;
00433                         fscanf (fp->fp, "%lf\n", &leader->extr_z0);
00434                 }
00435                 else if (strcmp (temp_string, "211") == 0)
00436                 {
00437                         /* Now follows a string containing the
00438                          * X-value of the "Horizontal" direction for
00439                          * leader. */
00440                         (fp->line_number)++;
00441                         fscanf (fp->fp, "%lf\n", &leader->p1->x0);
00442                 }
00443                 else if (strcmp (temp_string, "221") == 0)
00444                 {
00445                         /* Now follows a string containing the
00446                          * Y-value of the "Horizontal" direction for
00447                          * leader. */
00448                         (fp->line_number)++;
00449                         fscanf (fp->fp, "%lf\n", &leader->p1->y0);
00450                 }
00451                 else if (strcmp (temp_string, "231") == 0)
00452                 {
00453                         /* Now follows a string containing the
00454                          * Z-value of the "Horizontal" direction for
00455                          * leader. */
00456                         (fp->line_number)++;
00457                         fscanf (fp->fp, "%lf\n", &leader->p1->z0);
00458                 }
00459                 else if (strcmp (temp_string, "212") == 0)
00460                 {
00461                         /* Now follows a string containing the
00462                          * X-value of the Block reference insertion
00463                          * point offset from last leader vertex. */
00464                         (fp->line_number)++;
00465                         fscanf (fp->fp, "%lf\n", &leader->p2->x0);
00466                 }
00467                 else if (strcmp (temp_string, "222") == 0)
00468                 {
00469                         /* Now follows a string containing the
00470                          * Y-value of the Block reference insertion
00471                          * point offset from last leader vertex. */
00472                         (fp->line_number)++;
00473                         fscanf (fp->fp, "%lf\n", &leader->p2->y0);
00474                 }
00475                 else if (strcmp (temp_string, "232") == 0)
00476                 {
00477                         /* Now follows a string containing the
00478                          * Z-value of the Block reference insertion
00479                          * point offset from last leader vertex. */
00480                         (fp->line_number)++;
00481                         fscanf (fp->fp, "%lf\n", &leader->p2->z0);
00482                 }
00483                 else if (strcmp (temp_string, "213") == 0)
00484                 {
00485                         /* Now follows a string containing the
00486                          * X-value of the Annotation placement point
00487                          * offset from last leader vertex. */
00488                         (fp->line_number)++;
00489                         fscanf (fp->fp, "%lf\n", &leader->p3->x0);
00490                 }
00491                 else if (strcmp (temp_string, "223") == 0)
00492                 {
00493                         /* Now follows a string containing the
00494                          * Y-value of the Annotation placement point
00495                          * offset from last leader vertex. */
00496                         (fp->line_number)++;
00497                         fscanf (fp->fp, "%lf\n", &leader->p3->y0);
00498                 }
00499                 else if (strcmp (temp_string, "233") == 0)
00500                 {
00501                         /* Now follows a string containing the
00502                          * Z-value of the Annotation placement point
00503                          * offset from last leader vertex. */
00504                         (fp->line_number)++;
00505                         fscanf (fp->fp, "%lf\n", &leader->p3->z0);
00506                 }
00507                 else if (strcmp (temp_string, "330") == 0)
00508                 {
00509                         /* Now follows a string containing Soft-pointer
00510                          * ID/handle to owner dictionary. */
00511                         (fp->line_number)++;
00512                         fscanf (fp->fp, "%s\n", leader->dictionary_owner_soft);
00513                 }
00514                 else if (strcmp (temp_string, "340") == 0)
00515                 {
00516                         /* Now follows a string containing Hard
00517                          * reference to associated annotation (mtext,
00518                          * tolerance, or insert entity). */
00519                         (fp->line_number)++;
00520                         fscanf (fp->fp, "%s\n", leader->annotation_reference_hard);
00521                 }
00522                 else if (strcmp (temp_string, "360") == 0)
00523                 {
00524                         /* Now follows a string containing Hard owner
00525                          * ID/handle to owner dictionary. */
00526                         (fp->line_number)++;
00527                         fscanf (fp->fp, "%s\n", leader->dictionary_owner_hard);
00528                 }
00529                 else if (strcmp (temp_string, "999") == 0)
00530                 {
00531                         /* Now follows a string containing a comment. */
00532                         (fp->line_number)++;
00533                         fscanf (fp->fp, "%s\n", temp_string);
00534                         fprintf (stdout, (_("DXF comment: %s\n")), temp_string);
00535                 }
00536                 else
00537                 {
00538                         fprintf (stderr,
00539                           (_("Warning in %s () unknown string tag found while reading from: %s in line: %d.\n")),
00540                           __FUNCTION__, fp->filename, fp->line_number);
00541                 }
00542         }
00543         if (i != leader->number_vertices)
00544         {
00545                 fprintf (stderr,
00546                   (_("Warning in %s () actual number of vertices differs from number_vertices value in struct.\n")),
00547                   __FUNCTION__);
00548         }
00549         /* Handle omitted members and/or illegal values. */
00550         if (strcmp (leader->linetype, "") == 0)
00551         {
00552                 leader->linetype = strdup (DXF_DEFAULT_LINETYPE);
00553         }
00554         if (strcmp (leader->layer, "") == 0)
00555         {
00556                 leader->layer = strdup (DXF_DEFAULT_LAYER);
00557         }
00558         /* Clean up. */
00559         free (temp_string);
00560 #if DEBUG
00561         DXF_DEBUG_END
00562 #endif
00563         return (leader);
00564 }
00565 
00566 
00573 int
00574 dxf_leader_write
00575 (
00576         DxfFile *fp,
00578         DxfLeader *leader
00580 )
00581 {
00582 #if DEBUG
00583         DXF_DEBUG_BEGIN
00584 #endif
00585         char *dxf_entity_name = strdup ("LEADER");
00586         int i;
00587         DxfPoint *iter;
00588 
00589         /* Do some basic checks. */
00590         if (fp == NULL)
00591         {
00592                 fprintf (stderr,
00593                   (_("Error in %s () a NULL file pointer was passed.\n")),
00594                   __FUNCTION__);
00595                 /* Clean up. */
00596                 free (dxf_entity_name);
00597                 return (EXIT_FAILURE);
00598         }
00599         if (leader == NULL)
00600         {
00601                 fprintf (stderr,
00602                   (_("Error in %s () a NULL pointer was passed.\n")),
00603                   __FUNCTION__);
00604                 /* Clean up. */
00605                 free (dxf_entity_name);
00606                 return (EXIT_FAILURE);
00607         }
00608         if (leader->p0 == NULL)
00609         {
00610                 fprintf (stderr,
00611                   (_("Error in %s () a NULL pointer was found.\n")),
00612                   __FUNCTION__);
00613                 /* Clean up. */
00614                 free (dxf_entity_name);
00615                 return (EXIT_FAILURE);
00616         }
00617         if (fp->acad_version_number < AutoCAD_13)
00618         {
00619                 fprintf (stderr,
00620                   (_("Warning in %s () illegal DXF version for this %s entity with id-code: %x.\n")),
00621                   __FUNCTION__, dxf_entity_name, leader->id_code);
00622         }
00623         if (strcmp (leader->linetype, "") == 0)
00624         {
00625                 fprintf (stderr,
00626                   (_("Warning in %s () empty linetype string for the %s entity with id-code: %x\n")),
00627                   __FUNCTION__, dxf_entity_name, leader->id_code);
00628                 fprintf (stderr,
00629                   (_("\t%s entity is reset to default linetype")),
00630                   dxf_entity_name);
00631                 leader->linetype = strdup (DXF_DEFAULT_LINETYPE);
00632         }
00633         if (strcmp (leader->layer, "") == 0)
00634         {
00635                 fprintf (stderr,
00636                   (_("Warning in %s () empty layer string for the %s entity with id-code: %x\n")),
00637                   __FUNCTION__, dxf_entity_name, leader->id_code);
00638                 fprintf (stderr,
00639                   (_("\t%s entity is relocated to layer 0")),
00640                   dxf_entity_name);
00641                 leader->layer = strdup (DXF_DEFAULT_LAYER);
00642         }
00643         /* Start writing output. */
00644         fprintf (fp->fp, "  0\n%s\n", dxf_entity_name);
00645         if (leader->id_code != -1)
00646         {
00647                 fprintf (fp->fp, "  5\n%x\n", leader->id_code);
00648         }
00659         if ((strcmp (leader->dictionary_owner_soft, "") != 0)
00660           && (fp->acad_version_number >= AutoCAD_14))
00661         {
00662                 fprintf (fp->fp, "102\n{ACAD_REACTORS\n");
00663                 fprintf (fp->fp, "330\n%s\n", leader->dictionary_owner_soft);
00664                 fprintf (fp->fp, "102\n}\n");
00665         }
00666         if ((strcmp (leader->dictionary_owner_hard, "") != 0)
00667           && (fp->acad_version_number >= AutoCAD_14))
00668         {
00669                 fprintf (fp->fp, "102\n{ACAD_XDICTIONARY\n");
00670                 fprintf (fp->fp, "360\n%s\n", leader->dictionary_owner_hard);
00671                 fprintf (fp->fp, "102\n}\n");
00672         }
00673         if (fp->acad_version_number >= AutoCAD_13)
00674         {
00675                 fprintf (fp->fp, "100\nAcDbEntity\n");
00676         }
00677         if (leader->paperspace == DXF_PAPERSPACE)
00678         {
00679                 fprintf (fp->fp, " 67\n%d\n", DXF_PAPERSPACE);
00680         }
00681         fprintf (fp->fp, "  8\n%s\n", leader->layer);
00682         if (strcmp (leader->linetype, DXF_DEFAULT_LINETYPE) != 0)
00683         {
00684                 fprintf (fp->fp, "  6\n%s\n", leader->linetype);
00685         }
00686         if (leader->color != DXF_COLOR_BYLAYER)
00687         {
00688                 fprintf (fp->fp, " 62\n%d\n", leader->color);
00689         }
00690         if ((fp->acad_version_number <= AutoCAD_11)
00691           && DXF_FLATLAND
00692           && (leader->elevation != 0.0))
00693         {
00694                 fprintf (fp->fp, " 38\n%f\n", leader->elevation);
00695         }
00696         if (leader->thickness != 0.0)
00697         {
00698                 fprintf (fp->fp, " 39\n%f\n", leader->thickness);
00699         }
00700         if (leader->linetype_scale != 1.0)
00701         {
00702                 fprintf (fp->fp, " 48\n%f\n", leader->linetype_scale);
00703         }
00704         if (leader->visibility != 0)
00705         {
00706                 fprintf (fp->fp, " 60\n%d\n", leader->visibility);
00707         }
00708         if (fp->acad_version_number >= AutoCAD_13)
00709         {
00710                 fprintf (fp->fp, "100\nAcDbLeader\n");
00711         }
00712         fprintf (fp->fp, "  3\n%s\n", leader->dimension_style_name);
00713         fprintf (fp->fp, " 71\n%d\n", leader->arrow_head_flag);
00714         fprintf (fp->fp, " 72\n%d\n", leader->path_type);
00715         fprintf (fp->fp, " 73\n%d\n", leader->creation_flag);
00716         fprintf (fp->fp, " 74\n%d\n", leader->hookline_direction_flag);
00717         fprintf (fp->fp, " 75\n%d\n", leader->hookline_flag);
00718         fprintf (fp->fp, " 40\n%f\n", leader->text_annotation_height);
00719         fprintf (fp->fp, " 41\n%f\n", leader->text_annotation_width);
00720         fprintf (fp->fp, " 76\n%d\n", leader->number_vertices);
00721         iter = (DxfPoint *) leader->p0;
00722         i = 1;
00723         while (iter->next != NULL)
00724         {
00725                 fprintf (fp->fp, " 10\n%f\n", iter->x0);
00726                 fprintf (fp->fp, " 20\n%f\n", iter->y0);
00727                 fprintf (fp->fp, " 30\n%f\n", iter->z0);
00728                 iter = (DxfPoint *) iter->next;
00729                 i++;
00730         }
00731         if (i != leader->number_vertices)
00732         {
00733                 fprintf (stderr,
00734                   (_("Warning in %s () actual number of vertices differs from number_vertices value in struct.\n")),
00735                   __FUNCTION__);
00736         }
00737         fprintf (fp->fp, " 77\n%d\n", leader->leader_color);
00738         fprintf (fp->fp, "340\n%s\n", leader->annotation_reference_hard);
00739         fprintf (fp->fp, "210\n%f\n", leader->extr_x0);
00740         fprintf (fp->fp, "220\n%f\n", leader->extr_y0);
00741         fprintf (fp->fp, "230\n%f\n", leader->extr_z0);
00742         fprintf (fp->fp, "211\n%f\n", leader->p1->x0);
00743         fprintf (fp->fp, "221\n%f\n", leader->p1->y0);
00744         fprintf (fp->fp, "231\n%f\n", leader->p1->z0);
00745         fprintf (fp->fp, "212\n%f\n", leader->p2->x0);
00746         fprintf (fp->fp, "222\n%f\n", leader->p2->y0);
00747         fprintf (fp->fp, "232\n%f\n", leader->p2->z0);
00748         fprintf (fp->fp, "213\n%f\n", leader->p3->x0);
00749         fprintf (fp->fp, "223\n%f\n", leader->p3->y0);
00750         fprintf (fp->fp, "233\n%f\n", leader->p3->z0);
00754         /* Clean up. */
00755         free (dxf_entity_name);
00756 #if DEBUG
00757         DXF_DEBUG_END
00758 #endif
00759         return (EXIT_SUCCESS);
00760 }
00761 
00762 
00770 int
00771 dxf_leader_free
00772 (
00773         DxfLeader *leader
00776 )
00777 {
00778 #if DEBUG
00779         DXF_DEBUG_BEGIN
00780 #endif
00781         /* Do some basic checks. */
00782         if (leader == NULL)
00783         {
00784                 fprintf (stderr,
00785                   (_("Error in %s () a NULL pointer was passed.\n")),
00786                   __FUNCTION__);
00787                 return (EXIT_FAILURE);
00788         }
00789         if (leader->next != NULL)
00790         {
00791                 fprintf (stderr,
00792                   (_("Error in %s () pointer to next was not NULL.\n")),
00793                   __FUNCTION__);
00794                 return (EXIT_FAILURE);
00795         }
00796         free (leader->linetype);
00797         free (leader->layer);
00798         free (leader->dictionary_owner_soft);
00799         free (leader->dictionary_owner_hard);
00800         free (leader->dimension_style_name);
00801         free (leader->annotation_reference_hard);
00802         free (leader);
00803         leader = NULL;
00804 #if DEBUG
00805         DXF_DEBUG_END
00806 #endif
00807         return (EXIT_SUCCESS);
00808 }
00809 
00810 
00815 void
00816 dxf_leader_free_chain
00817 (
00818         DxfLeader *leaders
00820 )
00821 {
00822 #ifdef DEBUG
00823         DXF_DEBUG_BEGIN
00824 #endif
00825         if (leaders == NULL)
00826         {
00827                 fprintf (stderr,
00828                   (_("Warning in %s () a NULL pointer was passed.\n")),
00829                   __FUNCTION__);
00830         }
00831         while (leaders != NULL)
00832         {
00833                 struct DxfLeader *iter = leaders->next;
00834                 dxf_leader_free (leaders);
00835                 leaders = (DxfLeader *) iter;
00836         }
00837 #if DEBUG
00838         DXF_DEBUG_END
00839 #endif
00840 }
00841 
00842 
00848 int
00849 dxf_leader_get_id_code
00850 (
00851         DxfLeader *leader
00853 )
00854 {
00855 #if DEBUG
00856         DXF_DEBUG_BEGIN
00857 #endif
00858         /* Do some basic checks. */
00859         if (leader == NULL)
00860         {
00861                 fprintf (stderr,
00862                   (_("Error in %s () a NULL pointer was passed.\n")),
00863                   __FUNCTION__);
00864                 return (EXIT_FAILURE);
00865         }
00866         if (leader->id_code < 0)
00867         {
00868                 fprintf (stderr,
00869                   (_("Error in %s () a negative value was found.\n")),
00870                   __FUNCTION__);
00871                 return (EXIT_FAILURE);
00872         }
00873 #if DEBUG
00874         DXF_DEBUG_END
00875 #endif
00876         return (leader->id_code);
00877 }
00878 
00879 
00883 DxfLeader *
00884 dxf_leader_set_id_code
00885 (
00886         DxfLeader *leader,
00888         int id_code
00892 )
00893 {
00894 #if DEBUG
00895         DXF_DEBUG_BEGIN
00896 #endif
00897         /* Do some basic checks. */
00898         if (leader == NULL)
00899         {
00900                 fprintf (stderr,
00901                   (_("Error in %s () a NULL pointer was passed.\n")),
00902                   __FUNCTION__);
00903                 return (NULL);
00904         }
00905         if (id_code < 0)
00906         {
00907                 fprintf (stderr,
00908                   (_("Error in %s () a negative value was passed.\n")),
00909                   __FUNCTION__);
00910                 return (NULL);
00911         }
00912         leader->id_code = id_code;
00913 #if DEBUG
00914         DXF_DEBUG_END
00915 #endif
00916         return (leader);
00917 }
00918 
00919 
00925 char *
00926 dxf_leader_get_linetype
00927 (
00928         DxfLeader *leader
00930 )
00931 {
00932 #if DEBUG
00933         DXF_DEBUG_BEGIN
00934 #endif
00935         /* Do some basic checks. */
00936         if (leader == NULL)
00937         {
00938                 fprintf (stderr,
00939                   (_("Error in %s () a NULL pointer was passed.\n")),
00940                   __FUNCTION__);
00941                 return (NULL);
00942         }
00943         if (leader->linetype ==  NULL)
00944         {
00945                 fprintf (stderr,
00946                   (_("Error in %s () a NULL pointer was found.\n")),
00947                   __FUNCTION__);
00948                 return (NULL);
00949         }
00950 #if DEBUG
00951         DXF_DEBUG_END
00952 #endif
00953         return (strdup (leader->linetype));
00954 }
00955 
00956 
00960 DxfLeader *
00961 dxf_leader_set_linetype
00962 (
00963         DxfLeader *leader,
00965         char *linetype
00967 )
00968 {
00969 #if DEBUG
00970         DXF_DEBUG_BEGIN
00971 #endif
00972         /* Do some basic checks. */
00973         if (leader == NULL)
00974         {
00975                 fprintf (stderr,
00976                   (_("Error in %s () a NULL pointer was passed.\n")),
00977                   __FUNCTION__);
00978                 return (NULL);
00979         }
00980         if (linetype == NULL)
00981         {
00982                 fprintf (stderr,
00983                   (_("Error in %s () a NULL pointer was passed.\n")),
00984                   __FUNCTION__);
00985                 return (NULL);
00986         }
00987         leader->linetype = strdup (linetype);
00988 #if DEBUG
00989         DXF_DEBUG_END
00990 #endif
00991         return (leader);
00992 }
00993 
00994 
01000 char *
01001 dxf_leader_get_layer
01002 (
01003         DxfLeader *leader
01005 )
01006 {
01007 #if DEBUG
01008         DXF_DEBUG_BEGIN
01009 #endif
01010         /* Do some basic checks. */
01011         if (leader == NULL)
01012         {
01013                 fprintf (stderr,
01014                   (_("Error in %s () a NULL pointer was passed.\n")),
01015                   __FUNCTION__);
01016                 return (NULL);
01017         }
01018         if (leader->layer ==  NULL)
01019         {
01020                 fprintf (stderr,
01021                   (_("Error in %s () a NULL pointer was found.\n")),
01022                   __FUNCTION__);
01023                 return (NULL);
01024         }
01025 #if DEBUG
01026         DXF_DEBUG_END
01027 #endif
01028         return (strdup (leader->layer));
01029 }
01030 
01031 
01035 DxfLeader *
01036 dxf_leader_set_layer
01037 (
01038         DxfLeader *leader,
01040         char *layer
01042 )
01043 {
01044 #if DEBUG
01045         DXF_DEBUG_BEGIN
01046 #endif
01047         /* Do some basic checks. */
01048         if (leader == NULL)
01049         {
01050                 fprintf (stderr,
01051                   (_("Error in %s () a NULL pointer was passed.\n")),
01052                   __FUNCTION__);
01053                 return (NULL);
01054         }
01055         if (layer == NULL)
01056         {
01057                 fprintf (stderr,
01058                   (_("Error in %s () a NULL pointer was passed.\n")),
01059                   __FUNCTION__);
01060                 return (NULL);
01061         }
01062         leader->layer = strdup (layer);
01063 #if DEBUG
01064         DXF_DEBUG_END
01065 #endif
01066         return (leader);
01067 }
01068 
01069 
01075 double
01076 dxf_leader_get_elevation
01077 (
01078         DxfLeader *leader
01080 )
01081 {
01082 #if DEBUG
01083         DXF_DEBUG_BEGIN
01084 #endif
01085         /* Do some basic checks. */
01086         if (leader == NULL)
01087         {
01088                 fprintf (stderr,
01089                   (_("Error in %s () a NULL pointer was passed.\n")),
01090                   __FUNCTION__);
01091                 return (EXIT_FAILURE);
01092         }
01093 #if DEBUG
01094         DXF_DEBUG_END
01095 #endif
01096         return (leader->elevation);
01097 }
01098 
01099 
01103 DxfLeader *
01104 dxf_leader_set_elevation
01105 (
01106         DxfLeader *leader,
01108         double elevation
01110 )
01111 {
01112 #if DEBUG
01113         DXF_DEBUG_BEGIN
01114 #endif
01115         /* Do some basic checks. */
01116         if (leader == NULL)
01117         {
01118                 fprintf (stderr,
01119                   (_("Error in %s () a NULL pointer was passed.\n")),
01120                   __FUNCTION__);
01121                 return (NULL);
01122         }
01123         leader->elevation = elevation;
01124 #if DEBUG
01125         DXF_DEBUG_END
01126 #endif
01127         return (leader);
01128 }
01129 
01130 
01136 double
01137 dxf_leader_get_thickness
01138 (
01139         DxfLeader *leader
01141 )
01142 {
01143 #if DEBUG
01144         DXF_DEBUG_BEGIN
01145 #endif
01146         /* Do some basic checks. */
01147         if (leader == NULL)
01148         {
01149                 fprintf (stderr,
01150                   (_("Error in %s () a NULL pointer was passed.\n")),
01151                   __FUNCTION__);
01152                 return (EXIT_FAILURE);
01153         }
01154         if (leader->thickness < 0.0)
01155         {
01156                 fprintf (stderr,
01157                   (_("Error in %s () a negative value was found.\n")),
01158                   __FUNCTION__);
01159                 return (EXIT_FAILURE);
01160         }
01161 #if DEBUG
01162         DXF_DEBUG_END
01163 #endif
01164         return (leader->thickness);
01165 }
01166 
01167 
01171 DxfLeader *
01172 dxf_leader_set_thickness
01173 (
01174         DxfLeader *leader,
01176         double thickness
01178 )
01179 {
01180 #if DEBUG
01181         DXF_DEBUG_BEGIN
01182 #endif
01183         /* Do some basic checks. */
01184         if (leader == NULL)
01185         {
01186                 fprintf (stderr,
01187                   (_("Error in %s () a NULL pointer was passed.\n")),
01188                   __FUNCTION__);
01189                 return (NULL);
01190         }
01191         if (thickness < 0.0)
01192         {
01193                 fprintf (stderr,
01194                   (_("Error in %s () a negative value was passed.\n")),
01195                   __FUNCTION__);
01196                 return (NULL);
01197         }
01198         leader->thickness = thickness;
01199 #if DEBUG
01200         DXF_DEBUG_END
01201 #endif
01202         return (leader);
01203 }
01204 
01205 
01211 double
01212 dxf_leader_get_linetype_scale
01213 (
01214         DxfLeader *leader
01216 )
01217 {
01218 #if DEBUG
01219         DXF_DEBUG_BEGIN
01220 #endif
01221         /* Do some basic checks. */
01222         if (leader == NULL)
01223         {
01224                 fprintf (stderr,
01225                   (_("Error in %s () a NULL pointer was passed.\n")),
01226                   __FUNCTION__);
01227                 return (EXIT_FAILURE);
01228         }
01229         if (leader->linetype_scale < 0.0)
01230         {
01231                 fprintf (stderr,
01232                   (_("Error in %s () a negative value was found.\n")),
01233                   __FUNCTION__);
01234                 return (EXIT_FAILURE);
01235         }
01236 #if DEBUG
01237         DXF_DEBUG_END
01238 #endif
01239         return (leader->linetype_scale);
01240 }
01241 
01242 
01246 DxfLeader *
01247 dxf_leader_set_linetype_scale
01248 (
01249         DxfLeader *leader,
01251         double linetype_scale
01253 )
01254 {
01255 #if DEBUG
01256         DXF_DEBUG_BEGIN
01257 #endif
01258         /* Do some basic checks. */
01259         if (leader == NULL)
01260         {
01261                 fprintf (stderr,
01262                   (_("Error in %s () a NULL pointer was passed.\n")),
01263                   __FUNCTION__);
01264                 return (NULL);
01265         }
01266         if (linetype_scale < 0.0)
01267         {
01268                 fprintf (stderr,
01269                   (_("Error in %s () a negative value was passed.\n")),
01270                   __FUNCTION__);
01271                 return (NULL);
01272         }
01273         leader->linetype_scale = linetype_scale;
01274 #if DEBUG
01275         DXF_DEBUG_END
01276 #endif
01277         return (leader);
01278 }
01279 
01280 
01286 int16_t
01287 dxf_leader_get_visibility
01288 (
01289         DxfLeader *leader
01291 )
01292 {
01293 #if DEBUG
01294         DXF_DEBUG_BEGIN
01295 #endif
01296         /* Do some basic checks. */
01297         if (leader == NULL)
01298         {
01299                 fprintf (stderr,
01300                   (_("Error in %s () a NULL pointer was passed.\n")),
01301                   __FUNCTION__);
01302                 return (EXIT_FAILURE);
01303         }
01304         if (leader->visibility < 0)
01305         {
01306                 fprintf (stderr,
01307                   (_("Error in %s () a negative value was found.\n")),
01308                   __FUNCTION__);
01309                 return (EXIT_FAILURE);
01310         }
01311         if (leader->visibility > 1)
01312         {
01313                 fprintf (stderr,
01314                   (_("Error in %s () an out of range value was found.\n")),
01315                   __FUNCTION__);
01316                 return (EXIT_FAILURE);
01317         }
01318 #if DEBUG
01319         DXF_DEBUG_END
01320 #endif
01321         return (leader->visibility);
01322 }
01323 
01324 
01328 DxfLeader *
01329 dxf_leader_set_visibility
01330 (
01331         DxfLeader *leader,
01333         int16_t visibility
01335 )
01336 {
01337 #if DEBUG
01338         DXF_DEBUG_BEGIN
01339 #endif
01340         /* Do some basic checks. */
01341         if (leader == NULL)
01342         {
01343                 fprintf (stderr,
01344                   (_("Error in %s () a NULL pointer was passed.\n")),
01345                   __FUNCTION__);
01346                 return (NULL);
01347         }
01348         if (visibility < 0)
01349         {
01350                 fprintf (stderr,
01351                   (_("Error in %s () a negative value was passed.\n")),
01352                   __FUNCTION__);
01353                 return (NULL);
01354         }
01355         if (visibility > 1)
01356         {
01357                 fprintf (stderr,
01358                   (_("Error in %s () an out of range value was passed.\n")),
01359                   __FUNCTION__);
01360                 return (NULL);
01361         }
01362         leader->visibility = visibility;
01363 #if DEBUG
01364         DXF_DEBUG_END
01365 #endif
01366         return (leader);
01367 }
01368 
01369 
01375 int
01376 dxf_leader_get_color
01377 (
01378         DxfLeader *leader
01380 )
01381 {
01382 #if DEBUG
01383         DXF_DEBUG_BEGIN
01384 #endif
01385         /* Do some basic checks. */
01386         if (leader == NULL)
01387         {
01388                 fprintf (stderr,
01389                   (_("Error in %s () a NULL pointer was passed.\n")),
01390                   __FUNCTION__);
01391                 return (EXIT_FAILURE);
01392         }
01393         if (leader->color < 0)
01394         {
01395                 fprintf (stderr,
01396                   (_("Warning in %s () a negative value was found.\n")),
01397                   __FUNCTION__);
01398         }
01399 #if DEBUG
01400         DXF_DEBUG_END
01401 #endif
01402         return (leader->color);
01403 }
01404 
01405 
01409 DxfLeader *
01410 dxf_leader_set_color
01411 (
01412         DxfLeader *leader,
01414         int color
01416 )
01417 {
01418 #if DEBUG
01419         DXF_DEBUG_BEGIN
01420 #endif
01421         /* Do some basic checks. */
01422         if (leader == NULL)
01423         {
01424                 fprintf (stderr,
01425                   (_("Error in %s () a NULL pointer was passed.\n")),
01426                   __FUNCTION__);
01427                 return (NULL);
01428         }
01429         if (color < 0)
01430         {
01431                 fprintf (stderr,
01432                   (_("Warning in %s () a negative value was passed.\n")),
01433                   __FUNCTION__);
01434         }
01435         leader->color = color;
01436 #if DEBUG
01437         DXF_DEBUG_END
01438 #endif
01439         return (leader);
01440 }
01441 
01442 
01448 int
01449 dxf_leader_get_paperspace
01450 (
01451         DxfLeader *leader
01453 )
01454 {
01455 #if DEBUG
01456         DXF_DEBUG_BEGIN
01457 #endif
01458         /* Do some basic checks. */
01459         if (leader == NULL)
01460         {
01461                 fprintf (stderr,
01462                   (_("Error in %s () a NULL pointer was passed.\n")),
01463                   __FUNCTION__);
01464                 return (EXIT_FAILURE);
01465         }
01466         if (leader->paperspace < 0)
01467         {
01468                 fprintf (stderr,
01469                   (_("Warning in %s () a negative value was found.\n")),
01470                   __FUNCTION__);
01471         }
01472         if (leader->paperspace > 1)
01473         {
01474                 fprintf (stderr,
01475                   (_("Warning in %s () an out of range value was found.\n")),
01476                   __FUNCTION__);
01477         }
01478 #if DEBUG
01479         DXF_DEBUG_END
01480 #endif
01481         return (leader->paperspace);
01482 }
01483 
01484 
01488 DxfLeader *
01489 dxf_leader_set_paperspace
01490 (
01491         DxfLeader *leader,
01493         int paperspace
01495 )
01496 {
01497 #if DEBUG
01498         DXF_DEBUG_BEGIN
01499 #endif
01500         /* Do some basic checks. */
01501         if (leader == NULL)
01502         {
01503                 fprintf (stderr,
01504                   (_("Error in %s () a NULL pointer was passed.\n")),
01505                   __FUNCTION__);
01506                 return (NULL);
01507         }
01508         if (paperspace < 0)
01509         {
01510                 fprintf (stderr,
01511                   (_("Error in %s () a negative value was passed.\n")),
01512                   __FUNCTION__);
01513                 return (NULL);
01514         }
01515         if (paperspace > 1)
01516         {
01517                 fprintf (stderr,
01518                   (_("Error in %s () an out of range value was passed.\n")),
01519                   __FUNCTION__);
01520                 return (NULL);
01521         }
01522         leader->paperspace = paperspace;
01523 #if DEBUG
01524         DXF_DEBUG_END
01525 #endif
01526         return (leader);
01527 }
01528 
01529 
01538 char *
01539 dxf_leader_get_dictionary_owner_soft
01540 (
01541         DxfLeader *leader
01543 )
01544 {
01545 #if DEBUG
01546         DXF_DEBUG_BEGIN
01547 #endif
01548         /* Do some basic checks. */
01549         if (leader == NULL)
01550         {
01551                 fprintf (stderr,
01552                   (_("Error in %s () a NULL pointer was passed.\n")),
01553                   __FUNCTION__);
01554                 return (NULL);
01555         }
01556         if (leader->dictionary_owner_soft ==  NULL)
01557         {
01558                 fprintf (stderr,
01559                   (_("Error in %s () a NULL pointer was found.\n")),
01560                   __FUNCTION__);
01561                 return (NULL);
01562         }
01563 #if DEBUG
01564         DXF_DEBUG_END
01565 #endif
01566         return (strdup (leader->dictionary_owner_soft));
01567 }
01568 
01569 
01574 DxfLeader *
01575 dxf_leader_set_dictionary_owner_soft
01576 (
01577         DxfLeader *leader,
01579         char *dictionary_owner_soft
01582 )
01583 {
01584 #if DEBUG
01585         DXF_DEBUG_BEGIN
01586 #endif
01587         /* Do some basic checks. */
01588         if (leader == NULL)
01589         {
01590                 fprintf (stderr,
01591                   (_("Error in %s () a NULL pointer was passed.\n")),
01592                   __FUNCTION__);
01593                 return (NULL);
01594         }
01595         if (dictionary_owner_soft == NULL)
01596         {
01597                 fprintf (stderr,
01598                   (_("Error in %s () a NULL pointer was passed.\n")),
01599                   __FUNCTION__);
01600                 return (NULL);
01601         }
01602         leader->dictionary_owner_soft = strdup (dictionary_owner_soft);
01603 #if DEBUG
01604         DXF_DEBUG_END
01605 #endif
01606         return (leader);
01607 }
01608 
01609 
01618 char *
01619 dxf_leader_get_dictionary_owner_hard
01620 (
01621         DxfLeader *leader
01623 )
01624 {
01625 #if DEBUG
01626         DXF_DEBUG_BEGIN
01627 #endif
01628         /* Do some basic checks. */
01629         if (leader == NULL)
01630         {
01631                 fprintf (stderr,
01632                   (_("Error in %s () a NULL pointer was passed.\n")),
01633                   __FUNCTION__);
01634                 return (NULL);
01635         }
01636         if (leader->dictionary_owner_hard ==  NULL)
01637         {
01638                 fprintf (stderr,
01639                   (_("Error in %s () a NULL pointer was found.\n")),
01640                   __FUNCTION__);
01641                 return (NULL);
01642         }
01643 #if DEBUG
01644         DXF_DEBUG_END
01645 #endif
01646         return (strdup (leader->dictionary_owner_hard));
01647 }
01648 
01649 
01654 DxfLeader *
01655 dxf_leader_set_dictionary_owner_hard
01656 (
01657         DxfLeader *leader,
01659         char *dictionary_owner_hard
01662 )
01663 {
01664 #if DEBUG
01665         DXF_DEBUG_BEGIN
01666 #endif
01667         /* Do some basic checks. */
01668         if (leader == NULL)
01669         {
01670                 fprintf (stderr,
01671                   (_("Error in %s () a NULL pointer was passed.\n")),
01672                   __FUNCTION__);
01673                 return (NULL);
01674         }
01675         if (dictionary_owner_hard == NULL)
01676         {
01677                 fprintf (stderr,
01678                   (_("Error in %s () a NULL pointer was passed.\n")),
01679                   __FUNCTION__);
01680                 return (NULL);
01681         }
01682         leader->dictionary_owner_hard = strdup (dictionary_owner_hard);
01683 #if DEBUG
01684         DXF_DEBUG_END
01685 #endif
01686         return (leader);
01687 }
01688 
01689 
01696 char *
01697 dxf_leader_get_dimension_style_name
01698 (
01699         DxfLeader *leader
01701 )
01702 {
01703 #if DEBUG
01704         DXF_DEBUG_BEGIN
01705 #endif
01706         /* Do some basic checks. */
01707         if (leader == NULL)
01708         {
01709                 fprintf (stderr,
01710                   (_("Error in %s () a NULL pointer was passed.\n")),
01711                   __FUNCTION__);
01712                 return (NULL);
01713         }
01714         if (leader->dimension_style_name ==  NULL)
01715         {
01716                 fprintf (stderr,
01717                   (_("Error in %s () a NULL pointer was found.\n")),
01718                   __FUNCTION__);
01719                 return (NULL);
01720         }
01721 #if DEBUG
01722         DXF_DEBUG_END
01723 #endif
01724         return (strdup (leader->dimension_style_name));
01725 }
01726 
01727 
01731 DxfLeader *
01732 dxf_leader_set_dimension_style_name
01733 (
01734         DxfLeader *leader,
01736         char *dimension_style_name
01739 )
01740 {
01741 #if DEBUG
01742         DXF_DEBUG_BEGIN
01743 #endif
01744         /* Do some basic checks. */
01745         if (leader == NULL)
01746         {
01747                 fprintf (stderr,
01748                   (_("Error in %s () a NULL pointer was passed.\n")),
01749                   __FUNCTION__);
01750                 return (NULL);
01751         }
01752         if (dimension_style_name == NULL)
01753         {
01754                 fprintf (stderr,
01755                   (_("Error in %s () a NULL pointer was passed.\n")),
01756                   __FUNCTION__);
01757                 return (NULL);
01758         }
01759         leader->layer = strdup (dimension_style_name);
01760 #if DEBUG
01761         DXF_DEBUG_END
01762 #endif
01763         return (leader);
01764 }
01765 
01766 
01772 DxfPoint *
01773 dxf_leader_get_p0
01774 (
01775         DxfLeader *leader
01777 )
01778 {
01779 #ifdef DEBUG
01780         DXF_DEBUG_BEGIN
01781 #endif
01782         /* Do some basic checks. */
01783         if (leader == NULL)
01784         {
01785                 fprintf (stderr,
01786                   (_("Error in %s () a NULL pointer was passed.\n")),
01787                   __FUNCTION__);
01788                 return (NULL);
01789         }
01790         if (leader->p0 == NULL)
01791         {
01792                 fprintf (stderr,
01793                   (_("Error in %s () a NULL pointer was found.\n")),
01794                   __FUNCTION__);
01795                 return (NULL);
01796         }
01797 #if DEBUG
01798         DXF_DEBUG_END
01799 #endif
01800         return (leader->p0);
01801 }
01802 
01803 
01809 DxfLeader *
01810 dxf_leader_set_p0
01811 (
01812         DxfLeader *leader,
01814         DxfPoint *p0
01816 )
01817 {
01818 #ifdef DEBUG
01819         DXF_DEBUG_BEGIN
01820 #endif
01821         /* Do some basic checks. */
01822         if (leader == NULL)
01823         {
01824                 fprintf (stderr,
01825                   (_("Error in %s () a NULL pointer was passed.\n")),
01826                   __FUNCTION__);
01827                 return (NULL);
01828         }
01829         if (p0 == NULL)
01830         {
01831                 fprintf (stderr,
01832                   (_("Error in %s () a NULL pointer was passed.\n")),
01833                   __FUNCTION__);
01834                 return (NULL);
01835         }
01836         leader->p0 = p0;
01837 #if DEBUG
01838         DXF_DEBUG_END
01839 #endif
01840         return (leader);
01841 }
01842 
01843 
01850 double
01851 dxf_leader_get_x0
01852 (
01853         DxfLeader *leader
01855 )
01856 {
01857 #ifdef DEBUG
01858         DXF_DEBUG_BEGIN
01859 #endif
01860 
01861         /* Do some basic checks. */
01862         if (leader == NULL)
01863         {
01864                 fprintf (stderr,
01865                   (_("Error in %s () a NULL pointer was passed.\n")),
01866                   __FUNCTION__);
01867                 return (EXIT_FAILURE);
01868         }
01869         if (leader->p0 == NULL)
01870         {
01871                 fprintf (stderr,
01872                   (_("Error in %s () a NULL pointer was found.\n")),
01873                   __FUNCTION__);
01874                 return (EXIT_FAILURE);
01875         }
01876 #if DEBUG
01877         DXF_DEBUG_END
01878 #endif
01879         return (leader->p0->x0);
01880 }
01881 
01882 
01890 DxfLeader *
01891 dxf_leader_set_x0
01892 (
01893         DxfLeader *leader,
01895         double x0
01898 )
01899 {
01900 #ifdef DEBUG
01901         DXF_DEBUG_BEGIN
01902 #endif
01903         /* Do some basic checks. */
01904         if (leader == NULL)
01905         {
01906                 fprintf (stderr,
01907                   (_("Error in %s () a NULL pointer was passed.\n")),
01908                   __FUNCTION__);
01909                 return (NULL);
01910         }
01911         if (leader->p0 == NULL)
01912         {
01913                 fprintf (stderr,
01914                   (_("Error in %s () a NULL pointer was found.\n")),
01915                   __FUNCTION__);
01916                 return (NULL);
01917         }
01918         leader->p0->x0 = x0;
01919 #if DEBUG
01920         DXF_DEBUG_END
01921 #endif
01922         return (leader);
01923 }
01924 
01925 
01932 double
01933 dxf_leader_get_y0
01934 (
01935         DxfLeader *leader
01937 )
01938 {
01939 #ifdef DEBUG
01940         DXF_DEBUG_BEGIN
01941 #endif
01942 
01943         /* Do some basic checks. */
01944         if (leader == NULL)
01945         {
01946                 fprintf (stderr,
01947                   (_("Error in %s () a NULL pointer was passed.\n")),
01948                   __FUNCTION__);
01949                 return (EXIT_FAILURE);
01950         }
01951         if (leader->p0 == NULL)
01952         {
01953                 fprintf (stderr,
01954                   (_("Error in %s () a NULL pointer was found.\n")),
01955                   __FUNCTION__);
01956                 return (EXIT_FAILURE);
01957         }
01958 #if DEBUG
01959         DXF_DEBUG_END
01960 #endif
01961         return (leader->p0->y0);
01962 }
01963 
01964 
01972 DxfLeader *
01973 dxf_leader_set_y0
01974 (
01975         DxfLeader *leader,
01977         double y0
01980 )
01981 {
01982 #ifdef DEBUG
01983         DXF_DEBUG_BEGIN
01984 #endif
01985         /* Do some basic checks. */
01986         if (leader == NULL)
01987         {
01988                 fprintf (stderr,
01989                   (_("Error in %s () a NULL pointer was passed.\n")),
01990                   __FUNCTION__);
01991                 return (NULL);
01992         }
01993         if (leader->p0 == NULL)
01994         {
01995                 fprintf (stderr,
01996                   (_("Error in %s () a NULL pointer was found.\n")),
01997                   __FUNCTION__);
01998                 return (NULL);
01999         }
02000         leader->p0->y0 = y0;
02001 #if DEBUG
02002         DXF_DEBUG_END
02003 #endif
02004         return (leader);
02005 }
02006 
02007 
02014 double
02015 dxf_leader_get_z0
02016 (
02017         DxfLeader *leader
02019 )
02020 {
02021 #ifdef DEBUG
02022         DXF_DEBUG_BEGIN
02023 #endif
02024 
02025         /* Do some basic checks. */
02026         if (leader == NULL)
02027         {
02028                 fprintf (stderr,
02029                   (_("Error in %s () a NULL pointer was passed.\n")),
02030                   __FUNCTION__);
02031                 return (EXIT_FAILURE);
02032         }
02033         if (leader->p0 == NULL)
02034         {
02035                 fprintf (stderr,
02036                   (_("Error in %s () a NULL pointer was found.\n")),
02037                   __FUNCTION__);
02038                 return (EXIT_FAILURE);
02039         }
02040 #if DEBUG
02041         DXF_DEBUG_END
02042 #endif
02043         return (leader->p0->z0);
02044 }
02045 
02046 
02054 DxfLeader *
02055 dxf_leader_set_z0
02056 (
02057         DxfLeader *leader,
02059         double z0
02062 )
02063 {
02064 #ifdef DEBUG
02065         DXF_DEBUG_BEGIN
02066 #endif
02067         /* Do some basic checks. */
02068         if (leader == NULL)
02069         {
02070                 fprintf (stderr,
02071                   (_("Error in %s () a NULL pointer was passed.\n")),
02072                   __FUNCTION__);
02073                 return (NULL);
02074         }
02075         if (leader->p0 == NULL)
02076         {
02077                 fprintf (stderr,
02078                   (_("Error in %s () a NULL pointer was found.\n")),
02079                   __FUNCTION__);
02080                 return (NULL);
02081         }
02082         leader->p0->z0 = z0;
02083 #if DEBUG
02084         DXF_DEBUG_END
02085 #endif
02086         return (leader);
02087 }
02088 
02089 
02095 double
02096 dxf_leader_get_text_annotation_height
02097 (
02098         DxfLeader *leader
02100 )
02101 {
02102 #ifdef DEBUG
02103         DXF_DEBUG_BEGIN
02104 #endif
02105 
02106         /* Do some basic checks. */
02107         if (leader == NULL)
02108         {
02109                 fprintf (stderr,
02110                   (_("Error in %s () a NULL pointer was passed.\n")),
02111                   __FUNCTION__);
02112                 return (EXIT_FAILURE);
02113         }
02114         if (leader->text_annotation_height < 0.0)
02115         {
02116                 fprintf (stderr,
02117                   (_("Warning in %s () a negative value was found.\n")),
02118                   __FUNCTION__);
02119         }
02120 #if DEBUG
02121         DXF_DEBUG_END
02122 #endif
02123         return (leader->text_annotation_height);
02124 }
02125 
02126 
02133 DxfLeader *
02134 dxf_leader_set_text_annotation_height
02135 (
02136         DxfLeader *leader,
02138         double text_annotation_height
02141 )
02142 {
02143 #ifdef DEBUG
02144         DXF_DEBUG_BEGIN
02145 #endif
02146         /* Do some basic checks. */
02147         if (leader == NULL)
02148         {
02149                 fprintf (stderr,
02150                   (_("Error in %s () a NULL pointer was passed.\n")),
02151                   __FUNCTION__);
02152                 return (NULL);
02153         }
02154         if (text_annotation_height < 0.0)
02155         {
02156                 fprintf (stderr,
02157                   (_("Warning in %s () a negative value was passed.\n")),
02158                   __FUNCTION__);
02159         }
02160         leader->text_annotation_height = text_annotation_height;
02161 #if DEBUG
02162         DXF_DEBUG_END
02163 #endif
02164         return (leader);
02165 }
02166 
02167 
02173 double
02174 dxf_leader_get_text_annotation_width
02175 (
02176         DxfLeader *leader
02178 )
02179 {
02180 #ifdef DEBUG
02181         DXF_DEBUG_BEGIN
02182 #endif
02183 
02184         /* Do some basic checks. */
02185         if (leader == NULL)
02186         {
02187                 fprintf (stderr,
02188                   (_("Error in %s () a NULL pointer was passed.\n")),
02189                   __FUNCTION__);
02190                 return (EXIT_FAILURE);
02191         }
02192         if (leader->text_annotation_width < 0.0)
02193         {
02194                 fprintf (stderr,
02195                   (_("Warning in %s () a negative value was found.\n")),
02196                   __FUNCTION__);
02197         }
02198 #if DEBUG
02199         DXF_DEBUG_END
02200 #endif
02201         return (leader->text_annotation_width);
02202 }
02203 
02204 
02211 DxfLeader *
02212 dxf_leader_set_text_annotation_width
02213 (
02214         DxfLeader *leader,
02216         double text_annotation_width
02219 )
02220 {
02221 #ifdef DEBUG
02222         DXF_DEBUG_BEGIN
02223 #endif
02224         /* Do some basic checks. */
02225         if (leader == NULL)
02226         {
02227                 fprintf (stderr,
02228                   (_("Error in %s () a NULL pointer was passed.\n")),
02229                   __FUNCTION__);
02230                 return (NULL);
02231         }
02232         if (text_annotation_width < 0.0)
02233         {
02234                 fprintf (stderr,
02235                   (_("Warning in %s () a negative value was passed.\n")),
02236                   __FUNCTION__);
02237         }
02238         leader->text_annotation_width = text_annotation_width;
02239 #if DEBUG
02240         DXF_DEBUG_END
02241 #endif
02242         return (leader);
02243 }
02244 
02245 
02251 int
02252 dxf_leader_get_arrow_head_flag
02253 (
02254         DxfLeader *leader
02256 )
02257 {
02258 #if DEBUG
02259         DXF_DEBUG_BEGIN
02260 #endif
02261         /* Do some basic checks. */
02262         if (leader == NULL)
02263         {
02264                 fprintf (stderr,
02265                   (_("Error in %s () a NULL pointer was passed.\n")),
02266                   __FUNCTION__);
02267                 return (EXIT_FAILURE);
02268         }
02269         if (leader->arrow_head_flag < 0)
02270         {
02271                 fprintf (stderr,
02272                   (_("Error in %s () a negative value was found.\n")),
02273                   __FUNCTION__);
02274                 return (EXIT_FAILURE);
02275         }
02276         if (leader->arrow_head_flag > 1)
02277         {
02278                 fprintf (stderr,
02279                   (_("Error in %s () an out of range value was found.\n")),
02280                   __FUNCTION__);
02281                 return (EXIT_FAILURE);
02282         }
02283 #if DEBUG
02284         DXF_DEBUG_END
02285 #endif
02286         return (leader->arrow_head_flag);
02287 }
02288 
02289 
02293 DxfLeader *
02294 dxf_leader_set_arrow_head_flag
02295 (
02296         DxfLeader *leader,
02298         int arrow_head_flag
02300 )
02301 {
02302 #if DEBUG
02303         DXF_DEBUG_BEGIN
02304 #endif
02305         /* Do some basic checks. */
02306         if (leader == NULL)
02307         {
02308                 fprintf (stderr,
02309                   (_("Error in %s () a NULL pointer was passed.\n")),
02310                   __FUNCTION__);
02311                 return (NULL);
02312         }
02313         if (arrow_head_flag < 0)
02314         {
02315                 fprintf (stderr,
02316                   (_("Error in %s () a negative value was passed.\n")),
02317                   __FUNCTION__);
02318                 return (NULL);
02319         }
02320         if (arrow_head_flag > 1)
02321         {
02322                 fprintf (stderr,
02323                   (_("Error in %s () an out of range value was passed.\n")),
02324                   __FUNCTION__);
02325                 return (NULL);
02326         }
02327         leader->arrow_head_flag = arrow_head_flag;
02328 #if DEBUG
02329         DXF_DEBUG_END
02330 #endif
02331         return (leader);
02332 }
02333 
02334 
02340 int
02341 dxf_leader_get_path_type
02342 (
02343         DxfLeader *leader
02345 )
02346 {
02347 #if DEBUG
02348         DXF_DEBUG_BEGIN
02349 #endif
02350         /* Do some basic checks. */
02351         if (leader == NULL)
02352         {
02353                 fprintf (stderr,
02354                   (_("Error in %s () a NULL pointer was passed.\n")),
02355                   __FUNCTION__);
02356                 return (EXIT_FAILURE);
02357         }
02358         if (leader->path_type < 0)
02359         {
02360                 fprintf (stderr,
02361                   (_("Error in %s () a negative value was found.\n")),
02362                   __FUNCTION__);
02363                 return (EXIT_FAILURE);
02364         }
02365         if (leader->path_type > 1)
02366         {
02367                 fprintf (stderr,
02368                   (_("Error in %s () an out of range value was found.\n")),
02369                   __FUNCTION__);
02370                 return (EXIT_FAILURE);
02371         }
02372 #if DEBUG
02373         DXF_DEBUG_END
02374 #endif
02375         return (leader->path_type);
02376 }
02377 
02378 
02382 DxfLeader *
02383 dxf_leader_set_path_type
02384 (
02385         DxfLeader *leader,
02387         int path_type
02389 )
02390 {
02391 #if DEBUG
02392         DXF_DEBUG_BEGIN
02393 #endif
02394         /* Do some basic checks. */
02395         if (leader == NULL)
02396         {
02397                 fprintf (stderr,
02398                   (_("Error in %s () a NULL pointer was passed.\n")),
02399                   __FUNCTION__);
02400                 return (NULL);
02401         }
02402         if (path_type < 0)
02403         {
02404                 fprintf (stderr,
02405                   (_("Error in %s () a negative value was passed.\n")),
02406                   __FUNCTION__);
02407                 return (NULL);
02408         }
02409         if (path_type > 1)
02410         {
02411                 fprintf (stderr,
02412                   (_("Error in %s () an out of range value was passed.\n")),
02413                   __FUNCTION__);
02414                 return (NULL);
02415         }
02416         leader->path_type = path_type;
02417 #if DEBUG
02418         DXF_DEBUG_END
02419 #endif
02420         return (leader);
02421 }
02422 
02423 
02429 int
02430 dxf_leader_get_creation_flag
02431 (
02432         DxfLeader *leader
02434 )
02435 {
02436 #if DEBUG
02437         DXF_DEBUG_BEGIN
02438 #endif
02439         /* Do some basic checks. */
02440         if (leader == NULL)
02441         {
02442                 fprintf (stderr,
02443                   (_("Error in %s () a NULL pointer was passed.\n")),
02444                   __FUNCTION__);
02445                 return (EXIT_FAILURE);
02446         }
02447         if (leader->creation_flag < 0)
02448         {
02449                 fprintf (stderr,
02450                   (_("Error in %s () a negative value was found.\n")),
02451                   __FUNCTION__);
02452                 return (EXIT_FAILURE);
02453         }
02454         if (leader->creation_flag > 3)
02455         {
02456                 fprintf (stderr,
02457                   (_("Error in %s () an out of range value was found.\n")),
02458                   __FUNCTION__);
02459                 return (EXIT_FAILURE);
02460         }
02461 #if DEBUG
02462         DXF_DEBUG_END
02463 #endif
02464         return (leader->creation_flag);
02465 }
02466 
02467 
02471 DxfLeader *
02472 dxf_leader_set_creation_flag
02473 (
02474         DxfLeader *leader,
02476         int creation_flag
02478 )
02479 {
02480 #if DEBUG
02481         DXF_DEBUG_BEGIN
02482 #endif
02483         /* Do some basic checks. */
02484         if (leader == NULL)
02485         {
02486                 fprintf (stderr,
02487                   (_("Error in %s () a NULL pointer was passed.\n")),
02488                   __FUNCTION__);
02489                 return (NULL);
02490         }
02491         if (creation_flag < 0)
02492         {
02493                 fprintf (stderr,
02494                   (_("Error in %s () a negative value was passed.\n")),
02495                   __FUNCTION__);
02496                 return (NULL);
02497         }
02498         if (creation_flag > 3)
02499         {
02500                 fprintf (stderr,
02501                   (_("Error in %s () an out of range value was passed.\n")),
02502                   __FUNCTION__);
02503                 return (NULL);
02504         }
02505         leader->creation_flag = creation_flag;
02506 #if DEBUG
02507         DXF_DEBUG_END
02508 #endif
02509         return (leader);
02510 }
02511 
02512 
02518 int
02519 dxf_leader_get_hookline_direction_flag
02520 (
02521         DxfLeader *leader
02523 )
02524 {
02525 #if DEBUG
02526         DXF_DEBUG_BEGIN
02527 #endif
02528         /* Do some basic checks. */
02529         if (leader == NULL)
02530         {
02531                 fprintf (stderr,
02532                   (_("Error in %s () a NULL pointer was passed.\n")),
02533                   __FUNCTION__);
02534                 return (EXIT_FAILURE);
02535         }
02536         if (leader->hookline_direction_flag < 0)
02537         {
02538                 fprintf (stderr,
02539                   (_("Error in %s () a negative value was found.\n")),
02540                   __FUNCTION__);
02541                 return (EXIT_FAILURE);
02542         }
02543         if (leader->hookline_direction_flag > 1)
02544         {
02545                 fprintf (stderr,
02546                   (_("Error in %s () an out of range value was found.\n")),
02547                   __FUNCTION__);
02548                 return (EXIT_FAILURE);
02549         }
02550 #if DEBUG
02551         DXF_DEBUG_END
02552 #endif
02553         return (leader->hookline_direction_flag);
02554 }
02555 
02556 
02560 DxfLeader *
02561 dxf_leader_set_hookline_direction_flag
02562 (
02563         DxfLeader *leader,
02565         int hookline_direction_flag
02567 )
02568 {
02569 #if DEBUG
02570         DXF_DEBUG_BEGIN
02571 #endif
02572         /* Do some basic checks. */
02573         if (leader == NULL)
02574         {
02575                 fprintf (stderr,
02576                   (_("Error in %s () a NULL pointer was passed.\n")),
02577                   __FUNCTION__);
02578                 return (NULL);
02579         }
02580         if (hookline_direction_flag < 0)
02581         {
02582                 fprintf (stderr,
02583                   (_("Error in %s () a negative value was passed.\n")),
02584                   __FUNCTION__);
02585                 return (NULL);
02586         }
02587         if (hookline_direction_flag > 1)
02588         {
02589                 fprintf (stderr,
02590                   (_("Error in %s () an out of range value was passed.\n")),
02591                   __FUNCTION__);
02592                 return (NULL);
02593         }
02594         leader->hookline_direction_flag = hookline_direction_flag;
02595 #if DEBUG
02596         DXF_DEBUG_END
02597 #endif
02598         return (leader);
02599 }
02600 
02601 
02607 int
02608 dxf_leader_get_hookline_flag
02609 (
02610         DxfLeader *leader
02612 )
02613 {
02614 #if DEBUG
02615         DXF_DEBUG_BEGIN
02616 #endif
02617         /* Do some basic checks. */
02618         if (leader == NULL)
02619         {
02620                 fprintf (stderr,
02621                   (_("Error in %s () a NULL pointer was passed.\n")),
02622                   __FUNCTION__);
02623                 return (EXIT_FAILURE);
02624         }
02625         if (leader->hookline_flag < 0)
02626         {
02627                 fprintf (stderr,
02628                   (_("Error in %s () a negative value was found.\n")),
02629                   __FUNCTION__);
02630                 return (EXIT_FAILURE);
02631         }
02632         if (leader->hookline_flag > 1)
02633         {
02634                 fprintf (stderr,
02635                   (_("Error in %s () an out of range value was found.\n")),
02636                   __FUNCTION__);
02637                 return (EXIT_FAILURE);
02638         }
02639 #if DEBUG
02640         DXF_DEBUG_END
02641 #endif
02642         return (leader->hookline_flag);
02643 }
02644 
02645 
02649 DxfLeader *
02650 dxf_leader_set_hookline_flag
02651 (
02652         DxfLeader *leader,
02654         int hookline_flag
02656 )
02657 {
02658 #if DEBUG
02659         DXF_DEBUG_BEGIN
02660 #endif
02661         /* Do some basic checks. */
02662         if (leader == NULL)
02663         {
02664                 fprintf (stderr,
02665                   (_("Error in %s () a NULL pointer was passed.\n")),
02666                   __FUNCTION__);
02667                 return (NULL);
02668         }
02669         if (hookline_flag < 0)
02670         {
02671                 fprintf (stderr,
02672                   (_("Error in %s () a negative value was passed.\n")),
02673                   __FUNCTION__);
02674                 return (NULL);
02675         }
02676         if (hookline_flag > 1)
02677         {
02678                 fprintf (stderr,
02679                   (_("Error in %s () an out of range value was passed.\n")),
02680                   __FUNCTION__);
02681                 return (NULL);
02682         }
02683         leader->hookline_flag = hookline_flag;
02684 #if DEBUG
02685         DXF_DEBUG_END
02686 #endif
02687         return (leader);
02688 }
02689 
02690 
02696 int
02697 dxf_leader_get_number_vertices
02698 (
02699         DxfLeader *leader
02701 )
02702 {
02703 #if DEBUG
02704         DXF_DEBUG_BEGIN
02705 #endif
02706         /* Do some basic checks. */
02707         if (leader == NULL)
02708         {
02709                 fprintf (stderr,
02710                   (_("Error in %s () a NULL pointer was passed.\n")),
02711                   __FUNCTION__);
02712                 return (EXIT_FAILURE);
02713         }
02714         if (leader->number_vertices < 0)
02715         {
02716                 fprintf (stderr,
02717                   (_("Error in %s () a negative value was found.\n")),
02718                   __FUNCTION__);
02719                 return (EXIT_FAILURE);
02720         }
02721 #if DEBUG
02722         DXF_DEBUG_END
02723 #endif
02724         return (leader->number_vertices);
02725 }
02726 
02727 
02731 DxfLeader *
02732 dxf_leader_set_number_vertices
02733 (
02734         DxfLeader *leader,
02736         int number_vertices
02738 )
02739 {
02740 #if DEBUG
02741         DXF_DEBUG_BEGIN
02742 #endif
02743         /* Do some basic checks. */
02744         if (leader == NULL)
02745         {
02746                 fprintf (stderr,
02747                   (_("Error in %s () a NULL pointer was passed.\n")),
02748                   __FUNCTION__);
02749                 return (NULL);
02750         }
02751         if (number_vertices < 0)
02752         {
02753                 fprintf (stderr,
02754                   (_("Error in %s () a negative value was passed.\n")),
02755                   __FUNCTION__);
02756                 return (NULL);
02757         }
02758         leader->number_vertices = number_vertices;
02759 #if DEBUG
02760         DXF_DEBUG_END
02761 #endif
02762         return (leader);
02763 }
02764 
02765 
02771 int
02772 dxf_leader_get_leader_color
02773 (
02774         DxfLeader *leader
02776 )
02777 {
02778 #if DEBUG
02779         DXF_DEBUG_BEGIN
02780 #endif
02781         /* Do some basic checks. */
02782         if (leader == NULL)
02783         {
02784                 fprintf (stderr,
02785                   (_("Error in %s () a NULL pointer was passed.\n")),
02786                   __FUNCTION__);
02787                 return (EXIT_FAILURE);
02788         }
02789         if (leader->leader_color < 0)
02790         {
02791                 fprintf (stderr,
02792                   (_("Warning in %s () a negative value was found.\n")),
02793                   __FUNCTION__);
02794         }
02795 #if DEBUG
02796         DXF_DEBUG_END
02797 #endif
02798         return (leader->leader_color);
02799 }
02800 
02801 
02805 DxfLeader *
02806 dxf_leader_set_leader_color
02807 (
02808         DxfLeader *leader,
02810         int leader_color
02812 )
02813 {
02814 #if DEBUG
02815         DXF_DEBUG_BEGIN
02816 #endif
02817         /* Do some basic checks. */
02818         if (leader == NULL)
02819         {
02820                 fprintf (stderr,
02821                   (_("Error in %s () a NULL pointer was passed.\n")),
02822                   __FUNCTION__);
02823                 return (NULL);
02824         }
02825         if (leader_color < 0)
02826         {
02827                 fprintf (stderr,
02828                   (_("Warning in %s () a negative value was passed.\n")),
02829                   __FUNCTION__);
02830         }
02831         leader->leader_color = leader_color;
02832 #if DEBUG
02833         DXF_DEBUG_END
02834 #endif
02835         return (leader);
02836 }
02837 
02838 
02845 double
02846 dxf_leader_get_extr_x0
02847 (
02848         DxfLeader *leader
02850 )
02851 {
02852 #ifdef DEBUG
02853         DXF_DEBUG_BEGIN
02854 #endif
02855 
02856         /* Do some basic checks. */
02857         if (leader == NULL)
02858         {
02859                 fprintf (stderr,
02860                   (_("Error in %s () a NULL pointer was passed.\n")),
02861                   __FUNCTION__);
02862                 return (EXIT_FAILURE);
02863         }
02864 #if DEBUG
02865         DXF_DEBUG_END
02866 #endif
02867         return (leader->extr_x0);
02868 }
02869 
02870 
02878 DxfLeader *
02879 dxf_leader_set_extr_x0
02880 (
02881         DxfLeader *leader,
02883         double extr_x0
02886 )
02887 {
02888 #ifdef DEBUG
02889         DXF_DEBUG_BEGIN
02890 #endif
02891         /* Do some basic checks. */
02892         if (leader == NULL)
02893         {
02894                 fprintf (stderr,
02895                   (_("Error in %s () a NULL pointer was passed.\n")),
02896                   __FUNCTION__);
02897                 return (NULL);
02898         }
02899         leader->extr_x0 = extr_x0;
02900 #if DEBUG
02901         DXF_DEBUG_END
02902 #endif
02903         return (leader);
02904 }
02905 
02906 
02913 double
02914 dxf_leader_get_extr_y0
02915 (
02916         DxfLeader *leader
02918 )
02919 {
02920 #ifdef DEBUG
02921         DXF_DEBUG_BEGIN
02922 #endif
02923 
02924         /* Do some basic checks. */
02925         if (leader == NULL)
02926         {
02927                 fprintf (stderr,
02928                   (_("Error in %s () a NULL pointer was passed.\n")),
02929                   __FUNCTION__);
02930                 return (EXIT_FAILURE);
02931         }
02932 #if DEBUG
02933         DXF_DEBUG_END
02934 #endif
02935         return (leader->extr_y0);
02936 }
02937 
02938 
02946 DxfLeader *
02947 dxf_leader_set_extr_y0
02948 (
02949         DxfLeader *leader,
02951         double extr_y0
02954 )
02955 {
02956 #ifdef DEBUG
02957         DXF_DEBUG_BEGIN
02958 #endif
02959         /* Do some basic checks. */
02960         if (leader == NULL)
02961         {
02962                 fprintf (stderr,
02963                   (_("Error in %s () a NULL pointer was passed.\n")),
02964                   __FUNCTION__);
02965                 return (NULL);
02966         }
02967         leader->extr_y0 = extr_y0;
02968 #if DEBUG
02969         DXF_DEBUG_END
02970 #endif
02971         return (leader);
02972 }
02973 
02974 
02981 double
02982 dxf_leader_get_extr_z0
02983 (
02984         DxfLeader *leader
02986 )
02987 {
02988 #ifdef DEBUG
02989         DXF_DEBUG_BEGIN
02990 #endif
02991 
02992         /* Do some basic checks. */
02993         if (leader == NULL)
02994         {
02995                 fprintf (stderr,
02996                   (_("Error in %s () a NULL pointer was passed.\n")),
02997                   __FUNCTION__);
02998                 return (EXIT_FAILURE);
02999         }
03000 #if DEBUG
03001         DXF_DEBUG_END
03002 #endif
03003         return (leader->extr_z0);
03004 }
03005 
03006 
03014 DxfLeader *
03015 dxf_leader_set_extr_z0
03016 (
03017         DxfLeader *leader,
03019         double extr_z0
03022 )
03023 {
03024 #ifdef DEBUG
03025         DXF_DEBUG_BEGIN
03026 #endif
03027         /* Do some basic checks. */
03028         if (leader == NULL)
03029         {
03030                 fprintf (stderr,
03031                   (_("Error in %s () a NULL pointer was passed.\n")),
03032                   __FUNCTION__);
03033                 return (NULL);
03034         }
03035         leader->extr_z0 = extr_z0;
03036 #if DEBUG
03037         DXF_DEBUG_END
03038 #endif
03039         return (leader);
03040 }
03041 
03042 
03049 DxfPoint *
03050 dxf_leader_get_p1
03051 (
03052         DxfLeader *leader
03054 )
03055 {
03056 #ifdef DEBUG
03057         DXF_DEBUG_BEGIN
03058 #endif
03059         /* Do some basic checks. */
03060         if (leader == NULL)
03061         {
03062                 fprintf (stderr,
03063                   (_("Error in %s () a NULL pointer was passed.\n")),
03064                   __FUNCTION__);
03065                 return (NULL);
03066         }
03067         if (leader->p1 == NULL)
03068         {
03069                 fprintf (stderr,
03070                   (_("Error in %s () a NULL pointer was found.\n")),
03071                   __FUNCTION__);
03072                 return (NULL);
03073         }
03074 #if DEBUG
03075         DXF_DEBUG_END
03076 #endif
03077         return (leader->p1);
03078 }
03079 
03080 
03087 DxfLeader *
03088 dxf_leader_set_p1
03089 (
03090         DxfLeader *leader,
03092         DxfPoint *p1
03094 )
03095 {
03096 #ifdef DEBUG
03097         DXF_DEBUG_BEGIN
03098 #endif
03099         /* Do some basic checks. */
03100         if (leader == NULL)
03101         {
03102                 fprintf (stderr,
03103                   (_("Error in %s () a NULL pointer was passed.\n")),
03104                   __FUNCTION__);
03105                 return (NULL);
03106         }
03107         if (p1 == NULL)
03108         {
03109                 fprintf (stderr,
03110                   (_("Error in %s () a NULL pointer was passed.\n")),
03111                   __FUNCTION__);
03112                 return (NULL);
03113         }
03114         leader->p1 = p1;
03115 #if DEBUG
03116         DXF_DEBUG_END
03117 #endif
03118         return (leader);
03119 }
03120 
03121 
03128 double
03129 dxf_leader_get_x1
03130 (
03131         DxfLeader *leader
03133 )
03134 {
03135 #ifdef DEBUG
03136         DXF_DEBUG_BEGIN
03137 #endif
03138 
03139         /* Do some basic checks. */
03140         if (leader == NULL)
03141         {
03142                 fprintf (stderr,
03143                   (_("Error in %s () a NULL pointer was passed.\n")),
03144                   __FUNCTION__);
03145                 return (EXIT_FAILURE);
03146         }
03147         if (leader->p1 == NULL)
03148         {
03149                 fprintf (stderr,
03150                   (_("Error in %s () a NULL pointer was found.\n")),
03151                   __FUNCTION__);
03152                 return (EXIT_FAILURE);
03153         }
03154 #if DEBUG
03155         DXF_DEBUG_END
03156 #endif
03157         return (leader->p1->x0);
03158 }
03159 
03160 
03168 DxfLeader *
03169 dxf_leader_set_x1
03170 (
03171         DxfLeader *leader,
03173         double x1
03176 )
03177 {
03178 #ifdef DEBUG
03179         DXF_DEBUG_BEGIN
03180 #endif
03181         /* Do some basic checks. */
03182         if (leader == NULL)
03183         {
03184                 fprintf (stderr,
03185                   (_("Error in %s () a NULL pointer was passed.\n")),
03186                   __FUNCTION__);
03187                 return (NULL);
03188         }
03189         if (leader->p1 == NULL)
03190         {
03191                 fprintf (stderr,
03192                   (_("Error in %s () a NULL pointer was found.\n")),
03193                   __FUNCTION__);
03194                 return (NULL);
03195         }
03196         leader->p1->x0 = x1;
03197 #if DEBUG
03198         DXF_DEBUG_END
03199 #endif
03200         return (leader);
03201 }
03202 
03203 
03210 double
03211 dxf_leader_get_y1
03212 (
03213         DxfLeader *leader
03215 )
03216 {
03217 #ifdef DEBUG
03218         DXF_DEBUG_BEGIN
03219 #endif
03220 
03221         /* Do some basic checks. */
03222         if (leader == NULL)
03223         {
03224                 fprintf (stderr,
03225                   (_("Error in %s () a NULL pointer was passed.\n")),
03226                   __FUNCTION__);
03227                 return (EXIT_FAILURE);
03228         }
03229         if (leader->p1 == NULL)
03230         {
03231                 fprintf (stderr,
03232                   (_("Error in %s () a NULL pointer was found.\n")),
03233                   __FUNCTION__);
03234                 return (EXIT_FAILURE);
03235         }
03236 #if DEBUG
03237         DXF_DEBUG_END
03238 #endif
03239         return (leader->p1->y0);
03240 }
03241 
03242 
03250 DxfLeader *
03251 dxf_leader_set_y1
03252 (
03253         DxfLeader *leader,
03255         double y1
03258 )
03259 {
03260 #ifdef DEBUG
03261         DXF_DEBUG_BEGIN
03262 #endif
03263         /* Do some basic checks. */
03264         if (leader == NULL)
03265         {
03266                 fprintf (stderr,
03267                   (_("Error in %s () a NULL pointer was passed.\n")),
03268                   __FUNCTION__);
03269                 return (NULL);
03270         }
03271         if (leader->p1 == NULL)
03272         {
03273                 fprintf (stderr,
03274                   (_("Error in %s () a NULL pointer was found.\n")),
03275                   __FUNCTION__);
03276                 return (NULL);
03277         }
03278         leader->p1->y0 = y1;
03279 #if DEBUG
03280         DXF_DEBUG_END
03281 #endif
03282         return (leader);
03283 }
03284 
03285 
03292 double
03293 dxf_leader_get_z1
03294 (
03295         DxfLeader *leader
03297 )
03298 {
03299 #ifdef DEBUG
03300         DXF_DEBUG_BEGIN
03301 #endif
03302 
03303         /* Do some basic checks. */
03304         if (leader == NULL)
03305         {
03306                 fprintf (stderr,
03307                   (_("Error in %s () a NULL pointer was passed.\n")),
03308                   __FUNCTION__);
03309                 return (EXIT_FAILURE);
03310         }
03311         if (leader->p1 == NULL)
03312         {
03313                 fprintf (stderr,
03314                   (_("Error in %s () a NULL pointer was found.\n")),
03315                   __FUNCTION__);
03316                 return (EXIT_FAILURE);
03317         }
03318 #if DEBUG
03319         DXF_DEBUG_END
03320 #endif
03321         return (leader->p1->z0);
03322 }
03323 
03324 
03332 DxfLeader *
03333 dxf_leader_set_z1
03334 (
03335         DxfLeader *leader,
03337         double z1
03340 )
03341 {
03342 #ifdef DEBUG
03343         DXF_DEBUG_BEGIN
03344 #endif
03345         /* Do some basic checks. */
03346         if (leader == NULL)
03347         {
03348                 fprintf (stderr,
03349                   (_("Error in %s () a NULL pointer was passed.\n")),
03350                   __FUNCTION__);
03351                 return (NULL);
03352         }
03353         if (leader->p1 == NULL)
03354         {
03355                 fprintf (stderr,
03356                   (_("Error in %s () a NULL pointer was found.\n")),
03357                   __FUNCTION__);
03358                 return (NULL);
03359         }
03360         leader->p1->z0 = z1;
03361 #if DEBUG
03362         DXF_DEBUG_END
03363 #endif
03364         return (leader);
03365 }
03366 
03367 
03374 DxfPoint *
03375 dxf_leader_get_p2
03376 (
03377         DxfLeader *leader
03379 )
03380 {
03381 #ifdef DEBUG
03382         DXF_DEBUG_BEGIN
03383 #endif
03384         /* Do some basic checks. */
03385         if (leader == NULL)
03386         {
03387                 fprintf (stderr,
03388                   (_("Error in %s () a NULL pointer was passed.\n")),
03389                   __FUNCTION__);
03390                 return (NULL);
03391         }
03392         if (leader->p2 == NULL)
03393         {
03394                 fprintf (stderr,
03395                   (_("Error in %s () a NULL pointer was found.\n")),
03396                   __FUNCTION__);
03397                 return (NULL);
03398         }
03399 #if DEBUG
03400         DXF_DEBUG_END
03401 #endif
03402         return (leader->p2);
03403 }
03404 
03405 
03412 DxfLeader *
03413 dxf_leader_set_p2
03414 (
03415         DxfLeader *leader,
03417         DxfPoint *p2
03419 )
03420 {
03421 #ifdef DEBUG
03422         DXF_DEBUG_BEGIN
03423 #endif
03424         /* Do some basic checks. */
03425         if (leader == NULL)
03426         {
03427                 fprintf (stderr,
03428                   (_("Error in %s () a NULL pointer was passed.\n")),
03429                   __FUNCTION__);
03430                 return (NULL);
03431         }
03432         if (p2 == NULL)
03433         {
03434                 fprintf (stderr,
03435                   (_("Error in %s () a NULL pointer was passed.\n")),
03436                   __FUNCTION__);
03437                 return (NULL);
03438         }
03439         leader->p2 = p2;
03440 #if DEBUG
03441         DXF_DEBUG_END
03442 #endif
03443         return (leader);
03444 }
03445 
03446 
03454 double
03455 dxf_leader_get_x2
03456 (
03457         DxfLeader *leader
03459 )
03460 {
03461 #ifdef DEBUG
03462         DXF_DEBUG_BEGIN
03463 #endif
03464 
03465         /* Do some basic checks. */
03466         if (leader == NULL)
03467         {
03468                 fprintf (stderr,
03469                   (_("Error in %s () a NULL pointer was passed.\n")),
03470                   __FUNCTION__);
03471                 return (EXIT_FAILURE);
03472         }
03473         if (leader->p2 == NULL)
03474         {
03475                 fprintf (stderr,
03476                   (_("Error in %s () a NULL pointer was found.\n")),
03477                   __FUNCTION__);
03478                 return (EXIT_FAILURE);
03479         }
03480 #if DEBUG
03481         DXF_DEBUG_END
03482 #endif
03483         return (leader->p2->x0);
03484 }
03485 
03486 
03494 DxfLeader *
03495 dxf_leader_set_x2
03496 (
03497         DxfLeader *leader,
03499         double x2
03503 )
03504 {
03505 #ifdef DEBUG
03506         DXF_DEBUG_BEGIN
03507 #endif
03508         /* Do some basic checks. */
03509         if (leader == NULL)
03510         {
03511                 fprintf (stderr,
03512                   (_("Error in %s () a NULL pointer was passed.\n")),
03513                   __FUNCTION__);
03514                 return (NULL);
03515         }
03516         if (leader->p2 == NULL)
03517         {
03518                 fprintf (stderr,
03519                   (_("Error in %s () a NULL pointer was found.\n")),
03520                   __FUNCTION__);
03521                 return (NULL);
03522         }
03523         leader->p2->x0 = x2;
03524 #if DEBUG
03525         DXF_DEBUG_END
03526 #endif
03527         return (leader);
03528 }
03529 
03530 
03538 double
03539 dxf_leader_get_y2
03540 (
03541         DxfLeader *leader
03543 )
03544 {
03545 #ifdef DEBUG
03546         DXF_DEBUG_BEGIN
03547 #endif
03548 
03549         /* Do some basic checks. */
03550         if (leader == NULL)
03551         {
03552                 fprintf (stderr,
03553                   (_("Error in %s () a NULL pointer was passed.\n")),
03554                   __FUNCTION__);
03555                 return (EXIT_FAILURE);
03556         }
03557         if (leader->p2 == NULL)
03558         {
03559                 fprintf (stderr,
03560                   (_("Error in %s () a NULL pointer was found.\n")),
03561                   __FUNCTION__);
03562                 return (EXIT_FAILURE);
03563         }
03564 #if DEBUG
03565         DXF_DEBUG_END
03566 #endif
03567         return (leader->p2->y0);
03568 }
03569 
03570 
03578 DxfLeader *
03579 dxf_leader_set_y2
03580 (
03581         DxfLeader *leader,
03583         double y2
03587 )
03588 {
03589 #ifdef DEBUG
03590         DXF_DEBUG_BEGIN
03591 #endif
03592         /* Do some basic checks. */
03593         if (leader == NULL)
03594         {
03595                 fprintf (stderr,
03596                   (_("Error in %s () a NULL pointer was passed.\n")),
03597                   __FUNCTION__);
03598                 return (NULL);
03599         }
03600         if (leader->p2 == NULL)
03601         {
03602                 fprintf (stderr,
03603                   (_("Error in %s () a NULL pointer was found.\n")),
03604                   __FUNCTION__);
03605                 return (NULL);
03606         }
03607         leader->p2->y0 = y2;
03608 #if DEBUG
03609         DXF_DEBUG_END
03610 #endif
03611         return (leader);
03612 }
03613 
03614 
03622 double
03623 dxf_leader_get_z2
03624 (
03625         DxfLeader *leader
03627 )
03628 {
03629 #ifdef DEBUG
03630         DXF_DEBUG_BEGIN
03631 #endif
03632 
03633         /* Do some basic checks. */
03634         if (leader == NULL)
03635         {
03636                 fprintf (stderr,
03637                   (_("Error in %s () a NULL pointer was passed.\n")),
03638                   __FUNCTION__);
03639                 return (EXIT_FAILURE);
03640         }
03641         if (leader->p2 == NULL)
03642         {
03643                 fprintf (stderr,
03644                   (_("Error in %s () a NULL pointer was found.\n")),
03645                   __FUNCTION__);
03646                 return (EXIT_FAILURE);
03647         }
03648 #if DEBUG
03649         DXF_DEBUG_END
03650 #endif
03651         return (leader->p2->z0);
03652 }
03653 
03654 
03662 DxfLeader *
03663 dxf_leader_set_z2
03664 (
03665         DxfLeader *leader,
03667         double z2
03671 )
03672 {
03673 #ifdef DEBUG
03674         DXF_DEBUG_BEGIN
03675 #endif
03676         /* Do some basic checks. */
03677         if (leader == NULL)
03678         {
03679                 fprintf (stderr,
03680                   (_("Error in %s () a NULL pointer was passed.\n")),
03681                   __FUNCTION__);
03682                 return (NULL);
03683         }
03684         if (leader->p2 == NULL)
03685         {
03686                 fprintf (stderr,
03687                   (_("Error in %s () a NULL pointer was found.\n")),
03688                   __FUNCTION__);
03689                 return (NULL);
03690         }
03691         leader->p2->z0 = z2;
03692 #if DEBUG
03693         DXF_DEBUG_END
03694 #endif
03695         return (leader);
03696 }
03697 
03698 
03705 DxfPoint *
03706 dxf_leader_get_p3
03707 (
03708         DxfLeader *leader
03710 )
03711 {
03712 #ifdef DEBUG
03713         DXF_DEBUG_BEGIN
03714 #endif
03715         /* Do some basic checks. */
03716         if (leader == NULL)
03717         {
03718                 fprintf (stderr,
03719                   (_("Error in %s () a NULL pointer was passed.\n")),
03720                   __FUNCTION__);
03721                 return (NULL);
03722         }
03723         if (leader->p3 == NULL)
03724         {
03725                 fprintf (stderr,
03726                   (_("Error in %s () a NULL pointer was found.\n")),
03727                   __FUNCTION__);
03728                 return (NULL);
03729         }
03730 #if DEBUG
03731         DXF_DEBUG_END
03732 #endif
03733         return (leader->p3);
03734 }
03735 
03736 
03743 DxfLeader *
03744 dxf_leader_set_p3
03745 (
03746         DxfLeader *leader,
03748         DxfPoint *p3
03750 )
03751 {
03752 #ifdef DEBUG
03753         DXF_DEBUG_BEGIN
03754 #endif
03755         /* Do some basic checks. */
03756         if (leader == NULL)
03757         {
03758                 fprintf (stderr,
03759                   (_("Error in %s () a NULL pointer was passed.\n")),
03760                   __FUNCTION__);
03761                 return (NULL);
03762         }
03763         if (p3 == NULL)
03764         {
03765                 fprintf (stderr,
03766                   (_("Error in %s () a NULL pointer was passed.\n")),
03767                   __FUNCTION__);
03768                 return (NULL);
03769         }
03770         leader->p3 = p3;
03771 #if DEBUG
03772         DXF_DEBUG_END
03773 #endif
03774         return (leader);
03775 }
03776 
03777 
03785 double
03786 dxf_leader_get_x3
03787 (
03788         DxfLeader *leader
03790 )
03791 {
03792 #ifdef DEBUG
03793         DXF_DEBUG_BEGIN
03794 #endif
03795 
03796         /* Do some basic checks. */
03797         if (leader == NULL)
03798         {
03799                 fprintf (stderr,
03800                   (_("Error in %s () a NULL pointer was passed.\n")),
03801                   __FUNCTION__);
03802                 return (EXIT_FAILURE);
03803         }
03804         if (leader->p3 == NULL)
03805         {
03806                 fprintf (stderr,
03807                   (_("Error in %s () a NULL pointer was found.\n")),
03808                   __FUNCTION__);
03809                 return (EXIT_FAILURE);
03810         }
03811 #if DEBUG
03812         DXF_DEBUG_END
03813 #endif
03814         return (leader->p3->x0);
03815 }
03816 
03817 
03825 DxfLeader *
03826 dxf_leader_set_x3
03827 (
03828         DxfLeader *leader,
03830         double x3
03834 )
03835 {
03836 #ifdef DEBUG
03837         DXF_DEBUG_BEGIN
03838 #endif
03839         /* Do some basic checks. */
03840         if (leader == NULL)
03841         {
03842                 fprintf (stderr,
03843                   (_("Error in %s () a NULL pointer was passed.\n")),
03844                   __FUNCTION__);
03845                 return (NULL);
03846         }
03847         if (leader->p3 == NULL)
03848         {
03849                 fprintf (stderr,
03850                   (_("Error in %s () a NULL pointer was found.\n")),
03851                   __FUNCTION__);
03852                 return (NULL);
03853         }
03854         leader->p3->x0 = x3;
03855 #if DEBUG
03856         DXF_DEBUG_END
03857 #endif
03858         return (leader);
03859 }
03860 
03861 
03869 double
03870 dxf_leader_get_y3
03871 (
03872         DxfLeader *leader
03874 )
03875 {
03876 #ifdef DEBUG
03877         DXF_DEBUG_BEGIN
03878 #endif
03879 
03880         /* Do some basic checks. */
03881         if (leader == NULL)
03882         {
03883                 fprintf (stderr,
03884                   (_("Error in %s () a NULL pointer was passed.\n")),
03885                   __FUNCTION__);
03886                 return (EXIT_FAILURE);
03887         }
03888         if (leader->p3 == NULL)
03889         {
03890                 fprintf (stderr,
03891                   (_("Error in %s () a NULL pointer was found.\n")),
03892                   __FUNCTION__);
03893                 return (EXIT_FAILURE);
03894         }
03895 #if DEBUG
03896         DXF_DEBUG_END
03897 #endif
03898         return (leader->p3->y0);
03899 }
03900 
03901 
03909 DxfLeader *
03910 dxf_leader_set_y3
03911 (
03912         DxfLeader *leader,
03914         double y3
03918 )
03919 {
03920 #ifdef DEBUG
03921         DXF_DEBUG_BEGIN
03922 #endif
03923         /* Do some basic checks. */
03924         if (leader == NULL)
03925         {
03926                 fprintf (stderr,
03927                   (_("Error in %s () a NULL pointer was passed.\n")),
03928                   __FUNCTION__);
03929                 return (NULL);
03930         }
03931         if (leader->p3 == NULL)
03932         {
03933                 fprintf (stderr,
03934                   (_("Error in %s () a NULL pointer was found.\n")),
03935                   __FUNCTION__);
03936                 return (NULL);
03937         }
03938         leader->p3->y0 = y3;
03939 #if DEBUG
03940         DXF_DEBUG_END
03941 #endif
03942         return (leader);
03943 }
03944 
03945 
03953 double
03954 dxf_leader_get_z3
03955 (
03956         DxfLeader *leader
03958 )
03959 {
03960 #ifdef DEBUG
03961         DXF_DEBUG_BEGIN
03962 #endif
03963 
03964         /* Do some basic checks. */
03965         if (leader == NULL)
03966         {
03967                 fprintf (stderr,
03968                   (_("Error in %s () a NULL pointer was passed.\n")),
03969                   __FUNCTION__);
03970                 return (EXIT_FAILURE);
03971         }
03972         if (leader->p3 == NULL)
03973         {
03974                 fprintf (stderr,
03975                   (_("Error in %s () a NULL pointer was found.\n")),
03976                   __FUNCTION__);
03977                 return (EXIT_FAILURE);
03978         }
03979 #if DEBUG
03980         DXF_DEBUG_END
03981 #endif
03982         return (leader->p3->z0);
03983 }
03984 
03985 
03993 DxfLeader *
03994 dxf_leader_set_z3
03995 (
03996         DxfLeader *leader,
03998         double z3
04002 )
04003 {
04004 #ifdef DEBUG
04005         DXF_DEBUG_BEGIN
04006 #endif
04007         /* Do some basic checks. */
04008         if (leader == NULL)
04009         {
04010                 fprintf (stderr,
04011                   (_("Error in %s () a NULL pointer was passed.\n")),
04012                   __FUNCTION__);
04013                 return (NULL);
04014         }
04015         if (leader->p3 == NULL)
04016         {
04017                 fprintf (stderr,
04018                   (_("Error in %s () a NULL pointer was found.\n")),
04019                   __FUNCTION__);
04020                 return (NULL);
04021         }
04022         leader->p3->z0 = z3;
04023 #if DEBUG
04024         DXF_DEBUG_END
04025 #endif
04026         return (leader);
04027 }
04028 
04029 
04038 char *
04039 dxf_leader_get_annotation_reference_hard
04040 (
04041         DxfLeader *leader
04043 )
04044 {
04045 #if DEBUG
04046         DXF_DEBUG_BEGIN
04047 #endif
04048         /* Do some basic checks. */
04049         if (leader == NULL)
04050         {
04051                 fprintf (stderr,
04052                   (_("Error in %s () a NULL pointer was passed.\n")),
04053                   __FUNCTION__);
04054                 return (NULL);
04055         }
04056         if (leader->annotation_reference_hard ==  NULL)
04057         {
04058                 fprintf (stderr,
04059                   (_("Error in %s () a NULL pointer was found.\n")),
04060                   __FUNCTION__);
04061                 return (NULL);
04062         }
04063 #if DEBUG
04064         DXF_DEBUG_END
04065 #endif
04066         return (strdup (leader->annotation_reference_hard));
04067 }
04068 
04069 
04074 DxfLeader *
04075 dxf_leader_set_annotation_reference_hard
04076 (
04077         DxfLeader *leader,
04079         char *annotation_reference_hard
04082 )
04083 {
04084 #if DEBUG
04085         DXF_DEBUG_BEGIN
04086 #endif
04087         /* Do some basic checks. */
04088         if (leader == NULL)
04089         {
04090                 fprintf (stderr,
04091                   (_("Error in %s () a NULL pointer was passed.\n")),
04092                   __FUNCTION__);
04093                 return (NULL);
04094         }
04095         if (annotation_reference_hard == NULL)
04096         {
04097                 fprintf (stderr,
04098                   (_("Error in %s () a NULL pointer was passed.\n")),
04099                   __FUNCTION__);
04100                 return (NULL);
04101         }
04102         leader->annotation_reference_hard = strdup (annotation_reference_hard);
04103 #if DEBUG
04104         DXF_DEBUG_END
04105 #endif
04106         return (leader);
04107 }
04108 
04109 
04118 DxfLeader *
04119 dxf_leader_get_next
04120 (
04121         DxfLeader *leader
04123 )
04124 {
04125 #if DEBUG
04126         DXF_DEBUG_BEGIN
04127 #endif
04128         /* Do some basic checks. */
04129         if (leader == NULL)
04130         {
04131                 fprintf (stderr,
04132                   (_("Error in %s () a NULL pointer was passed.\n")),
04133                   __FUNCTION__);
04134                 return (NULL);
04135         }
04136         if (leader->next == NULL)
04137         {
04138                 fprintf (stderr,
04139                   (_("Error in %s () a NULL pointer was found.\n")),
04140                   __FUNCTION__);
04141                 return (NULL);
04142         }
04143 #if DEBUG
04144         DXF_DEBUG_END
04145 #endif
04146         return ((DxfLeader *) leader->next);
04147 }
04148 
04149 
04154 DxfLeader *
04155 dxf_leader_set_next
04156 (
04157         DxfLeader *leader,
04159         DxfLeader *next
04161 )
04162 {
04163 #if DEBUG
04164         DXF_DEBUG_BEGIN
04165 #endif
04166         /* Do some basic checks. */
04167         if (leader == NULL)
04168         {
04169                 fprintf (stderr,
04170                   (_("Error in %s () a NULL pointer was passed.\n")),
04171                   __FUNCTION__);
04172                 return (NULL);
04173         }
04174         if (next == NULL)
04175         {
04176                 fprintf (stderr,
04177                   (_("Error in %s () a NULL pointer was passed.\n")),
04178                   __FUNCTION__);
04179                 return (NULL);
04180         }
04181         leader->next = (struct DxfLeader *) next;
04182 #if DEBUG
04183         DXF_DEBUG_END
04184 #endif
04185         return (leader);
04186 }
04187 
04188 
04197 DxfLeader *
04198 dxf_leader_get_last
04199 (
04200         DxfLeader *leader
04202 )
04203 {
04204 #if DEBUG
04205         DXF_DEBUG_BEGIN
04206 #endif
04207         /* Do some basic checks. */
04208         if (leader == NULL)
04209         {
04210                 fprintf (stderr,
04211                   (_("Error in %s () a NULL pointer was passed.\n")),
04212                   __FUNCTION__);
04213                 return (NULL);
04214         }
04215         if (leader->next == NULL)
04216         {
04217                 fprintf (stderr,
04218                   (_("Warning in %s () a NULL pointer was found.\n")),
04219                   __FUNCTION__);
04220                 return ((DxfLeader *) leader);
04221         }
04222         DxfLeader *iter = (DxfLeader *) leader->next;
04223         while (iter->next != NULL)
04224         {
04225                 iter = (DxfLeader *) iter->next;
04226         }
04227 #if DEBUG
04228         DXF_DEBUG_END
04229 #endif
04230         return ((DxfLeader *) iter);
04231 }
04232 
04233 
04234 /* EOF */