b2main.c File Reference

The main program. More...

#include "bmepsi.h"

Include dependency graph for b2main.c:


Defines

#define B2MAIN_C   1
 Inside the b2main.c module.
#define VERSNUMB   "2.1.3"
 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.

Detailed Description

The main program.


Define Documentation

#define VERSNUMB   "2.1.3"

Version number.


Function Documentation

static void apply_arguments ( BJ bj,
char *  dl 
) [static]

Apply command line arguments to bmeps job.

Parameters:
bj Bmeps job.
dl Argument to apply.

static int compare_strings ( void *  l,
void *  r,
int  cr 
) [static]

Compare two strings.

Parameters:
l Left string.
r Right string.
cr Comparison criteria.
Returns:
Comparison result.

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

Parameters:
bj Bmeps job.

static void fputs_cp ( char *  s,
FILE *  f,
unsigned char *  cp 
) [static]

Print a string, use codepage conversions if necessary.

Parameters:
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.

Parameters:
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.

Parameters:
argc Number of command line arguments.
argv Command line arguments array.
Returns:
0 on success, any other value on error.

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

Parameters:
bj Bmeps job.
s1 Start index.
s2 End index.
Returns:
The maximum string length.

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

Parameters:
bj Bmeps job.

static void run_for_app_options ( BJ bj  )  [static]

Run for application options.

Parameters:
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.

Parameters:
bj Bmeps job.

static void run_for_filenames ( BJ bj  )  [static]

After creating temporary file names, run now.

Parameters:
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.

Parameters:
bj Bmeps job.

static void run_for_one_real_filename ( BJ bj,
char *  n 
) [static]

Run for on file name (input file) expaned/resolved.

Parameters:
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.

Parameters:
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.

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

Parameters:
bj Bmeps job.

static void show_alpha_channel_mixing ( BJ bj,
size_t  maxl,
unsigned char *  cp 
) [static]

Show alpha-channel mixing settings.

Parameters:
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.

Parameters:
bj Bmeps job.
maxl Reserved space.
cp Code page.

static void show_configuration ( BJ bj  )  [static]

Show configuration.

Parameters:
bj Bmeps job.

static void show_configuration_eps ( BJ bj,
size_t  maxl,
unsigned char *  cp 
) [static]

Show EPS output options.

Parameters:
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.

Parameters:
bj Bmeps job.
maxl Space reserved for output.
cp Code page.

static void show_details ( BJ bj,
unsigned char *  cp 
) [static]

Show details.

Parameters:
bj Bmeps job.
cp Code page.

static void show_encodings ( BJ bj,
size_t  maxl,
unsigned char *  cp 
) [static]

Show encodings.

Parameters:
bj Bmeps job.
maxl Reserved text width for output.
cp Code page.

static void show_help ( BJ bj  )  [static]

Show help text.

Parameters:
bj Bmeps job.

static void show_interpolation ( BJ bj,
size_t  maxl,
unsigned char *  cp 
) [static]

Show interpolation.

Parameters:
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.

Parameters:
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.

Parameters:
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).

Parameters:
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).

Parameters:
bj Bmeps jobs.
fi Input file.
fo Output file.
Returns:
1 on success, 0 on error.

static void write_configuration ( BJ bj  )  [static]

Write configuration to preferences.

Parameters:
bj Bmeps sjob.


Variable Documentation

char empty_string[] = { "" } [static]

Empty string.

char* encoding_types[] [static]

Initial value:

 {
  "ascii85", "run-length", "lzw", "dct", "flate"
}
Encoding type names.

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
}
Help text to show from "bmeps --help".

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
}
Long options.

char* output_type_names[] [static]

Initial value:

 {
  "EPS", "PDF", "BB (bounding box)"
}
Names of output types.

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:

 {



"/"

}
File name separator character.

char str_off[] = { "off" } [static]

String off.

char str_on[] = { "on" } [static]

String on.

char str_ps2[] = { "ps2" } [static]

String ps2.


Generated on Tue Jul 14 14:30:21 2009 for bmeps by  doxygen 1.5.8