Apache HTTPD
Classes | Macros | Enumerations | Functions
jlibtool.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <dirent.h>
#include <errno.h>
#include <assert.h>

Go to the source code of this file.

Classes

struct  count_chars
 
struct  library_name
 
struct  library_opts
 
struct  options_t
 
struct  command_t
 

Macros

#define PATH_MAX   1024
 
#define VERSION   "1.4"
 

Enumerations

enum  tool_mode_t { mUnknown , mCompile , mLink , mInstall }
 
enum  output_t {
  otGeneral , otObject , otProgram , otLibrary ,
  otStaticLibraryOnly , otDynamicLibraryOnly , otModule
}
 
enum  pic_mode_e { pic_UNKNOWN , pic_PREFER , pic_AVOID }
 
enum  shared_mode_e { share_UNSET , share_STATIC , share_SHARED }
 
enum  lib_type {
  type_UNKNOWN , type_DYNAMIC_LIB , type_STATIC_LIB , type_MODULE_LIB ,
  type_OBJECT
}
 

Functions

void init_count_chars (count_chars *cc)
 
void clear_count_chars (count_chars *cc)
 
void push_count_chars (count_chars *cc, const char *newval)
 
void pop_count_chars (count_chars *cc)
 
void insert_count_chars (count_chars *cc, const char *newval, int position)
 
void append_count_chars (count_chars *cc, count_chars *cctoadd)
 
const charflatten_count_chars (count_chars *cc, int space)
 
charshell_esc (const char *str)
 
int external_spawn (command_t *cmd, const char *file, const char **argv)
 
int run_command (command_t *cmd_data, count_chars *cc)
 
void print_config ()
 
void add_runtimedirlib (char *arg, command_t *cmd_data)
 
int parse_long_opt (char *arg, command_t *cmd_data)
 
int parse_short_opt (char *arg, command_t *cmd_data)
 
chartruncate_dll_name (char *path)
 
long safe_strtol (const char *nptr, const char **endptr, int base)
 
void safe_mkdir (const char *path)
 
const charjlibtool_basename (const char *fullpath)
 
const charnameof (const char *fullpath)
 
const chardarwin_dynamic_link_function (const char *version_info)
 
chargen_library_name (const char *name, int genlib)
 
chargen_install_name (const char *name, int genlib)
 
charcheck_object_exists (command_t *cmd, const char *arg, int arglen)
 
charcheck_library_exists (command_t *cmd, const char *arg, int pathlen, int libdircheck, enum lib_type *libtype)
 
charload_install_path (const char *arg)
 
charload_noinstall_path (const char *arg, int pathlen)
 
void add_dynamic_link_opts (command_t *cmd_data, count_chars *args)
 
void add_minus_l (count_chars *cc, const char *arg)
 
void add_linker_flag_prefix (count_chars *cc, const char *arg)
 
int explode_static_lib (command_t *cmd_data, const char *lib)
 
int parse_input_file_name (char *arg, command_t *cmd_data)
 
int parse_output_file_name (char *arg, command_t *cmd_data)
 
void parse_args (int argc, char *argv[], command_t *cmd_data)
 
const charexpand_path (const char *relpath)
 
void link_fixup (command_t *c)
 
void post_parse_fixup (command_t *cmd_data)
 
int run_mode (command_t *cmd_data)
 
void cleanup_tmp_dir (const char *dirname)
 
void cleanup_tmp_dirs (command_t *cmd_data)
 
int ensure_fake_uptodate (command_t *cmd_data)
 
int add_for_runtime (command_t *cmd_data)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ PATH_MAX

#define PATH_MAX   1024

Definition at line 180 of file jlibtool.c.

◆ VERSION

#define VERSION   "1.4"

Definition at line 185 of file jlibtool.c.

Enumeration Type Documentation

◆ lib_type

Enumerator
type_UNKNOWN 
type_DYNAMIC_LIB 
type_STATIC_LIB 
type_MODULE_LIB 
type_OBJECT 

Definition at line 216 of file jlibtool.c.

◆ output_t

Enumerator
otGeneral 
otObject 
otProgram 
otLibrary 
otStaticLibraryOnly 
otDynamicLibraryOnly 
otModule 

Definition at line 194 of file jlibtool.c.

◆ pic_mode_e

Enumerator
pic_UNKNOWN 
pic_PREFER 
pic_AVOID 

Definition at line 204 of file jlibtool.c.

◆ shared_mode_e

Enumerator
share_UNSET 
share_STATIC 
share_SHARED 

Definition at line 210 of file jlibtool.c.

◆ tool_mode_t

Enumerator
mUnknown 
mCompile 
mLink 
mInstall 

Definition at line 187 of file jlibtool.c.

Function Documentation

◆ add_dynamic_link_opts()

void add_dynamic_link_opts ( command_t cmd_data,
count_chars args 
)

Definition at line 1012 of file jlibtool.c.

◆ add_for_runtime()

int add_for_runtime ( command_t cmd_data)

Definition at line 1991 of file jlibtool.c.

◆ add_linker_flag_prefix()

void add_linker_flag_prefix ( count_chars cc,
const char arg 
)

Definition at line 1171 of file jlibtool.c.

◆ add_minus_l()

void add_minus_l ( count_chars cc,
const char arg 
)

