#include "bmepsi.h"
Defines | |
#define | B2MAIN_C 1 |
Inside the b2main.c module. | |
#define | VERSNUMB "2.1.2" |
Version number. | |
Functions | |
static int | compare_strings (void *l, void *r, int cr) |
Compare two strings. | |
static void | silence_check (int argc, char **argv, int *rs, int *rf) |
Check whether or not to run silently. | |
static void | apply_arguments (BJ *bj, char *dl) |
Apply command line arguments to bmeps job. | |
static void | show_version (BJ *bj) |
Show the version number and license information. | |
static void | show_help (BJ *bj) |
Show help text. | |
static size_t | max_str_length (BJ *bj, size_t s1, size_t s2) |
Find maximum string length in print (after text -> utf-8 conversion). | |
static void | fputs_cp (char *s, FILE *f, unsigned char *cp) |
Print a string, use codepage conversions if necessary. | |
static void | fputs_formatted (BJ *bj, char *s, size_t maxl) |
Print string formatted. | |
static void | write_configuration (BJ *bj) |
Write configuration to preferences. | |
static void | show_colored_output (BJ *bj, size_t maxl, unsigned char *cp) |
Show whether output is colored. | |
static void | show_details (BJ *bj, unsigned char *cp) |
Show details. | |
static void | show_encodings (BJ *bj, size_t maxl, unsigned char *cp) |
Show encodings. | |
static void | show_interpolation (BJ *bj, size_t maxl, unsigned char *cp) |
Show interpolation. | |
static void | show_alpha_channel_mixing (BJ *bj, size_t maxl, unsigned char *cp) |
Show alpha-channel mixing settings. | |
static void | show_resolution_and_media_size (BJ *bj, size_t maxl, unsigned char *cp) |
Show resolution and media size settings. | |
static void | show_configuration_eps (BJ *bj, size_t maxl, unsigned char *cp) |
Show EPS output options. | |
static void | show_configuration_pdf (BJ *bj, size_t maxl, unsigned char *cp) |
Show PDF output settings. | |
static void | show_configuration (BJ *bj) |
Show configuration. | |
static void | run_for_app_options (BJ *bj) |
Run for application options. | |
static int | transfer_file_contents (BJ *bj, FILE *fi, FILE *fo) |
Transfer file contents (to create copy of a tiff file). | |
static void | run_for_two_real_filenames (BJ *bj, char *in, char *on) |
Run for two real file names. | |
static void | run_for_two_filenames (BJ *bj) |
Run for two file names, wildcards are not yet expaneded/resolved. | |
static void | run_for_one_real_filename (BJ *bj, char *n) |
Run for on file name (input file) expaned/resolved. | |
static void | run_for_one_filename (BJ *bj) |
Run for one file name (input file). | |
static void | run_for_directory (BJ *bj) |
Run for a directory (file name in bj->i1). | |
static void | run_for_filenames (BJ *bj) |
After creating temporary file names, run now. | |
static void | do_real_work (BJ *bj) |
Go and do the conversion. | |
static void | run_with_strings (BJ *bj) |
After loading localized strings, go to work now. | |
static void | run (BJ *bj) |
After creating the application structure, go to real work now. | |
int | main (int argc, char *argv[]) |
The main program. | |
Variables | |
static char * | long_options [] |
Long options. | |
static char | str_ps2 [] = { "ps2" } |
String ps2. | |
static char | str_on [] = { "on" } |
String on. | |
static char | str_off [] = { "off" } |
String off. | |
static char | pk_lang [] = { "/language" } |
String /language. | |
static char | pk_make [] = { "/make" } |
String /make. | |
static char | pk_alph [] = { "/pdf/suppress-alpha-info" } |
String /pdf/suppress-alpha-info. | |
static char | empty_string [] = { "" } |
Empty string. | |
static char * | help_text [] |
Help text to show from "bmeps --help". | |
static char | help_file_name [] = { "bmeps.txt" } |
Name of help text file. | |
static char * | output_type_names [] |
Names of output types. | |
static char * | eps_levels [] = { "1", "2", "3" } |
EPS levels. | |
static char * | pdf_levels [] = { "1.2", "1.3", "1.4" } |
PDF levels. | |
static char * | version_text [] |
Text to show as version information. | |
static char * | encoding_types [] |
Encoding type names. | |
static char | sep [] |
File name separator character. | |
static char * | suffixes [] = { ".pdf", ".eps", ".bb" } |
Output file name suffixes. | |
static BO | bo |
The bmeps options set. | |
static BJ | bj |
The bmeps job data. | |
static char | sccs_id [] = { "@(#)b2main.ctr 1.36 04/14/09" } |
SCCIS ID. |
#define VERSNUMB "2.1.2" |
Version number.
static void apply_arguments | ( | BJ * | bj, | |
char * | dl | |||
) | [static] |
Apply command line arguments to bmeps job.
bj | Bmeps job. | |
dl | Argument to apply. |
static int compare_strings | ( | void * | l, | |
void * | r, | |||
int | cr | |||
) | [static] |
Compare two strings.
l | Left string. | |
r | Right string. | |
cr | Comparison criteria. |
static void do_real_work | ( | BJ * | bj | ) | [static] |
Go and do the conversion.
This function creates file names for temporary files and invokes run_for_filenames().
bj | Bmeps job. |
static void fputs_cp | ( | char * | s, | |
FILE * | f, | |||
unsigned char * | cp | |||
) | [static] |
Print a string, use codepage conversions if necessary.
s | String to print. | |
f | Output file. | |
cp | Code page (may be NULL). |
static void fputs_formatted | ( | BJ * | bj, | |
char * | s, | |||
size_t | maxl | |||
) | [static] |
Print string formatted.
Spaces are appended to fit the string to maxl.
bj | Bmeps job. | |
s | String to print. | |
maxl | Length reserved for string. |
int main | ( | int | argc, | |
char * | argv[] | |||
) |
The main program.
This function creates an application structure and invokes the run() function.
argc | Number of command line arguments. | |
argv | Command line arguments array. |
static size_t max_str_length | ( | BJ * | bj, | |
size_t | s1, | |||
size_t | s2 | |||
) | [static] |
Find maximum string length in print (after text -> utf-8 conversion).
bj | Bmeps job. | |
s1 | Start index. | |
s2 | End index. |
static void run | ( | BJ * | bj | ) | [static] |
After creating the application structure, go to real work now.
This function is invoked by the main() function after the application structure was created. The function loads the localized strings and invokes run_with_strings().
bj | Bmeps job. |
static void run_for_app_options | ( | BJ * | bj | ) | [static] |
Run for application options.
bj | Bmeps job. |
static void run_for_directory | ( | BJ * | bj | ) | [static] |
Run for a directory (file name in bj->i1).
This function is invoked if only file name was provided and this file name points to a directory.
bj | Bmeps job. |
static void run_for_filenames | ( | BJ * | bj | ) | [static] |
After creating temporary file names, run now.
bj | Bmeps job. |
static void run_for_one_filename | ( | BJ * | bj | ) | [static] |
Run for one file name (input file).
Wildcards are not yet expanded/resolved.
bj | Bmeps job. |
static void run_for_one_real_filename | ( | BJ * | bj, | |
char * | n | |||
) | [static] |
Run for on file name (input file) expaned/resolved.
bj | Bmeps job. | |
n | Input file name. |
static void run_for_two_filenames | ( | BJ * | bj | ) | [static] |
Run for two file names, wildcards are not yet expaneded/resolved.
bj | Bmeps job. |
static void run_for_two_real_filenames | ( | BJ * | bj, | |
char * | in, | |||
char * | on | |||
) | [static] |
Run for two real file names.
Wildcards in the file names are expanded/resolved.
bj | Bmeps job. | |
in | Input file name. | |
on | Output file name. |
static void run_with_strings | ( | BJ * | bj | ) | [static] |
After loading localized strings, go to work now.
This function reads defaults from the preferences system and invokes apply_arguments() to process the command line arguments and do_real_work().
bj | Bmeps job. |
static void show_alpha_channel_mixing | ( | BJ * | bj, | |
size_t | maxl, | |||
unsigned char * | cp | |||
) | [static] |
Show alpha-channel mixing settings.
bj | Bmeps job. | |
maxl | Reserved space for output. | |
cp | Code page. |
static void show_colored_output | ( | BJ * | bj, | |
size_t | maxl, | |||
unsigned char * | cp | |||
) | [static] |
Show whether output is colored.
bj | Bmeps job. | |
maxl | Reserved space. | |
cp | Code page. |
static void show_configuration | ( | BJ * | bj | ) | [static] |
Show configuration.
bj | Bmeps job. |
static void show_configuration_eps | ( | BJ * | bj, | |
size_t | maxl, | |||
unsigned char * | cp | |||
) | [static] |
Show EPS output options.
bj | Bmeps job. | |
maxl | Reserved space for output. | |
cp | Code page. |
static void show_configuration_pdf | ( | BJ * | bj, | |
size_t | maxl, | |||
unsigned char * | cp | |||
) | [static] |
Show PDF output settings.
bj | Bmeps job. | |
maxl | Space reserved for output. | |
cp | Code page. |
static void show_details | ( | BJ * | bj, | |
unsigned char * | cp | |||
) | [static] |
Show details.
bj | Bmeps job. | |
cp | Code page. |
static void show_encodings | ( | BJ * | bj, | |
size_t | maxl, | |||
unsigned char * | cp | |||
) | [static] |
Show encodings.
bj | Bmeps job. | |
maxl | Reserved text width for output. | |
cp | Code page. |
static void show_help | ( | BJ * | bj | ) | [static] |
Show help text.
bj | Bmeps job. |
static void show_interpolation | ( | BJ * | bj, | |
size_t | maxl, | |||
unsigned char * | cp | |||
) | [static] |
Show interpolation.
bj | Bmeps job. | |
maxl | Reserved space. | |
cp | Code page. |
static void show_resolution_and_media_size | ( | BJ * | bj, | |
size_t | maxl, | |||
unsigned char * | cp | |||
) | [static] |
Show resolution and media size settings.
bj | Bmeps job | |
maxl | Reserved space for output. | |
cp | Code page. |
static void show_version | ( | BJ * | bj | ) | [static] |
Show the version number and license information.
bj | Bmeps job. |
static void silence_check | ( | int | argc, | |
char ** | argv, | |||
int * | rs, | |||
int * | rf | |||
) | [static] |
Check whether or not to run silently.
Set *rs (run silently) and *rf (run as filter).
argc | Number of command line arguments. | |
argv | Command line arguments array. | |
rs | Pointer to run-silently flag. | |
rf | Pointer to run-as-filter flag. |
static int transfer_file_contents | ( | BJ * | bj, | |
FILE * | fi, | |||
FILE * | fo | |||
) | [static] |
Transfer file contents (to create copy of a tiff file).
bj | Bmeps jobs. | |
fi | Input file. | |
fo | Output file. |
static void write_configuration | ( | BJ * | bj | ) | [static] |
Write configuration to preferences.
bj | Bmeps sjob. |
char empty_string[] = { "" } [static] |
Empty string.
char* encoding_types[] [static] |
Initial value:
{ "ascii85", "run-length", "lzw", "dct", "flate" }
char* help_text[] [static] |
Initial value:
{ "Usage:", "------", "", "bmeps [-l <language>] [ <inputfile> [ <outputfile> ] ] [<options>]", "", "Options:", "<language> Output language", "-o <option-setting> Configuration setting", "-m Make style", "-f <frame-range> Start and end frame", "-t <file-type> Input file type when processing standard input", "-a Automatically create output file name", "-A Suppress notice about transferred alpha channel(s)", NULL }
char* long_options[] [static] |
Initial value:
{ "h$elp", "v$ersion", "conf$igure", "unconf$igure", "res$et", "sh$ow-configuration", "sil$ently", "lang$uage", "opt$ion", "f$rames", "t$ype", "configuration-file", "write-configuration-file", NULL }
char* output_type_names[] [static] |
Initial value:
{ "EPS", "PDF", "BB (bounding box)" }
char pk_alph[] = { "/pdf/suppress-alpha-info" } [static] |
String /pdf/suppress-alpha-info.
char pk_lang[] = { "/language" } [static] |
String /language.
char pk_make[] = { "/make" } [static] |
String /make.
char sep[] [static] |
Initial value:
{
"/"
}
char str_off[] = { "off" } [static] |
String off.
char str_on[] = { "on" } [static] |
String on.
char str_ps2[] = { "ps2" } [static] |
String ps2.