dgaudet 98/03/16 23:54:29
Modified: src/ap ap_execve.c src/include alloc.h conf.h hide.h http_config.h http_core.h http_protocol.h httpd.h src/main alloc.c http_config.c http_core.c http_log.c http_main.c http_protocol.c http_request.c http_vhost.c src/os/unix os.c os.h Log: - staticization! (Doug I know this breaks your dce thing -- but we talked about you changing STANDALONE_MAIN to be a #include instead.) - change API_EXPORT to CORE_EXPORT for the functions Doug needed for mod_perl - basic_http_header is API_EXPORT - send_header_field is API_EXPORT_NONSTD - srm_command_loop is API_EXPORT Revision Changes Path 1.8 +1 -0 apache-1.3/src/ap/ap_execve.c Index: ap_execve.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/ap/ap_execve.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- ap_execve.c 1998/02/27 09:46:31 1.7 +++ ap_execve.c 1998/03/17 07:54:09 1.8 @@ -331,5 +331,6 @@ return NULL; } #else +extern void ap_execve_is_not_here(void); void ap_execve_is_not_here(void) {} #endif /* NEED_HASHBANG_EMUL */ 1.49 +1 -2 apache-1.3/src/include/alloc.h Index: alloc.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/alloc.h,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- alloc.h 1998/03/14 00:32:05 1.48 +++ alloc.h 1998/03/17 07:54:10 1.49 @@ -82,8 +82,7 @@ typedef struct pool pool; -extern pool *permanent_pool; -void init_alloc(void); /* Set up everything */ +pool * init_alloc(void); /* Set up everything */ API_EXPORT(pool *) make_sub_pool(pool *); /* All pools are subpools of permanent_pool */ API_EXPORT(void) destroy_pool(pool *); 1.191 +5 -0 apache-1.3/src/include/conf.h Index: conf.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/conf.h,v retrieving revision 1.190 retrieving revision 1.191 diff -u -r1.190 -r1.191 --- conf.h 1998/03/13 23:44:42 1.190 +++ conf.h 1998/03/17 07:54:10 1.191 @@ -759,6 +759,11 @@ #define API_VAR_EXPORT #endif +/* modules should not used functions marked CORE_EXPORT */ +#ifndef CORE_EXPORT +#define CORE_EXPORT API_EXPORT +#endif + /* So that we can use inline on some critical functions, and use * GNUC attributes (such as to get -Wall warnings for printf-like * functions). Only do this in gcc 2.7 or later ... it may work 1.12 +4 -53 apache-1.3/src/include/hide.h Index: hide.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/hide.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- hide.h 1998/03/14 12:22:10 1.11 +++ hide.h 1998/03/17 07:54:11 1.12 @@ -117,6 +117,7 @@ #define cgi_module AP_cgi_module #define config_log_module AP_config_log_module #define core_module AP_core_module +#define day_snames AP_day_snames #define db_auth_module AP_db_auth_module #define dbm_auth_module AP_dbm_auth_module #define digest_module AP_digest_module @@ -131,6 +132,7 @@ #define info_module AP_info_module #define mime_magic_module AP_mime_magic_module #define mime_module AP_mime_module +#define month_snames AP_month_snames #define negotiation_module AP_negotiation_module #define prelinked_modules AP_prelinked_modules #define preloaded_modules AP_preloaded_modules @@ -152,14 +154,11 @@ /* * Text segment symbols */ -#define AMCSocketCleanup AP_AMCSocketCleanup -#define AMCSocketInitialize AP_AMCSocketInitialize #define MD5Final AP_MD5Final #define MD5Init AP_MD5Init #define MD5Update AP_MD5Update #define add_cgi_vars AP_add_cgi_vars #define add_common_vars AP_add_common_vars -#define add_file_conf AP_add_file_conf #define add_module AP_add_module #define add_named_module AP_add_named_module #define add_per_dir_conf AP_add_per_dir_conf @@ -192,7 +191,6 @@ #define bskiplf AP_bskiplf #define bvputs AP_bvputs #define bwrite AP_bwrite -#define bytes_in_block_list AP_bytes_in_block_list #define bytes_in_free_blocks AP_bytes_in_free_blocks #define bytes_in_pool AP_bytes_in_pool #define call_exec AP_call_exec @@ -205,13 +203,10 @@ #define check_alarm AP_check_alarm #define check_auth AP_check_auth #define check_cmd_context AP_check_cmd_context -#define check_serverpath AP_check_serverpath -#define check_symlinks AP_check_symlinks #define check_user_id AP_check_user_id #define checkmask AP_checkmask #define child_exit_modules AP_child_exit_modules #define child_init_modules AP_child_init_modules -#define child_main AP_child_main #define child_terminate AP_child_terminate #define cleanup_for_exec AP_cleanup_for_exec #define clear_module_list AP_clear_module_list @@ -225,29 +220,19 @@ #define copy_array_hdr AP_copy_array_hdr #define copy_table AP_copy_table #define core_reorder_directories AP_core_reorder_directories -#define core_translate AP_core_translate #define count_dirs AP_count_dirs -#define create_connection_config AP_create_connection_config -#define create_core_dir_config AP_create_core_dir_config -#define create_core_server_config AP_create_core_server_config -#define create_default_per_dir_config AP_create_default_per_dir_config #define create_empty_config AP_create_empty_config #define create_environment AP_create_environment #define create_per_dir_config AP_create_per_dir_config #define create_request_config AP_create_request_config -#define create_server_config AP_create_server_config -#define day_snames AP_day_snames #define default_handler AP_default_handler #define default_port_for_request AP_default_port_for_request #define default_port_for_scheme AP_default_port_for_scheme #define default_type AP_default_type #define destroy_pool AP_destroy_pool #define destroy_sub_req AP_destroy_sub_req -#define detach AP_detach #define die AP_die -#define directory_walk AP_directory_walk #define discard_request_body AP_discard_request_body -#define do_nothing AP_do_nothing #define document_root AP_document_root #define each_byterange AP_each_byterange #define error_log2stderr AP_error_log2stderr @@ -255,7 +240,6 @@ #define escape_path_segment AP_escape_path_segment #define escape_shell_cmd AP_escape_shell_cmd #define exists_scoreboard_image AP_exists_scoreboard_image -#define file_walk AP_file_walk #define finalize_request_protocol AP_finalize_request_protocol #define finalize_sub_req_protocol AP_finalize_sub_req_protocol #define find_command AP_find_command @@ -268,17 +252,13 @@ #define find_token AP_find_token #define find_types AP_find_types #define fini_vhost_config AP_fini_vhost_config -#define fixup_virtual_hosts AP_fixup_virtual_hosts #define fnmatch AP_fnmatch #define force_library_loading AP_force_library_loading -#define free_blocks AP_free_blocks #define get_basic_auth_pw AP_get_basic_auth_pw #define get_client_block AP_get_client_block #define get_gmtoff AP_get_gmtoff #define get_local_host AP_get_local_host -#define get_mime_headers AP_get_mime_headers #define get_module_config AP_get_module_config -#define get_path_info AP_get_path_info #define get_remote_host AP_get_remote_host #define get_remote_logname AP_get_remote_logname #define get_server_name AP_get_server_name @@ -304,29 +284,23 @@ #define ind AP_ind #define index_of_response AP_index_of_response #define init_alloc AP_init_alloc -#define init_config_globals AP_init_config_globals #define init_modules AP_init_modules -#define init_server_config AP_init_server_config -#define init_suexec AP_init_suexec #define init_vhost_config AP_init_vhost_config #define init_virtual_host AP_init_virtual_host -#define internal_internal_redirect AP_internal_internal_redirect #define internal_redirect AP_internal_redirect #define internal_redirect_handler AP_internal_redirect_handler -#define invoke_cmd AP_invoke_cmd #define invoke_handler AP_invoke_handler #define is_directory AP_is_directory #define is_fnmatch AP_is_fnmatch #define is_initial_req AP_is_initial_req #define is_matchexp AP_is_matchexp #define is_url AP_is_url -#define just_die AP_just_die #define keepalive_timeout AP_keepalive_timeout #define kill_cleanup AP_kill_cleanup #define kill_cleanups_for_fd AP_kill_cleanups_for_fd #define kill_cleanups_for_socket AP_kill_cleanups_for_socket #define kill_timeout AP_kill_timeout -#define location_walk AP_location_walk +#define limit_section AP_limit_section #define log_assert AP_log_assert #define log_error AP_log_error #define log_pid AP_log_pid @@ -340,17 +314,10 @@ #define make_dirstr_prefix AP_make_dirstr_prefix #define make_full_path AP_make_full_path #define make_sub_pool AP_make_sub_pool -#define make_sub_request AP_make_sub_request #define make_table AP_make_table -#define malloc_block AP_malloc_block #define matches_request_vhost AP_matches_request_vhost #define meets_conditions AP_meets_conditions -#define merge_core_dir_configs AP_merge_core_dir_configs -#define merge_core_server_configs AP_merge_core_server_configs #define merge_per_dir_configs AP_merge_per_dir_configs -#define merge_server_configs AP_merge_server_configs -#define month_snames AP_month_snames -#define new_block AP_new_block #define no2slash AP_no2slash #define note_auth_failure AP_note_auth_failure #define note_basic_auth_failure AP_note_basic_auth_failure @@ -360,7 +327,6 @@ #define note_digest_auth_failure AP_note_digest_auth_failure #define note_subprocess AP_note_subprocess #define null_cleanup AP_null_cleanup -#define open_error_log AP_open_error_log #define open_logs AP_open_logs #define open_piped_log AP_open_piped_log #define os_escape_path AP_os_escape_path @@ -383,7 +349,6 @@ #define pfdopen AP_pfdopen #define pfopen AP_pfopen #define pgethostbyname AP_pgethostbyname -#define plustospace AP_plustospace #define pool_is_ancestor AP_pool_is_ancestor #define pool_join AP_pool_join #define popendir AP_popendir @@ -391,9 +356,7 @@ #define pregcomp AP_pregcomp #define pregfree AP_pregfree #define pregsub AP_pregsub -#define process_command_config AP_process_command_config #define process_request AP_process_request -#define process_request_internal AP_process_request_internal #define process_resource_config AP_process_resource_config #define proxy_add_header AP_proxy_add_header #define proxy_c2hex AP_proxy_c2hex @@ -438,14 +401,9 @@ #define rationalize_mtime AP_rationalize_mtime #define read_config AP_read_config #define read_request AP_read_request -#define read_request_line AP_read_request_line #define register_cleanup AP_register_cleanup #define register_other_child AP_register_other_child -#define reinit_scoreboard AP_reinit_scoreboard #define remove_module AP_remove_module -#define rename_original_env AP_rename_original_env -#define reopen_scoreboard AP_reopen_scoreboard -#define require AP_require #define requires AP_requires #define reset_timeout AP_reset_timeout #define response_code_string AP_response_code_string @@ -462,7 +420,6 @@ #define rvputs AP_rvputs #define rwrite AP_rwrite #define satisfies AP_satisfies -#define satisfy AP_satisfy #define scan_script_header_err AP_scan_script_header_err #define scan_script_header_err_buff AP_scan_script_header_err_buff #define send_error_response AP_send_error_response @@ -487,7 +444,6 @@ #define set_last_modified AP_set_last_modified #define set_module_config AP_set_module_config #define set_name_virtual_host AP_set_name_virtual_host -#define set_signals AP_set_signals #define set_string_slot AP_set_string_slot #define set_string_slot_lower AP_set_string_slot_lower #define set_sub_req_protocol AP_set_sub_req_protocol @@ -496,15 +452,11 @@ #define should_client_block AP_should_client_block #define show_directives AP_show_directives #define show_modules AP_show_modules -#define show_overrides AP_show_overrides -#define sig_coredump AP_sig_coredump #define soft_timeout AP_soft_timeout #define some_auth_required AP_some_auth_required -#define spacetoplus AP_spacetoplus #define spawn_child_err AP_spawn_child_err #define spawn_child_err_buff AP_spawn_child_err_buff #define srm_command_loop AP_srm_command_loop -#define standalone_main AP_standalone_main #define start_restart AP_start_restart #define start_shutdown AP_start_shutdown #define str_tolower AP_str_tolower @@ -523,7 +475,6 @@ #define table_setn AP_table_setn #define table_unset AP_table_unset #define time_process_request AP_time_process_request -#define timeout AP_timeout #define tm2sec AP_tm2sec #define translate_name AP_translate_name #define uname2id AP_uname2id @@ -537,7 +488,7 @@ #define update_mtime AP_update_mtime #define update_vhost_from_headers AP_update_vhost_from_headers #define update_vhost_given_ip AP_update_vhost_given_ip -#define usage AP_usage +#define util_init AP_util_init #define util_uri_init AP_util_uri_init #define uudecode AP_uudecode #define vbprintf AP_vbprintf 1.75 +11 -6 apache-1.3/src/include/http_config.h Index: http_config.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/http_config.h,v retrieving revision 1.74 retrieving revision 1.75 diff -u -r1.74 -r1.75 --- http_config.h 1998/03/17 03:26:41 1.74 +++ http_config.h 1998/03/17 07:54:11 1.75 @@ -300,6 +300,9 @@ API_EXPORT(const char *) find_module_name(module *m); API_EXPORT(module *) find_linked_module(const char *name); +/* for implementing subconfigs and customized config files */ +API_EXPORT(const char *) srm_command_loop(cmd_parms *parms, void *config); + #ifdef CORE_PRIVATE extern API_VAR_EXPORT module *top_module; @@ -320,19 +323,16 @@ /* For http_request.c... */ void *create_request_config(pool *p); -API_EXPORT(void *) create_per_dir_config(pool *p); +CORE_EXPORT(void *) create_per_dir_config(pool *p); void *merge_per_dir_configs(pool *p, void *base, void *new); void *create_empty_config(pool *p); -void core_reorder_directories(pool *, server_rec *); - /* For http_core.c... (<Directory> command and virtual hosts) */ int parse_htaccess(void **result, request_rec *r, int override, const char *path, const char *access_name); -API_EXPORT(const char *) srm_command_loop(cmd_parms *parms, void *config); -API_EXPORT(const char *) init_virtual_host(pool *p, const char *hostname, +CORE_EXPORT(const char *) init_virtual_host(pool *p, const char *hostname, server_rec *main_server, server_rec **); void process_resource_config(server_rec *s, char *fname, pool *p, pool *ptemp); @@ -352,7 +352,6 @@ /* Module-method dispatchers, also for http_request.c */ int translate_name(request_rec *); -int directory_walk(request_rec *); /* check symlinks, get per-dir config */ int check_access(request_rec *); /* check access on non-auth basis */ int check_user_id(request_rec *); /* obtain valid username from client auth */ int check_auth(request_rec *); /* check (validated) user is authorized here */ @@ -362,6 +361,12 @@ int log_transaction(request_rec *r); int header_parse(request_rec *); int run_post_read_request(request_rec *); + +/* for mod_perl */ + +CORE_EXPORT(const command_rec *) find_command(const char *name, const command_rec *cmds); +CORE_EXPORT(const command_rec *) find_command_in_modules(const char *cmd_name, module **mod); +CORE_EXPORT(const char *) handle_command(cmd_parms *parms, void *config, const char *l); #endif 1.38 +8 -0 apache-1.3/src/include/http_core.h Index: http_core.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/http_core.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- http_core.h 1998/03/17 03:26:42 1.37 +++ http_core.h 1998/03/17 07:54:12 1.38 @@ -236,6 +236,14 @@ array_header *sec_url; } core_server_config; +/* for http_config.c */ +void core_reorder_directories(pool *, server_rec *); + +/* for mod_perl */ +CORE_EXPORT(void) add_per_dir_conf (server_rec *s, void *dir_config); +CORE_EXPORT(void) add_per_url_conf (server_rec *s, void *url_config); +CORE_EXPORT(const char *) limit_section (cmd_parms *cmd, void *dummy, const char *arg); + #endif #endif /* !APACHE_HTTP_CORE_H */ 1.35 +8 -1 apache-1.3/src/include/http_protocol.h Index: http_protocol.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/http_protocol.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- http_protocol.h 1998/01/21 19:17:39 1.34 +++ http_protocol.h 1998/03/17 07:54:12 1.35 @@ -65,8 +65,15 @@ /* Send a single HTTP header field */ -int send_header_field(request_rec *r, const char *fieldname, +API_EXPORT_NONSTD(int) send_header_field(request_rec *r, const char *fieldname, const char *fieldval); + +/* Send the minimal part of an HTTP response header... but modules should be + * very careful about using this, and should prefer send_http_header(). + * Much of the HTTP/1.1 implementation correctness depends on code in + * send_http_header(). + */ +API_EXPORT(void) basic_http_header(request_rec *r); /* Send the Status-Line and header fields for HTTP response */ 1.199 +2 -0 apache-1.3/src/include/httpd.h Index: httpd.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/httpd.h,v retrieving revision 1.198 retrieving revision 1.199 diff -u -r1.198 -r1.199 --- httpd.h 1998/03/16 08:53:29 1.198 +++ httpd.h 1998/03/17 07:54:13 1.199 @@ -806,6 +806,8 @@ /* Prototypes for utilities... util.c. */ +extern void util_init(void); + /* Time */ extern API_VAR_EXPORT const char month_snames[12][4]; extern API_VAR_EXPORT const char day_snames[7][4]; 1.78 +7 -5 apache-1.3/src/main/alloc.c Index: alloc.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/alloc.c,v retrieving revision 1.77 retrieving revision 1.78 diff -u -r1.77 -r1.78 --- alloc.c 1998/03/14 00:32:06 1.77 +++ alloc.c 1998/03/17 07:54:16 1.78 @@ -195,7 +195,7 @@ /* Get a completely new block from the system pool. Note that we rely on malloc() to provide aligned memory. */ -union block_hdr *malloc_block(int size) +static union block_hdr *malloc_block(int size) { union block_hdr *blok = (union block_hdr *) malloc(size + sizeof(union block_hdr)); @@ -237,7 +237,7 @@ /* Free a chain of blocks --- must be called with alarms blocked. */ -void free_blocks(union block_hdr *blok) +static void free_blocks(union block_hdr *blok) { #ifdef ALLOC_USE_MALLOC union block_hdr *next; @@ -296,7 +296,7 @@ * if necessary. Must be called with alarms blocked. */ -union block_hdr *new_block(int min_size) +static union block_hdr *new_block(int min_size) { union block_hdr **lastptr = &block_freelist; union block_hdr *blok = block_freelist; @@ -331,7 +331,7 @@ /* Accounting */ -long bytes_in_block_list(union block_hdr *blok) +static long bytes_in_block_list(union block_hdr *blok) { long size = 0; @@ -436,7 +436,7 @@ } #endif -void init_alloc(void) +pool *init_alloc(void) { #ifdef POOL_DEBUG char s; @@ -447,6 +447,8 @@ alloc_mutex = create_mutex(NULL); spawn_mutex = create_mutex(NULL); permanent_pool = make_sub_pool(NULL); + + return permanent_pool; } API_EXPORT(void) clear_pool(struct pool *a) 1.108 +15 -21 apache-1.3/src/main/http_config.c Index: http_config.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_config.c,v retrieving revision 1.107 retrieving revision 1.108 diff -u -r1.107 -r1.108 --- http_config.c 1998/03/17 03:26:44 1.107 +++ http_config.c 1998/03/17 07:54:17 1.108 @@ -131,8 +131,7 @@ return (void *) conf_vector; } -void * - create_default_per_dir_config(pool *p) +static void *create_default_per_dir_config(pool *p) { void **conf_vector = (void **) pcalloc(p, sizeof(void *) * (total_modules + DYNAMIC_MODULE_LIMIT)); module *modp; @@ -168,8 +167,7 @@ return (void *) conf_vector; } -void * - create_server_config(pool *p, server_rec *s) +static void *create_server_config(pool *p, server_rec *s) { void **conf_vector = (void **) pcalloc(p, sizeof(void *) * (total_modules + DYNAMIC_MODULE_LIMIT)); module *modp; @@ -182,7 +180,7 @@ return (void *) conf_vector; } -void merge_server_configs(pool *p, void *base, void *virt) +static void merge_server_configs(pool *p, void *base, void *virt) { /* Can reuse the 'virt' vector for the spine of it, since we don't * have to deal with the moral equivalent of .htaccess files here... @@ -203,11 +201,6 @@ } } -void *create_connection_config(pool *p) -{ - return create_empty_config(p); -} - void *create_request_config(pool *p) { return create_empty_config(p); @@ -696,8 +689,8 @@ * invoking the function... */ -const char *invoke_cmd(const command_rec *cmd, cmd_parms *parms, void *mconfig, - const char *args) +static const char *invoke_cmd(const command_rec *cmd, cmd_parms *parms, + void *mconfig, const char *args) { char *w, *w2, *w3; const char *errmsg; @@ -861,7 +854,7 @@ } } -API_EXPORT(const command_rec *) find_command(const char *name, const command_rec *cmds) +CORE_EXPORT(const command_rec *) find_command(const char *name, const command_rec *cmds) { while (cmds->name) if (!strcasecmp(name, cmds->name)) @@ -872,7 +865,7 @@ return NULL; } -API_EXPORT(const command_rec *) find_command_in_modules(const char *cmd_name, module **mod) +CORE_EXPORT(const command_rec *) find_command_in_modules(const char *cmd_name, module **mod) { const command_rec *cmdp; module *modp; @@ -886,7 +879,7 @@ return NULL; } -API_EXPORT(const char *) handle_command(cmd_parms *parms, void *config, const char *l) +CORE_EXPORT(const char *) handle_command(cmd_parms *parms, void *config, const char *l) { const char *args, *cmd_name, *retval; const command_rec *cmd; @@ -1051,7 +1044,8 @@ return 0; } -void process_command_config(server_rec *s, array_header *arr, pool *p, pool *ptemp) +static void process_command_config(server_rec *s, array_header *arr, pool *p, + pool *ptemp) { const char *errmsg; cmd_parms parms; @@ -1201,7 +1195,7 @@ } -API_EXPORT(const char *) init_virtual_host(pool *p, const char *hostname, +CORE_EXPORT(const char *) init_virtual_host(pool *p, const char *hostname, server_rec *main_server, server_rec **ps) { server_rec *s = (server_rec *) pcalloc(p, sizeof(server_rec)); @@ -1250,7 +1244,7 @@ } -void fixup_virtual_hosts(pool *p, server_rec *main_server) +static void fixup_virtual_hosts(pool *p, server_rec *main_server) { server_rec *virt; @@ -1298,7 +1292,7 @@ * Getting *everything* configured... */ -void init_config_globals(pool *p) +static void init_config_globals(pool *p) { /* ServerRoot, server_confname set in httpd.c */ @@ -1324,7 +1318,7 @@ ap_cpystrn(coredump_dir, server_root, sizeof(coredump_dir)); } -server_rec *init_server_config(pool *p) +static server_rec *init_server_config(pool *p) { server_rec *s = (server_rec *) pcalloc(p, sizeof(server_rec)); @@ -1451,7 +1445,7 @@ * a particular directive is allowed to be used. This procedure prints * in English where the given (pc) directive can be used. */ -void show_overrides(const command_rec *pc, module *pm) +static void show_overrides(const command_rec *pc, module *pm) { int n = 0; 1.173 +12 -12 apache-1.3/src/main/http_core.c Index: http_core.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_core.c,v retrieving revision 1.172 retrieving revision 1.173 diff -u -r1.172 -r1.173 --- http_core.c 1998/03/17 03:26:45 1.172 +++ http_core.c 1998/03/17 07:54:18 1.173 @@ -100,7 +100,7 @@ * the http_conf_globals. */ -void *create_core_dir_config (pool *a, char *dir) +static void *create_core_dir_config (pool *a, char *dir) { core_dir_config *conf = (core_dir_config *)pcalloc(a, sizeof(core_dir_config)); @@ -138,7 +138,7 @@ return (void *)conf; } -void *merge_core_dir_configs (pool *a, void *basev, void *newv) +static void *merge_core_dir_configs (pool *a, void *basev, void *newv) { core_dir_config *base = (core_dir_config *)basev; core_dir_config *new = (core_dir_config *)newv; @@ -219,7 +219,7 @@ return (void*)conf; } -void *create_core_server_config (pool *a, server_rec *s) +static void *create_core_server_config (pool *a, server_rec *s) { core_server_config *conf = (core_server_config *)pcalloc(a, sizeof(core_server_config)); @@ -233,7 +233,7 @@ return (void *)conf; } -void *merge_core_server_configs (pool *p, void *basev, void *virtv) +static void *merge_core_server_configs (pool *p, void *basev, void *virtv) { core_server_config *base = (core_server_config *)basev; core_server_config *virt = (core_server_config *)virtv; @@ -253,7 +253,7 @@ * these are part of the core server config. */ -API_EXPORT(void) add_per_dir_conf (server_rec *s, void *dir_config) +CORE_EXPORT(void) add_per_dir_conf (server_rec *s, void *dir_config) { core_server_config *sconf = get_module_config (s->module_config, &core_module); @@ -262,7 +262,7 @@ *new_space = dir_config; } -API_EXPORT(void) add_per_url_conf (server_rec *s, void *url_config) +CORE_EXPORT(void) add_per_url_conf (server_rec *s, void *url_config) { core_server_config *sconf = get_module_config (s->module_config, &core_module); @@ -271,7 +271,7 @@ *new_space = url_config; } -void add_file_conf (core_dir_config *conf, void *url_config) +static void add_file_conf (core_dir_config *conf, void *url_config) { void **new_space = (void **) push_array (conf->sec); @@ -852,7 +852,7 @@ return NULL; } -const char *satisfy (cmd_parms *cmd, core_dir_config *c, char *arg) +static const char *satisfy (cmd_parms *cmd, core_dir_config *c, char *arg) { if(!strcasecmp(arg,"all")) c->satisfy = SATISFY_ALL; @@ -863,7 +863,7 @@ return NULL; } -const char *require (cmd_parms *cmd, core_dir_config *c, char *arg) +static const char *require (cmd_parms *cmd, core_dir_config *c, char *arg) { require_line *r; @@ -876,7 +876,7 @@ return NULL; } -API_EXPORT(const char *) limit_section (cmd_parms *cmd, void *dummy, const char *arg) +CORE_EXPORT(const char *) limit_section (cmd_parms *cmd, void *dummy, const char *arg) { const char *limited_methods = getword(cmd->pool,&arg,'>'); int limited = 0; @@ -1987,7 +1987,7 @@ * Core handlers for various phases of server operation... */ -int core_translate (request_rec *r) +static int core_translate (request_rec *r) { void *sconf = r->server->module_config; core_server_config *conf = get_module_config (sconf, &core_module); @@ -2012,7 +2012,7 @@ return OK; } -int do_nothing (request_rec *r) { return OK; } +static int do_nothing (request_rec *r) { return OK; } #ifdef USE_MMAP_FILES struct mmap { 1.49 +1 -1 apache-1.3/src/main/http_log.c Index: http_log.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_log.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- http_log.c 1998/01/07 16:46:05 1.48 +++ http_log.c 1998/03/17 07:54:19 1.49 @@ -176,7 +176,7 @@ return(child_pid); } -void open_error_log (server_rec *s, pool *p) +static void open_error_log (server_rec *s, pool *p) { char *fname; 1.306 +27 -35 apache-1.3/src/main/http_main.c Index: http_main.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v retrieving revision 1.305 retrieving revision 1.306 diff -u -r1.305 -r1.306 --- http_main.c 1998/03/16 15:58:48 1.305 +++ http_main.c 1998/03/17 07:54:20 1.306 @@ -150,7 +150,9 @@ * make all the modules into shared libraries that core httpd still * includes the full Apache API. Without this function the objects in * main/util_script.c would not be linked into a minimal httpd. + * And the extra prototype is to make gcc -Wmissing-prototypes quiet. */ +extern void force_library_loading(void); void force_library_loading(void) { add_cgi_vars(NULL); } @@ -775,7 +777,7 @@ #define SAFE_ACCEPT(stmt) do {stmt;} while(0) #endif -void usage(char *bin) +static void usage(char *bin) { char pad[MAX_STRING_LEN]; int i; @@ -811,7 +813,7 @@ static APACHE_TLS int volatile alarms_blocked = 0; static APACHE_TLS int volatile alarm_pending = 0; -void timeout(int sig) +static void timeout(int sig) { /* Also called on SIGPIPE */ char errstr[MAX_STRING_LEN]; void *dirconf; @@ -1328,7 +1330,7 @@ * shared memory (so they use memcpy etc.) */ -void reinit_scoreboard(pool *p) +static void reinit_scoreboard(pool *p) { ap_assert(!scoreboard_image); scoreboard_image = (scoreboard *) malloc(SCOREBOARD_SIZE); @@ -1414,7 +1416,7 @@ scoreboard_image->global.exit_generation = 0; } -void reopen_scoreboard(pool *p) +static void reopen_scoreboard(pool *p) { caddr_t m; int rc; @@ -1492,7 +1494,7 @@ scoreboard_image->global.exit_generation = 0; } -void reopen_scoreboard(pool *p) +static void reopen_scoreboard(pool *p) { } @@ -1553,7 +1555,7 @@ scoreboard_image->global.exit_generation = 0; } -void reopen_scoreboard(pool *p) +static void reopen_scoreboard(pool *p) { } @@ -1644,7 +1646,7 @@ scoreboard_image->global.exit_generation = 0; } -void reopen_scoreboard(pool *p) +static void reopen_scoreboard(pool *p) { } @@ -1706,7 +1708,7 @@ #endif /* Called by parent process */ -void reinit_scoreboard(pool *p) +static void reinit_scoreboard(pool *p) { int exit_gen = 0; if (scoreboard_image) @@ -2125,7 +2127,7 @@ /* handle all varieties of core dumping signals */ -void sig_coredump(int sig) +static void sig_coredump(int sig) { char emsg[256]; const char *s; @@ -2174,7 +2176,7 @@ * Connection structures and accounting... */ -void just_die(int sig) +static void just_die(int sig) { /* SIGHUP to child process??? */ /* if alarms are blocked we have to wait to die otherwise we might * end up with corruption in alloc.c's internal structures */ @@ -2289,7 +2291,7 @@ #endif } -void set_signals(void) +static void set_signals(void) { #ifndef NO_USE_SIGACTION struct sigaction sa; @@ -2365,7 +2367,7 @@ * Here follows a long bunch of generic server bookkeeping stuff... */ -void detach(void) +static void detach(void) { #if !defined(WIN32) int x; @@ -2488,7 +2490,7 @@ } /* check to see if we have the 'suexec' setuid wrapper installed */ -int init_suexec(void) +static int init_suexec(void) { #ifndef WIN32 struct stat wrapper; @@ -2509,7 +2511,7 @@ */ -conn_rec *ap__new_connection(pool *p, server_rec *server, BUFF *inout, +static conn_rec *new_connection(pool *p, server_rec *server, BUFF *inout, const struct sockaddr_in *remaddr, const struct sockaddr_in *saddr, int child_num) @@ -2823,11 +2825,11 @@ } +#ifdef WIN32 static int s_iInitCount = 0; -int AMCSocketInitialize(void) +static int AMCSocketInitialize(void) { -#ifdef WIN32 int iVersionRequested; WSADATA wsaData; int err; @@ -2852,9 +2854,6 @@ WSACleanup(); return (s_iInitCount); } -#else - signal(SIGPIPE, SIG_IGN); -#endif /* WIN32 */ s_iInitCount++; return (s_iInitCount); @@ -2862,16 +2861,13 @@ } -void AMCSocketCleanup(void) +static void AMCSocketCleanup(void) { -#ifdef WIN32 if (--s_iInitCount == 0) WSACleanup(); -#else /* not WIN32 */ - s_iInitCount--; -#endif /* WIN32 */ return; } +#endif static void show_compile_settings(void) { @@ -2966,9 +2962,6 @@ } -/* DEAN WILL CLEAN THIS UP! */ -extern void util_init(void); - /* Some init code that's common between win32 and unix... well actually * some of it is #ifdef'd but was duplicated before anyhow. This stuff * is still a mess. @@ -2994,8 +2987,7 @@ AMCSocketInitialize(); #endif /* WIN32 */ - init_alloc(); - pconf = permanent_pool; + pconf = init_alloc(); ptrans = make_sub_pool(pconf); util_init(); @@ -3025,7 +3017,7 @@ requests_this_child = max_requests_per_child = 1; } -void child_main(int child_num_arg) +static void child_main(int child_num_arg) { NET_SIZE_T clen; struct sockaddr sa_server; @@ -3321,7 +3313,7 @@ #endif bpushfd(conn_io, csd, dupped_csd); - current_conn = ap__new_connection(ptrans, server_conf, conn_io, + current_conn = new_connection(ptrans, server_conf, conn_io, (struct sockaddr_in *) &sa_client, (struct sockaddr_in *) &sa_server, my_child_num); @@ -3638,7 +3630,7 @@ #ifndef STANDALONE_MAIN #define STANDALONE_MAIN standalone_main -void standalone_main(int argc, char **argv) +static void standalone_main(int argc, char **argv) { int remaining_children_to_start; @@ -3998,7 +3990,7 @@ cio->fd = fileno(stdout); #endif cio->fd_in = fileno(stdin); - conn = ap__new_connection(ptrans, server_conf, cio, + conn = new_connection(ptrans, server_conf, cio, (struct sockaddr_in *) &sa_client, (struct sockaddr_in *) &sa_server, -1); r = read_request(conn); @@ -4210,7 +4202,7 @@ * accepted socket, instead of blocking on a mutex or select(). */ -void child_sub_main(int child_num) +static void child_sub_main(int child_num) { NET_SIZE_T clen; struct sockaddr sa_server; @@ -4301,7 +4293,7 @@ #endif bpushfd(conn_io, csd, dupped_csd); - current_conn = ap__new_connection(ptrans, server_conf, conn_io, + current_conn = new_connection(ptrans, server_conf, conn_io, (struct sockaddr_in *) &sa_client, (struct sockaddr_in *) &sa_server, child_num); 1.199 +5 -5 apache-1.3/src/main/http_protocol.c Index: http_protocol.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.198 retrieving revision 1.199 diff -u -r1.198 -r1.199 --- http_protocol.c 1998/03/16 08:53:26 1.198 +++ http_protocol.c 1998/03/17 07:54:21 1.199 @@ -619,7 +619,7 @@ } } -int read_request_line(request_rec *r) +static int read_request_line(request_rec *r) { char l[HUGE_STRING_LEN]; const char *ll = l, *uri; @@ -678,7 +678,7 @@ return 1; } -void get_mime_headers(request_rec *r) +static void get_mime_headers(request_rec *r) { conn_rec *c = r->connection; int len; @@ -995,14 +995,14 @@ * In other words, don't change this one without checking table_do in alloc.c. * It returns true unless there was a write error of some kind. */ -int send_header_field(request_rec *r, const char *fieldname, - const char *fieldval) +API_EXPORT_NONSTD(int) send_header_field(request_rec *r, + const char *fieldname, const char *fieldval) { return (0 < bvputs(r->connection->client, fieldname, ": ", fieldval, "\015\012", NULL)); } -void basic_http_header(request_rec *r) +API_EXPORT(void) basic_http_header(request_rec *r) { char *protocol; #ifdef CHARSET_EBCDIC 1.113 +9 -9 apache-1.3/src/main/http_request.c Index: http_request.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_request.c,v retrieving revision 1.112 retrieving revision 1.113 diff -u -r1.112 -r1.113 --- http_request.c 1998/03/14 12:22:07 1.112 +++ http_request.c 1998/03/17 07:54:22 1.113 @@ -106,7 +106,7 @@ } -int check_symlinks(char *d, int opts) +static int check_symlinks(char *d, int opts) { #if defined(__EMX__) || defined(WIN32) /* OS/2 doesn't have symlinks */ @@ -166,7 +166,7 @@ /* Dealing with the file system to get PATH_INFO */ -int get_path_info(request_rec *r) +static int get_path_info(request_rec *r) { char *cp; char *path = r->filename; @@ -263,7 +263,7 @@ return OK; } -int directory_walk(request_rec *r) +static int directory_walk(request_rec *r) { core_server_config *sconf = get_module_config(r->server->module_config, &core_module); @@ -492,7 +492,7 @@ * symlink goop. */ } -int location_walk(request_rec *r) +static int location_walk(request_rec *r) { core_server_config *sconf = get_module_config(r->server->module_config, &core_module); @@ -562,7 +562,7 @@ return OK; } -int file_walk(request_rec *r) +static int file_walk(request_rec *r) { core_dir_config *conf = get_module_config(r->per_dir_config, &core_module); void *per_dir_defaults = r->per_dir_config; @@ -641,7 +641,7 @@ * structure... */ -request_rec *make_sub_request(const request_rec *r) +static request_rec *make_sub_request(const request_rec *r) { pool *rrp = make_sub_pool(r->pool); request_rec *rr = pcalloc(rrp, sizeof(request_rec)); @@ -983,7 +983,7 @@ return 0; } -void process_request_internal(request_rec *r) +static void process_request_internal(request_rec *r) { int access_status; @@ -1181,7 +1181,7 @@ #endif } -table *rename_original_env(pool *p, table *t) +static table *rename_original_env(pool *p, table *t) { array_header *env_arr = table_elts(t); table_entry *elts = (table_entry *) env_arr->elts; @@ -1198,7 +1198,7 @@ return new; } -request_rec *internal_internal_redirect(const char *new_uri, request_rec *r) +static request_rec *internal_internal_redirect(const char *new_uri, request_rec *r) { int access_status; request_rec *new = (request_rec *) pcalloc(r->pool, sizeof(request_rec)); 1.11 +1 -1 apache-1.3/src/main/http_vhost.c Index: http_vhost.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_vhost.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- http_vhost.c 1998/03/06 19:49:12 1.10 +++ http_vhost.c 1998/03/17 07:54:23 1.11 @@ -764,7 +764,7 @@ } -void check_serverpath(request_rec *r) +static void check_serverpath(request_rec *r) { server_rec *s; server_rec *last_s; 1.6 +2 -1 apache-1.3/src/os/unix/os.c Index: os.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/unix/os.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- os.c 1998/02/28 15:39:36 1.5 +++ os.c 1998/03/17 07:54:27 1.6 @@ -8,6 +8,7 @@ /* some linkers complain unless there's at least one function in each - * .o file + * .o file... and extra prototype is for gcc -Wmissing-prototypes */ +extern void os_is_not_here(void); void os_is_not_here(void) {} 1.15 +2 -2 apache-1.3/src/os/unix/os.h Index: os.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/unix/os.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- os.h 1998/03/13 16:15:41 1.14 +++ os.h 1998/03/17 07:54:28 1.15 @@ -74,9 +74,9 @@ */ #define INLINE extern ap_inline #include "os-inline.c" -#endif -#ifndef INLINE +#else + /* Compiler does not support inline, so prototype the inlineable functions * as normal */