remake
4.3+dbg-1.5
|
#include <config.h>
#include "gnuremake.h"
#include <stddef.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
#include <stdio.h>
#include <ctype.h>
#include <time.h>
#include <errno.h>
#include <strings.h>
#include <gettext.h>
#include <glob.h>
#include <alloca.h>
#include <sys/timeb.h>
#include <sys/time.h>
#include <unistd.h>
#include <limits.h>
#include <sys/param.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <stdint.h>
#include <locale.h>
Go to the source code of this file.
Macros | |
#define | HAVE_CONFIG_H 1 |
#define | _GNU_SOURCE 1 |
#define | NDEBUG 1 |
#define | isblank(c) ((c) == ' ' || (c) == '\t') |
#define | sigmask(sig) (1 << ((sig) - 1)) |
#define | PATH_MAX MAXPATHLEN |
#define | MAXPATHLEN 1024 |
#define | GET_PATH_MAX PATH_MAX |
#define | PATH_VAR(var) char var[PATH_MAX+1] |
#define | CHAR_BIT 8 |
#define | USHRT_MAX 65535 |
#define | INTEGER_TYPE_SIGNED(t) ((t) -1 <= 0) |
#define | INTEGER_TYPE_MINIMUM(t) (! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)) |
#define | INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t)) |
#define | CHAR_MAX INTEGER_TYPE_MAXIMUM (char) |
#define | S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) |
#define | S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) |
#define | ATTRIBUTE(x) |
#define | __format__ format |
#define | __printf__ printf |
#define | UNUSED ATTRIBUTE ((unused)) |
#define | NORETURN ATTRIBUTE ((noreturn)) |
#define | ANSI_STRING 1 |
#define | EXIT_SUCCESS 0 |
#define | EXIT_FAILURE 1 |
#define | FILE_TIMESTAMP uintmax_t |
#define | ISDIGIT(c) ((unsigned) (c) - '0' <= 9) |
#define | streq(a, b) |
#define | patheq(a, b) streq(a, b) |
#define | strneq(a, b, l) (strncmp ((a), (b), (l)) == 0) |
#define | ENUM_BITFIELD(bits) |
#define | _(msgid) gettext (msgid) |
#define | N_(msgid) gettext_noop (msgid) |
#define | S_(msg1, msg2, num) ngettext (msg1,msg2,num) |
#define | ANY_SET(_v, _m) (((_v)&(_m)) != 0) |
#define | NONE_SET(_v, _m) (! ANY_SET ((_v),(_m))) |
#define | MAP_NUL 0x0001 |
#define | MAP_BLANK 0x0002 |
#define | MAP_NEWLINE 0x0004 |
#define | MAP_COMMENT 0x0008 |
#define | MAP_SEMI 0x0010 |
#define | MAP_EQUALS 0x0020 |
#define | MAP_COLON 0x0040 |
#define | MAP_VARSEP 0x0080 |
#define | MAP_PIPE 0x0100 |
#define | MAP_DOT 0x0200 |
#define | MAP_COMMA 0x0400 |
#define | MAP_USERFUNC 0x2000 |
#define | MAP_VARIABLE 0x4000 |
#define | MAP_DIRSEP 0x8000 |
#define | MAP_SPACE (MAP_BLANK|MAP_NEWLINE) |
#define | MAP_PATHSEP MAP_COLON |
#define | STOP_SET(_v, _m) ANY_SET(stopchar_map[(unsigned char)(_v)],(_m)) |
#define | ISBLANK(c) STOP_SET((c),MAP_BLANK) |
#define | ISSPACE(c) STOP_SET((c),MAP_SPACE) |
#define | NEXT_TOKEN(s) while (ISSPACE (*(s))) ++(s) |
#define | END_OF_TOKEN(s) while (! STOP_SET (*(s), MAP_SPACE|MAP_NUL)) ++(s) |
#define | NILF ((gmk_floc *)0) |
#define | CSTRLEN(_s) (sizeof (_s)-1) |
#define | STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s) |
#define | INTSTR_LENGTH CSTRLEN ("18446744073709551616") |
#define | DEFAULT_TTYNAME "true" |
#define | TTYNAME(_f) ttyname (_f) |
#define | O(_t, _a, _f) _t((_a), 0, (_f)) |
#define | OS(_t, _a, _f, _s) _t((_a), strlen (_s), (_f), (_s)) |
#define | OSS(_t, _a, _f, _s1, _s2) |
#define | OSSS(_t, _a, _f, _s1, _s2, _s3) |
#define | ON(_t, _a, _f, _n) _t((_a), INTSTR_LENGTH, (_f), (_n)) |
#define | ONN(_t, _a, _f, _n1, _n2) _t((_a), INTSTR_LENGTH*2, (_f), (_n1), (_n2)) |
#define | OSN(_t, _a, _f, _s, _n) |
#define | ONS(_t, _a, _f, _n, _s) |
#define | OUT_OF_MEM() O (fatal, NILF, _("virtual memory exhausted")) |
#define | xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s)) |
#define | SPIN(_s) |
#define | RECIPEPREFIX_NAME ".RECIPEPREFIX" |
#define | RECIPEPREFIX_DEFAULT '\t' |
#define | MIN(_a, _b) ((_a)<(_b)?(_a):(_b)) |
#define | MAX(_a, _b) ((_a)>(_b)?(_a):(_b)) |
#define | MAKE_SUCCESS 0 |
#define | MAKE_TROUBLE 1 |
#define | MAKE_FAILURE 2 |
#define | initialize_main(pargc, pargv) |
#define | EINTRLOOP(_v, _c) while (((_v)=_c)==-1 && errno==EINTR) |
#define | ENULLLOOP(_v, _c) |
Typedefs | |
typedef long int(* | ar_member_func_t) (int desc, const char *mem, int truncated, long int hdrpos, long int datapos, long int size, long int date, int uid, int gid, unsigned int mode, const void *arg) |
typedef int(* | load_func_t) (const gmk_floc *flocp) |
Functions | |
const char * | concat (unsigned int,...) |
void | message (int prefix, size_t length, const char *fmt,...) ATTRIBUTE((__format__(__printf__ |
void void | error (const gmk_floc *flocp, size_t length, const char *fmt,...) ATTRIBUTE((__format__(__printf__ |
void void void | fatal (const gmk_floc *flocp, size_t length, const char *fmt,...) ATTRIBUTE((noreturn |
void void void | __format__ (__printf__, 3, 4))) |
void | out_of_memory () NORETURN |
void | die (int) NORETURN |
void | pfatal_with_name (const char *) NORETURN |
void | perror_with_name (const char *, const char *) |
void * | xmalloc (size_t) |
void * | xcalloc (size_t) |
void * | xrealloc (void *, size_t) |
char * | xstrdup (const char *) |
char * | xstrndup (const char *, size_t) |
char * | find_next_token (const char **, size_t *) |
char * | next_token (const char *) |
char * | end_of_token (const char *) |
void | collapse_continuations (char *) |
char * | lindex (const char *, const char *, int) |
int | alpha_compare (const void *, const void *) |
void | print_spaces (unsigned int) |
char * | find_percent (char *) |
const char * | find_percent_cached (const char **) |
FILE * | get_tmpfile (char **, const char *) |
ssize_t | writebuf (int, const void *, size_t) |
ssize_t | readbuf (int, void *, size_t) |
int | ar_name (const char *) |
void | ar_parse_name (const char *, char **, char **) |
int | ar_touch (const char *) |
int | ar_member_date (const char *, time_t *) |
long int | ar_scan (const char *archive, ar_member_func_t function, const void *arg) |
int | ar_name_equal (const char *name, const char *mem, int truncated) |
int | ar_member_touch (const char *arname, const char *memname) |
int | dir_file_exists_p (const char *, const char *) |
int | file_exists_p (const char *) |
int | file_impossible_p (const char *) |
void | file_impossible (const char *) |
const char * | dir_name (const char *) |
void | print_dir_data_base (void) |
void | dir_setup_glob (glob_t *) |
void | hash_init_directories (void) |
void | define_default_variables (void) |
void | undefine_default_variables (void) |
void | set_default_suffixes (void) |
void | install_default_suffix_rules (void) |
void | install_default_implicit_rules (void) |
void | build_vpath_lists (void) |
void | construct_vpath_list (char *pattern, char *dirpath) |
const char * | vpath_search (const char *file, FILE_TIMESTAMP *mtime_ptr, unsigned int *vpath_index, unsigned int *path_index) |
void | construct_include_path (const char **arg_dirs) |
void | user_access (void) |
void | make_access (void) |
void | child_access (void) |
char * | strip_whitespace (const char **begpp, const char **endpp) |
void | show_goal_error (void) |
void | strcache_init (void) |
void | strcache_print_stats (const char *prefix) |
int | strcache_iscached (const char *str) |
const char * | strcache_add (const char *str) |
const char * | strcache_add_len (const char *str, size_t len) |
int | strcache_setbufsize (unsigned int size) |
int | guile_gmake_setup (const gmk_floc *flocp) |
int | load_file (const gmk_floc *flocp, const char **filename, int noerror) |
void | unload_file (const char *name) |
long int | atol () |
long int | lseek () |
char * | getcwd () |
void | remote_setup (void) |
void | remote_cleanup (void) |
int | start_remote_job_p (int) |
int | start_remote_job (char **, char **, int, int *, pid_t *, int *) |
int | remote_status (int *, int *, int *, int) |
void | block_remote_children (void) |
void | unblock_remote_children (void) |
int | remote_kill (pid_t id, int sig) |
void | print_variable_data_base (void) |
void | print_vpath_data_base (void) |
Variables | |
int | errno |
const gmk_floc * | reading_file |
const gmk_floc ** | expanding_var |
char ** | environ |
unsigned short | stopchar_map [] |
int | just_print_flag |
int | run_silent |
int | ignore_errors_flag |
int | keep_going_flag |
int | print_data_base_flag |
int | question_flag |
int | touch_flag |
int | always_make_flag |
int | env_overrides |
int | no_builtin_rules_flag |
int | no_builtin_variables_flag |
int | print_version_flag |
int | print_directory_flag |
int | check_symlink_flag |
int | warn_undefined_variables_flag |
int | trace_flag |
int | posix_pedantic |
int | not_parallel |
int | second_expansion |
int | clock_skew_detected |
int | rebuilding_makefiles |
int | one_shell |
int | output_sync |
int | verify_flag |
int | batch_mode_shell |
char | cmd_prefix |
unsigned int | job_slots |
int | job_fds [2] |
int | job_rfd |
double | max_load_average |
const char * | program |
char * | starting_directory |
unsigned int | makelevel |
char * | version_string |
char * | remote_description |
char * | make_host |
unsigned int | commands_started |
int | handling_fatal_signal |
#define _ | ( | msgid | ) | gettext (msgid) |
#define __format__ format |
#define __printf__ printf |
#define _GNU_SOURCE 1 |
#define ANSI_STRING 1 |
#define ANY_SET | ( | _v, | |
_m | |||
) | (((_v)&(_m)) != 0) |
#define ATTRIBUTE | ( | x | ) |
#define CHAR_BIT 8 |
#define CHAR_MAX INTEGER_TYPE_MAXIMUM (char) |
#define CSTRLEN | ( | _s | ) | (sizeof (_s)-1) |
#define DEFAULT_TTYNAME "true" |
#define EINTRLOOP | ( | _v, | |
_c | |||
) | while (((_v)=_c)==-1 && errno==EINTR) |
#define ENULLLOOP | ( | _v, | |
_c | |||
) |
#define ENUM_BITFIELD | ( | bits | ) |
#define EXIT_FAILURE 1 |
#define EXIT_SUCCESS 0 |
#define FILE_TIMESTAMP uintmax_t |
#define GET_PATH_MAX PATH_MAX |
#define HAVE_CONFIG_H 1 |
#define initialize_main | ( | pargc, | |
pargv | |||
) |
#define INTEGER_TYPE_MAXIMUM | ( | t | ) | (~ (t) 0 - INTEGER_TYPE_MINIMUM (t)) |
#define INTEGER_TYPE_MINIMUM | ( | t | ) | (! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)) |
#define INTEGER_TYPE_SIGNED | ( | t | ) | ((t) -1 <= 0) |
#define INTSTR_LENGTH CSTRLEN ("18446744073709551616") |
#define isblank | ( | c | ) | ((c) == ' ' || (c) == '\t') |
#define ISDIGIT | ( | c | ) | ((unsigned) (c) - '0' <= 9) |
#define MAKE_FAILURE 2 |
#define MAKE_SUCCESS 0 |
#define MAKE_TROUBLE 1 |
#define MAP_BLANK 0x0002 |
#define MAP_COLON 0x0040 |
#define MAP_COMMA 0x0400 |
#define MAP_COMMENT 0x0008 |
#define MAP_DIRSEP 0x8000 |
#define MAP_DOT 0x0200 |
#define MAP_EQUALS 0x0020 |
#define MAP_NEWLINE 0x0004 |
#define MAP_NUL 0x0001 |
#define MAP_PATHSEP MAP_COLON |
#define MAP_PIPE 0x0100 |
#define MAP_SEMI 0x0010 |
#define MAP_SPACE (MAP_BLANK|MAP_NEWLINE) |
#define MAP_USERFUNC 0x2000 |
#define MAP_VARIABLE 0x4000 |
#define MAP_VARSEP 0x0080 |
#define MAX | ( | _a, | |
_b | |||
) | ((_a)>(_b)?(_a):(_b)) |
#define MAXPATHLEN 1024 |
#define MIN | ( | _a, | |
_b | |||
) | ((_a)<(_b)?(_a):(_b)) |
#define N_ | ( | msgid | ) | gettext_noop (msgid) |
#define NDEBUG 1 |
#define NEXT_TOKEN | ( | s | ) | while (ISSPACE (*(s))) ++(s) |
#define NILF ((gmk_floc *)0) |
#define NONE_SET | ( | _v, | |
_m | |||
) | (! ANY_SET ((_v),(_m))) |
#define NORETURN ATTRIBUTE ((noreturn)) |
#define O | ( | _t, | |
_a, | |||
_f | |||
) | _t((_a), 0, (_f)) |
#define ON | ( | _t, | |
_a, | |||
_f, | |||
_n | |||
) | _t((_a), INTSTR_LENGTH, (_f), (_n)) |
#define ONN | ( | _t, | |
_a, | |||
_f, | |||
_n1, | |||
_n2 | |||
) | _t((_a), INTSTR_LENGTH*2, (_f), (_n1), (_n2)) |
#define ONS | ( | _t, | |
_a, | |||
_f, | |||
_n, | |||
_s | |||
) |
#define OS | ( | _t, | |
_a, | |||
_f, | |||
_s | |||
) | _t((_a), strlen (_s), (_f), (_s)) |
#define OSN | ( | _t, | |
_a, | |||
_f, | |||
_s, | |||
_n | |||
) |
#define OSS | ( | _t, | |
_a, | |||
_f, | |||
_s1, | |||
_s2 | |||
) |
#define OSSS | ( | _t, | |
_a, | |||
_f, | |||
_s1, | |||
_s2, | |||
_s3 | |||
) |
#define PATH_MAX MAXPATHLEN |
#define PATH_VAR | ( | var | ) | char var[PATH_MAX+1] |
#define patheq | ( | a, | |
b | |||
) | streq(a, b) |
#define RECIPEPREFIX_DEFAULT '\t' |
#define RECIPEPREFIX_NAME ".RECIPEPREFIX" |
#define S_ | ( | msg1, | |
msg2, | |||
num | |||
) | ngettext (msg1,msg2,num) |
#define S_ISDIR | ( | mode | ) | (((mode) & S_IFMT) == S_IFDIR) |
#define S_ISREG | ( | mode | ) | (((mode) & S_IFMT) == S_IFREG) |
#define sigmask | ( | sig | ) | (1 << ((sig) - 1)) |
#define SPIN | ( | _s | ) |
#define STOP_SET | ( | _v, | |
_m | |||
) | ANY_SET(stopchar_map[(unsigned char)(_v)],(_m)) |
#define streq | ( | a, | |
b | |||
) |
#define STRING_SIZE_TUPLE | ( | _s | ) | (_s), CSTRLEN(_s) |
#define strneq | ( | a, | |
b, | |||
l | |||
) | (strncmp ((a), (b), (l)) == 0) |
#define TTYNAME | ( | _f | ) | ttyname (_f) |
#define UNUSED ATTRIBUTE ((unused)) |
#define USHRT_MAX 65535 |
#define xstrlen | ( | _s | ) | ((_s)==NULL ? 0 : strlen (_s)) |
typedef long int(* ar_member_func_t) (int desc, const char *mem, int truncated, long int hdrpos, long int datapos, long int size, long int date, int uid, int gid, unsigned int mode, const void *arg) |
typedef int(* load_func_t) (const gmk_floc *flocp) |
void void void __format__ | ( | __printf__ | , |
3 | , | ||
4 | |||
) |
int alpha_compare | ( | const void * | , |
const void * | |||
) |
int ar_member_date | ( | const char * | , |
time_t * | |||
) |
int ar_member_touch | ( | const char * | arname, |
const char * | memname | ||
) |
int ar_name | ( | const char * | ) |
int ar_name_equal | ( | const char * | name, |
const char * | mem, | ||
int | truncated | ||
) |
void ar_parse_name | ( | const char * | , |
char ** | , | ||
char ** | |||
) |
long int ar_scan | ( | const char * | archive, |
ar_member_func_t | function, | ||
const void * | arg | ||
) |
int ar_touch | ( | const char * | ) |
long int atol | ( | ) |
void block_remote_children | ( | void | ) |
void build_vpath_lists | ( | void | ) |
void child_access | ( | void | ) |
void collapse_continuations | ( | char * | ) |
const char* concat | ( | unsigned | int, |
... | |||
) |
void construct_include_path | ( | const char ** | arg_dirs | ) |
void construct_vpath_list | ( | char * | pattern, |
char * | dirpath | ||
) |
void define_default_variables | ( | void | ) |
void die | ( | int | ) |
int dir_file_exists_p | ( | const char * | , |
const char * | |||
) |
const char* dir_name | ( | const char * | ) |
void dir_setup_glob | ( | glob_t * | ) |
char* end_of_token | ( | const char * | ) |
void void error | ( | const gmk_floc * | flocp, |
size_t | length, | ||
const char * | fmt, | ||
... | |||
) |
void void void fatal | ( | const gmk_floc * | flocp, |
size_t | length, | ||
const char * | fmt, | ||
... | |||
) |
int file_exists_p | ( | const char * | ) |
void file_impossible | ( | const char * | ) |
int file_impossible_p | ( | const char * | ) |
char* find_next_token | ( | const char ** | , |
size_t * | |||
) |
char* find_percent | ( | char * | ) |
const char* find_percent_cached | ( | const char ** | ) |
FILE* get_tmpfile | ( | char ** | , |
const char * | |||
) |
char* getcwd | ( | ) |
int guile_gmake_setup | ( | const gmk_floc * | flocp | ) |
void hash_init_directories | ( | void | ) |
void install_default_implicit_rules | ( | void | ) |
void install_default_suffix_rules | ( | void | ) |
char* lindex | ( | const char * | , |
const char * | , | ||
int | |||
) |
int load_file | ( | const gmk_floc * | flocp, |
const char ** | filename, | ||
int | noerror | ||
) |
long int lseek | ( | ) |
void make_access | ( | void | ) |
void message | ( | int | prefix, |
size_t | length, | ||
const char * | fmt, | ||
... | |||
) |
char* next_token | ( | const char * | ) |
void out_of_memory | ( | ) |
void perror_with_name | ( | const char * | , |
const char * | |||
) |
void pfatal_with_name | ( | const char * | ) |
void print_dir_data_base | ( | void | ) |
void print_spaces | ( | unsigned | int | ) |
void print_variable_data_base | ( | void | ) |
Referenced by dbg_cmd_info().
void print_vpath_data_base | ( | void | ) |
Referenced by dbg_cmd_info().
ssize_t readbuf | ( | int | , |
void * | , | ||
size_t | |||
) |
void remote_cleanup | ( | void | ) |
int remote_kill | ( | pid_t | id, |
int | sig | ||
) |
void remote_setup | ( | void | ) |
int remote_status | ( | int * | , |
int * | , | ||
int * | , | ||
int | |||
) |
void set_default_suffixes | ( | void | ) |
void show_goal_error | ( | void | ) |
int start_remote_job | ( | char ** | , |
char ** | , | ||
int | , | ||
int * | , | ||
pid_t * | , | ||
int * | |||
) |
int start_remote_job_p | ( | int | ) |
const char* strcache_add | ( | const char * | str | ) |
const char* strcache_add_len | ( | const char * | str, |
size_t | len | ||
) |
void strcache_init | ( | void | ) |
int strcache_iscached | ( | const char * | str | ) |
void strcache_print_stats | ( | const char * | prefix | ) |
int strcache_setbufsize | ( | unsigned int | size | ) |
char* strip_whitespace | ( | const char ** | begpp, |
const char ** | endpp | ||
) |
void unblock_remote_children | ( | void | ) |
void undefine_default_variables | ( | void | ) |
void unload_file | ( | const char * | name | ) |
void user_access | ( | void | ) |
const char* vpath_search | ( | const char * | file, |
FILE_TIMESTAMP * | mtime_ptr, | ||
unsigned int * | vpath_index, | ||
unsigned int * | path_index | ||
) |
ssize_t writebuf | ( | int | , |
const void * | , | ||
size_t | |||
) |
void* xcalloc | ( | size_t | ) |
void* xmalloc | ( | size_t | ) |
void* xrealloc | ( | void * | , |
size_t | |||
) |
char* xstrdup | ( | const char * | ) |
char* xstrndup | ( | const char * | , |
size_t | |||
) |
int always_make_flag |
int batch_mode_shell |
int check_symlink_flag |
int clock_skew_detected |
char cmd_prefix |
unsigned int commands_started |
int env_overrides |
char** environ |
int errno |
const gmk_floc** expanding_var |
int handling_fatal_signal |
int ignore_errors_flag |
int job_fds[2] |
int job_rfd |
unsigned int job_slots |
int just_print_flag |
int keep_going_flag |
char * make_host |
unsigned int makelevel |
double max_load_average |
int no_builtin_rules_flag |
int no_builtin_variables_flag |
int not_parallel |
int one_shell |
int output_sync |
int posix_pedantic |
int print_data_base_flag |
int print_directory_flag |
int print_version_flag |
const char* program |
int question_flag |
const gmk_floc* reading_file |
int rebuilding_makefiles |
char * remote_description |
int run_silent |
int second_expansion |
char* starting_directory |
unsigned short stopchar_map[] |
int touch_flag |
int trace_flag |
int verify_flag |
char* version_string |
int warn_undefined_variables_flag |