w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

xmain.c File Reference
#include <string.h>
#include <stdlib.h>
#include "obx.h"
#include "keiko.h"
#include "exec.h"
Include dependency graph for xmain.c:

Go to the source code of this file.

Macros

#define main   xmain
 
#define EXTERN
 
#define MYNAME   "runtime system"
 
#define TOP   5 /* Number of frames shown at top and bottom */
 
#define BOT   5
 
#define GAP   10 /* Don't omit less than this many frames */
 
#define NBUF   (BOT+GAP-1)
 
#define argc   saved_argc
 
#define argv   saved_argv
 

Functions

void make_module (char *name, word addr, int chksum, int nlines)
 
void make_proc (char *name, word addr)
 
void make_symbol (const char *kind, char *name, word addr)
 
void fix_sizes (int dseg)
 
static void backtrace (value *bp)
 
static const char * message (int code)
 
void error_stop (const char *msg, int val, int line, value *bp, uchar *pc)
 
void runtime_error (int m, int line, value *bp, uchar *pc)
 
void rterror (int num, int line, value *bp)
 
void stkoflo (value *bp)
 
static void run (value *prog)
 
void xmain_exit (int status)
 
void error_exit (int status)
 
int xmain (int ac, char *av[])
 
word wrap_prim (primitive *prim)
 

Variables

const char * version
 
const char * lib_version
 
const char * copyright = "Copyright (C) 1999--2012 J. M. Spivey"
 
int vm_debug
 

Macro Definition Documentation

◆ argc

int argc   saved_argc

Definition at line 269 of file xmain.c.

Referenced by _getopt_initialize(), _getopt_internal(), _getopt_internal_r(), _getopt_long_only_r(), _getopt_long_r(), aget_index(), aptex_run(), argnum_error(), argvRemove(), callgs(), callgsDLL(), cipush(), Clp_NewParser(), Clp_SetArguments(), codegen(), CommandLine::CommandLine(), createargtable(), createCmdLine(), DecodeArgs(), do_args(), do_args_first_pass(), do_args_second_pass(), doalias(), doargs(), dobind(), dobreak(), dobuiltin(), dochdir(), docontinue(), dodrive(), doecho(), doexit(), dofc(), dofunctions(), dogetopts(), dohistory(), dolet(), dopwd(), doread(), doreturn(), doset(), doshift(), dotrap(), dotypeset(), doumask(), dounalias(), dounset(), dowhence(), exc_exception(), exec_command(), expand_builtin_function(), extractbb(), f_instance_eval(), fixCommandLine(), floatArg(), get_hash(), getargs(), getopt(), getopt_long(), getopt_long_only(), GetOptions(), Ghostscript::Ghostscript(), grabArg(), hash_except(), hash_slice(), hash_values_at(), Ghostscript::init(), init_settings(), Ghostscript::init_with_args(), initArgs(), Initialise(), kpathsea_get_command_line_args_utf8(), longArg(), lua_initialize(), luac_main(), main(), make_command_line(), math_log(), mcall(), method_bcall(), method_call(), mod_attr_define(), mrb_argnum_error(), mrb_ary_push_m(), mrb_ary_splice(), mrb_ary_values_at(), mrb_basicsocket_setsockopt(), mrb_class_new_instance(), mrb_f_caller(), mrb_f_raise(), mrb_f_send(), mrb_f_sprintf(), mrb_file__gethome(), mrb_file_realpath(), mrb_file_s_chmod(), mrb_file_s_unlink(), mrb_funcall(), mrb_funcall_argv(), mrb_funcall_id(), mrb_funcall_with_block(), mrb_get_arg1(), mrb_get_argc(), mrb_get_args(), mrb_get_argv(), mrb_get_values_at(), mrb_instance_new(), mrb_io_s_select(), mrb_make_exception(), mrb_mod_module_exec(), mrb_mod_module_function(), mrb_mod_remove_method(), mrb_mod_undef(), mrb_obj_extend(), mrb_obj_extend_m(), mrb_obj_instance_exec(), mrb_obj_new(), mrb_print(), mrb_proc_new_cfunc_with_env(), mrb_puts(), mrb_str_chomp_bang(), mrb_str_end_with(), mrb_str_format(), mrb_str_split_m(), mrb_str_start_with(), mrb_struct_initialize(), mrb_struct_initialize_withArg(), mrb_struct_s_def(), mrb_struct_values_at(), mrb_vm_exec(), mrb_yield_argv(), mrb_yield_cont(), mrb_yield_with_class(), my_getopt(), openfiles(), options_init(), optParseOptions(), CL::CommandLine::parse(), cmdlineparse::parser::parse(), parse_args(), parse_cmd_line(), parse_command_line(), parse_options(), parse_switches(), parseArgs(), ParseArgs(), parseargs(), ProgramOptions::parseoptions(), CL::CommandLine::parseShortOption(), PASCAL_MAIN(), pm_optParseOptions(), pmain(), Pre_Process_Argv(), printHelp(), processargs(), processOptions(), pstoedit(), pstoedit_plainC(), pstoeditwithghostscript(), ptenc_get_command_line_args(), raise_va(), read_command_line(), read_config_file(), read_config_special(), read_options(), rezzip_make(), runTestRequest(), scan_args(), SetBrowseGlob(), SetUpParameterEV(), strip(), synctex_edit(), synctex_test(), synctex_test_file(), synctex_update(), synctex_view(), u_parseArgs(), unzzip_cat(), unzzip_extract(), unzzip_list(), unzzip_long_list(), unzzip_print(), unzzip_show_list(), WndProc(), and xmain().

