Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

include/gimp-print/util.h

Go to the documentation of this file.
00001 /*
00002  * "$Id: util.h,v 1.7 2004/05/09 16:06:05 rleigh 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 extern void stp_abort(void);
00071 
00072 /*
00073  * Remove inactive and unclaimed options from the list
00074  */
00075 extern void stp_prune_inactive_options(stp_vars_t *v);
00076 
00077 
00078 extern void stp_zprintf(const stp_vars_t *v, const char *format, ...)
00079        __attribute__((format(__printf__, 2, 3)));
00080 
00081 extern void stp_zfwrite(const char *buf, size_t bytes, size_t nitems,
00082                         const stp_vars_t *v);
00083 
00084 extern void stp_putc(int ch, const stp_vars_t *v);
00085 extern void stp_put16_le(unsigned short sh, const stp_vars_t *v);
00086 extern void stp_put16_be(unsigned short sh, const stp_vars_t *v);
00087 extern void stp_put32_le(unsigned int sh, const stp_vars_t *v);
00088 extern void stp_put32_be(unsigned int sh, const stp_vars_t *v);
00089 extern void stp_puts(const char *s, const stp_vars_t *v);
00090 extern void stp_send_command(const stp_vars_t *v, const char *command,
00091                              const char *format, ...);
00092 
00093 extern void stp_erputc(int ch);
00094 
00095 extern void stp_eprintf(const stp_vars_t *v, const char *format, ...)
00096        __attribute__((format(__printf__, 2, 3)));
00097 extern void stp_erprintf(const char *format, ...)
00098        __attribute__((format(__printf__, 1, 2)));
00099 extern void stp_asprintf(char **strp, const char *format, ...)
00100        __attribute__((format(__printf__, 2, 3)));
00101 extern void stp_catprintf(char **strp, const char *format, ...)
00102        __attribute__((format(__printf__, 2, 3)));
00103 
00104 #define STP_DBG_LUT             0x1
00105 #define STP_DBG_COLORFUNC       0x2
00106 #define STP_DBG_INK             0x4
00107 #define STP_DBG_PS              0x8
00108 #define STP_DBG_PCL             0x10
00109 #define STP_DBG_ESCP2           0x20
00110 #define STP_DBG_CANON           0x40
00111 #define STP_DBG_LEXMARK         0x80
00112 #define STP_DBG_WEAVE_PARAMS    0x100
00113 #define STP_DBG_ROWS            0x200
00114 #define STP_DBG_MARK_FILE      0x400
00115 #define STP_DBG_LIST           0x800
00116 #define STP_DBG_MODULE         0x1000
00117 #define STP_DBG_PATH           0x2000
00118 #define STP_DBG_PAPER          0x4000
00119 #define STP_DBG_PRINTERS       0x8000
00120 #define STP_DBG_XML            0x10000
00121 #define STP_DBG_VARS           0x20000
00122 #define STP_DBG_OLYMPUS        0x40000
00123 
00124 extern unsigned long stp_get_debug_level(void);
00125 extern void stp_dprintf(unsigned long level, const stp_vars_t *v,
00126                         const char *format, ...)
00127        __attribute__((format(__printf__, 3, 4)));
00128 extern void stp_deprintf(unsigned long level, const char *format, ...)
00129        __attribute__((format(__printf__, 2, 3)));
00130 extern void stp_init_debug_messages(stp_vars_t *v);
00131 extern void stp_flush_debug_messages(stp_vars_t *v);
00132 
00133 
00134 extern void *stp_malloc (size_t);
00135 extern void *stp_zalloc (size_t);
00136 extern void *stp_realloc (void *ptr, size_t);
00137 extern void stp_free(void *ptr);
00138 
00139 #define STP_SAFE_FREE(x)                        \
00140 do                                              \
00141 {                                               \
00142   if ((x))                                      \
00143     stp_free((char *)(x));                      \
00144   ((x)) = NULL;                                 \
00145 } while (0)
00146 
00147 extern size_t stp_strlen(const char *s);
00148 extern char *stp_strndup(const char *s, int n);
00149 extern char *stp_strdup(const char *s);
00150 
00153 #ifdef __cplusplus
00154   }
00155 #endif
00156 
00157 #endif /* GIMP_PRINT_UTIL_H */
00158 /*
00159  * End of "$Id: util.h,v 1.7 2004/05/09 16:06:05 rleigh Exp $".
00160  */

Generated on Wed May 12 20:21:27 2004 for libgimpprint API Reference by doxygen1.2.17