Definition at line 1147 of file jlibtool.c.

◆ add_runtimedirlib()

void add_runtimedirlib ( char arg,
command_t cmd_data 
)

Definition at line 515 of file jlibtool.c.

◆ append_count_chars()

void append_count_chars ( count_chars cc,
count_chars cctoadd 
)

Definition at line 361 of file jlibtool.c.

◆ check_library_exists()

char * check_library_exists ( command_t cmd,
const char arg,
int  pathlen,
int  libdircheck,
enum lib_type libtype 
)

Definition at line 893 of file jlibtool.c.

◆ check_object_exists()

char * check_object_exists ( command_t cmd,
const char arg,
int  arglen 
)

Definition at line 844 of file jlibtool.c.

◆ cleanup_tmp_dir()

void cleanup_tmp_dir ( const char dirname)

Definition at line 1940 of file jlibtool.c.

◆ cleanup_tmp_dirs()

void cleanup_tmp_dirs ( command_t cmd_data)

Definition at line 1963 of file jlibtool.c.

◆ clear_count_chars()

void clear_count_chars ( count_chars cc)

Definition at line 329 of file jlibtool.c.

◆ darwin_dynamic_link_function()

const char * darwin_dynamic_link_function ( const char version_info)

Definition at line 739 of file jlibtool.c.

◆ ensure_fake_uptodate()

int ensure_fake_uptodate ( command_t cmd_data)

Definition at line 1972 of file jlibtool.c.

◆ expand_path()

const char * expand_path ( const char relpath)

Definition at line 1647 of file jlibtool.c.

◆ explode_static_lib()

int explode_static_lib ( command_t cmd_data,
const char lib 
)

Definition at line 1184 of file jlibtool.c.

◆ external_spawn()

int external_spawn ( command_t cmd,
const char file,
const char **  argv 
)

Definition at line 435 of file jlibtool.c.

◆ flatten_count_chars()

const char * flatten_count_chars ( count_chars cc,
int  space 
)

Definition at line 371 of file jlibtool.c.

◆ gen_install_name()

char * gen_install_name ( const char name,
int  genlib 
)

Definition at line 826 of file jlibtool.c.

◆ gen_library_name()

char * gen_library_name ( const char name,
int  genlib 
)

Definition at line 786 of file jlibtool.c.

◆ init_count_chars()

void init_count_chars ( count_chars cc)

Definition at line 323 of file jlibtool.c.

◆ insert_count_chars()

void insert_count_chars ( count_chars cc,
const char newval,
int  position 
)

Definition at line 349 of file jlibtool.c.

◆ jlibtool_basename()

const char * jlibtool_basename ( const char fullpath)

Definition at line 701 of file jlibtool.c.

◆ link_fixup()

void link_fixup ( command_t c)

Definition at line 1659 of file jlibtool.c.

◆ load_install_path()

char * load_install_path ( const char arg)

Definition at line 958 of file jlibtool.c.

◆ load_noinstall_path()

char * load_noinstall_path ( const char arg,
int  pathlen 
)

Definition at line 983 of file jlibtool.c.

◆ main()

int main ( int  argc,
char argv[] 
)

Definition at line 2010 of file jlibtool.c.

◆ nameof()

const char * nameof ( const char fullpath)

Definition at line 719 of file jlibtool.c.

◆ parse_args()

void parse_args ( int  argc,
char argv[],
command_t cmd_data 
)

Definition at line 1497 of file jlibtool.c.

◆ parse_input_file_name()

int parse_input_file_name ( char arg,
command_t cmd_data 
)

Definition at line 1268 of file jlibtool.c.

◆ parse_long_opt()

int parse_long_opt ( char arg,
command_t cmd_data 
)

Definition at line 523 of file jlibtool.c.

◆ parse_output_file_name()

int parse_output_file_name ( char arg,
command_t cmd_data 
)

Definition at line 1415 of file jlibtool.c.

◆ parse_short_opt()

int parse_short_opt ( char arg,
command_t cmd_data 
)

Definition at line 584 of file jlibtool.c.

◆ pop_count_chars()

void pop_count_chars ( count_chars cc)

Definition at line 344 of file jlibtool.c.

◆ post_parse_fixup()

void post_parse_fixup ( command_t cmd_data)

Definition at line 1717 of file jlibtool.c.

◆ print_config()

void print_config ( )

Definition at line 500 of file jlibtool.c.

◆ push_count_chars()

void push_count_chars ( count_chars cc,
const char newval 
)

Definition at line 339 of file jlibtool.c.

◆ run_command()

int run_command ( command_t cmd_data,
count_chars cc 
)

Definition at line 471 of file jlibtool.c.

◆ run_mode()

int run_mode ( command_t cmd_data)

Definition at line 1762 of file jlibtool.c.

◆ safe_mkdir()

void safe_mkdir ( const char path)

Definition at line 686 of file jlibtool.c.

◆ safe_strtol()

long safe_strtol ( const char nptr,
const char **  endptr,
int  base 
)

Definition at line 671 of file jlibtool.c.

◆ shell_esc()

char * shell_esc ( const char str)

Definition at line 401 of file jlibtool.c.

◆ truncate_dll_name()

char * truncate_dll_name ( char path)

Definition at line 646 of file jlibtool.c.