Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

include/gimp-print/util.h

Go to the documentation of this file.
00001 /*
00002  * "$Id: util.h,v 1.9 2004/05/30 01:26:15 rlk Exp $"
00003  *
00004  *   libgimpprint utility and miscellaneous functions.
00005  *
00006  *   Copyright 1997-2000 Michael Sweet (mike@easysw.com) and
00007  *      Robert Krawitz (rlk@alum.mit.edu)
00008  *
00009  *   This program is free software; you can redistribute it and/or modify it
00010  *   under the terms of the GNU General Public License as published by the Free
00011  *   Software Foundation; either version 2 of the License, or (at your option)
00012  *   any later version.
00013  *
00014  *   This program is distributed in the hope that it will be useful, but
00015  *   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00016  *   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00017  *   for more details.
00018  *
00019  *   You should have received a copy of the GNU General Public License
00020  *   along with this program; if not, write to the Free Software
00021  *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00022  */
00023 
00029 #ifndef GIMP_PRINT_UTIL_H
00030 #define GIMP_PRINT_UTIL_H
00031 
00032 #include <gimp-print/curve.h>
00033 #include <gimp-print/vars.h>
00034 
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038 
00053 extern int stp_init(void);
00054 
00066 extern const char *stp_set_output_codeset(const char *codeset);
00067 
00068 extern stp_curve_t *stp_read_and_compose_curves(const char *s1, const char *s2,
00069                                                 stp_curve_compose_t comp,
00070                                                 size_t piecewise_point_count);
00071 extern void stp_abort(void);
00072 
00073 /*
00074  * Remove inactive and unclaimed options from the list
00075  */
00076 extern void stp_prune_inactive_options(stp_vars_t *v);
00077 
00078 
00079 extern void stp_zprintf(const stp_vars_t *v, const char *format, ...)
00080        __attribute__((format(__printf__, 2, 3)));
00081 
00082 extern void stp_zfwrite(const char *buf, size_t bytes, size_t nitems,
00083                         const stp_vars_t *v);
00084 
00085 extern void stp_putc(int ch, const stp_vars_t *v);
00086 extern void stp_put16_le(unsigned short sh, const stp_vars_t *v);
00087 extern void stp_put16_be(unsigned short sh, const stp_vars_t *v);
00088 extern void stp_put32_le(unsigned int sh, const stp_vars_t *v);
00089 extern void stp_put32_be(unsigned int sh, const stp_vars_t *v);
00090 extern void stp_puts(const char *s, const stp_vars_t *v);
00091 extern void stp_send_command(const stp_vars_t *v, const char *command,
00092                              const char *format, ...);
00093 
00094 extern void stp_erputc(int ch);
00095 
00096 extern void stp_eprintf(const stp_vars_t *v, const char *format, ...)
00097        __attribute__((format(__printf__, 2, 3)));
00098 extern void stp_erprintf(const char *format, ...)
00099        __attribute__((format(__printf__, 1, 2)));
00100 extern void stp_asprintf(char **strp, const char *format, ...)
00101        __attribute__((format(__printf__, 2, 3)));
00102 extern void stp_catprintf(char **strp, const char *format, ...)
00103        __attribute__((format(__printf__, 2, 3)));
00104 
00105 #define STP_DBG_LUT             0x1
00106 #define STP_DBG_COLORFUNC       0x2
00107 #define STP_DBG_INK             0x4
00108 #define STP_DBG_PS              0x8
00109 #define STP_DBG_PCL             0x10
00110 #define STP_DBG_ESCP2           0x20
00111 #define STP_DBG_CANON           0x40
00112 #define STP_DBG_LEXMARK         0x80
00113 #define STP_DBG_WEAVE_PARAMS    0x100
00114 #define STP_DBG_ROWS            0x200
00115 #define STP_DBG_MARK_FILE       0x400
00116 #define STP_DBG_LIST            0x800
00117 #define STP_DBG_MODULE          0x1000
00118 #define STP_DBG_PATH            0x2000
00119 #define STP_DBG_PAPER           0x4000
00120 #define STP_DBG_PRINTERS        0x8000
00121 #define STP_DBG_XML             0x10000
00122 #define STP_DBG_VARS            0x20000
00123 #define STP_DBG_OLYMPUS         0x40000
00124 #define STP_DBG_CURVE           0x80000
00125 #define STP_DBG_CURVE_ERRORS    0x100000
00126 
00127 extern unsigned long stp_get_debug_level(void);
00128 extern void stp_dprintf(unsigned long level, const stp_vars_t *v,
00129                         const char *format, ...)
00130        __attribute__((format(__printf__, 3, 4)));
00131 extern void stp_deprintf(unsigned long level, const char *format, ...)
00132        __attribute__((format(__printf__, 2, 3)));
00133 extern void stp_init_debug_messages(stp_vars_t *v);
00134 extern void stp_flush_debug_messages(stp_vars_t *v);
00135 
00136 
00137 extern void *stp_malloc (size_t);
00138 extern void *stp_zalloc (size_t);
00139 extern void *stp_realloc (void *ptr, size_t);
00140 extern void stp_free(void *ptr);
00141 
00142 #define STP_SAFE_FREE(x)                        \
00143 do                                              \
00144 {                                               \
00145   if ((x))                                      \
00146     stp_free((char *)(x));                      \
00147   ((x)) = NULL;                                 \
00148 } while (0)
00149 
00150 extern size_t stp_strlen(const char *s);
00151 extern char *stp_strndup(const char *s, int n);
00152 extern char *stp_strdup(const char *s);
00153 
00156 #ifdef __cplusplus
00157   }
00158 #endif
00159 
00160 #endif /* GIMP_PRINT_UTIL_H */
00161 /*
00162  * End of "$Id: util.h,v 1.9 2004/05/30 01:26:15 rlk Exp $".
00163  */

Generated on Wed Aug 25 07:56:13 2004 for libgimpprint API Reference by doxygen 1.3.6