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

print-util.c File Reference

#include <gutenprint/gutenprint.h>
#include "gutenprint-internal.h"
#include <gutenprint/gutenprint-intl-internal.h>
#include <math.h>
#include <limits.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "generic-options.h"

Go to the source code of this file.

Defines

#define FMIN(a, b)   ((a) < (b) ? (a) : (b))
#define STPI_VASPRINTF(result, bytes, format)
#define BYTE(expr, byteno)   (((expr) >> (8 * byteno)) & 0xff)

Functions

void stp_zprintf (const stp_vars_t *v, const char *format,...)
void stp_asprintf (char **strp, const char *format,...)
void stp_catprintf (char **strp, const char *format,...)
void stp_zfwrite (const char *buf, size_t bytes, size_t nitems, const stp_vars_t *v)
void stp_putc (int ch, const stp_vars_t *v)
void stp_put16_le (unsigned short sh, const stp_vars_t *v)
void stp_put16_be (unsigned short sh, const stp_vars_t *v)
void stp_put32_le (unsigned int in, const stp_vars_t *v)
void stp_put32_be (unsigned int in, const stp_vars_t *v)
void stp_puts (const char *s, const stp_vars_t *v)
void stp_send_command (const stp_vars_t *v, const char *command, const char *format,...)
void stp_eprintf (const stp_vars_t *v, const char *format,...)
void stp_erputc (int ch)
void stp_erprintf (const char *format,...)
static void stpi_init_debug (void)
unsigned long stp_get_debug_level (void)
void stp_dprintf (unsigned long level, const stp_vars_t *v, const char *format,...)
void stp_deprintf (unsigned long level, const char *format,...)
static void fill_buffer_writefunc (void *priv, const char *buffer, size_t bytes)
void stp_init_debug_messages (stp_vars_t *v)
void stp_flush_debug_messages (stp_vars_t *v)
void * stp_malloc (size_t size)
void * stp_zalloc (size_t size)
void * stp_realloc (void *ptr, size_t size)
void stp_free (void *ptr)
int stp_init (void)
 Initialise libgimpprint.
size_t stp_strlen (const char *s)
char * stp_strndup (const char *s, int n)
char * stp_strdup (const char *s)
const char * stp_set_output_codeset (const char *codeset)
 Set the output encoding.
stp_curve_tstp_read_and_compose_curves (const char *s1, const char *s2, stp_curve_compose_t comp, size_t piecewise_point_count)
void stp_merge_printvars (stp_vars_t *user, const stp_vars_t *print)
 Merge defaults for a printer with user-chosen settings.
stp_parameter_list_t stp_get_parameter_list (const stp_vars_t *v)
 List the available parameters for the currently chosen settings.
void stp_abort (void)

Variables

static unsigned long stpi_debug_level = 0
void *(* stp_malloc_func )(size_t size) = malloc
void *(* stpi_realloc_func )(void *ptr, size_t size) = realloc
void(* stpi_free_func )(void *ptr) = free


Define Documentation

#define BYTE expr,
byteno   )     (((expr) >> (8 * byteno)) & 0xff)
 

Definition at line 134 of file print-util.c.

Referenced by stp_put16_be(), stp_put16_le(), stp_put32_be(), and stp_put32_le().

#define FMIN a,
 )     ((a) < (b) ? (a) : (b))
 

Definition at line 50 of file print-util.c.

#define STPI_VASPRINTF result,
bytes,
format   ) 
 

Value:

{                                                                       \
  int current_allocation = 64;                                          \
  result = stp_malloc(current_allocation);                              \
  while (1)                                                             \
    {                                                                   \
      va_list args;                                                     \
      va_start(args, format);                                           \
      bytes = vsnprintf(result, current_allocation, format, args);      \
      va_end(args);                                                     \
      if (bytes >= 0 && bytes < current_allocation)                     \
        break;                                                          \
      else                                                              \
        {                                                               \
          stp_free (result);                                            \
          if (bytes < 0)                                                \
            current_allocation *= 2;                                    \
          else                                                          \
            current_allocation = bytes + 1;                             \
          result = stp_malloc(current_allocation);                      \
        }                                                               \
    }                                                                   \
}

Definition at line 65 of file print-util.c.

Referenced by stp_asprintf(), stp_catprintf(), stp_dprintf(), stp_eprintf(), and stp_zprintf().


Function Documentation

static void fill_buffer_writefunc void *  priv,
const char *  buffer,
size_t  bytes
[static]
 

Definition at line 352 of file print-util.c.

References debug_msgbuf_t::bytes, debug_msgbuf_t::data, stp_malloc(), and stp_realloc().

Referenced by stp_init_debug_messages().

void stp_asprintf char **  strp,
const char *  format,
  ...
 

Definition at line 100 of file print-util.c.

References STPI_VASPRINTF.

void stp_catprintf char **  strp,
const char *  format,
  ...
 

Definition at line 109 of file print-util.c.

References stp_asprintf(), stp_free(), and STPI_VASPRINTF.

void stp_deprintf unsigned long  level,
const char *  format,
  ...
 

Definition at line 341 of file print-util.c.

References stpi_debug_level, and stpi_init_debug().

void stp_dprintf unsigned long  level,
const stp_vars_t v,
const char *  format,
  ...
 

Definition at line 327 of file print-util.c.

References stp_free(), stp_get_errdata(), stp_get_errfunc(), stpi_debug_level, stpi_init_debug(), and STPI_VASPRINTF.

void stp_eprintf const stp_vars_t v,
const char *  format,
  ...
 

Definition at line 267 of file print-util.c.

References stp_free(), stp_get_errdata(), stp_get_errfunc(), and STPI_VASPRINTF.

void stp_erprintf const char *  format,
  ...
 

Definition at line 293 of file print-util.c.

void stp_zprintf const stp_vars_t v,
const char *  format,
  ...
 

Definition at line 90 of file print-util.c.

References stp_free(), stp_get_outdata(), stp_get_outfunc(), and STPI_VASPRINTF.

static void stpi_init_debug void   )  [static]
 

Definition at line 304 of file print-util.c.

References stp_erprintf(), and stpi_debug_level.

Referenced by stp_deprintf(), stp_dprintf(), stp_get_debug_level(), and stp_init().


Variable Documentation

void*(* stp_malloc_func)(size_t size) = malloc
 

Definition at line 396 of file print-util.c.

Referenced by stp_malloc().

unsigned long stpi_debug_level = 0 [static]
 

Definition at line 301 of file print-util.c.

Referenced by stp_deprintf(), stp_dprintf(), stp_get_debug_level(), and stpi_init_debug().

void(* stpi_free_func)(void *ptr) = free
 

Definition at line 398 of file print-util.c.

Referenced by stp_free().

void*(* stpi_realloc_func)(void *ptr, size_t size) = realloc
 

Definition at line 397 of file print-util.c.

Referenced by stp_realloc().


Generated on Thu Feb 10 19:29:31 2005 for libgutenprint API Reference by  doxygen 1.4.1