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

src/main/print-util.c File Reference

#include <gimp-print/gimp-print.h>
#include "gimp-print-internal.h"
#include <gimp-print/gimp-print-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.

Data Structures

struct  debug_msgbuf_t

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,...)
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,...)
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)
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

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

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 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 Wed May 12 20:21:37 2004 for libgimpprint API Reference by doxygen1.2.17