libDXF 0.0.1
A library with DXF related functions written in C.
|
00001 00044 #include "seqend.h" 00045 00046 00055 DxfSeqend * 00056 dxf_seqend_new () 00057 { 00058 #if DEBUG 00059 DXF_DEBUG_BEGIN 00060 #endif 00061 DxfSeqend *seqend = NULL; 00062 size_t size; 00063 00064 size = sizeof (DxfSeqend); 00065 /* avoid malloc of 0 bytes */ 00066 if (size == 0) size = 1; 00067 if ((seqend = malloc (size)) == NULL) 00068 { 00069 fprintf (stderr, 00070 (_("Error in %s () could not allocate memory for a DxfSeqend struct.\n")), 00071 __FUNCTION__); 00072 seqend = NULL; 00073 } 00074 else 00075 { 00076 memset (seqend, 0, size); 00077 } 00078 #if DEBUG 00079 DXF_DEBUG_END 00080 #endif 00081 return (seqend); 00082 } 00083 00084 00092 DxfSeqend * 00093 dxf_seqend_init 00094 ( 00095 DxfSeqend *seqend 00097 ) 00098 { 00099 #if DEBUG 00100 DXF_DEBUG_BEGIN 00101 #endif 00102 /* Do some basic checks. */ 00103 if (seqend == NULL) 00104 { 00105 fprintf (stderr, 00106 (_("Warning in %s () a NULL pointer was passed.\n")), 00107 __FUNCTION__); 00108 seqend = dxf_seqend_new (); 00109 } 00110 if (seqend == NULL) 00111 { 00112 fprintf (stderr, 00113 (_("Error in %s () could not allocate memory for a DxfSeqend struct.\n")), 00114 __FUNCTION__); 00115 return (NULL); 00116 } 00117 seqend->id_code = 0; 00118 seqend->linetype = strdup (DXF_DEFAULT_LINETYPE); 00119 seqend->layer = strdup (DXF_DEFAULT_LAYER); 00120 seqend->elevation = 0.0; 00121 seqend->thickness = 0.0; 00122 seqend->linetype_scale = DXF_DEFAULT_LINETYPE_SCALE; 00123 seqend->visibility = DXF_DEFAULT_VISIBILITY; 00124 seqend->color = DXF_COLOR_BYLAYER; 00125 seqend->paperspace = DXF_MODELSPACE; 00126 seqend->graphics_data_size = 0; 00127 seqend->shadow_mode = 0; 00128 seqend->binary_graphics_data = dxf_binary_graphics_data_new (); 00129 seqend->binary_graphics_data = dxf_binary_graphics_data_init (seqend->binary_graphics_data); 00130 seqend->dictionary_owner_soft = strdup (""); 00131 seqend->material = strdup (""); 00132 seqend->dictionary_owner_hard = strdup (""); 00133 seqend->lineweight = 0; 00134 seqend->plot_style_name = strdup (""); 00135 seqend->color_value = 0; 00136 seqend->color_name = strdup (""); 00137 seqend->transparency = 0; 00138 seqend->app_name = strdup (""); 00139 #if DEBUG 00140 DXF_DEBUG_END 00141 #endif 00142 return (seqend); 00143 } 00144 00145 00157 DxfSeqend * 00158 dxf_seqend_read 00159 ( 00160 DxfFile *fp, 00162 DxfSeqend *seqend 00164 ) 00165 { 00166 #if DEBUG 00167 DXF_DEBUG_BEGIN 00168 #endif 00169 char *temp_string = NULL; 00170 00171 /* Do some basic checks. */ 00172 if (fp == NULL) 00173 { 00174 fprintf (stderr, 00175 (_("Error in %s () a NULL file pointer was passed.\n")), 00176 __FUNCTION__); 00177 /* Clean up. */ 00178 free (temp_string); 00179 return (NULL); 00180 } 00181 if (seqend == NULL) 00182 { 00183 fprintf (stderr, 00184 (_("Warning in %s () a NULL pointer was passed.\n")), 00185 __FUNCTION__); 00186 seqend = dxf_seqend_new (); 00187 seqend = dxf_seqend_init (seqend); 00188 } 00189 (fp->line_number)++; 00190 fscanf (fp->fp, "%[^\n]", temp_string); 00191 while (strcmp (temp_string, "0") != 0) 00192 { 00193 if (ferror (fp->fp)) 00194 { 00195 fprintf (stderr, 00196 (_("Error in %s () while reading from: %s in line: %d.\n")), 00197 __FUNCTION__, fp->filename, fp->line_number); 00198 fclose (fp->fp); 00199 /* Clean up. */ 00200 free (temp_string); 00201 return (NULL); 00202 } 00203 if (strcmp (temp_string, "2") == 0) 00204 { 00205 /* Now follows a string containing an application 00206 * name. */ 00207 (fp->line_number)++; 00208 fscanf (fp->fp, "%s\n", seqend->app_name); 00209 } 00210 else if (strcmp (temp_string, "5") == 0) 00211 { 00212 /* Now follows a string containing a sequential 00213 * id number. */ 00214 (fp->line_number)++; 00215 fscanf (fp->fp, "%x\n", &seqend->id_code); 00216 } 00217 else if (strcmp (temp_string, "6") == 0) 00218 { 00219 /* Now follows a string containing a linetype 00220 * name. */ 00221 (fp->line_number)++; 00222 fscanf (fp->fp, "%s\n", seqend->linetype); 00223 } 00224 else if (strcmp (temp_string, "8") == 0) 00225 { 00226 /* Now follows a string containing a layer name. */ 00227 (fp->line_number)++; 00228 fscanf (fp->fp, "%s\n", seqend->layer); 00229 } 00230 else if (strcmp (temp_string, "38") == 0) 00231 { 00232 /* Now follows a string containing the 00233 * elevation. */ 00234 (fp->line_number)++; 00235 fscanf (fp->fp, "%lf\n", &seqend->elevation); 00236 } 00237 else if (strcmp (temp_string, "39") == 0) 00238 { 00239 /* Now follows a string containing the 00240 * thickness. */ 00241 (fp->line_number)++; 00242 fscanf (fp->fp, "%lf\n", &seqend->thickness); 00243 } 00244 else if (strcmp (temp_string, "48") == 0) 00245 { 00246 /* Now follows a string containing the linetype 00247 * scale. */ 00248 (fp->line_number)++; 00249 fscanf (fp->fp, "%lf\n", &seqend->linetype_scale); 00250 } 00251 else if (strcmp (temp_string, "60") == 0) 00252 { 00253 /* Now follows a string containing the 00254 * visibility value. */ 00255 (fp->line_number)++; 00256 fscanf (fp->fp, "%hd\n", &seqend->visibility); 00257 } 00258 else if (strcmp (temp_string, "62") == 0) 00259 { 00260 /* Now follows a string containing the 00261 * color value. */ 00262 (fp->line_number)++; 00263 fscanf (fp->fp, "%d\n", &seqend->color); 00264 } 00265 else if (strcmp (temp_string, "67") == 0) 00266 { 00267 /* Now follows a string containing the 00268 * paperspace value. */ 00269 (fp->line_number)++; 00270 fscanf (fp->fp, "%d\n", &seqend->paperspace); 00271 } 00272 else if (strcmp (temp_string, "92") == 0) 00273 { 00274 /* Now follows a string containing the 00275 * graphics data size value. */ 00276 (fp->line_number)++; 00277 fscanf (fp->fp, "%d\n", &seqend->graphics_data_size); 00278 } 00279 else if ((fp->acad_version_number >= AutoCAD_13) 00280 && (strcmp (temp_string, "100") == 0)) 00281 { 00282 /* Now follows a string containing the 00283 * subclass marker value. */ 00284 (fp->line_number)++; 00285 fscanf (fp->fp, "%s\n", temp_string); 00286 if (strcmp (temp_string, "AcDbEntity") != 0) 00287 { 00288 fprintf (stderr, 00289 (_("Warning in %s () found a bad subclass marker in: %s in line: %d.\n")), 00290 __FUNCTION__, fp->filename, fp->line_number); 00291 } 00292 } 00293 else if (strcmp (temp_string, "284") == 0) 00294 { 00295 /* Now follows a string containing the shadow 00296 * mode value. */ 00297 (fp->line_number)++; 00298 fscanf (fp->fp, "%hd\n", &seqend->shadow_mode); 00299 } 00300 else if (strcmp (temp_string, "310") == 0) 00301 { 00302 /* Now follows a string containing binary 00303 * graphics data. */ 00304 (fp->line_number)++; 00305 fscanf (fp->fp, "%s\n", seqend->binary_graphics_data->data_line); 00306 dxf_binary_graphics_data_init ((DxfBinaryGraphicsData *) seqend->binary_graphics_data->next); 00307 seqend->binary_graphics_data = (DxfBinaryGraphicsData *) seqend->binary_graphics_data->next; 00308 } 00309 else if (strcmp (temp_string, "330") == 0) 00310 { 00311 /* Now follows a string containing Soft-pointer 00312 * ID/handle to owner dictionary. */ 00313 (fp->line_number)++; 00314 fscanf (fp->fp, "%s\n", seqend->dictionary_owner_soft); 00315 } 00316 else if (strcmp (temp_string, "347") == 0) 00317 { 00318 /* Now follows a string containing a 00319 * hard-pointer ID/handle to material object. */ 00320 (fp->line_number)++; 00321 fscanf (fp->fp, "%s\n", seqend->material); 00322 } 00323 else if (strcmp (temp_string, "360") == 0) 00324 { 00325 /* Now follows a string containing Hard owner 00326 * ID/handle to owner dictionary. */ 00327 (fp->line_number)++; 00328 fscanf (fp->fp, "%s\n", seqend->dictionary_owner_hard); 00329 } 00330 else if (strcmp (temp_string, "370") == 0) 00331 { 00332 /* Now follows a string containing the lineweight 00333 * value. */ 00334 (fp->line_number)++; 00335 fscanf (fp->fp, "%hd\n", &seqend->lineweight); 00336 } 00337 else if (strcmp (temp_string, "390") == 0) 00338 { 00339 /* Now follows a string containing a plot style 00340 * name value. */ 00341 (fp->line_number)++; 00342 fscanf (fp->fp, "%s\n", seqend->plot_style_name); 00343 } 00344 else if (strcmp (temp_string, "420") == 0) 00345 { 00346 /* Now follows a string containing a color value. */ 00347 (fp->line_number)++; 00348 fscanf (fp->fp, "%ld\n", &seqend->color_value); 00349 } 00350 else if (strcmp (temp_string, "430") == 0) 00351 { 00352 /* Now follows a string containing a color 00353 * name value. */ 00354 (fp->line_number)++; 00355 fscanf (fp->fp, "%s\n", seqend->color_name); 00356 } 00357 else if (strcmp (temp_string, "440") == 0) 00358 { 00359 /* Now follows a string containing a transparency 00360 * value. */ 00361 (fp->line_number)++; 00362 fscanf (fp->fp, "%ld\n", &seqend->transparency); 00363 } 00364 else if (strcmp (temp_string, "999") == 0) 00365 { 00366 /* Now follows a string containing a comment. */ 00367 (fp->line_number)++; 00368 fscanf (fp->fp, "%s\n", temp_string); 00369 fprintf (stdout, "DXF comment: %s\n", temp_string); 00370 } 00371 else 00372 { 00373 fprintf (stderr, 00374 (_("Warning in %s () unknown string tag found while reading from: %s in line: %d.\n")), 00375 __FUNCTION__, fp->filename, fp->line_number); 00376 } 00377 } 00378 /* Handle omitted members and/or illegal values. */ 00379 if (strcmp (seqend->linetype, "") == 0) 00380 { 00381 seqend->linetype = strdup (DXF_DEFAULT_LINETYPE); 00382 } 00383 if (strcmp (seqend->layer, "") == 0) 00384 { 00385 seqend->layer = strdup (DXF_DEFAULT_LAYER); 00386 } 00387 /* Clean up. */ 00388 free (temp_string); 00389 #if DEBUG 00390 DXF_DEBUG_END 00391 #endif 00392 return (seqend); 00393 } 00394 00395 00410 int 00411 dxf_seqend_write 00412 ( 00413 DxfFile *fp, 00415 DxfSeqend *seqend 00417 ) 00418 { 00419 #if DEBUG 00420 DXF_DEBUG_BEGIN 00421 #endif 00422 char *dxf_entity_name = strdup ("SEQEND"); 00423 00424 /* Do some basic checks. */ 00425 if (fp == NULL) 00426 { 00427 fprintf (stderr, 00428 (_("Error in %s () a NULL file pointer was passed.\n")), 00429 __FUNCTION__); 00430 /* Clean up. */ 00431 free (dxf_entity_name); 00432 return (EXIT_FAILURE); 00433 } 00434 if (seqend == NULL) 00435 { 00436 fprintf (stderr, 00437 (_("Error in %s () a NULL pointer was passed.\n")), 00438 __FUNCTION__); 00439 /* Clean up. */ 00440 free (dxf_entity_name); 00441 return (EXIT_FAILURE); 00442 } 00443 if (strcmp (seqend->linetype, "") == 0) 00444 { 00445 fprintf (stderr, 00446 (_("Warning in %s () empty linetype string for the %s entity with id-code: %x\n")), 00447 __FUNCTION__, dxf_entity_name, seqend->id_code); 00448 fprintf (stderr, 00449 (_("\t%s entity is reset to default linetype")), 00450 dxf_entity_name); 00451 seqend->linetype = strdup (DXF_DEFAULT_LINETYPE); 00452 } 00453 if (strcmp (seqend->layer, "") == 0) 00454 { 00455 fprintf (stderr, 00456 (_("Warning in %s () empty layer string for the %s entity with id-code: %x\n")), 00457 __FUNCTION__, dxf_entity_name, seqend->id_code); 00458 fprintf (stderr, 00459 (_("\t%s entity is relocated to layer 0")), 00460 dxf_entity_name); 00461 seqend->layer = DXF_DEFAULT_LAYER; 00462 } 00463 /* Start writing output. */ 00464 fprintf (fp->fp, " 0\n%s\n", dxf_entity_name); 00465 if (seqend->id_code != -1) 00466 { 00467 fprintf (fp->fp, " 5\n%x\n", seqend->id_code); 00468 } 00479 if ((strcmp (seqend->dictionary_owner_soft, "") != 0) 00480 && (fp->acad_version_number >= AutoCAD_14)) 00481 { 00482 fprintf (fp->fp, "102\n{ACAD_REACTORS\n"); 00483 fprintf (fp->fp, "330\n%s\n", seqend->dictionary_owner_soft); 00484 fprintf (fp->fp, "102\n}\n"); 00485 } 00486 if ((strcmp (seqend->dictionary_owner_hard, "") != 0) 00487 && (fp->acad_version_number >= AutoCAD_14)) 00488 { 00489 fprintf (fp->fp, "102\n{ACAD_XDICTIONARY\n"); 00490 fprintf (fp->fp, "360\n%s\n", seqend->dictionary_owner_hard); 00491 fprintf (fp->fp, "102\n}\n"); 00492 } 00493 if (fp->acad_version_number >= AutoCAD_13) 00494 { 00495 fprintf (fp->fp, "100\nAcDbEntity\n"); 00496 } 00497 if (seqend->paperspace == DXF_PAPERSPACE) 00498 { 00499 fprintf (fp->fp, " 67\n%d\n", DXF_PAPERSPACE); 00500 } 00501 fprintf (fp->fp, " 8\n%s\n", seqend->layer); 00502 if (strcmp (seqend->linetype, DXF_DEFAULT_LINETYPE) != 0) 00503 { 00504 fprintf (fp->fp, " 6\n%s\n", seqend->linetype); 00505 } 00506 if ((fp->acad_version_number >= AutoCAD_2008) 00507 && (strcmp (seqend->material, "") != 0)) 00508 { 00509 fprintf (fp->fp, "347\n%s\n", seqend->material); 00510 } 00511 if (seqend->color != DXF_COLOR_BYLAYER) 00512 { 00513 fprintf (fp->fp, " 62\n%d\n", seqend->color); 00514 } 00515 if (fp->acad_version_number >= AutoCAD_2002) 00516 { 00517 fprintf (fp->fp, "370\n%d\n", seqend->lineweight); 00518 } 00519 if ((fp->acad_version_number <= AutoCAD_11) 00520 && DXF_FLATLAND 00521 && (seqend->elevation != 0.0)) 00522 { 00523 fprintf (fp->fp, " 38\n%f\n", seqend->elevation); 00524 } 00525 if ((fp->acad_version_number <= AutoCAD_13) 00526 && (seqend->thickness != 0.0)) 00527 { 00528 fprintf (fp->fp, " 39\n%f\n", seqend->thickness); 00529 } 00530 if (seqend->linetype_scale != 1.0) 00531 { 00532 fprintf (fp->fp, " 48\n%f\n", seqend->linetype_scale); 00533 } 00534 if (seqend->visibility != 0) 00535 { 00536 fprintf (fp->fp, " 60\n%d\n", seqend->visibility); 00537 } 00538 if ((fp->acad_version_number >= AutoCAD_2000) 00539 && (seqend->graphics_data_size > 0)) 00540 { 00541 #ifdef BUILD_64 00542 fprintf (fp->fp, "160\n%d\n", seqend->graphics_data_size); 00543 #else 00544 fprintf (fp->fp, " 92\n%d\n", seqend->graphics_data_size); 00545 #endif 00546 if (seqend->binary_graphics_data != NULL) 00547 { 00548 DxfBinaryGraphicsData *iter; 00549 iter = (DxfBinaryGraphicsData *) seqend->binary_graphics_data; 00550 while (iter != NULL) 00551 { 00552 fprintf (fp->fp, "310\n%s\n", dxf_binary_graphics_data_get_data_line (iter)); 00553 iter = (DxfBinaryGraphicsData *) dxf_binary_graphics_data_get_next (iter); 00554 } 00555 } 00556 } 00557 if (fp->acad_version_number >= AutoCAD_2004) 00558 { 00559 fprintf (fp->fp, "420\n%ld\n", seqend->color_value); 00560 fprintf (fp->fp, "430\n%s\n", seqend->color_name); 00561 fprintf (fp->fp, "440\n%ld\n", seqend->transparency); 00562 } 00563 if (fp->acad_version_number >= AutoCAD_2009) 00564 { 00565 fprintf (fp->fp, "390\n%s\n", seqend->plot_style_name); 00566 fprintf (fp->fp, "284\n%d\n", seqend->shadow_mode); 00567 } 00568 /* Clean up. */ 00569 free (dxf_entity_name); 00570 #if DEBUG 00571 DXF_DEBUG_END 00572 #endif 00573 return (EXIT_SUCCESS); 00574 } 00575 00576 00584 int 00585 dxf_seqend_free 00586 ( 00587 DxfSeqend *seqend 00590 ) 00591 { 00592 #if DEBUG 00593 DXF_DEBUG_BEGIN 00594 #endif 00595 /* Do some basic checks. */ 00596 if (seqend == NULL) 00597 { 00598 fprintf (stderr, 00599 (_("Error in %s () a NULL pointer was passed.\n")), 00600 __FUNCTION__); 00601 return (EXIT_FAILURE); 00602 } 00603 free (seqend->linetype); 00604 free (seqend->layer); 00605 dxf_binary_graphics_data_free_chain (seqend->binary_graphics_data); 00606 free (seqend->dictionary_owner_soft); 00607 free (seqend->material); 00608 free (seqend->dictionary_owner_hard); 00609 free (seqend->plot_style_name); 00610 free (seqend->color_name); 00611 free (seqend->app_name); 00612 free (seqend); 00613 seqend = NULL; 00614 #if DEBUG 00615 DXF_DEBUG_END 00616 #endif 00617 return (EXIT_SUCCESS); 00618 } 00619 00620 00626 int 00627 dxf_seqend_get_id_code 00628 ( 00629 DxfSeqend *seqend 00631 ) 00632 { 00633 #if DEBUG 00634 DXF_DEBUG_BEGIN 00635 #endif 00636 /* Do some basic checks. */ 00637 if (seqend == NULL) 00638 { 00639 fprintf (stderr, 00640 (_("Error in %s () a NULL pointer was passed.\n")), 00641 __FUNCTION__); 00642 return (EXIT_FAILURE); 00643 } 00644 if (seqend->id_code < 0) 00645 { 00646 fprintf (stderr, 00647 (_("Warning in %s () a negative value was found.\n")), 00648 __FUNCTION__); 00649 } 00650 #if DEBUG 00651 DXF_DEBUG_END 00652 #endif 00653 return (seqend->id_code); 00654 } 00655 00656 00660 DxfSeqend * 00661 dxf_seqend_set_id_code 00662 ( 00663 DxfSeqend *seqend, 00665 int id_code 00669 ) 00670 { 00671 #if DEBUG 00672 DXF_DEBUG_BEGIN 00673 #endif 00674 /* Do some basic checks. */ 00675 if (seqend == NULL) 00676 { 00677 fprintf (stderr, 00678 (_("Error in %s () a NULL pointer was passed.\n")), 00679 __FUNCTION__); 00680 return (NULL); 00681 } 00682 if (id_code < 0) 00683 { 00684 fprintf (stderr, 00685 (_("Warning in %s () a negative value was passed.\n")), 00686 __FUNCTION__); 00687 } 00688 seqend->id_code = id_code; 00689 #if DEBUG 00690 DXF_DEBUG_END 00691 #endif 00692 return (seqend); 00693 } 00694 00695 00701 char * 00702 dxf_seqend_get_linetype 00703 ( 00704 DxfSeqend *seqend 00706 ) 00707 { 00708 #if DEBUG 00709 DXF_DEBUG_BEGIN 00710 #endif 00711 /* Do some basic checks. */ 00712 if (seqend == NULL) 00713 { 00714 fprintf (stderr, 00715 (_("Error in %s () a NULL pointer was passed.\n")), 00716 __FUNCTION__); 00717 return (NULL); 00718 } 00719 if (seqend->linetype == NULL) 00720 { 00721 fprintf (stderr, 00722 (_("Error in %s () a NULL pointer was found.\n")), 00723 __FUNCTION__); 00724 return (NULL); 00725 } 00726 #if DEBUG 00727 DXF_DEBUG_END 00728 #endif 00729 return (strdup (seqend->linetype)); 00730 } 00731 00732 00736 DxfSeqend * 00737 dxf_seqend_set_linetype 00738 ( 00739 DxfSeqend *seqend, 00741 char *linetype 00744 ) 00745 { 00746 #if DEBUG 00747 DXF_DEBUG_BEGIN 00748 #endif 00749 /* Do some basic checks. */ 00750 if (seqend == NULL) 00751 { 00752 fprintf (stderr, 00753 (_("Error in %s () a NULL pointer was passed.\n")), 00754 __FUNCTION__); 00755 return (NULL); 00756 } 00757 if (linetype == NULL) 00758 { 00759 fprintf (stderr, 00760 (_("Error in %s () a NULL pointer was passed.\n")), 00761 __FUNCTION__); 00762 return (NULL); 00763 } 00764 seqend->linetype = strdup (linetype); 00765 #if DEBUG 00766 DXF_DEBUG_END 00767 #endif 00768 return (seqend); 00769 } 00770 00771 00777 char * 00778 dxf_seqend_get_layer 00779 ( 00780 DxfSeqend *seqend 00782 ) 00783 { 00784 #if DEBUG 00785 DXF_DEBUG_BEGIN 00786 #endif 00787 /* Do some basic checks. */ 00788 if (seqend == NULL) 00789 { 00790 fprintf (stderr, 00791 (_("Error in %s () a NULL pointer was passed.\n")), 00792 __FUNCTION__); 00793 return (NULL); 00794 } 00795 if (seqend->layer == NULL) 00796 { 00797 fprintf (stderr, 00798 (_("Error in %s () a NULL pointer was found.\n")), 00799 __FUNCTION__); 00800 return (NULL); 00801 } 00802 #if DEBUG 00803 DXF_DEBUG_END 00804 #endif 00805 return (strdup (seqend->layer)); 00806 } 00807 00808 00812 DxfSeqend * 00813 dxf_seqend_set_layer 00814 ( 00815 DxfSeqend *seqend, 00817 char *layer 00820 ) 00821 { 00822 #if DEBUG 00823 DXF_DEBUG_BEGIN 00824 #endif 00825 /* Do some basic checks. */ 00826 if (seqend == NULL) 00827 { 00828 fprintf (stderr, 00829 (_("Error in %s () a NULL pointer was passed.\n")), 00830 __FUNCTION__); 00831 return (NULL); 00832 } 00833 if (layer == NULL) 00834 { 00835 fprintf (stderr, 00836 (_("Error in %s () a NULL pointer was passed.\n")), 00837 __FUNCTION__); 00838 return (NULL); 00839 } 00840 seqend->layer = strdup (layer); 00841 #if DEBUG 00842 DXF_DEBUG_END 00843 #endif 00844 return (seqend); 00845 } 00846 00847 00853 double 00854 dxf_seqend_get_elevation 00855 ( 00856 DxfSeqend *seqend 00858 ) 00859 { 00860 #if DEBUG 00861 DXF_DEBUG_BEGIN 00862 #endif 00863 /* Do some basic checks. */ 00864 if (seqend == NULL) 00865 { 00866 fprintf (stderr, 00867 (_("Error in %s () a NULL pointer was passed.\n")), 00868 __FUNCTION__); 00869 return (EXIT_FAILURE); 00870 } 00871 #if DEBUG 00872 DXF_DEBUG_END 00873 #endif 00874 return (seqend->elevation); 00875 } 00876 00877 00881 DxfSeqend * 00882 dxf_seqend_set_elevation 00883 ( 00884 DxfSeqend *seqend, 00886 double elevation 00888 ) 00889 { 00890 #if DEBUG 00891 DXF_DEBUG_BEGIN 00892 #endif 00893 /* Do some basic checks. */ 00894 if (seqend == NULL) 00895 { 00896 fprintf (stderr, 00897 (_("Error in %s () a NULL pointer was passed.\n")), 00898 __FUNCTION__); 00899 return (NULL); 00900 } 00901 seqend->elevation = elevation; 00902 #if DEBUG 00903 DXF_DEBUG_END 00904 #endif 00905 return (seqend); 00906 } 00907 00908 00914 double 00915 dxf_seqend_get_thickness 00916 ( 00917 DxfSeqend *seqend 00919 ) 00920 { 00921 #if DEBUG 00922 DXF_DEBUG_BEGIN 00923 #endif 00924 /* Do some basic checks. */ 00925 if (seqend == NULL) 00926 { 00927 fprintf (stderr, 00928 (_("Error in %s () a NULL pointer was passed.\n")), 00929 __FUNCTION__); 00930 return (EXIT_FAILURE); 00931 } 00932 if (seqend->thickness < 0.0) 00933 { 00934 fprintf (stderr, 00935 (_("Error in %s () a negative value was found.\n")), 00936 __FUNCTION__); 00937 return (EXIT_FAILURE); 00938 } 00939 #if DEBUG 00940 DXF_DEBUG_END 00941 #endif 00942 return (seqend->thickness); 00943 } 00944 00945 00949 DxfSeqend * 00950 dxf_seqend_set_thickness 00951 ( 00952 DxfSeqend *seqend, 00954 double thickness 00956 ) 00957 { 00958 #if DEBUG 00959 DXF_DEBUG_BEGIN 00960 #endif 00961 /* Do some basic checks. */ 00962 if (seqend == NULL) 00963 { 00964 fprintf (stderr, 00965 (_("Error in %s () a NULL pointer was passed.\n")), 00966 __FUNCTION__); 00967 return (NULL); 00968 } 00969 if (thickness < 0.0) 00970 { 00971 fprintf (stderr, 00972 (_("Error in %s () a negative value was passed.\n")), 00973 __FUNCTION__); 00974 return (NULL); 00975 } 00976 seqend->thickness = thickness; 00977 #if DEBUG 00978 DXF_DEBUG_END 00979 #endif 00980 return (seqend); 00981 } 00982 00983 00989 double 00990 dxf_seqend_get_linetype_scale 00991 ( 00992 DxfSeqend *seqend 00994 ) 00995 { 00996 #if DEBUG 00997 DXF_DEBUG_BEGIN 00998 #endif 00999 /* Do some basic checks. */ 01000 if (seqend == NULL) 01001 { 01002 fprintf (stderr, 01003 (_("Error in %s () a NULL pointer was passed.\n")), 01004 __FUNCTION__); 01005 return (EXIT_FAILURE); 01006 } 01007 if (seqend->linetype_scale < 0.0) 01008 { 01009 fprintf (stderr, 01010 (_("Error in %s () a negative value was found.\n")), 01011 __FUNCTION__); 01012 return (EXIT_FAILURE); 01013 } 01014 #if DEBUG 01015 DXF_DEBUG_END 01016 #endif 01017 return (seqend->linetype_scale); 01018 } 01019 01020 01024 DxfSeqend * 01025 dxf_seqend_set_linetype_scale 01026 ( 01027 DxfSeqend *seqend, 01029 double linetype_scale 01031 ) 01032 { 01033 #if DEBUG 01034 DXF_DEBUG_BEGIN 01035 #endif 01036 /* Do some basic checks. */ 01037 if (seqend == NULL) 01038 { 01039 fprintf (stderr, 01040 (_("Error in %s () a NULL pointer was passed.\n")), 01041 __FUNCTION__); 01042 return (NULL); 01043 } 01044 if (linetype_scale < 0.0) 01045 { 01046 fprintf (stderr, 01047 (_("Error in %s () a negative value was passed.\n")), 01048 __FUNCTION__); 01049 return (NULL); 01050 } 01051 seqend->linetype_scale = linetype_scale; 01052 #if DEBUG 01053 DXF_DEBUG_END 01054 #endif 01055 return (seqend); 01056 } 01057 01058 01064 int16_t 01065 dxf_seqend_get_visibility 01066 ( 01067 DxfSeqend *seqend 01069 ) 01070 { 01071 #if DEBUG 01072 DXF_DEBUG_BEGIN 01073 #endif 01074 /* Do some basic checks. */ 01075 if (seqend == NULL) 01076 { 01077 fprintf (stderr, 01078 (_("Error in %s () a NULL pointer was passed.\n")), 01079 __FUNCTION__); 01080 return (EXIT_FAILURE); 01081 } 01082 if (seqend->visibility < 0) 01083 { 01084 fprintf (stderr, 01085 (_("Error in %s () a negative value was found.\n")), 01086 __FUNCTION__); 01087 return (EXIT_FAILURE); 01088 } 01089 if (seqend->visibility > 1) 01090 { 01091 fprintf (stderr, 01092 (_("Error in %s () an out of range value was found.\n")), 01093 __FUNCTION__); 01094 return (EXIT_FAILURE); 01095 } 01096 #if DEBUG 01097 DXF_DEBUG_END 01098 #endif 01099 return (seqend->visibility); 01100 } 01101 01102 01106 DxfSeqend * 01107 dxf_seqend_set_visibility 01108 ( 01109 DxfSeqend *seqend, 01111 int16_t visibility 01113 ) 01114 { 01115 #if DEBUG 01116 DXF_DEBUG_BEGIN 01117 #endif 01118 /* Do some basic checks. */ 01119 if (seqend == NULL) 01120 { 01121 fprintf (stderr, 01122 (_("Error in %s () a NULL pointer was passed.\n")), 01123 __FUNCTION__); 01124 return (NULL); 01125 } 01126 if (visibility < 0) 01127 { 01128 fprintf (stderr, 01129 (_("Error in %s () a negative value was passed.\n")), 01130 __FUNCTION__); 01131 return (NULL); 01132 } 01133 if (visibility > 1) 01134 { 01135 fprintf (stderr, 01136 (_("Error in %s () an out of range value was passed.\n")), 01137 __FUNCTION__); 01138 return (NULL); 01139 } 01140 seqend->visibility = visibility; 01141 #if DEBUG 01142 DXF_DEBUG_END 01143 #endif 01144 return (seqend); 01145 } 01146 01147 01153 int 01154 dxf_seqend_get_color 01155 ( 01156 DxfSeqend *seqend 01158 ) 01159 { 01160 #if DEBUG 01161 DXF_DEBUG_BEGIN 01162 #endif 01163 /* Do some basic checks. */ 01164 if (seqend == NULL) 01165 { 01166 fprintf (stderr, 01167 (_("Error in %s () a NULL pointer was passed.\n")), 01168 __FUNCTION__); 01169 return (EXIT_FAILURE); 01170 } 01171 if (seqend->color < 0) 01172 { 01173 fprintf (stderr, 01174 (_("Warning in %s () a negative value was found.\n")), 01175 __FUNCTION__); 01176 } 01177 #if DEBUG 01178 DXF_DEBUG_END 01179 #endif 01180 return (seqend->color); 01181 } 01182 01183 01187 DxfSeqend * 01188 dxf_seqend_set_color 01189 ( 01190 DxfSeqend *seqend, 01192 int color 01194 ) 01195 { 01196 #if DEBUG 01197 DXF_DEBUG_BEGIN 01198 #endif 01199 /* Do some basic checks. */ 01200 if (seqend == NULL) 01201 { 01202 fprintf (stderr, 01203 (_("Error in %s () a NULL pointer was passed.\n")), 01204 __FUNCTION__); 01205 return (NULL); 01206 } 01207 if (color < 0) 01208 { 01209 fprintf (stderr, 01210 (_("Warning in %s () a negative value was passed.\n")), 01211 __FUNCTION__); 01212 } 01213 seqend->color = color; 01214 #if DEBUG 01215 DXF_DEBUG_END 01216 #endif 01217 return (seqend); 01218 } 01219 01220 01226 int 01227 dxf_seqend_get_paperspace 01228 ( 01229 DxfSeqend *seqend 01231 ) 01232 { 01233 #if DEBUG 01234 DXF_DEBUG_BEGIN 01235 #endif 01236 /* Do some basic checks. */ 01237 if (seqend == NULL) 01238 { 01239 fprintf (stderr, 01240 (_("Error in %s () a NULL pointer was passed.\n")), 01241 __FUNCTION__); 01242 return (EXIT_FAILURE); 01243 } 01244 if (seqend->paperspace < 0) 01245 { 01246 fprintf (stderr, 01247 (_("Warning in %s () a negative value was found.\n")), 01248 __FUNCTION__); 01249 } 01250 if (seqend->paperspace > 1) 01251 { 01252 fprintf (stderr, 01253 (_("Warning in %s () an out of range value was found.\n")), 01254 __FUNCTION__); 01255 } 01256 #if DEBUG 01257 DXF_DEBUG_END 01258 #endif 01259 return (seqend->paperspace); 01260 } 01261 01262 01266 DxfSeqend * 01267 dxf_seqend_set_paperspace 01268 ( 01269 DxfSeqend *seqend, 01271 int paperspace 01274 ) 01275 { 01276 #if DEBUG 01277 DXF_DEBUG_BEGIN 01278 #endif 01279 /* Do some basic checks. */ 01280 if (seqend == NULL) 01281 { 01282 fprintf (stderr, 01283 (_("Error in %s () a NULL pointer was passed.\n")), 01284 __FUNCTION__); 01285 return (NULL); 01286 } 01287 if (paperspace < 0) 01288 { 01289 fprintf (stderr, 01290 (_("Error in %s () a negative value was passed.\n")), 01291 __FUNCTION__); 01292 return (NULL); 01293 } 01294 if (paperspace > 1) 01295 { 01296 fprintf (stderr, 01297 (_("Error in %s () an out of range value was passed.\n")), 01298 __FUNCTION__); 01299 return (NULL); 01300 } 01301 seqend->paperspace = paperspace; 01302 #if DEBUG 01303 DXF_DEBUG_END 01304 #endif 01305 return (seqend); 01306 } 01307 01308 01316 int 01317 dxf_seqend_get_graphics_data_size 01318 ( 01319 DxfSeqend *seqend 01321 ) 01322 { 01323 #if DEBUG 01324 DXF_DEBUG_BEGIN 01325 #endif 01326 /* Do some basic checks. */ 01327 if (seqend == NULL) 01328 { 01329 fprintf (stderr, 01330 (_("Error in %s () a NULL pointer was passed.\n")), 01331 __FUNCTION__); 01332 return (EXIT_FAILURE); 01333 } 01334 if (seqend->graphics_data_size < 0) 01335 { 01336 fprintf (stderr, 01337 (_("Warning in %s () a negative value was found.\n")), 01338 __FUNCTION__); 01339 } 01340 if (seqend->graphics_data_size == 0) 01341 { 01342 fprintf (stderr, 01343 (_("Warning in %s () a zero value was found.\n")), 01344 __FUNCTION__); 01345 } 01346 #if DEBUG 01347 DXF_DEBUG_END 01348 #endif 01349 return (seqend->graphics_data_size); 01350 } 01351 01352 01360 DxfSeqend * 01361 dxf_seqend_set_graphics_data_size 01362 ( 01363 DxfSeqend *seqend, 01365 int graphics_data_size 01368 ) 01369 { 01370 #if DEBUG 01371 DXF_DEBUG_BEGIN 01372 #endif 01373 /* Do some basic checks. */ 01374 if (seqend == NULL) 01375 { 01376 fprintf (stderr, 01377 (_("Error in %s () a NULL pointer was passed.\n")), 01378 __FUNCTION__); 01379 return (NULL); 01380 } 01381 if (graphics_data_size < 0) 01382 { 01383 fprintf (stderr, 01384 (_("Error in %s () a negative value was passed.\n")), 01385 __FUNCTION__); 01386 return (NULL); 01387 } 01388 if (graphics_data_size == 0) 01389 { 01390 fprintf (stderr, 01391 (_("Warning in %s () a zero value was passed.\n")), 01392 __FUNCTION__); 01393 } 01394 seqend->graphics_data_size = graphics_data_size; 01395 #if DEBUG 01396 DXF_DEBUG_END 01397 #endif 01398 return (seqend); 01399 } 01400 01401 01408 int16_t 01409 dxf_seqend_get_shadow_mode 01410 ( 01411 DxfSeqend *seqend 01413 ) 01414 { 01415 #if DEBUG 01416 DXF_DEBUG_BEGIN 01417 #endif 01418 /* Do some basic checks. */ 01419 if (seqend == NULL) 01420 { 01421 fprintf (stderr, 01422 (_("Error in %s () a NULL pointer was passed.\n")), 01423 __FUNCTION__); 01424 return (EXIT_FAILURE); 01425 } 01426 if (seqend->shadow_mode < 0) 01427 { 01428 fprintf (stderr, 01429 (_("Error in %s () a negative value was found.\n")), 01430 __FUNCTION__); 01431 return (EXIT_FAILURE); 01432 } 01433 if (seqend->shadow_mode > 3) 01434 { 01435 fprintf (stderr, 01436 (_("Error in %s () an out of range value was found.\n")), 01437 __FUNCTION__); 01438 return (EXIT_FAILURE); 01439 } 01440 #if DEBUG 01441 DXF_DEBUG_END 01442 #endif 01443 return (seqend->shadow_mode); 01444 } 01445 01446 01453 DxfSeqend * 01454 dxf_seqend_set_shadow_mode 01455 ( 01456 DxfSeqend *seqend, 01458 int16_t shadow_mode 01460 ) 01461 { 01462 #if DEBUG 01463 DXF_DEBUG_BEGIN 01464 #endif 01465 /* Do some basic checks. */ 01466 if (seqend == NULL) 01467 { 01468 fprintf (stderr, 01469 (_("Error in %s () a NULL pointer was passed.\n")), 01470 __FUNCTION__); 01471 return (NULL); 01472 } 01473 if (shadow_mode < 0) 01474 { 01475 fprintf (stderr, 01476 (_("Error in %s () a negative value was passed.\n")), 01477 __FUNCTION__); 01478 return (NULL); 01479 } 01480 if (shadow_mode > 3) 01481 { 01482 fprintf (stderr, 01483 (_("Error in %s () an out of range value was passed.\n")), 01484 __FUNCTION__); 01485 return (NULL); 01486 } 01487 seqend->shadow_mode = shadow_mode; 01488 #if DEBUG 01489 DXF_DEBUG_END 01490 #endif 01491 return (seqend); 01492 } 01493 01494 01503 DxfBinaryGraphicsData * 01504 dxf_seqend_get_binary_graphics_data 01505 ( 01506 DxfSeqend *seqend 01508 ) 01509 { 01510 #if DEBUG 01511 DXF_DEBUG_BEGIN 01512 #endif 01513 /* Do some basic checks. */ 01514 if (seqend == NULL) 01515 { 01516 fprintf (stderr, 01517 (_("Error in %s () a NULL pointer was passed.\n")), 01518 __FUNCTION__); 01519 return (NULL); 01520 } 01521 if (seqend->binary_graphics_data == NULL) 01522 { 01523 fprintf (stderr, 01524 (_("Error in %s () a NULL pointer was found.\n")), 01525 __FUNCTION__); 01526 return (NULL); 01527 } 01528 #if DEBUG 01529 DXF_DEBUG_END 01530 #endif 01531 return ((DxfBinaryGraphicsData *) seqend->binary_graphics_data); 01532 } 01533 01534 01539 DxfSeqend * 01540 dxf_seqend_set_binary_graphics_data 01541 ( 01542 DxfSeqend *seqend, 01544 DxfBinaryGraphicsData *data 01547 ) 01548 { 01549 #if DEBUG 01550 DXF_DEBUG_BEGIN 01551 #endif 01552 /* Do some basic checks. */ 01553 if (seqend == NULL) 01554 { 01555 fprintf (stderr, 01556 (_("Error in %s () a NULL pointer was passed.\n")), 01557 __FUNCTION__); 01558 return (NULL); 01559 } 01560 if (data == NULL) 01561 { 01562 fprintf (stderr, 01563 (_("Error in %s () a NULL pointer was passed.\n")), 01564 __FUNCTION__); 01565 return (NULL); 01566 } 01567 seqend->binary_graphics_data = (DxfBinaryGraphicsData *) data; 01568 #if DEBUG 01569 DXF_DEBUG_END 01570 #endif 01571 return (seqend); 01572 } 01573 01574 01583 char * 01584 dxf_seqend_get_dictionary_owner_soft 01585 ( 01586 DxfSeqend *seqend 01588 ) 01589 { 01590 #if DEBUG 01591 DXF_DEBUG_BEGIN 01592 #endif 01593 /* Do some basic checks. */ 01594 if (seqend == NULL) 01595 { 01596 fprintf (stderr, 01597 (_("Error in %s () a NULL pointer was passed.\n")), 01598 __FUNCTION__); 01599 return (NULL); 01600 } 01601 if (seqend->dictionary_owner_soft == NULL) 01602 { 01603 fprintf (stderr, 01604 (_("Error in %s () a NULL pointer was found.\n")), 01605 __FUNCTION__); 01606 return (NULL); 01607 } 01608 #if DEBUG 01609 DXF_DEBUG_END 01610 #endif 01611 return (strdup (seqend->dictionary_owner_soft)); 01612 } 01613 01614 01619 DxfSeqend * 01620 dxf_seqend_set_dictionary_owner_soft 01621 ( 01622 DxfSeqend *seqend, 01624 char *dictionary_owner_soft 01627 ) 01628 { 01629 #if DEBUG 01630 DXF_DEBUG_BEGIN 01631 #endif 01632 /* Do some basic checks. */ 01633 if (seqend == NULL) 01634 { 01635 fprintf (stderr, 01636 (_("Error in %s () a NULL pointer was passed.\n")), 01637 __FUNCTION__); 01638 return (NULL); 01639 } 01640 if (dictionary_owner_soft == NULL) 01641 { 01642 fprintf (stderr, 01643 (_("Error in %s () a NULL pointer was passed.\n")), 01644 __FUNCTION__); 01645 return (NULL); 01646 } 01647 seqend->dictionary_owner_soft = strdup (dictionary_owner_soft); 01648 #if DEBUG 01649 DXF_DEBUG_END 01650 #endif 01651 return (seqend); 01652 } 01653 01654 01663 char * 01664 dxf_seqend_get_material 01665 ( 01666 DxfSeqend *seqend 01668 ) 01669 { 01670 #if DEBUG 01671 DXF_DEBUG_BEGIN 01672 #endif 01673 /* Do some basic checks. */ 01674 if (seqend == NULL) 01675 { 01676 fprintf (stderr, 01677 (_("Error in %s () a NULL pointer was passed.\n")), 01678 __FUNCTION__); 01679 return (NULL); 01680 } 01681 if (seqend->material == NULL) 01682 { 01683 fprintf (stderr, 01684 (_("Error in %s () a NULL pointer was found.\n")), 01685 __FUNCTION__); 01686 return (NULL); 01687 } 01688 #if DEBUG 01689 DXF_DEBUG_END 01690 #endif 01691 return (strdup (seqend->material)); 01692 } 01693 01694 01701 DxfSeqend * 01702 dxf_seqend_set_material 01703 ( 01704 DxfSeqend *seqend, 01706 char *material 01709 ) 01710 { 01711 #if DEBUG 01712 DXF_DEBUG_BEGIN 01713 #endif 01714 /* Do some basic checks. */ 01715 if (seqend == NULL) 01716 { 01717 fprintf (stderr, 01718 (_("Error in %s () a NULL pointer was passed.\n")), 01719 __FUNCTION__); 01720 return (NULL); 01721 } 01722 if (material == NULL) 01723 { 01724 fprintf (stderr, 01725 (_("Error in %s () a NULL pointer was passed.\n")), 01726 __FUNCTION__); 01727 return (NULL); 01728 } 01729 seqend->material = strdup (material); 01730 #if DEBUG 01731 DXF_DEBUG_END 01732 #endif 01733 return (seqend); 01734 } 01735 01736 01745 char * 01746 dxf_seqend_get_dictionary_owner_hard 01747 ( 01748 DxfSeqend *seqend 01750 ) 01751 { 01752 #if DEBUG 01753 DXF_DEBUG_BEGIN 01754 #endif 01755 /* Do some basic checks. */ 01756 if (seqend == NULL) 01757 { 01758 fprintf (stderr, 01759 (_("Error in %s () a NULL pointer was passed.\n")), 01760 __FUNCTION__); 01761 return (NULL); 01762 } 01763 if (seqend->dictionary_owner_hard == NULL) 01764 { 01765 fprintf (stderr, 01766 (_("Error in %s () a NULL pointer was found.\n")), 01767 __FUNCTION__); 01768 return (NULL); 01769 } 01770 #if DEBUG 01771 DXF_DEBUG_END 01772 #endif 01773 return (strdup (seqend->dictionary_owner_hard)); 01774 } 01775 01776 01781 DxfSeqend * 01782 dxf_seqend_set_dictionary_owner_hard 01783 ( 01784 DxfSeqend *seqend, 01786 char *dictionary_owner_hard 01789 ) 01790 { 01791 #if DEBUG 01792 DXF_DEBUG_BEGIN 01793 #endif 01794 /* Do some basic checks. */ 01795 if (seqend == NULL) 01796 { 01797 fprintf (stderr, 01798 (_("Error in %s () a NULL pointer was passed.\n")), 01799 __FUNCTION__); 01800 return (NULL); 01801 } 01802 if (dictionary_owner_hard == NULL) 01803 { 01804 fprintf (stderr, 01805 (_("Error in %s () a NULL pointer was passed.\n")), 01806 __FUNCTION__); 01807 return (NULL); 01808 } 01809 seqend->dictionary_owner_hard = strdup (dictionary_owner_hard); 01810 #if DEBUG 01811 DXF_DEBUG_END 01812 #endif 01813 return (seqend); 01814 } 01815 01816 01823 int16_t 01824 dxf_seqend_get_lineweight 01825 ( 01826 DxfSeqend *seqend 01828 ) 01829 { 01830 #if DEBUG 01831 DXF_DEBUG_BEGIN 01832 #endif 01833 /* Do some basic checks. */ 01834 if (seqend == NULL) 01835 { 01836 fprintf (stderr, 01837 (_("Error in %s () a NULL pointer was passed.\n")), 01838 __FUNCTION__); 01839 return (EXIT_FAILURE); 01840 } 01841 #if DEBUG 01842 DXF_DEBUG_END 01843 #endif 01844 return (seqend->lineweight); 01845 } 01846 01847 01854 DxfSeqend * 01855 dxf_seqend_set_lineweight 01856 ( 01857 DxfSeqend *seqend, 01859 int16_t lineweight 01861 ) 01862 { 01863 #if DEBUG 01864 DXF_DEBUG_BEGIN 01865 #endif 01866 /* Do some basic checks. */ 01867 if (seqend == NULL) 01868 { 01869 fprintf (stderr, 01870 (_("Error in %s () a NULL pointer was passed.\n")), 01871 __FUNCTION__); 01872 return (NULL); 01873 } 01874 seqend->lineweight = lineweight; 01875 #if DEBUG 01876 DXF_DEBUG_END 01877 #endif 01878 return (seqend); 01879 } 01880 01881 01888 char * 01889 dxf_seqend_get_plot_style_name 01890 ( 01891 DxfSeqend *seqend 01893 ) 01894 { 01895 #if DEBUG 01896 DXF_DEBUG_BEGIN 01897 #endif 01898 /* Do some basic checks. */ 01899 if (seqend == NULL) 01900 { 01901 fprintf (stderr, 01902 (_("Error in %s () a NULL pointer was passed.\n")), 01903 __FUNCTION__); 01904 return (NULL); 01905 } 01906 if (seqend->plot_style_name == NULL) 01907 { 01908 fprintf (stderr, 01909 (_("Error in %s () a NULL pointer was found.\n")), 01910 __FUNCTION__); 01911 return (NULL); 01912 } 01913 #if DEBUG 01914 DXF_DEBUG_END 01915 #endif 01916 return (strdup (seqend->plot_style_name)); 01917 } 01918 01919 01926 DxfSeqend * 01927 dxf_seqend_set_plot_style_name 01928 ( 01929 DxfSeqend *seqend, 01931 char *plot_style_name 01934 ) 01935 { 01936 #if DEBUG 01937 DXF_DEBUG_BEGIN 01938 #endif 01939 /* Do some basic checks. */ 01940 if (seqend == NULL) 01941 { 01942 fprintf (stderr, 01943 (_("Error in %s () a NULL pointer was passed.\n")), 01944 __FUNCTION__); 01945 return (NULL); 01946 } 01947 if (plot_style_name == NULL) 01948 { 01949 fprintf (stderr, 01950 (_("Error in %s () a NULL pointer was passed.\n")), 01951 __FUNCTION__); 01952 return (NULL); 01953 } 01954 seqend->plot_style_name = strdup (plot_style_name); 01955 #if DEBUG 01956 DXF_DEBUG_END 01957 #endif 01958 return (seqend); 01959 } 01960 01961 01968 long 01969 dxf_seqend_get_color_value 01970 ( 01971 DxfSeqend *seqend 01973 ) 01974 { 01975 #if DEBUG 01976 DXF_DEBUG_BEGIN 01977 #endif 01978 /* Do some basic checks. */ 01979 if (seqend == NULL) 01980 { 01981 fprintf (stderr, 01982 (_("Error in %s () a NULL pointer was passed.\n")), 01983 __FUNCTION__); 01984 return (EXIT_FAILURE); 01985 } 01986 #if DEBUG 01987 DXF_DEBUG_END 01988 #endif 01989 return (seqend->color_value); 01990 } 01991 01992 01999 DxfSeqend * 02000 dxf_seqend_set_color_value 02001 ( 02002 DxfSeqend *seqend, 02004 long color_value 02006 ) 02007 { 02008 #if DEBUG 02009 DXF_DEBUG_BEGIN 02010 #endif 02011 /* Do some basic checks. */ 02012 if (seqend == NULL) 02013 { 02014 fprintf (stderr, 02015 (_("Error in %s () a NULL pointer was passed.\n")), 02016 __FUNCTION__); 02017 return (NULL); 02018 } 02019 seqend->color_value = color_value; 02020 #if DEBUG 02021 DXF_DEBUG_END 02022 #endif 02023 return (seqend); 02024 } 02025 02026 02033 char * 02034 dxf_seqend_get_color_name 02035 ( 02036 DxfSeqend *seqend 02038 ) 02039 { 02040 #if DEBUG 02041 DXF_DEBUG_BEGIN 02042 #endif 02043 /* Do some basic checks. */ 02044 if (seqend == NULL) 02045 { 02046 fprintf (stderr, 02047 (_("Error in %s () a NULL pointer was passed.\n")), 02048 __FUNCTION__); 02049 return (NULL); 02050 } 02051 if (seqend->color_name == NULL) 02052 { 02053 fprintf (stderr, 02054 (_("Error in %s () a NULL pointer was found.\n")), 02055 __FUNCTION__); 02056 return (NULL); 02057 } 02058 #if DEBUG 02059 DXF_DEBUG_END 02060 #endif 02061 return (strdup (seqend->color_name)); 02062 } 02063 02064 02071 DxfSeqend * 02072 dxf_seqend_set_color_name 02073 ( 02074 DxfSeqend *seqend, 02076 char *color_name 02079 ) 02080 { 02081 #if DEBUG 02082 DXF_DEBUG_BEGIN 02083 #endif 02084 /* Do some basic checks. */ 02085 if (seqend == NULL) 02086 { 02087 fprintf (stderr, 02088 (_("Error in %s () a NULL pointer was passed.\n")), 02089 __FUNCTION__); 02090 return (NULL); 02091 } 02092 if (color_name == NULL) 02093 { 02094 fprintf (stderr, 02095 (_("Error in %s () a NULL pointer was passed.\n")), 02096 __FUNCTION__); 02097 return (NULL); 02098 } 02099 seqend->color_name = strdup (color_name); 02100 #if DEBUG 02101 DXF_DEBUG_END 02102 #endif 02103 return (seqend); 02104 } 02105 02106 02113 long 02114 dxf_seqend_get_transparency 02115 ( 02116 DxfSeqend *seqend 02118 ) 02119 { 02120 #if DEBUG 02121 DXF_DEBUG_BEGIN 02122 #endif 02123 /* Do some basic checks. */ 02124 if (seqend == NULL) 02125 { 02126 fprintf (stderr, 02127 (_("Error in %s () a NULL pointer was passed.\n")), 02128 __FUNCTION__); 02129 return (EXIT_FAILURE); 02130 } 02131 #if DEBUG 02132 DXF_DEBUG_END 02133 #endif 02134 return (seqend->transparency); 02135 } 02136 02137 02144 DxfSeqend * 02145 dxf_seqend_set_transparency 02146 ( 02147 DxfSeqend *seqend, 02149 long transparency 02151 ) 02152 { 02153 #if DEBUG 02154 DXF_DEBUG_BEGIN 02155 #endif 02156 /* Do some basic checks. */ 02157 if (seqend == NULL) 02158 { 02159 fprintf (stderr, 02160 (_("Error in %s () a NULL pointer was passed.\n")), 02161 __FUNCTION__); 02162 return (NULL); 02163 } 02164 seqend->transparency = transparency; 02165 #if DEBUG 02166 DXF_DEBUG_END 02167 #endif 02168 return (seqend); 02169 } 02170 02171 02178 char * 02179 dxf_seqend_get_app_name 02180 ( 02181 DxfSeqend *seqend 02183 ) 02184 { 02185 #if DEBUG 02186 DXF_DEBUG_BEGIN 02187 #endif 02188 /* Do some basic checks. */ 02189 if (seqend == NULL) 02190 { 02191 fprintf (stderr, 02192 (_("Error in %s () a NULL pointer was passed.\n")), 02193 __FUNCTION__); 02194 return (NULL); 02195 } 02196 if (seqend->app_name == NULL) 02197 { 02198 fprintf (stderr, 02199 (_("Error in %s () a NULL pointer was found.\n")), 02200 __FUNCTION__); 02201 return (NULL); 02202 } 02203 #if DEBUG 02204 DXF_DEBUG_END 02205 #endif 02206 return (strdup (seqend->app_name)); 02207 } 02208 02209 02216 DxfSeqend * 02217 dxf_seqend_set_app_name 02218 ( 02219 DxfSeqend *seqend, 02221 char *app_name 02224 ) 02225 { 02226 #if DEBUG 02227 DXF_DEBUG_BEGIN 02228 #endif 02229 /* Do some basic checks. */ 02230 if (seqend == NULL) 02231 { 02232 fprintf (stderr, 02233 (_("Error in %s () a NULL pointer was passed.\n")), 02234 __FUNCTION__); 02235 return (NULL); 02236 } 02237 if (app_name == NULL) 02238 { 02239 fprintf (stderr, 02240 (_("Error in %s () a NULL pointer was passed.\n")), 02241 __FUNCTION__); 02242 return (NULL); 02243 } 02244 seqend->app_name = strdup (app_name); 02245 #if DEBUG 02246 DXF_DEBUG_END 02247 #endif 02248 return (seqend); 02249 } 02250 02251 02252 /* EOF */