![]() |
GNU PROLOG with UTF8 support
|
#include "../EnginePl/gp_config.h"#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <sys/stat.h>#include <errno.h>#include <ctype.h>#include <sys/types.h>#include <dirent.h>#include <unistd.h>#include <sys/param.h>#include <sys/wait.h>#include "../EnginePl/pl_params.h"#include "../EnginePl/wam_regs.h"#include "decode_hexa.c"#include "copying.c"#include "prolog_path.c"#include "../EnginePl/machine1.c"
Data Structures | |
| struct | FileInf |
| struct | CmdInf |
Macros | |
| #define | READ_REGISTRY_ONLY |
| #define | CMD_LINE_MAX_OPT 8192 |
| #define | CMD_LINE_LENGTH (MAXPATHLEN + CMD_LINE_MAX_OPT + 1) |
| #define | TEMP_FILE_PREFIX GPLC |
| #define | OBJ_FILE_ALL_PL_BIPS "all_pl_bips" |
| #define | OBJ_FILE_ALL_FD_BIPS "all_fd_bips" |
| #define | OBJ_FILE_TOP_LEVEL "top_level" |
| #define | OBJ_FILE_DEBUGGER "debugger" |
| #define | EXE_FILE_PL2WAM "pl2wam" |
| #define | EXE_FILE_WAM2MA "wam2ma" |
| #define | EXE_FILE_MA2ASM "ma2asm" |
| #define | EXE_FILE_ASM AS |
| #define | EXE_FILE_FD2C "fd2c" |
| #define | EXE_FILE_CC CC |
| #define | EXE_FILE_LINK CC |
| #define | EXE_FILE_STRIP STRIP |
| #define | FILE_PL 0 |
| #define | FILE_WAM 1 |
| #define | FILE_MA 2 |
| #define | FILE_ASM 3 |
| #define | FILE_OBJ 4 |
| #define | FILE_FD 5 |
| #define | FILE_C 6 |
| #define | FILE_LINK 7 |
| #define | LINK_OPTION 8 |
| #define | PL_SUFFIX PROLOG_FILE_SUFFIX |
| #define | PL_SUFFIX_ALTERNATE PROLOG_FILE_SUFFIXES_ALT |
| #define | WAM_SUFFIX ".wam" |
| #define | WBC_SUFFIX ".wbc" |
| #define | MA_SUFFIX ".ma" |
| #define | FD_SUFFIX ".fd" |
| #define | C_SUFFIX ".c" |
| #define | C_SUFFIX_ALTERNATE "|.C|.cc|.CC|.cxx|.CXX|.c++|.C++|.cpp|.CPP|" |
| #define | CC_COMPILE_OPT "-c " |
| #define | CC_INCLUDE_OPT "-I" |
| #define | Record_Link_Warn_Option(i) sprintf(warn_str + strlen(warn_str), "%s ", argv[i]) |
| #define | Before_Cmd(cmd) |
| #define | After_Cmd(error) |
| #define | Check_Arg(i, str) (last_opt = str, strncmp(argv[i], str, strlen(argv[i])) == 0) |
| #define | Add_Last_Option(opt) sprintf(opt + strlen(opt), "%s ", last_opt) |
| #define | Add_Option(i, opt) sprintf(opt + strlen(opt), "%s ", argv[i]) |
| #define | L(msg) fprintf(stderr, "%s\n", msg) |
Functions | |
| char * | Search_Path (char *file) |
| void | Determine_Pathnames (void) |
| void | Compile_Files (void) |
| void | Create_Output_File_Name (FileInf *f, char *buff) |
| void | New_Work_File (FileInf *f, int stage, int stop_after) |
| void | Free_Work_File2 (FileInf *f) |
| void | Compile_Cmd (CmdInf *c, FileInf *f) |
| void | Link_Cmd (void) |
| void | Exec_One_Cmd (char *str, int no_decode_hex) |
| int | Spawn_Decode_Hex (char *arg[]) |
| void | Delete_Temp_File (char *name) |
| int | Find_File (char *file, char *suff, char *file_path, int ignore_error) |
| char * | Find_Suffix (char *suffixes, char *suffix) |
| void | Pl_Fatal_Error (char *format,...) |
| void | Parse_Arguments (int argc, char *argv[]) |
| void | Display_Help (void) |
| int | main (int argc, char *argv[]) |
| #define Add_Last_Option | ( | opt | ) | sprintf(opt + strlen(opt), "%s ", last_opt) |
| #define After_Cmd | ( | error | ) |
| #define Before_Cmd | ( | cmd | ) |
| #define C_SUFFIX ".c" |
| #define C_SUFFIX_ALTERNATE "|.C|.cc|.CC|.cxx|.CXX|.c++|.C++|.cpp|.CPP|" |
| #define CC_COMPILE_OPT "-c " |
| #define CC_INCLUDE_OPT "-I" |
| #define CMD_LINE_LENGTH (MAXPATHLEN + CMD_LINE_MAX_OPT + 1) |
| #define CMD_LINE_MAX_OPT 8192 |
| #define EXE_FILE_ASM AS |
| #define EXE_FILE_CC CC |
| #define EXE_FILE_FD2C "fd2c" |
| #define EXE_FILE_LINK CC |
| #define EXE_FILE_MA2ASM "ma2asm" |
| #define EXE_FILE_PL2WAM "pl2wam" |
| #define EXE_FILE_STRIP STRIP |
| #define EXE_FILE_WAM2MA "wam2ma" |
| #define FD_SUFFIX ".fd" |
| #define FILE_ASM 3 |
| #define FILE_C 6 |
| #define FILE_FD 5 |
| #define FILE_LINK 7 |
| #define FILE_MA 2 |
| #define FILE_OBJ 4 |
| #define FILE_PL 0 |
| #define FILE_WAM 1 |
| #define L | ( | msg | ) | fprintf(stderr, "%s\n", msg) |
| #define LINK_OPTION 8 |
| #define MA_SUFFIX ".ma" |
| #define OBJ_FILE_ALL_FD_BIPS "all_fd_bips" |
| #define OBJ_FILE_ALL_PL_BIPS "all_pl_bips" |
| #define OBJ_FILE_DEBUGGER "debugger" |
| #define OBJ_FILE_TOP_LEVEL "top_level" |
| #define PL_SUFFIX PROLOG_FILE_SUFFIX |
| #define PL_SUFFIX_ALTERNATE PROLOG_FILE_SUFFIXES_ALT |
| #define READ_REGISTRY_ONLY |
| #define TEMP_FILE_PREFIX GPLC |
| #define WAM_SUFFIX ".wam" |
| #define WBC_SUFFIX ".wbc" |


