libDXF 0.0.1
A library with DXF related functions written in C.
|
00001 00036 #include "oleframe.h" 00037 00038 00047 DxfOleFrame * 00048 dxf_oleframe_new () 00049 { 00050 #if DEBUG 00051 DXF_DEBUG_BEGIN 00052 #endif 00053 DxfOleFrame *oleframe = NULL; 00054 size_t size; 00055 00056 size = sizeof (DxfOleFrame); 00057 /* avoid malloc of 0 bytes */ 00058 if (size == 0) size = 1; 00059 if ((oleframe = malloc (size)) == NULL) 00060 { 00061 fprintf (stderr, 00062 (_("Error in %s () could not allocate memory for a DxfOleFrame struct.\n")), 00063 __FUNCTION__); 00064 oleframe = NULL; 00065 } 00066 else 00067 { 00068 memset (oleframe, 0, size); 00069 } 00070 #if DEBUG 00071 DXF_DEBUG_END 00072 #endif 00073 return (oleframe); 00074 } 00075 00076 00087 DxfOleFrame * 00088 dxf_oleframe_init 00089 ( 00090 DxfOleFrame *oleframe 00092 ) 00093 { 00094 #if DEBUG 00095 DXF_DEBUG_BEGIN 00096 #endif 00097 /* Do some basic checks. */ 00098 if (oleframe == NULL) 00099 { 00100 fprintf (stderr, 00101 (_("Warning in %s () a NULL pointer was passed.\n")), 00102 __FUNCTION__); 00103 oleframe = dxf_oleframe_new (); 00104 } 00105 if (oleframe == NULL) 00106 { 00107 fprintf (stderr, 00108 (_("Error in %s () could not allocate memory for a DxfOleFrame struct.\n")), 00109 __FUNCTION__); 00110 return (NULL); 00111 } 00112 oleframe->id_code = 0; 00113 oleframe->linetype = strdup (DXF_DEFAULT_LINETYPE); 00114 oleframe->layer = strdup (DXF_DEFAULT_LAYER); 00115 oleframe->elevation = 0.0; 00116 oleframe->thickness = 0.0; 00117 oleframe->linetype_scale = DXF_DEFAULT_LINETYPE_SCALE; 00118 oleframe->visibility = DXF_DEFAULT_VISIBILITY; 00119 oleframe->color = DXF_COLOR_BYLAYER; 00120 oleframe->paperspace = DXF_MODELSPACE; 00121 oleframe->dictionary_owner_soft = strdup (""); 00122 oleframe->dictionary_owner_hard = strdup (""); 00123 oleframe->ole_version_number = 1; 00124 oleframe->length = 0; 00125 oleframe->binary_data = dxf_char_new (); 00126 oleframe->binary_data = dxf_char_init (oleframe->binary_data); 00127 oleframe->binary_data->value = strdup (""); 00128 oleframe->binary_data->length = 0; 00129 oleframe->binary_data->next = NULL; 00130 oleframe->next = NULL; 00131 #if DEBUG 00132 DXF_DEBUG_END 00133 #endif 00134 return (oleframe); 00135 } 00136 00137 00152 DxfOleFrame * 00153 dxf_oleframe_read 00154 ( 00155 DxfFile *fp, 00157 DxfOleFrame *oleframe 00159 ) 00160 { 00161 #if DEBUG 00162 DXF_DEBUG_BEGIN 00163 #endif 00164 char *temp_string = NULL; 00165 DxfChar *iter = NULL; 00166 00167 /* Do some basic checks. */ 00168 if (fp == NULL) 00169 { 00170 fprintf (stderr, 00171 (_("Error in %s () a NULL file pointer was passed.\n")), 00172 __FUNCTION__); 00173 /* Clean up. */ 00174 free (temp_string); 00175 return (NULL); 00176 } 00177 if (oleframe == NULL) 00178 { 00179 fprintf (stderr, 00180 (_("Warning in %s () a NULL pointer was passed.\n")), 00181 __FUNCTION__); 00182 oleframe = dxf_oleframe_new (); 00183 oleframe = dxf_oleframe_init (oleframe); 00184 } 00185 iter = (DxfChar *) oleframe->binary_data; 00186 (fp->line_number)++; 00187 fscanf (fp->fp, "%[^\n]", temp_string); 00188 while (strcmp (temp_string, "0") != 0) 00189 { 00190 if (ferror (fp->fp)) 00191 { 00192 fprintf (stderr, 00193 (_("Error in %s () while reading from: %s in line: %d.\n")), 00194 __FUNCTION__, fp->filename, fp->line_number); 00195 fclose (fp->fp); 00196 /* Clean up. */ 00197 free (temp_string); 00198 return (NULL); 00199 } 00200 if (strcmp (temp_string, "1") == 0) 00201 { 00202 /* Now follows a string containing a End of Ole 00203 * data marker. */ 00204 (fp->line_number)++; 00205 fscanf (fp->fp, "%s\n", temp_string); 00206 if (strcmp (temp_string, "OLE") != 0) 00207 { 00208 fprintf (stderr, 00209 (_("Warning in %s () found a bad End of Ole data marker in: %s in line: %d.\n")), 00210 __FUNCTION__, fp->filename, fp->line_number); 00211 } 00212 } 00213 if (strcmp (temp_string, "5") == 0) 00214 { 00215 /* Now follows a string containing a sequential 00216 * id number. */ 00217 (fp->line_number)++; 00218 fscanf (fp->fp, "%x\n", &oleframe->id_code); 00219 } 00220 else if (strcmp (temp_string, "6") == 0) 00221 { 00222 /* Now follows a string containing a linetype 00223 * name. */ 00224 (fp->line_number)++; 00225 fscanf (fp->fp, "%s\n", oleframe->linetype); 00226 } 00227 else if (strcmp (temp_string, "8") == 0) 00228 { 00229 /* Now follows a string containing a layer name. */ 00230 (fp->line_number)++; 00231 fscanf (fp->fp, "%s\n", oleframe->layer); 00232 } 00233 else if ((fp->acad_version_number <= AutoCAD_11) 00234 && (strcmp (temp_string, "38") == 0) 00235 && (oleframe->elevation != 0.0)) 00236 { 00237 /* Now follows a string containing the 00238 * elevation. */ 00239 (fp->line_number)++; 00240 fscanf (fp->fp, "%lf\n", &oleframe->elevation); 00241 } 00242 else if (strcmp (temp_string, "39") == 0) 00243 { 00244 /* Now follows a string containing the 00245 * thickness. */ 00246 (fp->line_number)++; 00247 fscanf (fp->fp, "%lf\n", &oleframe->thickness); 00248 } 00249 else if (strcmp (temp_string, "48") == 0) 00250 { 00251 /* Now follows a string containing the linetype 00252 * scale. */ 00253 (fp->line_number)++; 00254 fscanf (fp->fp, "%lf\n", &oleframe->linetype_scale); 00255 } 00256 else if (strcmp (temp_string, "60") == 0) 00257 { 00258 /* Now follows a string containing the 00259 * visibility value. */ 00260 (fp->line_number)++; 00261 fscanf (fp->fp, "%hd\n", &oleframe->visibility); 00262 } 00263 else if (strcmp (temp_string, "62") == 0) 00264 { 00265 /* Now follows a string containing the 00266 * color value. */ 00267 (fp->line_number)++; 00268 fscanf (fp->fp, "%d\n", &oleframe->color); 00269 } 00270 else if (strcmp (temp_string, "67") == 0) 00271 { 00272 /* Now follows a string containing the 00273 * paperspace value. */ 00274 (fp->line_number)++; 00275 fscanf (fp->fp, "%d\n", &oleframe->paperspace); 00276 } 00277 else if (strcmp (temp_string, "70") == 0) 00278 { 00279 /* Now follows a string containing the ole 00280 * version number. */ 00281 (fp->line_number)++; 00282 fscanf (fp->fp, "%d\n", &oleframe->ole_version_number); 00283 } 00284 else if (strcmp (temp_string, "90") == 0) 00285 { 00286 /* Now follows a string containing the length of 00287 * binary data. */ 00288 (fp->line_number)++; 00289 fscanf (fp->fp, "%ld\n", &oleframe->length); 00290 } 00291 else if ((fp->acad_version_number >= AutoCAD_13) 00292 && (strcmp (temp_string, "100") == 0)) 00293 { 00294 /* Now follows a string containing the 00295 * subclass marker value. */ 00296 (fp->line_number)++; 00297 fscanf (fp->fp, "%s\n", temp_string); 00298 if ((strcmp (temp_string, "AcDbEntity") != 0) 00299 && ((strcmp (temp_string, "AcDbOleFrame") != 0))) 00300 { 00301 fprintf (stderr, 00302 (_("Warning in %s () found a bad subclass marker in: %s in line: %d.\n")), 00303 __FUNCTION__, fp->filename, fp->line_number); 00304 } 00305 } 00306 else if (strcmp (temp_string, "310") == 0) 00307 { 00308 /* Now follows a string containing binary data. */ 00309 (fp->line_number)++; 00310 fscanf (fp->fp, "%s\n", iter->value); 00311 iter->next = (struct DxfChar *) dxf_char_init ((DxfChar *) iter->next); 00312 iter = (DxfChar *) iter->next; 00313 } 00314 else if (strcmp (temp_string, "330") == 0) 00315 { 00316 /* Now follows a string containing Soft-pointer 00317 * ID/handle to owner dictionary. */ 00318 (fp->line_number)++; 00319 fscanf (fp->fp, "%s\n", oleframe->dictionary_owner_soft); 00320 } 00321 else if (strcmp (temp_string, "360") == 0) 00322 { 00323 /* Now follows a string containing Hard owner 00324 * ID/handle to owner dictionary. */ 00325 (fp->line_number)++; 00326 fscanf (fp->fp, "%s\n", oleframe->dictionary_owner_hard); 00327 } 00328 else if (strcmp (temp_string, "999") == 0) 00329 { 00330 /* Now follows a string containing a comment. */ 00331 (fp->line_number)++; 00332 fscanf (fp->fp, "%s\n", temp_string); 00333 fprintf (stdout, "DXF comment: %s\n", temp_string); 00334 } 00335 else 00336 { 00337 fprintf (stderr, 00338 (_("Warning in %s () unknown string tag found while reading from: %s in line: %d.\n")), 00339 __FUNCTION__, fp->filename, fp->line_number); 00340 } 00341 } 00342 /* Handle omitted members and/or illegal values. */ 00343 if (strcmp (oleframe->linetype, "") == 0) 00344 { 00345 oleframe->linetype = strdup (DXF_DEFAULT_LINETYPE); 00346 } 00347 if (strcmp (oleframe->layer, "") == 0) 00348 { 00349 oleframe->layer = strdup (DXF_DEFAULT_LAYER); 00350 } 00351 /* Clean up. */ 00352 free (temp_string); 00353 #if DEBUG 00354 DXF_DEBUG_END 00355 #endif 00356 return (oleframe); 00357 } 00358 00359 00369 int 00370 dxf_oleframe_write 00371 ( 00372 DxfFile *fp, 00374 DxfOleFrame *oleframe 00376 ) 00377 { 00378 #if DEBUG 00379 DXF_DEBUG_BEGIN 00380 #endif 00381 char *dxf_entity_name = strdup ("OLEFRAME"); 00382 DxfChar *iter = NULL; 00383 00384 /* Do some basic checks. */ 00385 if (fp == NULL) 00386 { 00387 fprintf (stderr, 00388 (_("Error in %s () a NULL file pointer was passed.\n")), 00389 __FUNCTION__); 00390 /* Clean up. */ 00391 free (dxf_entity_name); 00392 return (EXIT_FAILURE); 00393 } 00394 if (oleframe == NULL) 00395 { 00396 fprintf (stderr, 00397 (_("Error in %s () a NULL pointer was passed.\n")), 00398 __FUNCTION__); 00399 /* Clean up. */ 00400 free (dxf_entity_name); 00401 return (EXIT_FAILURE); 00402 } 00403 if (fp->acad_version_number < AutoCAD_13) 00404 { 00405 fprintf (stderr, 00406 (_("Warning in %s () illegal DXF version for this entity.\n")), 00407 __FUNCTION__); 00408 } 00409 if (strcmp (oleframe->linetype, "") == 0) 00410 { 00411 fprintf (stderr, 00412 (_("Warning in %s () empty linetype string for the %s entity with id-code: %x\n")), 00413 __FUNCTION__, dxf_entity_name, oleframe->id_code); 00414 fprintf (stderr, 00415 (_("\t%s entity is reset to default linetype")), 00416 dxf_entity_name); 00417 oleframe->linetype = strdup (DXF_DEFAULT_LINETYPE); 00418 } 00419 if (strcmp (oleframe->layer, "") == 0) 00420 { 00421 fprintf (stderr, 00422 (_("Warning in %s () empty layer string for the %s entity with id-code: %x\n")), 00423 __FUNCTION__, dxf_entity_name, oleframe->id_code); 00424 fprintf (stderr, 00425 (_("\t%s entity is relocated to layer 0")), 00426 dxf_entity_name); 00427 oleframe->layer = strdup (DXF_DEFAULT_LAYER); 00428 } 00429 /* Start writing output. */ 00430 fprintf (fp->fp, " 0\n%s\n", dxf_entity_name); 00431 if (oleframe->id_code != -1) 00432 { 00433 fprintf (fp->fp, " 5\n%x\n", oleframe->id_code); 00434 } 00445 if ((strcmp (oleframe->dictionary_owner_soft, "") != 0) 00446 && (fp->acad_version_number >= AutoCAD_14)) 00447 { 00448 fprintf (fp->fp, "102\n{ACAD_REACTORS\n"); 00449 fprintf (fp->fp, "330\n%s\n", oleframe->dictionary_owner_soft); 00450 fprintf (fp->fp, "102\n}\n"); 00451 } 00452 if ((strcmp (oleframe->dictionary_owner_hard, "") != 0) 00453 && (fp->acad_version_number >= AutoCAD_14)) 00454 { 00455 fprintf (fp->fp, "102\n{ACAD_XDICTIONARY\n"); 00456 fprintf (fp->fp, "360\n%s\n", oleframe->dictionary_owner_hard); 00457 fprintf (fp->fp, "102\n}\n"); 00458 } 00459 if (fp->acad_version_number >= AutoCAD_13) 00460 { 00461 fprintf (fp->fp, "100\nAcDbEntity\n"); 00462 } 00463 if (oleframe->paperspace == DXF_PAPERSPACE) 00464 { 00465 fprintf (fp->fp, " 67\n%d\n", DXF_PAPERSPACE); 00466 } 00467 fprintf (fp->fp, " 8\n%s\n", oleframe->layer); 00468 if (strcmp (oleframe->linetype, DXF_DEFAULT_LINETYPE) != 0) 00469 { 00470 fprintf (fp->fp, " 6\n%s\n", oleframe->linetype); 00471 } 00472 if ((fp->acad_version_number <= AutoCAD_11) 00473 && DXF_FLATLAND 00474 && (oleframe->elevation != 0.0)) 00475 { 00476 fprintf (fp->fp, " 38\n%f\n", oleframe->elevation); 00477 } 00478 if (oleframe->color != DXF_COLOR_BYLAYER) 00479 { 00480 fprintf (fp->fp, " 62\n%d\n", oleframe->color); 00481 } 00482 if (oleframe->linetype_scale != 1.0) 00483 { 00484 fprintf (fp->fp, " 48\n%f\n", oleframe->linetype_scale); 00485 } 00486 if (oleframe->visibility != 0) 00487 { 00488 fprintf (fp->fp, " 60\n%d\n", oleframe->visibility); 00489 } 00490 if (fp->acad_version_number >= AutoCAD_13) 00491 { 00492 fprintf (fp->fp, "100\nAcDbOleFrame\n"); 00493 } 00494 if (oleframe->thickness != 0.0) 00495 { 00496 fprintf (fp->fp, " 39\n%f\n", oleframe->thickness); 00497 } 00498 fprintf (fp->fp, " 70\n%d\n", oleframe->ole_version_number); 00499 fprintf (fp->fp, " 90\n%ld\n", oleframe->length); 00500 if (oleframe->binary_data != NULL) 00501 { 00502 iter = (DxfChar*) oleframe->binary_data; 00503 while ((iter != NULL) && (iter->value != NULL)) 00504 { 00505 fprintf (fp->fp, "310\n%s\n", iter->value); 00506 iter = (DxfChar*) iter->next; 00507 } 00508 } 00509 else 00510 { 00511 fprintf (fp->fp, "310\n\n"); 00512 } 00513 fprintf (fp->fp, " 1\nOLE\n"); 00514 /* Clean up. */ 00515 free (dxf_entity_name); 00516 #if DEBUG 00517 DXF_DEBUG_END 00518 #endif 00519 return (EXIT_SUCCESS); 00520 } 00521 00522 00533 int 00534 dxf_oleframe_free 00535 ( 00536 DxfOleFrame *oleframe 00539 ) 00540 { 00541 #if DEBUG 00542 DXF_DEBUG_BEGIN 00543 #endif 00544 /* Do some basic checks. */ 00545 if (oleframe == NULL) 00546 { 00547 fprintf (stderr, 00548 (_("Error in %s () a NULL pointer was passed.\n")), 00549 __FUNCTION__); 00550 return (EXIT_FAILURE); 00551 } 00552 if (oleframe->next != NULL) 00553 { 00554 fprintf (stderr, 00555 (_("Error in %s () pointer to next was not NULL.\n")), 00556 __FUNCTION__); 00557 return (EXIT_FAILURE); 00558 } 00559 free (oleframe->linetype); 00560 free (oleframe->layer); 00561 free (oleframe->dictionary_owner_soft); 00562 free (oleframe->dictionary_owner_hard); 00563 dxf_char_free_chain (oleframe->binary_data); 00564 free (oleframe); 00565 oleframe = NULL; 00566 #if DEBUG 00567 DXF_DEBUG_END 00568 #endif 00569 return (EXIT_SUCCESS); 00570 } 00571 00572 00583 void 00584 dxf_oleframe_free_chain 00585 ( 00586 DxfOleFrame *oleframes 00588 ) 00589 { 00590 #ifdef DEBUG 00591 DXF_DEBUG_BEGIN 00592 #endif 00593 if (oleframes == NULL) 00594 { 00595 fprintf (stderr, 00596 (_("Warning in %s () a NULL pointer was passed.\n")), 00597 __FUNCTION__); 00598 } 00599 while (oleframes != NULL) 00600 { 00601 struct DxfOleFrame *iter = oleframes->next; 00602 dxf_oleframe_free (oleframes); 00603 oleframes = (DxfOleFrame *) iter; 00604 } 00605 #if DEBUG 00606 DXF_DEBUG_END 00607 #endif 00608 } 00609 00610 00616 int 00617 dxf_oleframe_get_id_code 00618 ( 00619 DxfOleFrame *oleframe 00621 ) 00622 { 00623 #if DEBUG 00624 DXF_DEBUG_BEGIN 00625 #endif 00626 /* Do some basic checks. */ 00627 if (oleframe == NULL) 00628 { 00629 fprintf (stderr, 00630 (_("Error in %s () a NULL pointer was passed.\n")), 00631 __FUNCTION__); 00632 return (EXIT_FAILURE); 00633 } 00634 if (oleframe->id_code < 0) 00635 { 00636 fprintf (stderr, 00637 (_("Warning in %s () a negative value was found.\n")), 00638 __FUNCTION__); 00639 } 00640 #if DEBUG 00641 DXF_DEBUG_END 00642 #endif 00643 return (oleframe->id_code); 00644 } 00645 00646 00650 DxfOleFrame * 00651 dxf_oleframe_set_id_code 00652 ( 00653 DxfOleFrame *oleframe, 00655 int id_code 00659 ) 00660 { 00661 #if DEBUG 00662 DXF_DEBUG_BEGIN 00663 #endif 00664 /* Do some basic checks. */ 00665 if (oleframe == NULL) 00666 { 00667 fprintf (stderr, 00668 (_("Error in %s () a NULL pointer was passed.\n")), 00669 __FUNCTION__); 00670 return (NULL); 00671 } 00672 if (id_code < 0) 00673 { 00674 fprintf (stderr, 00675 (_("Warning in %s () a negative value was passed.\n")), 00676 __FUNCTION__); 00677 } 00678 oleframe->id_code = id_code; 00679 #if DEBUG 00680 DXF_DEBUG_END 00681 #endif 00682 return (oleframe); 00683 } 00684 00685 00691 char * 00692 dxf_oleframe_get_linetype 00693 ( 00694 DxfOleFrame *oleframe 00696 ) 00697 { 00698 #if DEBUG 00699 DXF_DEBUG_BEGIN 00700 #endif 00701 /* Do some basic checks. */ 00702 if (oleframe == NULL) 00703 { 00704 fprintf (stderr, 00705 (_("Error in %s () a NULL pointer was passed.\n")), 00706 __FUNCTION__); 00707 return (NULL); 00708 } 00709 if (oleframe->linetype == NULL) 00710 { 00711 fprintf (stderr, 00712 (_("Error in %s () a NULL pointer was found.\n")), 00713 __FUNCTION__); 00714 return (NULL); 00715 } 00716 #if DEBUG 00717 DXF_DEBUG_END 00718 #endif 00719 return (strdup (oleframe->linetype)); 00720 } 00721 00722 00726 DxfOleFrame * 00727 dxf_oleframe_set_linetype 00728 ( 00729 DxfOleFrame *oleframe, 00731 char *linetype 00733 ) 00734 { 00735 #if DEBUG 00736 DXF_DEBUG_BEGIN 00737 #endif 00738 /* Do some basic checks. */ 00739 if (oleframe == NULL) 00740 { 00741 fprintf (stderr, 00742 (_("Error in %s () a NULL pointer was passed.\n")), 00743 __FUNCTION__); 00744 return (NULL); 00745 } 00746 if (linetype == NULL) 00747 { 00748 fprintf (stderr, 00749 (_("Error in %s () a NULL pointer was passed.\n")), 00750 __FUNCTION__); 00751 return (NULL); 00752 } 00753 oleframe->linetype = strdup (linetype); 00754 #if DEBUG 00755 DXF_DEBUG_END 00756 #endif 00757 return (oleframe); 00758 } 00759 00760 00766 char * 00767 dxf_oleframe_get_layer 00768 ( 00769 DxfOleFrame *oleframe 00771 ) 00772 { 00773 #if DEBUG 00774 DXF_DEBUG_BEGIN 00775 #endif 00776 /* Do some basic checks. */ 00777 if (oleframe == NULL) 00778 { 00779 fprintf (stderr, 00780 (_("Error in %s () a NULL pointer was passed.\n")), 00781 __FUNCTION__); 00782 return (NULL); 00783 } 00784 if (oleframe->layer == NULL) 00785 { 00786 fprintf (stderr, 00787 (_("Error in %s () a NULL pointer was found.\n")), 00788 __FUNCTION__); 00789 return (NULL); 00790 } 00791 #if DEBUG 00792 DXF_DEBUG_END 00793 #endif 00794 return (strdup (oleframe->layer)); 00795 } 00796 00797 00801 DxfOleFrame * 00802 dxf_oleframe_set_layer 00803 ( 00804 DxfOleFrame *oleframe, 00806 char *layer 00808 ) 00809 { 00810 #if DEBUG 00811 DXF_DEBUG_BEGIN 00812 #endif 00813 /* Do some basic checks. */ 00814 if (oleframe == NULL) 00815 { 00816 fprintf (stderr, 00817 (_("Error in %s () a NULL pointer was passed.\n")), 00818 __FUNCTION__); 00819 return (NULL); 00820 } 00821 if (layer == NULL) 00822 { 00823 fprintf (stderr, 00824 (_("Error in %s () a NULL pointer was passed.\n")), 00825 __FUNCTION__); 00826 return (NULL); 00827 } 00828 oleframe->layer = strdup (layer); 00829 #if DEBUG 00830 DXF_DEBUG_END 00831 #endif 00832 return (oleframe); 00833 } 00834 00835 00841 double 00842 dxf_oleframe_get_elevation 00843 ( 00844 DxfOleFrame *oleframe 00846 ) 00847 { 00848 #if DEBUG 00849 DXF_DEBUG_BEGIN 00850 #endif 00851 /* Do some basic checks. */ 00852 if (oleframe == NULL) 00853 { 00854 fprintf (stderr, 00855 (_("Error in %s () a NULL pointer was passed.\n")), 00856 __FUNCTION__); 00857 return (EXIT_FAILURE); 00858 } 00859 #if DEBUG 00860 DXF_DEBUG_END 00861 #endif 00862 return (oleframe->elevation); 00863 } 00864 00865 00869 DxfOleFrame * 00870 dxf_oleframe_set_elevation 00871 ( 00872 DxfOleFrame *oleframe, 00874 double elevation 00876 ) 00877 { 00878 #if DEBUG 00879 DXF_DEBUG_BEGIN 00880 #endif 00881 /* Do some basic checks. */ 00882 if (oleframe == NULL) 00883 { 00884 fprintf (stderr, 00885 (_("Error in %s () a NULL pointer was passed.\n")), 00886 __FUNCTION__); 00887 return (NULL); 00888 } 00889 oleframe->elevation = elevation; 00890 #if DEBUG 00891 DXF_DEBUG_END 00892 #endif 00893 return (oleframe); 00894 } 00895 00896 00902 double 00903 dxf_oleframe_get_thickness 00904 ( 00905 DxfOleFrame *oleframe 00907 ) 00908 { 00909 #if DEBUG 00910 DXF_DEBUG_BEGIN 00911 #endif 00912 /* Do some basic checks. */ 00913 if (oleframe == NULL) 00914 { 00915 fprintf (stderr, 00916 (_("Error in %s () a NULL pointer was passed.\n")), 00917 __FUNCTION__); 00918 return (EXIT_FAILURE); 00919 } 00920 if (oleframe->thickness < 0.0) 00921 { 00922 fprintf (stderr, 00923 (_("Warning in %s () a negative value was found.\n")), 00924 __FUNCTION__); 00925 } 00926 #if DEBUG 00927 DXF_DEBUG_END 00928 #endif 00929 return (oleframe->thickness); 00930 } 00931 00932 00936 DxfOleFrame * 00937 dxf_oleframe_set_thickness 00938 ( 00939 DxfOleFrame *oleframe, 00941 double thickness 00943 ) 00944 { 00945 #if DEBUG 00946 DXF_DEBUG_BEGIN 00947 #endif 00948 /* Do some basic checks. */ 00949 if (oleframe == NULL) 00950 { 00951 fprintf (stderr, 00952 (_("Error in %s () a NULL pointer was passed.\n")), 00953 __FUNCTION__); 00954 return (NULL); 00955 } 00956 if (thickness < 0.0) 00957 { 00958 fprintf (stderr, 00959 (_("Warning in %s () a negative value was passed.\n")), 00960 __FUNCTION__); 00961 } 00962 oleframe->thickness = thickness; 00963 #if DEBUG 00964 DXF_DEBUG_END 00965 #endif 00966 return (oleframe); 00967 } 00968 00969 00975 double 00976 dxf_oleframe_get_linetype_scale 00977 ( 00978 DxfOleFrame *oleframe 00980 ) 00981 { 00982 #if DEBUG 00983 DXF_DEBUG_BEGIN 00984 #endif 00985 /* Do some basic checks. */ 00986 if (oleframe == NULL) 00987 { 00988 fprintf (stderr, 00989 (_("Error in %s () a NULL pointer was passed.\n")), 00990 __FUNCTION__); 00991 return (EXIT_FAILURE); 00992 } 00993 if (oleframe->linetype_scale < 0.0) 00994 { 00995 fprintf (stderr, 00996 (_("Warning in %s () a negative value was found.\n")), 00997 __FUNCTION__); 00998 } 00999 #if DEBUG 01000 DXF_DEBUG_END 01001 #endif 01002 return (oleframe->linetype_scale); 01003 } 01004 01005 01009 DxfOleFrame * 01010 dxf_oleframe_set_linetype_scale 01011 ( 01012 DxfOleFrame *oleframe, 01014 double linetype_scale 01016 ) 01017 { 01018 #if DEBUG 01019 DXF_DEBUG_BEGIN 01020 #endif 01021 /* Do some basic checks. */ 01022 if (oleframe == NULL) 01023 { 01024 fprintf (stderr, 01025 (_("Error in %s () a NULL pointer was passed.\n")), 01026 __FUNCTION__); 01027 return (NULL); 01028 } 01029 if (linetype_scale < 0.0) 01030 { 01031 fprintf (stderr, 01032 (_("Warning in %s () a negative value was passed.\n")), 01033 __FUNCTION__); 01034 } 01035 oleframe->linetype_scale = linetype_scale; 01036 #if DEBUG 01037 DXF_DEBUG_END 01038 #endif 01039 return (oleframe); 01040 } 01041 01042 01048 int16_t 01049 dxf_oleframe_get_visibility 01050 ( 01051 DxfOleFrame *oleframe 01053 ) 01054 { 01055 #if DEBUG 01056 DXF_DEBUG_BEGIN 01057 #endif 01058 /* Do some basic checks. */ 01059 if (oleframe == NULL) 01060 { 01061 fprintf (stderr, 01062 (_("Error in %s () a NULL pointer was passed.\n")), 01063 __FUNCTION__); 01064 return (EXIT_FAILURE); 01065 } 01066 if (oleframe->visibility < 0) 01067 { 01068 fprintf (stderr, 01069 (_("Warning in %s () a negative value was found.\n")), 01070 __FUNCTION__); 01071 } 01072 if (oleframe->visibility > 1) 01073 { 01074 fprintf (stderr, 01075 (_("Warning in %s () an out of range value was found.\n")), 01076 __FUNCTION__); 01077 } 01078 #if DEBUG 01079 DXF_DEBUG_END 01080 #endif 01081 return (oleframe->visibility); 01082 } 01083 01084 01088 DxfOleFrame * 01089 dxf_oleframe_set_visibility 01090 ( 01091 DxfOleFrame *oleframe, 01093 int16_t visibility 01095 ) 01096 { 01097 #if DEBUG 01098 DXF_DEBUG_BEGIN 01099 #endif 01100 /* Do some basic checks. */ 01101 if (oleframe == NULL) 01102 { 01103 fprintf (stderr, 01104 (_("Error in %s () a NULL pointer was passed.\n")), 01105 __FUNCTION__); 01106 return (NULL); 01107 } 01108 if (visibility < 0) 01109 { 01110 fprintf (stderr, 01111 (_("Warning in %s () a negative value was passed.\n")), 01112 __FUNCTION__); 01113 } 01114 if (visibility > 1) 01115 { 01116 fprintf (stderr, 01117 (_("Warning in %s () an out of range value was passed.\n")), 01118 __FUNCTION__); 01119 } 01120 oleframe->visibility = visibility; 01121 #if DEBUG 01122 DXF_DEBUG_END 01123 #endif 01124 return (oleframe); 01125 } 01126 01127 01133 int 01134 dxf_oleframe_get_color 01135 ( 01136 DxfOleFrame *oleframe 01138 ) 01139 { 01140 #if DEBUG 01141 DXF_DEBUG_BEGIN 01142 #endif 01143 /* Do some basic checks. */ 01144 if (oleframe == NULL) 01145 { 01146 fprintf (stderr, 01147 (_("Error in %s () a NULL pointer was passed.\n")), 01148 __FUNCTION__); 01149 return (EXIT_FAILURE); 01150 } 01151 if (oleframe->color < 0) 01152 { 01153 fprintf (stderr, 01154 (_("Warning in %s () a negative value was found.\n")), 01155 __FUNCTION__); 01156 } 01157 #if DEBUG 01158 DXF_DEBUG_END 01159 #endif 01160 return (oleframe->color); 01161 } 01162 01163 01167 DxfOleFrame * 01168 dxf_oleframe_set_color 01169 ( 01170 DxfOleFrame *oleframe, 01172 int color 01174 ) 01175 { 01176 #if DEBUG 01177 DXF_DEBUG_BEGIN 01178 #endif 01179 /* Do some basic checks. */ 01180 if (oleframe == NULL) 01181 { 01182 fprintf (stderr, 01183 (_("Error in %s () a NULL pointer was passed.\n")), 01184 __FUNCTION__); 01185 return (NULL); 01186 } 01187 if (color < 0) 01188 { 01189 fprintf (stderr, 01190 (_("Warning in %s () a negative value was passed.\n")), 01191 __FUNCTION__); 01192 } 01193 oleframe->color = color; 01194 #if DEBUG 01195 DXF_DEBUG_END 01196 #endif 01197 return (oleframe); 01198 } 01199 01200 01206 int 01207 dxf_oleframe_get_paperspace 01208 ( 01209 DxfOleFrame *oleframe 01211 ) 01212 { 01213 #if DEBUG 01214 DXF_DEBUG_BEGIN 01215 #endif 01216 /* Do some basic checks. */ 01217 if (oleframe == NULL) 01218 { 01219 fprintf (stderr, 01220 (_("Error in %s () a NULL pointer was passed.\n")), 01221 __FUNCTION__); 01222 return (EXIT_FAILURE); 01223 } 01224 if (oleframe->paperspace < 0) 01225 { 01226 fprintf (stderr, 01227 (_("Warning in %s () a negative value was found.\n")), 01228 __FUNCTION__); 01229 } 01230 if (oleframe->paperspace > 1) 01231 { 01232 fprintf (stderr, 01233 (_("Warning in %s () an out of range value was found.\n")), 01234 __FUNCTION__); 01235 } 01236 #if DEBUG 01237 DXF_DEBUG_END 01238 #endif 01239 return (oleframe->paperspace); 01240 } 01241 01242 01246 DxfOleFrame * 01247 dxf_oleframe_set_paperspace 01248 ( 01249 DxfOleFrame *oleframe, 01251 int paperspace 01254 ) 01255 { 01256 #if DEBUG 01257 DXF_DEBUG_BEGIN 01258 #endif 01259 /* Do some basic checks. */ 01260 if (oleframe == NULL) 01261 { 01262 fprintf (stderr, 01263 (_("Error in %s () a NULL pointer was passed.\n")), 01264 __FUNCTION__); 01265 return (NULL); 01266 } 01267 if (paperspace < 0) 01268 { 01269 fprintf (stderr, 01270 (_("Warning in %s () a negative value was passed.\n")), 01271 __FUNCTION__); 01272 } 01273 if (paperspace > 1) 01274 { 01275 fprintf (stderr, 01276 (_("Warning in %s () an out of range value was passed.\n")), 01277 __FUNCTION__); 01278 } 01279 oleframe->paperspace = paperspace; 01280 #if DEBUG 01281 DXF_DEBUG_END 01282 #endif 01283 return (oleframe); 01284 } 01285 01286 01294 int 01295 dxf_oleframe_get_graphics_data_size 01296 ( 01297 DxfOleFrame *oleframe 01299 ) 01300 { 01301 #if DEBUG 01302 DXF_DEBUG_BEGIN 01303 #endif 01304 /* Do some basic checks. */ 01305 if (oleframe == NULL) 01306 { 01307 fprintf (stderr, 01308 (_("Error in %s () a NULL pointer was passed.\n")), 01309 __FUNCTION__); 01310 return (EXIT_FAILURE); 01311 } 01312 if (oleframe->graphics_data_size < 0) 01313 { 01314 fprintf (stderr, 01315 (_("Warning in %s () a negative value was found.\n")), 01316 __FUNCTION__); 01317 } 01318 if (oleframe->graphics_data_size == 0) 01319 { 01320 fprintf (stderr, 01321 (_("Warning in %s () a zero value was found.\n")), 01322 __FUNCTION__); 01323 } 01324 #if DEBUG 01325 DXF_DEBUG_END 01326 #endif 01327 return (oleframe->graphics_data_size); 01328 } 01329 01330 01337 DxfOleFrame * 01338 dxf_oleframe_set_graphics_data_size 01339 ( 01340 DxfOleFrame *oleframe, 01342 int graphics_data_size 01345 ) 01346 { 01347 #if DEBUG 01348 DXF_DEBUG_BEGIN 01349 #endif 01350 /* Do some basic checks. */ 01351 if (oleframe == NULL) 01352 { 01353 fprintf (stderr, 01354 (_("Error in %s () a NULL pointer was passed.\n")), 01355 __FUNCTION__); 01356 return (NULL); 01357 } 01358 if (graphics_data_size < 0) 01359 { 01360 fprintf (stderr, 01361 (_("Error in %s () a negative value was passed.\n")), 01362 __FUNCTION__); 01363 return (NULL); 01364 } 01365 if (graphics_data_size == 0) 01366 { 01367 fprintf (stderr, 01368 (_("Warning in %s () a zero value was passed.\n")), 01369 __FUNCTION__); 01370 } 01371 oleframe->graphics_data_size = graphics_data_size; 01372 #if DEBUG 01373 DXF_DEBUG_END 01374 #endif 01375 return (oleframe); 01376 } 01377 01378 01385 int16_t 01386 dxf_oleframe_get_shadow_mode 01387 ( 01388 DxfOleFrame *oleframe 01390 ) 01391 { 01392 #if DEBUG 01393 DXF_DEBUG_BEGIN 01394 #endif 01395 /* Do some basic checks. */ 01396 if (oleframe == NULL) 01397 { 01398 fprintf (stderr, 01399 (_("Error in %s () a NULL pointer was passed.\n")), 01400 __FUNCTION__); 01401 return (EXIT_FAILURE); 01402 } 01403 if (oleframe->shadow_mode < 0) 01404 { 01405 fprintf (stderr, 01406 (_("Warning in %s () a negative value was found.\n")), 01407 __FUNCTION__); 01408 } 01409 if (oleframe->shadow_mode > 3) 01410 { 01411 fprintf (stderr, 01412 (_("Warning in %s () an out of range value was found.\n")), 01413 __FUNCTION__); 01414 } 01415 #if DEBUG 01416 DXF_DEBUG_END 01417 #endif 01418 return (oleframe->shadow_mode); 01419 } 01420 01421 01428 DxfOleFrame * 01429 dxf_oleframe_set_shadow_mode 01430 ( 01431 DxfOleFrame *oleframe, 01433 int16_t shadow_mode 01435 ) 01436 { 01437 #if DEBUG 01438 DXF_DEBUG_BEGIN 01439 #endif 01440 /* Do some basic checks. */ 01441 if (oleframe == NULL) 01442 { 01443 fprintf (stderr, 01444 (_("Error in %s () a NULL pointer was passed.\n")), 01445 __FUNCTION__); 01446 return (NULL); 01447 } 01448 if (shadow_mode < 0) 01449 { 01450 fprintf (stderr, 01451 (_("Warning in %s () a negative value was passed.\n")), 01452 __FUNCTION__); 01453 } 01454 if (shadow_mode > 3) 01455 { 01456 fprintf (stderr, 01457 (_("Warning in %s () an out of range value was passed.\n")), 01458 __FUNCTION__); 01459 } 01460 oleframe->shadow_mode = shadow_mode; 01461 #if DEBUG 01462 DXF_DEBUG_END 01463 #endif 01464 return (oleframe); 01465 } 01466 01467 01476 DxfBinaryGraphicsData * 01477 dxf_oleframe_get_binary_graphics_data 01478 ( 01479 DxfOleFrame *oleframe 01481 ) 01482 { 01483 #if DEBUG 01484 DXF_DEBUG_BEGIN 01485 #endif 01486 /* Do some basic checks. */ 01487 if (oleframe == NULL) 01488 { 01489 fprintf (stderr, 01490 (_("Error in %s () a NULL pointer was passed.\n")), 01491 __FUNCTION__); 01492 return (NULL); 01493 } 01494 if (oleframe->binary_graphics_data == NULL) 01495 { 01496 fprintf (stderr, 01497 (_("Error in %s () a NULL pointer was found.\n")), 01498 __FUNCTION__); 01499 return (NULL); 01500 } 01501 #if DEBUG 01502 DXF_DEBUG_END 01503 #endif 01504 return ((DxfBinaryGraphicsData *) oleframe->binary_graphics_data); 01505 } 01506 01507 01512 DxfOleFrame * 01513 dxf_oleframe_set_binary_graphics_data 01514 ( 01515 DxfOleFrame *oleframe, 01517 DxfBinaryGraphicsData *data 01520 ) 01521 { 01522 #if DEBUG 01523 DXF_DEBUG_BEGIN 01524 #endif 01525 /* Do some basic checks. */ 01526 if (oleframe == NULL) 01527 { 01528 fprintf (stderr, 01529 (_("Error in %s () a NULL pointer was passed.\n")), 01530 __FUNCTION__); 01531 return (NULL); 01532 } 01533 if (data == NULL) 01534 { 01535 fprintf (stderr, 01536 (_("Error in %s () a NULL pointer was passed.\n")), 01537 __FUNCTION__); 01538 return (NULL); 01539 } 01540 oleframe->binary_graphics_data = (DxfBinaryGraphicsData *) data; 01541 #if DEBUG 01542 DXF_DEBUG_END 01543 #endif 01544 return (oleframe); 01545 } 01546 01547 01556 char * 01557 dxf_oleframe_get_dictionary_owner_soft 01558 ( 01559 DxfOleFrame *oleframe 01561 ) 01562 { 01563 #if DEBUG 01564 DXF_DEBUG_BEGIN 01565 #endif 01566 /* Do some basic checks. */ 01567 if (oleframe == NULL) 01568 { 01569 fprintf (stderr, 01570 (_("Error in %s () a NULL pointer was passed.\n")), 01571 __FUNCTION__); 01572 return (NULL); 01573 } 01574 if (oleframe->dictionary_owner_soft == NULL) 01575 { 01576 fprintf (stderr, 01577 (_("Error in %s () a NULL pointer was found.\n")), 01578 __FUNCTION__); 01579 return (NULL); 01580 } 01581 #if DEBUG 01582 DXF_DEBUG_END 01583 #endif 01584 return (strdup (oleframe->dictionary_owner_soft)); 01585 } 01586 01587 01592 DxfOleFrame * 01593 dxf_oleframe_set_dictionary_owner_soft 01594 ( 01595 DxfOleFrame *oleframe, 01597 char *dictionary_owner_soft 01600 ) 01601 { 01602 #if DEBUG 01603 DXF_DEBUG_BEGIN 01604 #endif 01605 /* Do some basic checks. */ 01606 if (oleframe == NULL) 01607 { 01608 fprintf (stderr, 01609 (_("Error in %s () a NULL pointer was passed.\n")), 01610 __FUNCTION__); 01611 return (NULL); 01612 } 01613 if (dictionary_owner_soft == NULL) 01614 { 01615 fprintf (stderr, 01616 (_("Error in %s () a NULL pointer was passed.\n")), 01617 __FUNCTION__); 01618 return (NULL); 01619 } 01620 oleframe->dictionary_owner_soft = strdup (dictionary_owner_soft); 01621 #if DEBUG 01622 DXF_DEBUG_END 01623 #endif 01624 return (oleframe); 01625 } 01626 01627 01636 char * 01637 dxf_oleframe_get_material 01638 ( 01639 DxfOleFrame *oleframe 01641 ) 01642 { 01643 #if DEBUG 01644 DXF_DEBUG_BEGIN 01645 #endif 01646 /* Do some basic checks. */ 01647 if (oleframe == NULL) 01648 { 01649 fprintf (stderr, 01650 (_("Error in %s () a NULL pointer was passed.\n")), 01651 __FUNCTION__); 01652 return (NULL); 01653 } 01654 if (oleframe->material == NULL) 01655 { 01656 fprintf (stderr, 01657 (_("Error in %s () a NULL pointer was found.\n")), 01658 __FUNCTION__); 01659 return (NULL); 01660 } 01661 #if DEBUG 01662 DXF_DEBUG_END 01663 #endif 01664 return (strdup (oleframe->material)); 01665 } 01666 01667 01675 DxfOleFrame * 01676 dxf_oleframe_set_material 01677 ( 01678 DxfOleFrame *oleframe, 01680 char *material 01683 ) 01684 { 01685 #if DEBUG 01686 DXF_DEBUG_BEGIN 01687 #endif 01688 /* Do some basic checks. */ 01689 if (oleframe == NULL) 01690 { 01691 fprintf (stderr, 01692 (_("Error in %s () a NULL pointer was passed.\n")), 01693 __FUNCTION__); 01694 return (NULL); 01695 } 01696 if (material == NULL) 01697 { 01698 fprintf (stderr, 01699 (_("Error in %s () a NULL pointer was passed.\n")), 01700 __FUNCTION__); 01701 return (NULL); 01702 } 01703 oleframe->material = strdup (material); 01704 #if DEBUG 01705 DXF_DEBUG_END 01706 #endif 01707 return (oleframe); 01708 } 01709 01710 01719 char * 01720 dxf_oleframe_get_dictionary_owner_hard 01721 ( 01722 DxfOleFrame *oleframe 01724 ) 01725 { 01726 #if DEBUG 01727 DXF_DEBUG_BEGIN 01728 #endif 01729 /* Do some basic checks. */ 01730 if (oleframe == NULL) 01731 { 01732 fprintf (stderr, 01733 (_("Error in %s () a NULL pointer was passed.\n")), 01734 __FUNCTION__); 01735 return (NULL); 01736 } 01737 if (oleframe->dictionary_owner_hard == NULL) 01738 { 01739 fprintf (stderr, 01740 (_("Error in %s () a NULL pointer was found.\n")), 01741 __FUNCTION__); 01742 return (NULL); 01743 } 01744 #if DEBUG 01745 DXF_DEBUG_END 01746 #endif 01747 return (strdup (oleframe->dictionary_owner_hard)); 01748 } 01749 01750 01755 DxfOleFrame * 01756 dxf_oleframe_set_dictionary_owner_hard 01757 ( 01758 DxfOleFrame *oleframe, 01760 char *dictionary_owner_hard 01763 ) 01764 { 01765 #if DEBUG 01766 DXF_DEBUG_BEGIN 01767 #endif 01768 /* Do some basic checks. */ 01769 if (oleframe == NULL) 01770 { 01771 fprintf (stderr, 01772 (_("Error in %s () a NULL pointer was passed.\n")), 01773 __FUNCTION__); 01774 return (NULL); 01775 } 01776 if (dictionary_owner_hard == NULL) 01777 { 01778 fprintf (stderr, 01779 (_("Error in %s () a NULL pointer was passed.\n")), 01780 __FUNCTION__); 01781 return (NULL); 01782 } 01783 oleframe->dictionary_owner_hard = strdup (dictionary_owner_hard); 01784 #if DEBUG 01785 DXF_DEBUG_END 01786 #endif 01787 return (oleframe); 01788 } 01789 01790 01797 int16_t 01798 dxf_oleframe_get_lineweight 01799 ( 01800 DxfOleFrame *oleframe 01802 ) 01803 { 01804 #if DEBUG 01805 DXF_DEBUG_BEGIN 01806 #endif 01807 /* Do some basic checks. */ 01808 if (oleframe == NULL) 01809 { 01810 fprintf (stderr, 01811 (_("Error in %s () a NULL pointer was passed.\n")), 01812 __FUNCTION__); 01813 return (EXIT_FAILURE); 01814 } 01815 #if DEBUG 01816 DXF_DEBUG_END 01817 #endif 01818 return (oleframe->lineweight); 01819 } 01820 01821 01828 DxfOleFrame * 01829 dxf_oleframe_set_lineweight 01830 ( 01831 DxfOleFrame *oleframe, 01833 int16_t lineweight 01835 ) 01836 { 01837 #if DEBUG 01838 DXF_DEBUG_BEGIN 01839 #endif 01840 /* Do some basic checks. */ 01841 if (oleframe == NULL) 01842 { 01843 fprintf (stderr, 01844 (_("Error in %s () a NULL pointer was passed.\n")), 01845 __FUNCTION__); 01846 return (NULL); 01847 } 01848 oleframe->lineweight = lineweight; 01849 #if DEBUG 01850 DXF_DEBUG_END 01851 #endif 01852 return (oleframe); 01853 } 01854 01855 01862 char * 01863 dxf_oleframe_get_plot_style_name 01864 ( 01865 DxfOleFrame *oleframe 01867 ) 01868 { 01869 #if DEBUG 01870 DXF_DEBUG_BEGIN 01871 #endif 01872 /* Do some basic checks. */ 01873 if (oleframe == NULL) 01874 { 01875 fprintf (stderr, 01876 (_("Error in %s () a NULL pointer was passed.\n")), 01877 __FUNCTION__); 01878 return (NULL); 01879 } 01880 if (oleframe->plot_style_name == NULL) 01881 { 01882 fprintf (stderr, 01883 (_("Error in %s () a NULL pointer was found.\n")), 01884 __FUNCTION__); 01885 return (NULL); 01886 } 01887 #if DEBUG 01888 DXF_DEBUG_END 01889 #endif 01890 return (strdup (oleframe->plot_style_name)); 01891 } 01892 01893 01900 DxfOleFrame * 01901 dxf_oleframe_set_plot_style_name 01902 ( 01903 DxfOleFrame *oleframe, 01905 char *plot_style_name 01908 ) 01909 { 01910 #if DEBUG 01911 DXF_DEBUG_BEGIN 01912 #endif 01913 /* Do some basic checks. */ 01914 if (oleframe == NULL) 01915 { 01916 fprintf (stderr, 01917 (_("Error in %s () a NULL pointer was passed.\n")), 01918 __FUNCTION__); 01919 return (NULL); 01920 } 01921 if (plot_style_name == NULL) 01922 { 01923 fprintf (stderr, 01924 (_("Error in %s () a NULL pointer was passed.\n")), 01925 __FUNCTION__); 01926 return (NULL); 01927 } 01928 oleframe->plot_style_name = strdup (plot_style_name); 01929 #if DEBUG 01930 DXF_DEBUG_END 01931 #endif 01932 return (oleframe); 01933 } 01934 01935 01942 long 01943 dxf_oleframe_get_color_value 01944 ( 01945 DxfOleFrame *oleframe 01947 ) 01948 { 01949 #if DEBUG 01950 DXF_DEBUG_BEGIN 01951 #endif 01952 /* Do some basic checks. */ 01953 if (oleframe == NULL) 01954 { 01955 fprintf (stderr, 01956 (_("Error in %s () a NULL pointer was passed.\n")), 01957 __FUNCTION__); 01958 return (EXIT_FAILURE); 01959 } 01960 #if DEBUG 01961 DXF_DEBUG_END 01962 #endif 01963 return (oleframe->color_value); 01964 } 01965 01966 01973 DxfOleFrame * 01974 dxf_oleframe_set_color_value 01975 ( 01976 DxfOleFrame *oleframe, 01978 long color_value 01980 ) 01981 { 01982 #if DEBUG 01983 DXF_DEBUG_BEGIN 01984 #endif 01985 /* Do some basic checks. */ 01986 if (oleframe == NULL) 01987 { 01988 fprintf (stderr, 01989 (_("Error in %s () a NULL pointer was passed.\n")), 01990 __FUNCTION__); 01991 return (NULL); 01992 } 01993 oleframe->color_value = color_value; 01994 #if DEBUG 01995 DXF_DEBUG_END 01996 #endif 01997 return (oleframe); 01998 } 01999 02000 02007 char * 02008 dxf_oleframe_get_color_name 02009 ( 02010 DxfOleFrame *oleframe 02012 ) 02013 { 02014 #if DEBUG 02015 DXF_DEBUG_BEGIN 02016 #endif 02017 /* Do some basic checks. */ 02018 if (oleframe == NULL) 02019 { 02020 fprintf (stderr, 02021 (_("Error in %s () a NULL pointer was passed.\n")), 02022 __FUNCTION__); 02023 return (NULL); 02024 } 02025 if (oleframe->color_name == NULL) 02026 { 02027 fprintf (stderr, 02028 (_("Error in %s () a NULL pointer was found.\n")), 02029 __FUNCTION__); 02030 return (NULL); 02031 } 02032 #if DEBUG 02033 DXF_DEBUG_END 02034 #endif 02035 return (strdup (oleframe->color_name)); 02036 } 02037 02038 02045 DxfOleFrame * 02046 dxf_oleframe_set_color_name 02047 ( 02048 DxfOleFrame *oleframe, 02050 char *color_name 02053 ) 02054 { 02055 #if DEBUG 02056 DXF_DEBUG_BEGIN 02057 #endif 02058 /* Do some basic checks. */ 02059 if (oleframe == NULL) 02060 { 02061 fprintf (stderr, 02062 (_("Error in %s () a NULL pointer was passed.\n")), 02063 __FUNCTION__); 02064 return (NULL); 02065 } 02066 if (color_name == NULL) 02067 { 02068 fprintf (stderr, 02069 (_("Error in %s () a NULL pointer was passed.\n")), 02070 __FUNCTION__); 02071 return (NULL); 02072 } 02073 oleframe->color_name = strdup (color_name); 02074 #if DEBUG 02075 DXF_DEBUG_END 02076 #endif 02077 return (oleframe); 02078 } 02079 02080 02087 long 02088 dxf_oleframe_get_transparency 02089 ( 02090 DxfOleFrame *oleframe 02092 ) 02093 { 02094 #if DEBUG 02095 DXF_DEBUG_BEGIN 02096 #endif 02097 /* Do some basic checks. */ 02098 if (oleframe == NULL) 02099 { 02100 fprintf (stderr, 02101 (_("Error in %s () a NULL pointer was passed.\n")), 02102 __FUNCTION__); 02103 return (EXIT_FAILURE); 02104 } 02105 #if DEBUG 02106 DXF_DEBUG_END 02107 #endif 02108 return (oleframe->transparency); 02109 } 02110 02111 02118 DxfOleFrame * 02119 dxf_oleframe_set_transparency 02120 ( 02121 DxfOleFrame *oleframe, 02123 long transparency 02125 ) 02126 { 02127 #if DEBUG 02128 DXF_DEBUG_BEGIN 02129 #endif 02130 /* Do some basic checks. */ 02131 if (oleframe == NULL) 02132 { 02133 fprintf (stderr, 02134 (_("Error in %s () a NULL pointer was passed.\n")), 02135 __FUNCTION__); 02136 return (NULL); 02137 } 02138 oleframe->transparency = transparency; 02139 #if DEBUG 02140 DXF_DEBUG_END 02141 #endif 02142 return (oleframe); 02143 } 02144 02145 02151 int 02152 dxf_oleframe_get_ole_version_number 02153 ( 02154 DxfOleFrame *oleframe 02156 ) 02157 { 02158 #if DEBUG 02159 DXF_DEBUG_BEGIN 02160 #endif 02161 /* Do some basic checks. */ 02162 if (oleframe == NULL) 02163 { 02164 fprintf (stderr, 02165 (_("Error in %s () a NULL pointer was passed.\n")), 02166 __FUNCTION__); 02167 return (EXIT_FAILURE); 02168 } 02169 if (oleframe->ole_version_number < 0) 02170 { 02171 fprintf (stderr, 02172 (_("Warning in %s () a negative value was found.\n")), 02173 __FUNCTION__); 02174 } 02175 #if DEBUG 02176 DXF_DEBUG_END 02177 #endif 02178 return (oleframe->ole_version_number); 02179 } 02180 02181 02185 DxfOleFrame * 02186 dxf_oleframe_set_ole_version_number 02187 ( 02188 DxfOleFrame *oleframe, 02190 int ole_version_number 02192 ) 02193 { 02194 #if DEBUG 02195 DXF_DEBUG_BEGIN 02196 #endif 02197 /* Do some basic checks. */ 02198 if (oleframe == NULL) 02199 { 02200 fprintf (stderr, 02201 (_("Error in %s () a NULL pointer was passed.\n")), 02202 __FUNCTION__); 02203 return (NULL); 02204 } 02205 if (ole_version_number < 0) 02206 { 02207 fprintf (stderr, 02208 (_("Warning in %s () a negative value was passed.\n")), 02209 __FUNCTION__); 02210 } 02211 oleframe->ole_version_number = ole_version_number; 02212 #if DEBUG 02213 DXF_DEBUG_END 02214 #endif 02215 return (oleframe); 02216 } 02217 02218 02225 long 02226 dxf_oleframe_get_length 02227 ( 02228 DxfOleFrame *oleframe 02230 ) 02231 { 02232 #if DEBUG 02233 DXF_DEBUG_BEGIN 02234 #endif 02235 /* Do some basic checks. */ 02236 if (oleframe == NULL) 02237 { 02238 fprintf (stderr, 02239 (_("Error in %s () a NULL pointer was passed.\n")), 02240 __FUNCTION__); 02241 return (EXIT_FAILURE); 02242 } 02243 #if DEBUG 02244 DXF_DEBUG_END 02245 #endif 02246 return (oleframe->length); 02247 } 02248 02249 02256 DxfOleFrame * 02257 dxf_oleframe_set_length 02258 ( 02259 DxfOleFrame *oleframe, 02261 long length 02263 ) 02264 { 02265 #if DEBUG 02266 DXF_DEBUG_BEGIN 02267 #endif 02268 /* Do some basic checks. */ 02269 if (oleframe == NULL) 02270 { 02271 fprintf (stderr, 02272 (_("Error in %s () a NULL pointer was passed.\n")), 02273 __FUNCTION__); 02274 return (NULL); 02275 } 02276 oleframe->length = length; 02277 #if DEBUG 02278 DXF_DEBUG_END 02279 #endif 02280 return (oleframe); 02281 } 02282 02283 02292 DxfChar * 02293 dxf_oleframe_get_binary_data 02294 ( 02295 DxfOleFrame *oleframe 02297 ) 02298 { 02299 #if DEBUG 02300 DXF_DEBUG_BEGIN 02301 #endif 02302 /* Do some basic checks. */ 02303 if (oleframe == NULL) 02304 { 02305 fprintf (stderr, 02306 (_("Error in %s () a NULL pointer was passed.\n")), 02307 __FUNCTION__); 02308 return (NULL); 02309 } 02310 if (oleframe->binary_data == NULL) 02311 { 02312 fprintf (stderr, 02313 (_("Error in %s () a NULL pointer was found.\n")), 02314 __FUNCTION__); 02315 return (NULL); 02316 } 02317 #if DEBUG 02318 DXF_DEBUG_END 02319 #endif 02320 return (oleframe->binary_data); 02321 } 02322 02323 02332 DxfOleFrame * 02333 dxf_oleframe_set_binary_data 02334 ( 02335 DxfOleFrame *oleframe, 02337 DxfChar *binary_data 02339 ) 02340 { 02341 #if DEBUG 02342 DXF_DEBUG_BEGIN 02343 #endif 02344 /* Do some basic checks. */ 02345 if (oleframe == NULL) 02346 { 02347 fprintf (stderr, 02348 (_("Error in %s () a NULL pointer was passed.\n")), 02349 __FUNCTION__); 02350 return (NULL); 02351 } 02352 if (binary_data == NULL) 02353 { 02354 fprintf (stderr, 02355 (_("Error in %s () a NULL pointer was passed.\n")), 02356 __FUNCTION__); 02357 return (NULL); 02358 } 02359 oleframe->binary_data = binary_data; 02360 #if DEBUG 02361 DXF_DEBUG_END 02362 #endif 02363 return (oleframe); 02364 } 02365 02366 02375 DxfOleFrame * 02376 dxf_oleframe_get_next 02377 ( 02378 DxfOleFrame *oleframe 02380 ) 02381 { 02382 #if DEBUG 02383 DXF_DEBUG_BEGIN 02384 #endif 02385 /* Do some basic checks. */ 02386 if (oleframe == NULL) 02387 { 02388 fprintf (stderr, 02389 (_("Error in %s () a NULL pointer was passed.\n")), 02390 __FUNCTION__); 02391 return (NULL); 02392 } 02393 if (oleframe->next == NULL) 02394 { 02395 fprintf (stderr, 02396 (_("Error in %s () a NULL pointer was found.\n")), 02397 __FUNCTION__); 02398 return (NULL); 02399 } 02400 #if DEBUG 02401 DXF_DEBUG_END 02402 #endif 02403 return ((DxfOleFrame *) oleframe->next); 02404 } 02405 02406 02411 DxfOleFrame * 02412 dxf_oleframe_set_next 02413 ( 02414 DxfOleFrame *oleframe, 02416 DxfOleFrame *next 02418 ) 02419 { 02420 #if DEBUG 02421 DXF_DEBUG_BEGIN 02422 #endif 02423 /* Do some basic checks. */ 02424 if (oleframe == NULL) 02425 { 02426 fprintf (stderr, 02427 (_("Error in %s () a NULL pointer was passed.\n")), 02428 __FUNCTION__); 02429 return (NULL); 02430 } 02431 if (next == NULL) 02432 { 02433 fprintf (stderr, 02434 (_("Error in %s () a NULL pointer was passed.\n")), 02435 __FUNCTION__); 02436 return (NULL); 02437 } 02438 oleframe->next = (struct DxfOleFrame *) next; 02439 #if DEBUG 02440 DXF_DEBUG_END 02441 #endif 02442 return (oleframe); 02443 } 02444 02445 02454 DxfOleFrame * 02455 dxf_oleframe_get_last 02456 ( 02457 DxfOleFrame *oleframe 02459 ) 02460 { 02461 #if DEBUG 02462 DXF_DEBUG_BEGIN 02463 #endif 02464 /* Do some basic checks. */ 02465 if (oleframe == NULL) 02466 { 02467 fprintf (stderr, 02468 (_("Error in %s () a NULL pointer was passed.\n")), 02469 __FUNCTION__); 02470 return (NULL); 02471 } 02472 if (oleframe->next == NULL) 02473 { 02474 fprintf (stderr, 02475 (_("Warning in %s () a NULL pointer was found.\n")), 02476 __FUNCTION__); 02477 return ((DxfOleFrame *) oleframe); 02478 } 02479 DxfOleFrame *iter = (DxfOleFrame *) oleframe->next; 02480 while (iter->next != NULL) 02481 { 02482 iter = (DxfOleFrame *) iter->next; 02483 } 02484 #if DEBUG 02485 DXF_DEBUG_END 02486 #endif 02487 return ((DxfOleFrame *) iter); 02488 } 02489 02490 02491 /* EOF */