Compile-time Option Interface

Brief

To provide compile-time selection of internal options, APS provides a generic template mechanism for configurable options.  These include options related to compiler support, debugging, memory allocation, library support, paths, limits and timeouts, as well as other miscellaneous and module-specific options.  It is hoped that through adequate support by APS developers, the library will be able to be easily tailored for any environment simply by modifying a few settings.

Main Components

The interface is divided into two groups: options which can be configured through the ./configure script and those which cannot.  Generally the former group contains settings of major importance, whereas the second provide either refined versions of the former, or other miscellaneous internal settings which would be impractical or unnecessary to include in the former interface.  Naturally, the second group is far more developed.

Description of Related Files

Filename Distrib? Comments
acconfig.h yes Serves as a template for config.h.in file.
Contains a series of all C pre-processor macros to be exported from the configure through the AC_DEFINE() and AC_DEFINE_UNQUOTED() macros.  This need not contain definitions for constants generated by the AC_CHECK_xxx() macros.
acconfiginclude.h yes Included by acconfig.h / config.h to set up options which are not generated by the configure script and documentation for all exported constants and macros.  Here the C pre-processor does all the work.
aclocal.m4 yes Contains definitions for all automake macros used by this configuration process at the time of distribution.
[generated by aclocal]
config.cache no Contains cached settings from previous configure runs
[generated by configure]
config.guess yes Script that tries to guess the type of host system and its characteristics during configuration.
[from autoconf distribution]
config.h no This is the file to be included in APS sources (via src/apsinternal.h header).
[generated from config.h.in by configure]
config.h.in yes Provides a substitution template for the config.h file.
[generated from acconfig.h by autoheader]
config.log no Log file generated during configuration.
[generated by configure]
config.status no Script generated during configuration to rebuild a configuration based on current settings.  ie. ./config.status --recheck
[generated by configure]
config.sub yes Script containing useful subroutines for configuration.
[from autoconf distribution]
configure yes Macro-expanded configuration script.  Run this to setup system parameters and important compile-time options.
[generated by autoconf]
configure.in yes Template configuration script containing macros interspersed with BASH shell commands.
stamp-h no Meaningless for now...
[generated by configure]
stamp-h.in yes Copied to stamp-h by autoheader during configuration.

1.  Configure Script Options

Argument Parameter Description
--enable-debug no no debugging support: no symbols, trace macros, run-time checks / asserts
nosymbols no debug symbols, but supports trace macros and lightweight run-time checks / asserts
minimal minimal debugging support
yes / normal normal debugging support
full macro debugging, no inlining, minimal optimisation
heavy intensive debugging using heavy run-time verification tools
--enable-debug-trace no disable all run-time debug message classes (compiled out)
yes / default enable "msg", "error", "warn" and "fixme" run-time debug message classes ("trace" messages compiled out) and sets default debug message channels to all+error,all+fixme
[all][class[,...]] [:channel{+-}class[,...]] enable specific run-time debug message classes (see run-time debug trace messages document)
--enable-profiling no no profiling support
yes compile for profiling with prof
--enable-optimisations no no optimisation
minimal minimal optimisation
yes / normal normal optimisation
heavy heavy optimisation
--enable-inline no disable explicit function inlining
yes enable explicit function inlining
--enable-lpr no disable lpr transport
yes enable lpr transport
--enable-lpr-networks no route access to Unix network printers through an output filter script
yes let lpr daemon manage Unix network printers
--enable-cups no disable cups transport
yes enable cups transport

2.  Pre-processor Macros and Constants

Compiler Support

Name Type Description
const keyword <blank> if not supported by compiler
INLINE keyword <blank> if inlining not supported / not enabled
APSCFG_INLINE bool true, if inlining enabled (though may not be supported)
APSCFG_INLINE_KEYWORD keyword always valid if inlining is supported; even if not enabled

Debugging

Name Type Description
APSCFG_DEBUG bool true, if run-time debugging are enabled
APSCFG_DEBUG_TRACE bool true, if run-time program flow tracing is enabled
APSCFG_DEBUG_PARANOID bool true, if intensive run-time debugging tests are enabled
DEBUG #ifdef switch defined if APSCFG_DEBUG is true
for compatibility with APS-independant modules only: use APSCFG_DEBUG instead

