libgimpprint API Reference: print-util.c File Reference

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

# 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_t * | stp_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
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,
|  | b |  | ) | ((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 stp_asprintf | ( | char ** | strp,
|  | const char * | format,
|  |  | ...
| ) |

| Definition at line 100 of file print-util.c. References STPI_VASPRINTF. Referenced by stp_catprintf(), stp_xmltree_create_from_array(), stp_xmltree_create_from_curve(), and stp_xmltree_create_from_sequence().

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(). Referenced by canon_density(), canon_inks(), canon_write(), compute_spline_deltas_piecewise(), cx400_printer_init_func(), interpolate_gamma_internal(), interpolate_points(), olympus_do_print(), olympus_get_cached_output(), olympus_get_model_capabilities(), p300_block_init_func(), p300_plane_end_func(), p440_block_end_func(), pcl_printfunc(), pcl_string_to_val(), pcl_val_to_string(), stp_color_register(), stp_curve_create_from_file(), stp_curve_create_from_stream(), stp_curve_create_from_string(), stp_curve_create_from_xmltree(), stp_curve_set_data(), stp_curve_set_data_points(), stp_list_create(), stp_list_destroy(), stp_list_item_create(), stp_list_item_destroy(), stp_list_node_free_data(), stp_module_init(), stp_module_open(), stp_module_register(), stp_path_search(), stp_sequence_create_from_xmltree(), stp_xml_dither_cache_get(), stp_xml_dither_cache_set(), stp_xml_init_defaults(), stp_xml_parse_file(), stp_xml_parse_file_named(), stp_xml_process_dither_matrix(), stp_xmltree_create_from_curve(), stpi_curve_check_parameters(), stpi_dither_array_create_from_file(), stpi_paper_create(), stpi_path_check(), stpi_xml_process_family(), xml_doc_get_curve(), and xmldoc_create_from_curve().

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(), stp_vars_t, stpi_debug_level, stpi_init_debug(), and STPI_VASPRINTF. Referenced by calculate_pass_map(), escp2_find_resolution(), finalize_row(), ps_imageable_area_internal(), ps_media_size_internal(), ps_print_internal(), set_raw_ink_type(), setup_channel(), stp_channel_set_black_channel(), stp_channel_set_cutoff_adjustment(), stp_channel_set_density_adjustment(), stp_channel_set_ink_limit(), stp_dither_set_inks_full(), stp_set_default_string_parameter(), stp_set_string_parameter(), stp_set_string_parameter_n(), stp_verify_parameter(), stp_verify_printer_params(), stpi_compute_lut(), stpi_dither_finalize_ranges(), stpi_dither_set_ranges(), verify_curve_param(), verify_dimension_param(), verify_double_param(), verify_int_param(), verify_string_param(), and weave_parameters_by_row().

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(), stp_vars_t, and STPI_VASPRINTF. Referenced by add_to_row(), compute_gcr_curve(), escp2_do_print(), initialize_row(), olympus_do_print(), pcl_do_print(), ps_print_internal(), raw_print(), stp_dither_init(), stp_flush_debug_messages(), stp_initialize_weave(), stp_verify_parameter(), stp_verify_printer_params(), verify_curve_param(), verify_dimension_param(), verify_double_param(), verify_int_param(), and verify_string_param().

void stp_erprintf | ( | const char * | format,
|  |  | ...
| ) |

| Definition at line 293 of file print-util.c. Referenced by check_array(), check_color(), check_curve(), check_list(), check_paperlist(), check_sequence(), lexmark_init_line(), lexmark_init_printer(), lexmark_write(), null_list(), null_printer(), null_vars(), olympus_printsize(), setup_inks(), stp_array_create_from_xmltree(), stp_color_count(), stp_get_printer_by_driver(), stp_get_printer_by_index(), stp_get_printer_by_long_name(), stp_module_load(), stp_printer_create_from_xmltree(), stp_printer_model_count(), stp_sequence_create_from_xmltree(), stp_xml_parse_file(), stp_xml_process_paper(), stpi_dither_array_create_from_file(), stpi_dither_array_create_from_xmltree(), and stpi_init_debug().

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(), stp_vars_t, and STPI_VASPRINTF. Referenced by p10_block_init_func(), p200_plane_init_func(), p200_printer_end_func(), p300_block_init_func(), p300_plane_end_func(), p400_block_init_func(), p400_plane_end_func(), p400_plane_init_func(), p400_printer_init_func(), p440_block_init_func(), p440_printer_end_func(), p440_printer_init_func(), pcl_printfunc(), and ps_print_internal().

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