libDXF 0.0.1
A library with DXF related functions written in C.
|
00001 00038 #ifndef LIBDXF_SRC_UTIL_H 00039 #define LIBDXF_SRC_UTIL_H 00040 00041 #include "global.h" 00042 #include "file.h" 00043 00044 00045 #ifdef __cplusplus 00046 extern "C" { 00047 #endif 00048 00049 00051 #define dxf_return_val_if_fail(expr, val) if (!expr) return val; 00052 00054 enum return_state { FAIL = 0, SUCCESS, FOUND }; 00055 00056 #define dxf_return(expr) switch(expr) \ 00057 { \ 00058 case FAIL: \ 00059 return FAIL; \ 00060 break; \ 00061 case FOUND: \ 00062 return FOUND; \ 00063 break; \ 00064 } 00065 00066 00067 DxfChar *dxf_char_new (); 00068 DxfChar *dxf_char_init (DxfChar *c); 00069 int dxf_char_free (DxfChar *c); 00070 int dxf_char_free_chain (DxfChar *chars); 00071 DxfDouble *dxf_double_new (); 00072 DxfDouble *dxf_double_init (DxfDouble *d); 00073 int dxf_double_free (DxfDouble *d); 00074 int dxf_double_free_chain (DxfDouble *doubles); 00075 DxfInt *dxf_int_new (); 00076 DxfInt *dxf_int_init (DxfInt *i); 00077 int dxf_int_free (DxfInt *i); 00078 int dxf_int_free_chain (DxfInt *ints); 00079 int dxf_read_is_double (int type); 00080 int dxf_read_is_int (int type); 00081 int dxf_read_is_string (int type); 00082 int dxf_read_line (char * temp_string, DxfFile *fp); 00083 int dxf_read_scanf (DxfFile *fp, const char *template, ...); 00084 DxfFile *dxf_read_init (const char *filename); 00085 void dxf_read_close (DxfFile *file); 00086 00087 00088 #ifdef __cplusplus 00089 } 00090 #endif 00091 00092 00093 #endif /* LIBDXF_SRC_UTIL_H */ 00094 00095 00096 /* EOF */