Memory Allocator (TrackMem)

Name Type Description
APSCFG_MALLOC_LIB unquoted literal one of: stdlib, libc6, dmalloc, efence
APSCFG_MALLOC_DATAALIGN integer typical alignment for native datatypes
APSCFG_MALLOC_USERALIGN integer special alignment for user-allocated resources
void *APSCFG_MALLOC_ALLOC(size_t) function alias alias to memory allocator function
void *APSCFG_MALLOC_CALLOC(size_t) function alias alias to memory allocator function for zero-filled blocks
void *APSCFG_MALLOC_REALLOC(void *, size_t) function alias alias to memory reallocator function
void APSCFG_MALLOC_FREE(void *) function alias alias to memory disposal function
size_t APSCFG_MALLOC_USABLE_SIZE(void *) function alias alias to memory block sizing function, or undefined if not supported

String Functions

Name Type Description
char *strdup(const char *) function alias alias to string duplication function
int stricmp(const char *, const char *) function alias alias to locale-aware case insensitive string comparison function
int strnicmp(const char *, const char *, size_t) function alias alias to locale-aware case insensitive string comparison function with maximum length boundary
APSCFG_NEEDS_STRDUP #ifdef switch switch to build in strdup()-replacement in utils.c
APSCFG_NEEDS_STRICMP #ifdef switch switch to build in stricmp()-replacement in utils.c
APSCFG_NEEDS_STRNICMP #ifdef switch switch to build in strnicmp()-replacement in utils.c

Global Paths

Name Type Description
APSCFG_PATH_TEMPORARY_DIR string path to default temporary directory
APSCFG_PATH_PROC_DIR string path to process information volume
APSCFG_PATH_DEFAULT_PGM_SEARCHDIR string default program search path for FindProgram in utils.c
APSCFG_PATH_DEFAULT_FILE_SEARCHDIR string default file search path for FileFile in utils.c

Global Limits

Name Type Description
APSCFG_MAX_CONFIG_LINE_SIZE integer typical max length of a human-readable text configuration file
APSCFG_MAX_PRINTER_NAME_SIZE integer maximum length of a printer name (incl. terminator)
APSCFG_MAX_PATH_SIZE integer maximum length of a file path (incl. terminator)
APSCFG_MAX_NETWORK_PATH_SIZE integer maximum length of a network path (incl. terminator)
APSCFG_MAX_UINT_STR_SIZE integer maximum length of a string formed by the largest number that fits in a native unsigned integer (not incl. terminator)
APSCFG_MAX_INT_STR_SIZE integer maximum length of a string formed by the longest number that fits in a native integer (not incl. terminator)

Global Timeouts

Name Type Description
APSCFG_TIMEOUT_DEFAULT integer default timeout for spawned processes (avoid!   use as a stopgap only)

Global Options / Settings

Name Type Description
APSCFG_COPY_BUFFER_SIZE integer typical size of a buffer to be used for copying/spooling files
APSCFG_FILE_BUFFER_SIZE integer typical size of an input buffer to be used for accessing records in a human-readable text configuration file

Global Config Module Defaults

Name Type Description
APSCFG_CONFIG_PATH_PRINTER_SYS_DIR string path of root of system's printer configuration repository
APSCFG_CONFIG_PATH_PRINTER_USER_RELDIR string relative (to home) path of root of user's printer configuration repository
APSCFG_CONFIG_PATH_META_SYS_DIR string path of system's .conf file repository
APSCFG_CONFIG_PATH_META_USER_RELDIR string relative (to home) path of user's .conf file repository
APSCFG_CONFIG_PATH_PPD_SYS_DIR string path of system's .ppd file repository
APSCFG_CONFIG_PATH_PPD_SUFFIX string suffix for PPD files (.ppd)
APSCFG_CONFIG_PATH_PPD_SEPARATOR string separator for generated PPD files (between base name and printer name)
APSCFG_CONFIG_PATH_MODELDB_SYS_FILE string path of system's modeldb file
APSCFG_CONFIG_PATH_TESTPATTERN_FILE string path of system's testpattern file
APSCFG_CONFIG_PATH_MODEL_PROBE_FILE string path of model probe script
APSCFG_CONFIG_TIMEOUT_MODEL_PROBE integer timeout for printer model probe script

