summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2000-05-26 16:23:37 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2000-05-26 16:23:37 +0000
commit45ed8327ceaaf12e02fe2b425569aa606496f8e4 (patch)
treedbf960b4bef92de87f8e03af704563abe8c5b861 /include
parentd96e95f8e64abe4eeb5cc25c5364d8096050782d (diff)
downloadlibapr-45ed8327ceaaf12e02fe2b425569aa606496f8e4.tar.gz
Mass update of API_IMPORT/EXPORT symbols TO APR_ symbols.
APR is -NOT- the Apache server, so the import/export declations cannot use the same defined symbols. Other minor changes API_THREAD_PROC is now APR_THREAD_PROC. API_VAR_IMPORT/EXPORT are now APR_IMPORT/EXPORT_VAR, to allow easier grepping. The new compilation switches APR_STATIC and APR_EXPORT_SYMBOLS allow the builder to select either static linked or the creation of the export symbols for APR. The aprlib and aprlibdll .dsp projects now include the later symbol. More cleanups from recent commits are still needed, as well as a thorough review of the distinction between APR_EXPORT and APR_EXPORT_NONSTD. The later is used only for pure __cdecl required functions, such as variable arguments (not va array arguments, those are not an issue.) git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60101 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r--include/apr.h.in10
-rw-r--r--include/apr.hw24
-rw-r--r--include/apr_file_io.h2
-rw-r--r--include/apr_fnmatch.h4
-rw-r--r--include/apr_getopt.h4
-rw-r--r--include/apr_lib.h114
-rw-r--r--include/apr_md5.h10
-rw-r--r--include/apr_pools.h6
-rw-r--r--include/apr_thread_proc.h2
-rw-r--r--include/apr_time.h4
-rw-r--r--include/arch/win32/fileio.h2
11 files changed, 98 insertions, 84 deletions
diff --git a/include/apr.h.in b/include/apr.h.in
index 91031e86e..98a9f6b42 100644
--- a/include/apr.h.in
+++ b/include/apr.h.in
@@ -93,11 +93,11 @@ typedef @off_t_value@ ap_off_t;
/* Definitions that APR programs need to work properly. */
-#define API_THREAD_FUNC
-#define API_EXPORT(type) type
-#define API_EXPORT_NONSTD(type) type
-#define API_VAR_IMPORT extern
-#define API_VAR_EXPORT
+#define APR_THREAD_FUNC
+#define APR_EXPORT(type) type
+#define APR_EXPORT_NONSTD(type) type
+#define APR_IMPORT_VAR extern
+#define APR_EXPORT_VAR
/* Define APR_SSIZE_T_FMT.
* If ssize_t is an integer we define it to be "d",
diff --git a/include/apr.hw b/include/apr.hw
index 1f346e4ec..ad9cc3e85 100644
--- a/include/apr.hw
+++ b/include/apr.hw
@@ -163,11 +163,25 @@ typedef int gid_t;
/* Definitions that APR programs need to work properly. */
#define APR_SSIZE_T_FMT "d"
-#define API_THREAD_FUNC __stdcall
-#define API_EXPORT(type) type
-#define API_EXPORT_NONSTD(type) type
-#define API_VAR_IMPORT extern _declspec(dllimport)
-#define API_VAR_EXPORT
+#define APR_THREAD_FUNC __stdcall
+
+#if defined(APR_EXPORT_SYMBOLS)
+#define APR_EXPORT(type) __declspec(dllexport) type
+#define APR_EXPORT_NONSTD(type) __declspec(dllexport) type
+#define APR_EXPORT_VAR __declspec(dllexport)
+#define APR_IMPORT_VAR extern __declspec(dllexport)
+#elif defined(APR_STATIC)
+#define APR_EXPORT(type) type
+#define APR_EXPORT_NONSTD(type) type
+#define APR_EXPORT_VAR
+#define APR_IMPORT_VAR extern
+#else
+/* Default behavior is to import the shared .dll */
+#define APR_EXPORT(type) __declspec(dllimport) type
+#define APR_EXPORT_NONSTD(type) __declspec(dllimport) type
+#define APR_EXPORT_VAR __declspec(dllimport)
+#define APR_IMPORT_VAR extern __declspec(dllimport)
+#endif
#define ap_signal(a,b) signal(a,b)
diff --git a/include/apr_file_io.h b/include/apr_file_io.h
index 02f072de1..a58463ce6 100644
--- a/include/apr_file_io.h
+++ b/include/apr_file_io.h
@@ -391,7 +391,7 @@ B<Flush the file's buffer.>
=cut
*/
ap_status_t ap_flush(ap_file_t *thefile);
-API_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...)
+APR_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...)
__attribute__((format(printf,2,3)));
/*
diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h
index c0300b638..ba27efd1c 100644
--- a/include/apr_fnmatch.h
+++ b/include/apr_fnmatch.h
@@ -51,11 +51,11 @@ extern "C" {
/* This flag is an Apache addition */
#define FNM_CASE_BLIND 0x08 /* Compare characters case ap_pool_t nsensitively. */
-API_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *strings,
+APR_EXPORT(ap_status_t) ap_fnmatch(const char *pattern, const char *strings,
int flags);
/* this function is an Apache addition */
-API_EXPORT(int) ap_is_fnmatch(const char *pattern);
+APR_EXPORT(int) ap_is_fnmatch(const char *pattern);
#ifdef __cplusplus
}
diff --git a/include/apr_getopt.h b/include/apr_getopt.h
index f9ae7603f..e98d1e6da 100644
--- a/include/apr_getopt.h
+++ b/include/apr_getopt.h
@@ -55,12 +55,12 @@
#ifndef APR_GETOPT_H
#define APR_GETOPT_H
-API_VAR_IMPORT int
+APR_IMPORT_VAR int
ap_opterr, /* if error message should be printed */
ap_optind, /* index into parent argv vector */
ap_optopt, /* character checked for validity */
ap_optreset; /* reset getopt */
-API_VAR_IMPORT char *
+APR_IMPORT_VAR char *
ap_optarg; /* argument associated with option */
/*
diff --git a/include/apr_lib.h b/include/apr_lib.h
index 9f58b214c..f70675640 100644
--- a/include/apr_lib.h
+++ b/include/apr_lib.h
@@ -126,17 +126,17 @@ enum kill_conditions {
/*
* Define the prototypes for the various APR GP routines.
*/
-API_EXPORT(char *) ap_cpystrn(char *d, const char *s, size_t l);
-API_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str,
+APR_EXPORT(char *) ap_cpystrn(char *d, const char *s, size_t l);
+APR_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str,
char ***argv_out,
ap_pool_t *token_context);
-API_EXPORT(const char *) ap_filename_of_pathname(const char *pathname);
-API_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src);
+APR_EXPORT(const char *) ap_filename_of_pathname(const char *pathname);
+APR_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src);
-/*API_EXPORT(ap_mutex_t *) ap_create_mutex(void *m);*/
-API_EXPORT(int) ap_slack(int l, int h);
-API_EXPORT_NONSTD(ap_status_t) ap_execle(const char *c, const char *a, ...);
-API_EXPORT_NONSTD(ap_status_t) ap_execve(const char *c, const char *argv[],
+/*APR_EXPORT(ap_mutex_t *) ap_create_mutex(void *m);*/
+APR_EXPORT(int) ap_slack(int l, int h);
+APR_EXPORT_NONSTD(ap_status_t) ap_execle(const char *c, const char *a, ...);
+APR_EXPORT_NONSTD(ap_status_t) ap_execve(const char *c, const char *argv[],
const char *envp[]);
#define ap_create_mutex(x) (0)
@@ -230,7 +230,7 @@ API_EXPORT_NONSTD(ap_status_t) ap_execve(const char *c, const char *argv[],
* or until ap_vformatter returns.
*/
-API_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b),
+APR_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b),
ap_vformatter_buff_t *c, const char *fmt,
va_list ap);
@@ -238,7 +238,7 @@ API_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff_t *b),
/* A small routine to validate a plain text password with a password
* that has been encrypted using any algorithm APR knows about.
*/
-API_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash);
+APR_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *hash);
/*
@@ -257,22 +257,22 @@ API_EXPORT(ap_status_t) ap_validate_password(const char *passwd, const char *has
* to distinguish between an output which was truncated, and an output which
* exactly filled the buffer.
*/
-API_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format, ...)
+APR_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format, ...)
__attribute__((format(printf,3,4)));
-API_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format,
+APR_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format,
va_list ap);
/*
* APR memory structure manipulators (pools, tables, and arrays).
*/
-API_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode));
-API_EXPORT(void) ap_clear_pool(struct ap_pool_t *p);
-API_EXPORT(void) ap_destroy_pool(struct ap_pool_t *p);
-API_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p);
-API_EXPORT(long) ap_bytes_in_free_blocks(void);
-API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts);
-API_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b);
-API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub);
+APR_EXPORT(ap_pool_t *) ap_make_sub_pool(ap_pool_t *p, int (*apr_abort)(int retcode));
+APR_EXPORT(void) ap_clear_pool(struct ap_pool_t *p);
+APR_EXPORT(void) ap_destroy_pool(struct ap_pool_t *p);
+APR_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p);
+APR_EXPORT(long) ap_bytes_in_free_blocks(void);
+APR_EXPORT(ap_pool_t *) ap_find_pool(const void *ts);
+APR_EXPORT(int) ap_pool_is_ancestor(ap_pool_t *a, ap_pool_t *b);
+APR_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub);
/* used to guarantee to the ap_pool_t debugging code that the sub ap_pool_t will not be
* destroyed before the parent pool
@@ -285,78 +285,78 @@ API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub);
#endif /* POOL_DEBUG */
-API_EXPORT(void *) ap_palloc(struct ap_pool_t *c, int reqsize);
-API_EXPORT(void *) ap_pcalloc(struct ap_pool_t *p, int size);
-API_EXPORT(char *) ap_pstrdup(struct ap_pool_t *p, const char *s);
-API_EXPORT(char *) ap_pstrndup(struct ap_pool_t *p, const char *s, int n);
-API_EXPORT_NONSTD(char *) ap_pstrcat(struct ap_pool_t *p, ...);
-API_EXPORT(char *) ap_pvsprintf(struct ap_pool_t *p, const char *fmt, va_list ap);
-API_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *p, const char *fmt, ...);
-API_EXPORT(ap_array_header_t *) ap_make_array(struct ap_pool_t *p, int nelts,
+APR_EXPORT(void *) ap_palloc(struct ap_pool_t *c, int reqsize);
+APR_EXPORT(void *) ap_pcalloc(struct ap_pool_t *p, int size);
+APR_EXPORT(char *) ap_pstrdup(struct ap_pool_t *p, const char *s);
+APR_EXPORT(char *) ap_pstrndup(struct ap_pool_t *p, const char *s, int n);
+APR_EXPORT_NONSTD(char *) ap_pstrcat(struct ap_pool_t *p, ...);
+APR_EXPORT(char *) ap_pvsprintf(struct ap_pool_t *p, const char *fmt, va_list ap);
+APR_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *p, const char *fmt, ...);
+APR_EXPORT(ap_array_header_t *) ap_make_array(struct ap_pool_t *p, int nelts,
int elt_size);
-API_EXPORT(void *) ap_push_array(ap_array_header_t *arr);
-API_EXPORT(void) ap_array_cat(ap_array_header_t *dst,
+APR_EXPORT(void *) ap_push_array(ap_array_header_t *arr);
+APR_EXPORT(void) ap_array_cat(ap_array_header_t *dst,
const ap_array_header_t *src);
-API_EXPORT(ap_array_header_t *) ap_copy_array(struct ap_pool_t *p,
+APR_EXPORT(ap_array_header_t *) ap_copy_array(struct ap_pool_t *p,
const ap_array_header_t *arr);
-API_EXPORT(ap_array_header_t *)
+APR_EXPORT(ap_array_header_t *)
ap_copy_array_hdr(struct ap_pool_t *p,
const ap_array_header_t *arr);
-API_EXPORT(ap_array_header_t *)
+APR_EXPORT(ap_array_header_t *)
ap_append_arrays(struct ap_pool_t *p,
const ap_array_header_t *first,
const ap_array_header_t *second);
-API_EXPORT(char *) ap_array_pstrcat(struct ap_pool_t *p,
+APR_EXPORT(char *) ap_array_pstrcat(struct ap_pool_t *p,
const ap_array_header_t *arr,
const char sep);
-API_EXPORT(ap_table_t *) ap_make_table(struct ap_pool_t *p, int nelts);
-API_EXPORT(ap_table_t *) ap_copy_table(struct ap_pool_t *p, const ap_table_t *t);
-API_EXPORT(void) ap_clear_table(ap_table_t *t);
-API_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key);
-API_EXPORT(void) ap_table_set(ap_table_t *t, const char *key,
+APR_EXPORT(ap_table_t *) ap_make_table(struct ap_pool_t *p, int nelts);
+APR_EXPORT(ap_table_t *) ap_copy_table(struct ap_pool_t *p, const ap_table_t *t);
+APR_EXPORT(void) ap_clear_table(ap_table_t *t);
+APR_EXPORT(const char *) ap_table_get(const ap_table_t *t, const char *key);
+APR_EXPORT(void) ap_table_set(ap_table_t *t, const char *key,
const char *val);
-API_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key,
+APR_EXPORT(void) ap_table_setn(ap_table_t *t, const char *key,
const char *val);
-API_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key);
-API_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key,
+APR_EXPORT(void) ap_table_unset(ap_table_t *t, const char *key);
+APR_EXPORT(void) ap_table_merge(ap_table_t *t, const char *key,
const char *val);
-API_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key,
+APR_EXPORT(void) ap_table_mergen(ap_table_t *t, const char *key,
const char *val);
-API_EXPORT(void) ap_table_add(ap_table_t *t, const char *key,
+APR_EXPORT(void) ap_table_add(ap_table_t *t, const char *key,
const char *val);
-API_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key,
+APR_EXPORT(void) ap_table_addn(ap_table_t *t, const char *key,
const char *val);
-API_EXPORT(ap_table_t *) ap_overlay_tables(struct ap_pool_t *p,
+APR_EXPORT(ap_table_t *) ap_overlay_tables(struct ap_pool_t *p,
const ap_table_t *overlay,
const ap_table_t *base);
-API_EXPORT(void)
+APR_EXPORT(void)
ap_table_do(int (*comp) (void *, const char *, const char *),
void *rec, const ap_table_t *t, ...);
#define AP_OVERLAP_TABLES_SET (0)
#define AP_OVERLAP_TABLES_MERGE (1)
-API_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b,
+APR_EXPORT(void) ap_overlap_tables(ap_table_t *a, const ap_table_t *b,
unsigned flags);
-API_EXPORT(void) ap_register_cleanup(struct ap_pool_t *p, void *data,
+APR_EXPORT(void) ap_register_cleanup(struct ap_pool_t *p, void *data,
ap_status_t (*plain_cleanup) (void *),
ap_status_t (*child_cleanup) (void *));
-API_EXPORT(void) ap_kill_cleanup(struct ap_pool_t *p, void *data,
+APR_EXPORT(void) ap_kill_cleanup(struct ap_pool_t *p, void *data,
ap_status_t (*cleanup) (void *));
-API_EXPORT(ap_status_t) ap_run_cleanup(struct ap_pool_t *p, void *data,
+APR_EXPORT(ap_status_t) ap_run_cleanup(struct ap_pool_t *p, void *data,
ap_status_t (*cleanup) (void *));
-API_EXPORT(void) ap_cleanup_for_exec(void);
-API_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize);
-API_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data);
+APR_EXPORT(void) ap_cleanup_for_exec(void);
+APR_EXPORT(ap_status_t) ap_getpass(const char *prompt, char *pwbuf, size_t *bufsize);
+APR_EXPORT_NONSTD(ap_status_t) ap_null_cleanup(void *data);
-API_EXPORT(void) ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid,
+APR_EXPORT(void) ap_note_subprocess(struct ap_pool_t *a, ap_proc_t *pid,
enum kill_conditions how);
-API_EXPORT(int)
+APR_EXPORT(int)
ap_spawn_child(ap_pool_t *p,
int (*func) (void *a, ap_child_info_t *c),
void *data, enum kill_conditions kill_how,
FILE **pipe_in, FILE **pipe_out,
FILE **pipe_err);
-API_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size);
+APR_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size);
#ifdef __cplusplus
}
diff --git a/include/apr_md5.h b/include/apr_md5.h
index 8bdf1e303..25586c1d8 100644
--- a/include/apr_md5.h
+++ b/include/apr_md5.h
@@ -107,18 +107,18 @@ typedef struct {
#endif
} ap_md5_ctx_t;
-API_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context);
+APR_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context);
#if APR_HAS_XLATE
-API_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate);
+APR_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate);
#else
#define ap_MD5SetXlate(context, xlate) APR_ENOTIMPL
#endif
-API_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context,
+APR_EXPORT(ap_status_t) ap_MD5Update(ap_md5_ctx_t *context,
const unsigned char *input,
unsigned int inputLen);
-API_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE],
+APR_EXPORT(ap_status_t) ap_MD5Final(unsigned char digest[MD5_DIGESTSIZE],
ap_md5_ctx_t *context);
-API_EXPORT(ap_status_t) ap_MD5Encode(const char *password, const char *salt,
+APR_EXPORT(ap_status_t) ap_MD5Encode(const char *password, const char *salt,
char *result, size_t nbytes);
#ifdef __cplusplus
diff --git a/include/apr_pools.h b/include/apr_pools.h
index c485464e2..5d46ba8b8 100644
--- a/include/apr_pools.h
+++ b/include/apr_pools.h
@@ -135,7 +135,7 @@ void ap_term_alloc(void); /* Tear down everything */
/* routines to allocate memory from an pool... */
-API_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *, const char *fmt, ...)
+APR_EXPORT_NONSTD(char *) ap_psprintf(struct ap_pool_t *, const char *fmt, ...)
__attribute__((format(printf,2,3)));
/* array and alist management... keeping lists of things.
@@ -234,8 +234,8 @@ extern int raise_sigstop_flags;
/* Finally, some accounting */
-API_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p);
-API_EXPORT(long) ap_bytes_in_free_blocks(void);
+APR_EXPORT(long) ap_bytes_in_pool(ap_pool_t *p);
+APR_EXPORT(long) ap_bytes_in_free_blocks(void);
#ifdef __cplusplus
}
diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h
index fe56ac5ee..bcf3b5013 100644
--- a/include/apr_thread_proc.h
+++ b/include/apr_thread_proc.h
@@ -103,7 +103,7 @@ typedef struct ap_threadkey_t ap_threadkey_t;
typedef struct ap_other_child_rec_t ap_other_child_rec_t;
#endif /* APR_HAS_OTHER_CHILD */
-typedef void *(API_THREAD_FUNC *ap_thread_start_t)(void *);
+typedef void *(APR_THREAD_FUNC *ap_thread_start_t)(void *);
/* Thread Function definitions */
diff --git a/include/apr_time.h b/include/apr_time.h
index e38cdb84b..c423c068b 100644
--- a/include/apr_time.h
+++ b/include/apr_time.h
@@ -62,8 +62,8 @@
extern "C" {
#endif /* __cplusplus */
-API_VAR_IMPORT const char ap_month_snames[12][4];
-API_VAR_IMPORT const char ap_day_snames[7][4];
+APR_IMPORT_VAR const char ap_month_snames[12][4];
+APR_IMPORT_VAR const char ap_day_snames[7][4];
/* number of microseconds since 00:00:00 january 1, 1970 UTC */
typedef ap_int64_t ap_time_t;
diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h
index 7d9adf353..55d6847d6 100644
--- a/include/arch/win32/fileio.h
+++ b/include/arch/win32/fileio.h
@@ -137,7 +137,7 @@ struct ap_dir_t {
ap_status_t file_cleanup(void *);
/*mode_t get_fileperms(ap_fileperms_t);
*/
-API_EXPORT(char *) ap_os_systemcase_filename(struct ap_pool_t *pCont,
+APR_EXPORT(char *) ap_os_systemcase_filename(struct ap_pool_t *pCont,
const char *szFile);
char * canonical_filename(struct ap_pool_t *pCont, const char *szFile);