httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@engelschall.com (Ralf S. Engelschall)
Subject Re: cvs commit: apache-1.3/src/include compat.h
Date Mon, 13 Apr 1998 15:58:11 GMT

In article <199804131541.LAA21913@devsys.jaguNET.com> you wrote:
> Ben Laurie wrote:
>> 
>> rse@hyperreal.org wrote:
>> >   - renamed remaining os_ stuff in os/unix/ and os/bs2000/ to ap_ variants
>> 
>> I don't remember buying into removal of os_ as part of adding ap_.
>> Surely the correct thing to do is call it ap_os_ (or apos_, but I
>> suppose that would be against the rules)? I think it is a definite
>> backwards step to lose sight of which functions actually change on a
>> per-OS basis.
>> 

> Especially when they are already protected from name-space collisons,
> supposedly the whole and entire reason for this.

Ok, now that we have a flexible renaming tool, this issue
is just a problem of 5 minutes. I've run the rename stuff
with this little config:

ap_dso_error                        ap_os_dso_error                    
ap_dso_sym                          ap_os_dso_sym                      
ap_dso_unload                       ap_os_dso_unload                   
ap_dso_load                         ap_os_dso_load
ap_canonical_filename               ap_os_canonical_filename
ap_is_path_absolute                 ap_os_is_path_absolute             
ap_escape_path                      ap_os_escape_path                  

How about the resulting patch I appended?

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Index: include/compat.h
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/include/compat.h,v
retrieving revision 1.2
diff -u -r1.2 compat.h
--- compat.h	1998/04/13 10:32:27	1.2
+++ compat.h	1998/04/13 15:52:58
@@ -208,9 +208,9 @@
 #define open_logs                      ap_open_logs
 #define open_mutex                     ap_open_mutex
 #define open_piped_log                 ap_open_piped_log
-#define os_canonical_filename          ap_canonical_filename
-#define os_escape_path                 ap_escape_path
-#define os_is_path_absolute            ap_is_path_absolute
+#define os_canonical_filename          ap_os_canonical_filename
+#define os_escape_path                 ap_os_escape_path
+#define os_is_path_absolute            ap_os_is_path_absolute
 #define overlay_tables                 ap_overlay_tables
 #define palloc                         ap_palloc
 #define parseHTTPdate                  ap_parseHTTPdate
@@ -389,9 +389,9 @@
 #define util_uri_init                  ap_util_uri_init
 #define uudecode                       ap_uudecode
 #define vbprintf                       ap_vbprintf
-#define os_dl_load                     ap_dso_load
-#define os_dl_unload                   ap_dso_unload
-#define os_dl_sym                      ap_dso_sym
-#define os_dl_error                    ap_dso_error
+#define os_dl_load                     ap_os_dso_load
+#define os_dl_unload                   ap_os_dso_unload
+#define os_dl_sym                      ap_os_dso_sym
+#define os_dl_error                    ap_os_dso_error
 
 #endif /* APACHE_COMPAT_H */
Index: include/httpd.h
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/include/httpd.h,v
retrieving revision 1.202
diff -u -r1.202 httpd.h
--- httpd.h	1998/04/11 12:00:22	1.202
+++ httpd.h	1998/04/13 15:53:00
@@ -843,8 +843,8 @@
 API_EXPORT(void) ap_no2slash(char *name);
 API_EXPORT(void) ap_getparents(char *name);
 API_EXPORT(char *) ap_escape_path_segment(pool *p, const char *s);
-API_EXPORT(char *) ap_escape_path(pool *p, const char *path, int partial);
-#define escape_uri(ppool,path) ap_escape_path(ppool,path,1)
+API_EXPORT(char *) ap_os_escape_path(pool *p, const char *path, int partial);
+#define escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
 API_EXPORT(char *) ap_escape_html(pool *p, const char *s);
 API_EXPORT(char *) ap_construct_server(pool *p, const char *hostname,
 				    unsigned port, const request_rec *r);