◆ argv

char ** argv   saved_argv

Definition at line 270 of file xmain.c.

Referenced by __declspec(), _getopt_initialize(), _getopt_internal(), _getopt_internal_r(), _getopt_long_only_r(), _getopt_long_r(), add_charpath(), aget_index(), aptex_run(), argvRemove(), BuildCommandLine(), callgs(), callgsDLL(), ChangeDirectory(), CheckParameterLength(), child_execute_job(), Clp_NewParser(), Clp_SetArguments(), collectargs(), CommandLine::CommandLine(), construct_command_argv(), createargtable(), createCmdLine(), DecodeArgs(), do_args(), do_args_first_pass(), do_args_second_pass(), doalias(), doargs(), dobind(), dobreak(), dobuiltin(), dobytecode(), dochdir(), docontinue(), dodot(), dodrive(), doecho(), doeval(), doexit(), doexport(), dofc(), dofunctions(), dogetopts(), dohistory(), dolet(), domsdos(), dopwd(), doread(), doreadonly(), doreturn(), doset(), doshift(), doswap(), dotest(), dotrap(), dotypeset(), doumask(), dounalias(), dounset(), dowhence(), EnvironExecute(), exchange(), exec_command(), ExecuteACommand(), ExecuteScriptFile(), ExecuteSpecialProcessor(), ExecuteWindows(), expand_builtin_function(), extractbb(), f_instance_eval(), FindAcrobatModule(), fixCommandLine(), floatArg(), func_abspath(), func_addsuffix_addprefix(), func_and(), func_basename_dir(), func_call(), func_error(), func_eval(), func_file(), func_filter_filterout(), func_findstring(), func_firstword(), func_flavor(), func_foreach(), func_if(), func_join(), func_lastword(), func_notdir_suffix(), func_or(), func_origin(), func_patsubst(), func_realpath(), func_shell(), func_shell_base(), func_sort(), func_strip(), func_subst(), func_value(), func_wildcard(), func_word(), func_wordlist(), func_words(), get_hash(), getargs(), getopt(), getopt_long(), getopt_long_only(), GetOptions(), Ghostscript::Ghostscript(), grabArg(), handle_function(), handle_script(), hash_except(), hash_slice(), hash_values_at(), help_formats(), help_message(), Ghostscript::init(), init_default_kanji_select(), init_kpse(), init_settings(), Ghostscript::init_with_args(), initArgs(), Initialise(), kpathsea_fsyscp_spawnvp(), kpathsea_get_command_line_args_utf8(), LocalExecve(), longArg(), lua_initialize(), luac_main(), main(), make_command_line(), mcall(), method_bcall(), method_call(), mod_attr_define(), mrb_ary_push_m(), mrb_ary_splice(), mrb_ary_values_at(), mrb_class_new_instance(), mrb_f_send(), mrb_f_sprintf(), mrb_file_s_unlink(), mrb_funcall(), mrb_funcall_argv(), mrb_funcall_id(), mrb_funcall_with_block(), mrb_get_args(), mrb_get_values_at(), mrb_instance_new(), mrb_io_s_select(), mrb_make_exception(), mrb_mod_module_exec(), mrb_mod_module_function(), mrb_mod_remove_method(), mrb_mod_undef(), mrb_name_error(), mrb_no_method_error(), mrb_obj_extend(), mrb_obj_extend_m(), mrb_obj_instance_exec(), mrb_obj_new(), mrb_print(), mrb_proc_new_cfunc_with_env(), mrb_puts(), mrb_str_end_with(), mrb_str_format(), mrb_str_start_with(), mrb_struct_initialize(), mrb_struct_initialize_withArg(), mrb_struct_s_def(), mrb_struct_values_at(), mrb_vm_exec(), mrb_yield_argv(), mrb_yield_cont(), mrb_yield_with_class(), my_getopt(), MyExecute(), openfiles(), options_init(), optParseOptions(), CL::CommandLine::parse(), cmdlineparse::parser::parse(), parse_args(), parse_cmd_line(), parse_command_line(), parse_options(), parse_part1(), parse_part2(), parse_switches(), parseArgs(), ParseArgs(), parseargs(), ProgramOptions::parseoptions(), CL::CommandLine::parseShortOption(), PASCAL_MAIN(), pbm_init(), pgm_init(), pm_init(), pm_optParseOptions(), pmain(), pnm_init(), ppm_init(), Pre_Process_Argv(), prepare_cmdline(), printHelp(), process_begin(), process_easy(), process_files(), processargs(), processOptions(), ProcessSpaceInParameters(), pstoedit(), pstoedit_plainC(), pstoeditwithghostscript(), ptenc_get_command_line_args(), put_numbers(), raise_va(), read_command_line(), read_config_file(), read_config_special(), read_options(), rezzip_make(), runargs(), runTestRequest(), scan_args(), SetBrowseGlob(), SetUpParameterEV(), start_job_command(), start_remote_job(), StartTheProcess(), synctex_edit(), synctex_test(), synctex_test_file(), synctex_update(), synctex_view(), system(), TypesetVariables(), u_parseArgs(), unzzip_cat(), unzzip_extract(), unzzip_list(), unzzip_long_list(), unzzip_print(), unzzip_show_list(), UpdateVariableStatus(), WndProc(), and xmain().