| void Compile_Files | ( | void | ) |


| void Create_Output_File_Name | ( | FileInf * | f, |
| char * | buff | ||
| ) |

| void Delete_Temp_File | ( | char * | name | ) |

| void Determine_Pathnames | ( | void | ) |
| void Display_Help | ( | void | ) |

| void Exec_One_Cmd | ( | char * | str, |
| int | no_decode_hex | ||
| ) |


| int Find_File | ( | char * | file, |
| char * | suff, | ||
| char * | file_path, | ||
| int | ignore_error | ||
| ) |


| char * Find_Suffix | ( | char * | suffixes, |
| char * | suffix | ||
| ) |

| void Free_Work_File2 | ( | FileInf * | f | ) |


| void Link_Cmd | ( | void | ) |


| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |

| void New_Work_File | ( | FileInf * | f, |
| int | stage, | ||
| int | stop_after | ||
| ) |


| void Parse_Arguments | ( | int | argc, |
| char * | argv[] | ||
| ) |


| void Pl_Fatal_Error | ( | char * | format, |
| ... | |||
| ) |


| char* Search_Path | ( | char * | file | ) |
| int Spawn_Decode_Hex | ( | char * | arg[] | ) |


| int bc_mode = 0 |
| char* cc_fd2c_flags = CFLAGS " " |
| CmdInf cmd_asm = { EXE_FILE_ASM, " " ASFLAGS " ", "-o " } |
| CmdInf cmd_cc = { EXE_FILE_CC, " ", CC_OBJ_NAME_OPT } |
| CmdInf cmd_fd2c = { EXE_FILE_FD2C, " ", "-o " } |
| CmdInf cmd_link = { EXE_FILE_LINK, " " CFLAGS_MACHINE " ", CC_EXE_NAME_OPT } |
| CmdInf cmd_ma2asm = { EXE_FILE_MA2ASM, " ", "-o " } |
| CmdInf cmd_pl2wam = { EXE_FILE_PL2WAM, " ", "-o " } |
| CmdInf cmd_wam2ma = { EXE_FILE_WAM2MA, " ", "-o " } |
| char* devel_dir[] |
| int devel_mode = 0 |
| FileInf* file_lopt |
| char* file_name_out = NULL |
| int gui_console = 0 |
| char* last_opt |
| int min_fd_bips = 0 |
| int min_pl_bips = 0 |
| int nb_file_lopt = 0 |
| int needs_stack_file = 0 |
| int no_debugger = 0 |
| int no_decode_hex = 0 |
| int no_del_temp_files = 0 |
| int no_fd_lib = 0 |
| int no_fd_lib_warn = 0 |
| int no_pl_lib = 0 |
| int no_top_level = 0 |
| int pl_def_cstr_size = -1 |
| int pl_def_global_size = -1 |
| int pl_def_local_size = -1 |
| int pl_def_max_atom = -1 |
| int pl_def_trail_size = -1 |
| int pl_fixed_sizes = 0 |
| char* start_path |
| int stop_after = FILE_LINK |
| int strip = 0 |
| char* suffixes[] |
| char* temp_dir = NULL |
| int verbose = 0 |
| char warn_str[1024] = "" |
1.8.11