@@ -913,9 +913,9 @@
 API_EXPORT(void) ap_chdir_file(const char *file);
 
 #ifndef HAVE_CANONICAL_FILENAME
-#define ap_canonical_filename(p,f)  (f)
+#define ap_os_canonical_filename(p,f)  (f)
 #else
-API_EXPORT(char *) ap_canonical_filename(pool *p, const char *file);
+API_EXPORT(char *) ap_os_canonical_filename(pool *p, const char *file);
 #endif
 
 char *ap_get_local_host(pool *);
Index: main/http_config.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/main/http_config.c,v
retrieving revision 1.113
diff -u -r1.113 http_config.c
--- http_config.c	1998/04/11 12:00:28	1.113
+++ http_config.c	1998/04/13 15:52:43
@@ -983,7 +983,7 @@
        so the server can be moved or mirrored with less pain.  */
     char *p;
     int offset = (int) (long) cmd->info;
-    if (ap_is_path_absolute(arg))
+    if (ap_os_is_path_absolute(arg))
 	p = arg;
     else
 	p = ap_make_full_path(cmd->pool, ap_server_root, arg);
@@ -1001,7 +1001,7 @@
 
 API_EXPORT(char *) ap_server_root_relative(pool *p, char *file)
 {
-    if(ap_is_path_absolute(file))
+    if(ap_os_is_path_absolute(file))
 	return file;
     return ap_make_full_path(p, ap_server_root, file);
 }
Index: main/http_core.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/main/http_core.c,v
retrieving revision 1.182
diff -u -r1.182 http_core.c
--- http_core.c	1998/04/13 10:32:26	1.182
+++ http_core.c	1998/04/13 15:52:43
@@ -988,7 +988,7 @@
     }
     else {
 	/* Ensure that the pathname is canonical */
-	cmd->path = ap_canonical_filename(cmd->pool, cmd->path);
+	cmd->path = ap_os_canonical_filename(cmd->pool, cmd->path);
     }
 
     old_end_token = cmd->end_token;
@@ -1104,7 +1104,7 @@
     }
     else {
 	/* Ensure that the pathname is canonical */
-	cmd->path = ap_canonical_filename(cmd->pool, cmd->path);
+	cmd->path = ap_os_canonical_filename(cmd->pool, cmd->path);
     }
 
     old_end_token = cmd->end_token;
Index: main/http_request.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/main/http_request.c,v
retrieving revision 1.118
diff -u -r1.118 http_request.c
--- http_request.c	1998/04/11 12:00:30	1.118
+++ http_request.c	1998/04/13 15:52:44
@@ -306,7 +306,7 @@
      * Fake filenames (i.e. proxy:) only match Directory sections.
      */
 
-    if (!ap_is_path_absolute(r->filename))
+    if (!ap_os_is_path_absolute(r->filename))
     {
         void *this_conf, *entry_config;
         core_dir_config *entry_core;
@@ -343,7 +343,7 @@
         return OK;
     }
 
-    r->filename   = ap_canonical_filename(r->pool, r->filename);
+    r->filename   = ap_os_canonical_filename(r->pool, r->filename);
     test_filename = ap_pstrdup(r->pool, r->filename);
 
     ap_no2slash(test_filename);
@@ -414,7 +414,7 @@
             entry_dir = entry_core->d;
 
             if (entry_core->r
-		|| !ap_is_path_absolute(entry_dir)
+		|| !ap_os_is_path_absolute(entry_dir)
                 || entry_core->d_components > i)
                 break;
 
Index: main/util.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/main/util.c,v
retrieving revision 1.111
diff -u -r1.111 util.c
--- util.c	1998/04/11 12:00:31	1.111
+++ util.c	1998/04/13 15:52:45
@@ -1149,7 +1149,7 @@
     return copy;
 }
 