LPR Transport

Name Type Description
APSCFG_LPR_BUILD bool true, if LPR support should be compiled in
APSCFG_LPR_SUPPORT_BSD bool true, if BSD-style LPR support should be enabled / compiled in
APSCFG_LPR_SUPPORT_LPRNG bool true, if LPRNG-style LPR support should be enabled / compiled in
APSCFG_LPR_LET_DAEMON_MANAGE_NETWORKS bool true, if LPR's daemon should handle connections to other *ix LPR-based print servers
APSCFG_LPR_PATH_SPOOL_DIR string path of root of LPR's spool directory (/var/spool/lpd)
APSCFG_LPR_PATH_FILTER_DIR string path of print filter directory
APSCFG_LPR_PATH_MASTERFILTER_FILE string path of master filter to copy into spool directory as "filter"
APSCFG_LPR_PATH_PRINTCAP_SEARCHDIR string search path for printcap file
APSCFG_LPR_PATH_PRINTCAP_SEARCHFILE string search name for printcap file
APSCFG_LPR_PATH_PRINTCAP_DEFFILE string default location of printcap if search fails (/etc/printcap)
APSCFG_LPR_PATH_LPC_SEARCHPGM string search name for "lpc" command
APSCFG_LPR_PATH_LPD_SEARCHPGM string search name for "lpd" command
APSCFG_LPR_PATH_LPR_SEARCHPGM string search name for "lpr" command
APSCFG_LPR_PATH_LPRM_SEARCHPGM string search name for "lprm" command
APSCFG_LPR_PATH_LPQ_SEARCHPGM string search name for "lpq" command
APSCFG_LPR_TIMEOUT_LPC_DEFAULT integer default timeout for miscellaneous short "lpc" operations (avoid)
APSCFG_LPR_TIMEOUT_LPC_PAUSE integer timeout for "lpc pause"
APSCFG_LPR_TIMEOUT_LPC_REREAD integer timeout for "lpc reread"
APSCFG_LPR_TIMEOUT_LPC_RESTARTALL integer timeout for "lpc restart all"
APSCFG_LPR_TIMEOUT_LPC_RESUME integer timeout for "lpc resume"
APSCFG_LPR_TIMEOUT_LPC_STATUS integer timeout for "lpc status"
APSCFG_LPR_TIMEOUT_LPC_STOPALL integer timeout for "lpc stop all"
APSCFG_LPR_TIMEOUT_LPQ_READ integer timeout for "lpq" queue read
APSCFG_LPR_TIMEOUT_LPR_DISPATCH integer timeout for "lpr" job dispatch
APSCFG_LPR_TIMEOUT_LPR_VERSION integer timeout for "lpr" getting version info
APSCFG_LPR_TIMEOUT_LPRM_PURGE integer timeout for "lprm" purge entire queue
APSCFG_LPR_TIMEOUT_LPRM_REMOVE integer timeout for "lprm" remove single job
APSCFG_LPR_TIMEOUT_GS_PROCESS integer timeout for processing a file through Ghostscript

CUPS Transport

Name Type Description
APSCFG_CUPS_BUILD bool true, if CUPS support should be compiled in

Job Attributes Core

Name Type Description
APSCFG_ATTR_MAX_PROVIDERS integer maximum number of registered attribute providers

Miscellaneous

Name Type Description
SIZEOF_CHAR integer == sizeof(char)
SIZEOF_INT integer == sizeof(int)
SIZEOF_VOID_P integer == sizeof(void *)
SIZEOF_DOUBLE integer == sizeof(double)
PACKAGE string name of package ("APS")
VERSION string version of package ("1.1")

XYZ Module

Name Type Description

Future Directions

 

Corel Corporation
Linux Printing (APS) Development Team
April 2000.