◆ BOT

#define BOT   5

Definition at line 147 of file xmain.c.

◆ EXTERN

#define EXTERN (   void)

Definition at line 36 of file xmain.c.

◆ GAP

#define GAP   10 /* Don't omit less than this many frames */

Definition at line 148 of file xmain.c.

◆ main

#define main (   void)    xmain

Definition at line 31 of file xmain.c.

◆ MYNAME

#define MYNAME   "runtime system"

Definition at line 54 of file xmain.c.

◆ NBUF

#define NBUF   (BOT+GAP-1)

Definition at line 149 of file xmain.c.

◆ TOP

#define TOP   5 /* Number of frames shown at top and bottom */

Definition at line 146 of file xmain.c.

Function Documentation

◆ backtrace()

◆ error_exit()

void error_exit ( int  status)

Definition at line 504 of file xmain.c.

References exit(), and status.

◆ error_stop()

void error_stop ( const char *  msg,
int  val,
int  line,
value bp,
uchar pc 
)

Definition at line 222 of file xmain.c.

References backtrace(), bp, buf, cp, CP, dsegaddr, exit(), fflush, find_module, fprintf, mod(), nprocs, NULL, pc, sprintf, strcmp(), and valptr.

Referenced by EASSERT(), runtime_error(), and sys_liberror().