-API_EXPORT(char *) ap_escape_path(pool *p, const char *path, int partial)
+API_EXPORT(char *) ap_os_escape_path(pool *p, const char *path, int partial)
 {
     char *copy = ap_palloc(p, 3 * strlen(path) + 3);
     const unsigned char *s = (const unsigned char *)path;
Index: modules/standard/mod_alias.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/modules/standard/mod_alias.c,v
retrieving revision 1.34
diff -u -r1.34 mod_alias.c
--- mod_alias.c	1998/04/11 12:00:43	1.34
+++ mod_alias.c	1998/04/13 15:52:48
@@ -320,7 +320,7 @@
 	    if (l > 0) {
 		if (doesc) {
 		    char *escurl;
-		    escurl = ap_escape_path(r->pool, r->uri + l, 1);
+		    escurl = ap_os_escape_path(r->pool, r->uri + l, 1);
 
 		    found = ap_pstrcat(r->pool, p->real, escurl, NULL);
 		}
Index: modules/standard/mod_autoindex.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/modules/standard/mod_autoindex.c,v
retrieving revision 1.73
diff -u -r1.73 mod_autoindex.c
--- mod_autoindex.c	1998/04/11 12:00:44	1.73
+++ mod_autoindex.c	1998/04/13 15:52:48
@@ -851,7 +851,7 @@
 	    if (t[0] == '\0')
 		t = "/";
 	    anchor = ap_pstrcat(scratch, "<A HREF=\"",
-			ap_escape_html(scratch, ap_escape_path(scratch, t, 0)),
+			ap_escape_html(scratch, ap_os_escape_path(scratch, t, 0)),
 			     "\">", NULL);
 	    t2 = "Parent Directory</A>       ";
 	}
@@ -873,7 +873,7 @@
 		t2 = ap_pstrcat(scratch, t2, "</A>", buff, NULL);
 	    }
 	    anchor = ap_pstrcat(scratch, "<A HREF=\"",
-			ap_escape_html(scratch, ap_escape_path(scratch, t, 0)),
+			ap_escape_html(scratch, ap_os_escape_path(scratch, t, 0)),
 			     "\">", NULL);
 	}
 
Index: modules/standard/mod_so.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/modules/standard/mod_so.c,v
retrieving revision 1.20
diff -u -r1.20 mod_so.c
--- mod_so.c	1998/04/13 10:32:25	1.20
+++ mod_so.c	1998/04/13 15:52:57
@@ -195,7 +195,7 @@
     ap_remove_module(modi->modp);
 
     /* unload the module space itself */
-    ap_dso_unload((ap_dso_handle_t)modi->modp->dynamic_load_handle);
+    ap_os_dso_unload((ap_dso_handle_t)modi->modp->dynamic_load_handle);
 
     /* destroy the module information */
     modi->modp = NULL;
@@ -211,7 +211,7 @@
 
 static void unload_file(void *handle)
 {
-    ap_dso_unload((ap_dso_handle_t)handle);
+    ap_os_dso_unload((ap_dso_handle_t)handle);
 }
 
 /* 
@@ -248,8 +248,8 @@
     /*
      * Load the file into the Apache address space
      */
