mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-17 06:48:33 +00:00
[core] rename lib apr symbols to fspr
This commit is contained in:
1 parent
3c7e8ff989
commit
5c2726f413
354 files changed
+11614
-11614
No files matched your search
@@ -22,10 +22,10 @@ code to the effort.</p>
|
||||
<h2>APR On Windows and Netware</h2>
|
||||
|
||||
<p>APR on Windows and Netware is different from APR on all other systems,
|
||||
because those platforms don't use autoconf. On Unix, apr_private.h (private to
|
||||
because those platforms don't use autoconf. On Unix, fspr_private.h (private to
|
||||
APR) and apr.h (public, used by applications that use APR) are generated by
|
||||
autoconf from acconfig.h and apr.h.in respectively. On Windows (and Netware),
|
||||
apr_private.h and apr.h are created from apr_private.hw (apr_private.hwn)
|
||||
fspr_private.h and apr.h are created from fspr_private.hw (fspr_private.hwn)
|
||||
and apr.hw (apr.hwn) respectively.</p>
|
||||
|
||||
<p> <strong>
|
||||
@@ -34,7 +34,7 @@ and apr.hw (apr.hwn) respectively.</p>
|
||||
these additions as well. A general rule of thumb, is that if it is
|
||||
a feature macro, such as APR_HAS_THREADS, Windows and Netware need it.
|
||||
In other words, if the definition is going to be used in a public APR
|
||||
header file, such as apr_general.h, Windows needs it.
|
||||
header file, such as fspr_general.h, Windows needs it.
|
||||
|
||||
The only time it is safe to add a macro or test without also adding
|
||||
the macro to apr*.h[n]w, is if the macro tells APR how to build. For
|
||||
@@ -161,7 +161,7 @@ implemented one way. For example, time is a complete type because there
|
||||
is only one reasonable time implementation.
|
||||
|
||||
<li>The second exception to the incomplete type rule can be found in
|
||||
apr_portable.h. This file defines the native types for each platform.
|
||||
fspr_portable.h. This file defines the native types for each platform.
|
||||
Using these types, it is possible to extract native types for any APR type.</p>
|
||||
</ul>
|
||||
|
||||
@@ -171,14 +171,14 @@ in file_io/unix/fileio.h:</p>
|
||||
|
||||
<pre>
|
||||
struct ap_file_t {
|
||||
apr_pool_t *cntxt;
|
||||
fspr_pool_t *cntxt;
|
||||
int filedes;
|
||||
FILE *filehand;
|
||||
...
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>In include/apr_file_io.h:</p>
|
||||
<p>In include/fspr_file_io.h:</p>
|
||||
</pre>
|
||||
typedef struct ap_file_t ap_file_t;
|
||||
</pre>
|
||||
@@ -187,7 +187,7 @@ in file_io/unix/fileio.h:</p>
|
||||
field in this structure. Windows does not have a filedes field, so obviously,
|
||||
it is important that programs not be able to access these.</p>
|
||||
|
||||
<p>You may notice the apr_pool_t field. Most APR types have this field. This
|
||||
<p>You may notice the fspr_pool_t field. Most APR types have this field. This
|
||||
type is used to allocate memory within APR. Because every APR type has a pool,
|
||||
any APR function can allocate memory if it needs to. This is very important
|
||||
and it is one of the reasons that APR works. If you create a new type, you
|
||||
@@ -281,15 +281,15 @@ the error code indicates an error condition or a status codition.</strong>
|
||||
|
||||
<p>If your function has multiple return codes that all indicate success, but
|
||||
with different results, or if your function can only return PASS/FAIL, you
|
||||
should still return an apr_status_t. In the first case, define one
|
||||
should still return an fspr_status_t. In the first case, define one
|
||||
APR status code for each return value, an example of this is
|
||||
<code>apr_proc_wait</code>, which can only return APR_CHILDDONE,
|
||||
<code>fspr_proc_wait</code>, which can only return APR_CHILDDONE,
|
||||
APR_CHILDNOTDONE, or an error code. In the second case, please return
|
||||
APR_SUCCESS for PASS, and define a new APR status code for failure, an
|
||||
example of this is <code>apr_compare_users</code>, which can only return
|
||||
example of this is <code>fspr_compare_users</code>, which can only return
|
||||
APR_SUCCESS, APR_EMISMATCH, or an error code.</p>
|
||||
|
||||
<p>All of these definitions can be found in apr_errno.h for all platforms. When
|
||||
<p>All of these definitions can be found in fspr_errno.h for all platforms. When
|
||||
an error occurs in an APR function, the function must return an error code.
|
||||
If the error occurred in a system call and that system call uses errno to
|
||||
report an error, then the code is returned unchanged. For example: </p>
|
||||
@@ -320,7 +320,7 @@ case. We'll get to how this problem is solved in a little while.</p>
|
||||
|
||||
<p>If the error occurs in an APR function but it is not due to a system call,
|
||||
but it is actually an APR error or just a status code from APR, then the
|
||||
appropriate code should be returned. These codes are defined in apr_errno.h
|
||||
appropriate code should be returned. These codes are defined in fspr_errno.h
|
||||
and should be self explanatory.</p>
|
||||
|
||||
<p>No APR code should ever return a code between APR_OS_START_USEERR and
|
||||
|
||||
@@ -88,7 +88,7 @@ system objects.</p>
|
||||
|
||||
<h2>Canonical API</h2>
|
||||
|
||||
Functions to manipulate the apr_canon_file_t (an opaque type) include:
|
||||
Functions to manipulate the fspr_canon_file_t (an opaque type) include:
|
||||
|
||||
<ul>
|
||||
<li>Create canon_file_t (from char* path and canon_file_t parent path)
|
||||
@@ -99,7 +99,7 @@ Functions to manipulate the apr_canon_file_t (an opaque type) include:
|
||||
</ul>
|
||||
|
||||
<p>The path is corrected to the file system case only if is in absolute
|
||||
form. The apr_canon_file_t should be preserved as long as possible and
|
||||
form. The fspr_canon_file_t should be preserved as long as possible and
|
||||
used as the parent to create child entries to reduce the number of expensive
|
||||
stat and case canonicalization calls to the OS.</p>
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ EXPAND_ONLY_PREDEF=YES
|
||||
PREDEFINED="APR_DECLARE(x)=x" \
|
||||
"APR_DECLARE_NONSTD(x)=x" \
|
||||
"APR_DECLARE_DATA" \
|
||||
"APR_POOL_DECLARE_ACCESSOR(x)=apr_pool_t* apr_##x##_pool_get (const apr_##x##_t *the##x)" \
|
||||
"APR_DECLARE_INHERIT_SET(x)=apr_status_t apr_##x##_inherit_set(apr_##x##_t *the##x)" \
|
||||
"APR_DECLARE_INHERIT_UNSET(x)=apr_status_t apr_##x##_inherit_unset(apr_##x##_t *the##x)" \
|
||||
"APR_POOL_DECLARE_ACCESSOR(x)=fspr_pool_t* fspr_##x##_pool_get (const fspr_##x##_t *the##x)" \
|
||||
"APR_DECLARE_INHERIT_SET(x)=fspr_status_t fspr_##x##_inherit_set(fspr_##x##_t *the##x)" \
|
||||
"APR_DECLARE_INHERIT_UNSET(x)=fspr_status_t fspr_##x##_inherit_unset(fspr_##x##_t *the##x)" \
|
||||
"APR_HAS_THREADS" \
|
||||
"__attribute__(x)=" \
|
||||
DOXYGEN=
|
||||
|
||||
@@ -6,7 +6,7 @@ we don't expect them to migrate to using APR just because APR has been
|
||||
released. So, we have provided a way for non-APR'ized programs to interact
|
||||
very cleanly with APR.
|
||||
|
||||
There are a set of functions, all documented in apr_portable.h, which allow
|
||||
There are a set of functions, all documented in fspr_portable.h, which allow
|
||||
a programmer to either get a native type from an APR type, or to setup an
|
||||
APR type from a native type.
|
||||
|
||||
@@ -15,11 +15,11 @@ APR for file I/O, but you (in your infinite wisdom) want to use APR to make
|
||||
sure your section is portable. Assume the program provides a type foo_t with
|
||||
a file descriptor in it (fd).
|
||||
|
||||
void function_using_apr(foo_t non_apr_struct, ap_pool_t *p)
|
||||
void function_using_apr(foo_t non_fspr_struct, ap_pool_t *p)
|
||||
{
|
||||
ap_file_t *apr_file = NULL;
|
||||
ap_file_t *fspr_file = NULL;
|
||||
|
||||
ap_put_os_file(&apr_file, &non_apr_struct->fd, p);
|
||||
ap_put_os_file(&fspr_file, &non_fspr_struct->fd, p);
|
||||
|
||||
...
|
||||
}
|
||||
@@ -28,20 +28,20 @@ There are portable functions for each APR incomplete type. They are all
|
||||
called ap_put_os_foobar(), and they each take the same basic arguments, a
|
||||
pointer to a pointer to the incomplete type (the last pointer in that list
|
||||
should be NULL), a pointer to the native type, and a pool. Each of these can
|
||||
be found in apr_portable.h.
|
||||
be found in fspr_portable.h.
|
||||
|
||||
If you have to do the exact opposite (take an APR type and convert it to a
|
||||
native type, there are functions for that too. For example:
|
||||
|
||||
void function_not_using_apr(apr_file_t *apr_file)
|
||||
void function_not_using_apr(fspr_file_t *fspr_file)
|
||||
{
|
||||
int unix_file_desc;
|
||||
|
||||
ap_get_os_file(&unix_file_desc, apr_file);
|
||||
ap_get_os_file(&unix_file_desc, fspr_file);
|
||||
|
||||
...
|
||||
}
|
||||
|
||||
For each ap_put_os_foobar, there is a corresponding ap_get_os_file. These are
|
||||
also documented in apr_portable.h.
|
||||
also documented in fspr_portable.h.
|
||||
|
||||
@@ -60,13 +60,13 @@
|
||||
</p>
|
||||
<blockquote>
|
||||
<pre>
|
||||
subpool = apr_create_subpool(pool);
|
||||
subpool = fspr_create_subpool(pool);
|
||||
for (i = 0; i < n; ++i) {
|
||||
apr_pool_clear(subpool);
|
||||
fspr_pool_clear(subpool);
|
||||
|
||||
do_operation(..., subpool);
|
||||
}
|
||||
apr_pool_destroy(subpool);</pre>
|
||||
fspr_pool_destroy(subpool);</pre>
|
||||
</blockquote>
|
||||
<p>
|
||||
This pattern prevents the 'pool' from growing unbounded and
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
link with the /pdbtype:sept flag! At the time your application links to
|
||||
an APR library, the corresponding _src.pdb file should exist in the original
|
||||
path the library was built, or it may be sufficient to keep the _src.pdb file
|
||||
in the same path as the library file. (E.g. apr.lib and apr_src.pdb should
|
||||
in the same path as the library file. (E.g. apr.lib and fspr_src.pdb should
|
||||
reside together in your lib directory.) The later option is unconfirmed.</p>
|
||||
|
||||
<p>In order to keep the symbols compiled into the static library, your application
|
||||
|
||||
Reference in new issue
Block a user