◆ fix_sizes()

void fix_sizes ( int  dseg)

Definition at line 132 of file xmain.c.

References dmem, dsegaddr, i, _module::m_addr, _module::m_length, modtab, nmods, and p.

Referenced by load_image().

◆ make_module()

void make_module ( char *  name,
word  addr,
int  chksum,
int  nlines 
)

Definition at line 79 of file xmain.c.

References m, memset(), modtab, name, check-symbols::nm, nmods, NULL, panic(), and scratch_alloc_atomic.

Referenced by load_image().

◆ make_proc()

void make_proc ( char *  name,
word  addr 
)

Definition at line 103 of file xmain.c.

References a, cp, CP_CODE, CP_SIZE, i, name, np, nprocs, NULL, p, panic(), proctab, ptrcast, and scratch_alloc_atomic.

Referenced by load_image().

◆ make_symbol()

void make_symbol ( const char *  kind,
char *  name,
word  addr 
)

Definition at line 125 of file xmain.c.

References kind, and name.

◆ message()

static const char* message ( int  code)
static

Definition at line 192 of file xmain.c.

References E_ASSIGN, E_BOUND, E_CASE, E_CAST, E_DIV, E_FDIV, E_GLOB, E_NULL, E_RETURN, E_STACK, and E_WITH.

Referenced by runtime_error().

◆ rterror()

void rterror ( int  num,
int  line,
value bp 
)

Definition at line 257 of file xmain.c.

References bp, NULL, num, and runtime_error().

◆ run()

static void run ( value prog)
static

Definition at line 272 of file xmain.c.

References BP, CP, dsegaddr, HEAD, PC, primcall, prog, sp, and stack_size.

Referenced by xmain().

◆ runtime_error()

void runtime_error ( int  m,
int  line,
value bp,
uchar pc 
)

Definition at line 252 of file xmain.c.

References bp, error_stop(), m, message(), and pc.

Referenced by dbl_zcheck(), flo_zcheck(), long_zcheck(), rterror(), and stkoflo().

◆ stkoflo()

void stkoflo ( value bp)

Definition at line 262 of file xmain.c.

References bp, E_STACK, NULL, and runtime_error().

◆ wrap_prim()

word wrap_prim ( primitive prim)

Definition at line 627 of file xmain.c.

References prim, primitive, ptrcast, and virtual_alloc_atomic.

Referenced by dltrap(), and xmain().

◆ xmain()

◆ xmain_exit()

void xmain_exit ( int  status)

Definition at line 492 of file xmain.c.

References exit(), NULL, and status.

Referenced by P_xmain_exit(), and xmain().

Variable Documentation

◆ copyright

const char* copyright = "Copyright (C) 1999--2012 J. M. Spivey"

Definition at line 73 of file xmain.c.

Referenced by gregorio_print_version(), main(), otfcc_buildName(), and PS_Head().

◆ lib_version

const char* lib_version
extern

Definition at line 7 of file Builtin.c.

◆ version

const char* version ( void  )
Initial value:
=
"Oxford Oberon-2 " "runtime system" " version " "2021-02-07" " [build " "xml2pmx" "]"
""
""

bbox – calculates Bounding Box of a pbmraw/ppmraw-picture
Created: Nov. 1997, revised Feb. 1998, Dec. 1999, June 2009
Author: Roland Bless <roland -at- bless.de>
Copyright (C) 1998-2009 Roland Bless
To compile simply use:
"cc bbox.c -o bbox" or "make bbox"
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA global variables *

Definition at line 58 of file xmain.c.

Referenced by main().

◆ vm_debug

int vm_debug
extern

Referenced by xmain().