-    if (!(modhandle = ap_dso_load(szModuleFile))) {
-	const char *my_error = ap_dso_error();
+    if (!(modhandle = ap_os_dso_load(szModuleFile))) {
+	const char *my_error = ap_os_dso_error();
 	return ap_pstrcat (cmd->pool, "Cannot load ", szModuleFile,
 			" into server: ", 
 			my_error ? my_error : "(reason unknown)",
@@ -263,9 +263,9 @@
      * First with the hidden variant (prefix `AP_') and then with the plain
      * symbol name.
      */
-    if (!(modp = (module *)(ap_dso_sym(modhandle, modname)))) {
+    if (!(modp = (module *)(ap_os_dso_sym(modhandle, modname)))) {
 	return ap_pstrcat(cmd->pool, "Can't find module ", modname,
-		       " in file ", filename, ":", ap_dso_error(), NULL);
+		       " in file ", filename, ":", ap_os_dso_error(), NULL);
     }
     modi->modp = modp;
     modp->dynamic_load_handle = modhandle;
@@ -309,8 +309,8 @@
 
     file = ap_server_root_relative(cmd->pool, filename);
     
-    if (!(handle = ap_dso_load(file))) {
-	const char *my_error = ap_dso_error();
+    if (!(handle = ap_os_dso_load(file))) {
+	const char *my_error = ap_os_dso_error();
 	return ap_pstrcat (cmd->pool, "Cannot load ", filename, 
 			" into server:", 
 			my_error ? my_error : "(reason unknown)",
Index: modules/standard/mod_userdir.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/modules/standard/mod_userdir.c,v
retrieving revision 1.35
diff -u -r1.35 mod_userdir.c
--- mod_userdir.c	1998/04/11 12:00:53	1.35
+++ mod_userdir.c	1998/04/13 15:52:57
@@ -260,7 +260,7 @@
         if (strchr(userdir, '*'))
             x = ap_getword(r->pool, &userdir, '*');
 
-	if (userdir[0] == '\0' || ap_is_path_absolute(userdir)) {
+	if (userdir[0] == '\0' || ap_os_is_path_absolute(userdir)) {
             if (x) {
 #ifdef WIN32
                 /*
Index: os/bs2000/os-inline.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/os/bs2000/os-inline.c,v
retrieving revision 1.4
diff -u -r1.4 os-inline.c
--- os-inline.c	1998/04/11 12:01:02	1.4
+++ os-inline.c	1998/04/13 15:52:37
@@ -25,7 +25,7 @@
 
 #endif
 
-INLINE int ap_is_path_absolute(const char *file)
+INLINE int ap_os_is_path_absolute(const char *file)
 {
   return (file && file[0] == '/' ? 1 : 0);
 }
Index: os/bs2000/os.h
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/os/bs2000/os.h,v
retrieving revision 1.6
diff -u -r1.6 os.h
--- os.h	1998/04/13 10:32:24	1.6
+++ os.h	1998/04/13 15:52:37
@@ -20,7 +20,7 @@
 /* Compiler does not support inline, so prototype the inlineable functions
  * as normal
  */
-extern int ap_is_path_absolute(const char *f);
+extern int ap_os_is_path_absolute(const char *f);
 #endif
 
 /* Sorry if this is ugly, but the include order doesn't allow me
Index: os/emx/os-inline.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/os/emx/os-inline.c,v
retrieving revision 1.4
diff -u -r1.4 os-inline.c
--- os-inline.c	1998/04/11 12:01:03	1.4
+++ os-inline.c	1998/04/13 15:52:38
@@ -25,7 +25,7 @@
 
 #endif
 
-INLINE int ap_is_path_absolute(const char *file)
+INLINE int ap_os_is_path_absolute(const char *file)
 {
   /* For now, just do the same check that http_request.c and mod_alias.c
    * do. 
Index: os/emx/os.h
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/os/emx/os.h,v
retrieving revision 1.3
diff -u -r1.3 os.h
--- os.h	1998/04/11 12:01:04	1.3
+++ os.h	1998/04/13 15:52:38
@@ -16,7 +16,7 @@
 /* Compiler does not support inline, so prototype the inlineable functions
  * as normal
  */
-extern int ap_is_path_absolute(const char *f);
+extern int ap_os_is_path_absolute(const char *f);
 #endif
 
 /* OS/2 doesn't have symlinks so S_ISLNK is always false */
Index: os/unix/os-inline.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/os/unix/os-inline.c,v
retrieving revision 1.5
diff -u -r1.5 os-inline.c
--- os-inline.c	1998/04/11 12:01:04	1.5
+++ os-inline.c	1998/04/13 15:52:38
@@ -25,7 +25,7 @@
 
 #endif
 
-INLINE int ap_is_path_absolute(const char *file)
+INLINE int ap_os_is_path_absolute(const char *file)
 {
   return file[0] == '/';
 }
Index: os/unix/os.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/os/unix/os.c,v
retrieving revision 1.8
diff -u -r1.8 os.c
--- os.c	1998/04/13 10:32:24	1.8
+++ os.c	1998/04/13 15:52:38
@@ -19,7 +19,7 @@
  *  dynamic shared object (DSO) mechanism
  */
 
-void *ap_dso_load(const char *path)
+void *ap_os_dso_load(const char *path)
 {
 #if defined(HPUX) || defined(HPUX10)
     shl_t handle;
@@ -30,7 +30,7 @@
 #endif
 }
 
-void ap_dso_unload(void *handle) 
+void ap_os_dso_unload(void *handle) 
 {
 #if defined(HPUX) || defined(HPUX10)
     shl_unload((shl_t)handle);
@@ -40,7 +40,7 @@
     return;
 }
 
-void *ap_dso_sym(void *handle, const char *symname)
+void *ap_os_dso_sym(void *handle, const char *symname)
 {
 #if defined(HPUX) || defined(HPUX10)
     void *symaddr = NULL;
@@ -62,7 +62,7 @@
 #endif /* ndef HPUX */
 }
 
-const char *ap_dso_error(void)
+const char *ap_os_dso_error(void)
 {
 #if defined(HPUX) || defined(HPUX10)
     return strerror(errno);
Index: os/unix/os.h
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/os/unix/os.h,v
retrieving revision 1.20
diff -u -r1.20 os.h
--- os.h	1998/04/13 10:32:23	1.20
+++ os.h	1998/04/13 15:52:38
@@ -76,7 +76,7 @@
 /* Compiler does not support inline, so prototype the inlineable functions
  * as normal
  */
-extern int ap_is_path_absolute(const char *f);
+extern int ap_os_is_path_absolute(const char *f);
 #endif
 
 /*
@@ -120,9 +120,9 @@
 #endif
 
 #define     ap_dso_handle_t  void *
-void *      ap_dso_load(const char *);
-void        ap_dso_unload(void *);
-void *      ap_dso_sym(void *, const char *);
-const char *ap_dso_error(void);
+void *      ap_os_dso_load(const char *);
+void        ap_os_dso_unload(void *);
+void *      ap_os_dso_sym(void *, const char *);
+const char *ap_os_dso_error(void);
 
 #endif	/* !APACHE_OS_H */
Index: os/win32/os.h
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/os/win32/os.h,v
retrieving revision 1.16
diff -u -r1.16 os.h
--- os.h	1998/04/13 10:32:23	1.16
+++ os.h	1998/04/13 15:52:39
@@ -77,7 +77,7 @@
 #define NO_OTHER_CHILD
 #define NO_RELIABLE_PIPED_LOGS
 
-__inline int ap_is_path_absolute(const char *file)
+__inline int ap_os_is_path_absolute(const char *file)
 {
   /* For now, just do the same check that http_request.c and mod_alias.c
    * do. 
@@ -102,7 +102,7 @@
  * These are used by mod_so.c
  */
 #define ap_dso_handle_t  HINSTANCE
-#define ap_dso_load(l)   LoadLibraryEx(l, NULL, LOAD_WITH_ALTERED_SEARCH_PATH)
-#define ap_dso_unload(l) FreeLibrary(l)
-#define ap_dso_sym(h,s)  GetProcAddress(h,s)
-#define ap_dso_error()   ""	/* for now */
+#define ap_os_dso_load(l)   LoadLibraryEx(l, NULL, LOAD_WITH_ALTERED_SEARCH_PATH)
+#define ap_os_dso_unload(l) FreeLibrary(l)
+#define ap_os_dso_sym(h,s)  GetProcAddress(h,s)
+#define ap_os_dso_error()   ""	/* for now */
Index: os/win32/util_win32.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/os/win32/util_win32.c,v
retrieving revision 1.12
diff -u -r1.12 util_win32.c
--- util_win32.c	1998/04/11 12:01:07	1.12
+++ util_win32.c	1998/04/13 15:52:40
@@ -54,7 +54,7 @@
     }
 }
 
-API_EXPORT(char *) ap_canonical_filename(pool *pPool, const char *szFile)
+API_EXPORT(char *) ap_os_canonical_filename(pool *pPool, const char *szFile)
 {
     char buf[HUGE_STRING_LEN];
 

Mime
View raw message