/usr/src/packages/BUILD/postscriptbarcode-20170404.14~nightly/libs/c/postscriptbarcode.h File Reference

Public API for libpostscriptbarcode - a C library providing a functional interface to Barcode Writer in Pure PostScript. More...

Go to the source code of this file.

Typedefs

typedef struct BWIPP BWIPP
 A BWIPP context.

Functions

BWIPPbwipp_load (void)
 Load the BWIPP resources by searching for barcode.ps in default locations.
BWIPPbwipp_load_from_file (const char *filename)
 Load the BWIPP resources from a given resource file.
void bwipp_unload (BWIPP *ctx)
 Unload the BWIPP resources.
const char * bwipp_get_version (BWIPP *ctx)
 Provide the version of BWIPP that has been loaded.
char * bwipp_emit_required_resources (BWIPP *ctx, const char *name)
 Provides the set of BWIPP resources required to generate a barcode of the specified type.
char * bwipp_emit_all_resources (BWIPP *ctx)
 Provides the complete set of BWIPP resources.
char * bwipp_emit_exec (BWIPP *ctx, const char *barcode, const char *contents, const char *options)
 Provide the PostScript code that invokes a barcode with given parameters.
unsigned short bwipp_list_families (BWIPP *ctx, char ***families)
 List all known barcode families.
char * bwipp_list_families_as_string (BWIPP *ctx)
 List all known barcode families as a comma seperated string.
unsigned short bwipp_list_family_members (BWIPP *ctx, char ***members, const char *family)
 List all members of a given barcode family.
char * bwipp_list_family_members_as_string (BWIPP *ctx, const char *family)
 List all members of a given barcode family as a comma seperated string.
unsigned short bwipp_list_properties (BWIPP *ctx, char ***properties, const char *barcode)
 List all properties of a given barcode symbology.
char * bwipp_list_properties_as_string (BWIPP *ctx, const char *barcode)
 List all properties of a given barcode symbology as a comma seperated string.
const char * bwipp_get_property (BWIPP *ctx, const char *barcode, const char *property)
 Get the value of a given property of a given barcode symbology.
void bwipp_free (void *p)
 Free memory belonging to a BWIPP provided allocation.


Detailed Description

Public API for libpostscriptbarcode - a C library providing a functional interface to Barcode Writer in Pure PostScript.

The basic workflow is to firstly initialise the library to obtain a BWIPP context by loading the BWIPP resources using either bwipp_load() or bwipp_load_from_file(). The context is provided as the first argument to all subsequent function calls. You can then query the available barcode families with bwipp_list_families() and list each family's members using bwipp_list_family_members() to obtain the list of all supported barcode symbologies. The available properties of each barcode symbology can be enumerated using bwipp_list_properties() and read with bwipp_get_property(). To create a PostScript document concatenate together your own PostScript prolog with the output of either bwipp_emit_required_resources() (minimal set of resources for a specific barcode symbology) or bwipp_emit_all_resources() and you own PostScript code interspersed with calls to bwipp_emit_exec() to render a barcode. Finally, all resources can be freed using bwipp_unload().

The library should be thread-safe provided that the calling code is limited to one thread per context until the resources for the context have finished loading.


Function Documentation

char* bwipp_emit_all_resources ( BWIPP ctx  ) 

Provides the complete set of BWIPP resources.

Parameters:
ctx BWIPP context.
Returns:
A string containing the set of all PostScript resources, which the caller should release with bwipp_free().

char* bwipp_emit_exec ( BWIPP ctx,
const char *  barcode,
const char *  contents,
const char *  options 
)

Provide the PostScript code that invokes a barcode with given parameters.

Parameters:
ctx BWIPP context.
barcode The type of barcode.
contents The contents of the barcode.
options The formatting options for the barcode.
Returns:
The PostScript code that invokes the barcode, which the caller should release with bwipp_free().

char* bwipp_emit_required_resources ( BWIPP ctx,
const char *  name 
)

Provides the set of BWIPP resources required to generate a barcode of the specified type.

Parameters:
ctx BWIPP context.
name Path to the barcode.ps resources file.
Returns:
A string containing a set of PostScript resources, which the caller should release with bwipp_free().

void bwipp_free ( void *  p  ) 

Free memory belonging to a BWIPP provided allocation.

Parameters:
p Pointer to memory to free.

const char* bwipp_get_property ( BWIPP ctx,
const char *  barcode,
const char *  property 
)

Get the value of a given property of a given barcode symbology.

Parameters:
ctx BWIPP context.
barcode The type of barcode symbology.
property The name of the property to query.
Returns:
The value of the given property.

const char* bwipp_get_version ( BWIPP ctx  ) 

Provide the version of BWIPP that has been loaded.

Parameters:
ctx BWIPP context.
Returns:
A string containing the version.

unsigned short bwipp_list_families ( BWIPP ctx,
char ***  families 
)

List all known barcode families.

Parameters:
ctx BWIPP context.
families Returns list of all barcode families by reference, which the caller should release with bwipp_free().
Returns:
Number of barcode families returned.

char* bwipp_list_families_as_string ( BWIPP ctx  ) 

List all known barcode families as a comma seperated string.

Parameters:
ctx BWIPP context.
Returns:
A comma seperated list of all barcode families, which the caller should release with bwipp_free().

unsigned short bwipp_list_family_members ( BWIPP ctx,
char ***  members,
const char *  family 
)

List all members of a given barcode family.

Parameters:
ctx BWIPP context.
members Returns list of all barcode family members by reference, which the caller should release with bwipp_free().
family The name of a barcode family.
Returns:
Number of barcode family members returned.

char* bwipp_list_family_members_as_string ( BWIPP ctx,
const char *  family 
)

List all members of a given barcode family as a comma seperated string.

Parameters:
ctx BWIPP context.
family The name of a barcode family.
Returns:
A comma seperated list of all barcode family members, which the caller should release with bwipp_free().

unsigned short bwipp_list_properties ( BWIPP ctx,
char ***  properties,
const char *  barcode 
)

List all properties of a given barcode symbology.

Parameters:
ctx BWIPP context.
properties Returns list of all barcode properties by reference, which the caller should release with bwipp_free().
barcode The type of barcode symbology.
Returns:
Number of properties returned.

char* bwipp_list_properties_as_string ( BWIPP ctx,
const char *  barcode 
)

List all properties of a given barcode symbology as a comma seperated string.

Parameters:
ctx BWIPP context.
barcode The type of barcode symbology.
Returns:
A comma seperated list of all barcode properties, which the caller should release with bwipp_free().

BWIPP* bwipp_load ( void   ) 

Load the BWIPP resources by searching for barcode.ps in default locations.

Returns:
BWIPP context on success, else NULL.

BWIPP* bwipp_load_from_file ( const char *  filename  ) 

Load the BWIPP resources from a given resource file.

Parameters:
filename Path to the barcode.ps resources file.
Returns:
BWIPP context on success, else NULL.

void bwipp_unload ( BWIPP ctx  ) 

Unload the BWIPP resources.

Parameters:
ctx BWIPP context.
Returns:
Void.


Generated on Sat Apr 22 22:54:03 2017 for libpostscriptbarcode by  doxygen 1.5.6