diff options
-rw-r--r-- | dso/beos/Makefile.in | 60 | ||||
-rw-r--r-- | dso/beos/dso.c | 101 | ||||
-rw-r--r-- | dso/beos/dso.h | 72 | ||||
-rw-r--r-- | dso/os2/Makefile.in | 60 | ||||
-rw-r--r-- | dso/os2/dso.c | 104 | ||||
-rw-r--r-- | dso/os2/dso.h | 70 | ||||
-rw-r--r-- | dso/unix/Makefile.in | 60 | ||||
-rw-r--r-- | dso/unix/dso.c | 142 | ||||
-rw-r--r-- | dso/unix/dso.h | 70 | ||||
-rw-r--r-- | include/arch/beos/dso.h | 72 | ||||
-rw-r--r-- | include/arch/os2/dso.h | 70 | ||||
-rw-r--r-- | include/arch/unix/dso.h | 70 |
12 files changed, 951 insertions, 0 deletions
diff --git a/dso/beos/Makefile.in b/dso/beos/Makefile.in new file mode 100644 index 000000000..d0dfd0438 --- /dev/null +++ b/dso/beos/Makefile.in @@ -0,0 +1,60 @@ +#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) +#LIBS=$(EXTRA_LIBS) $(LIBS1) +#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) +#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) + +CC=@CC@ +RANLIB=@RANLIB@ +CFLAGS=@CFLAGS@ @OPTIM@ +LIBS=@LIBS@ +LDFLAGS=@LDFLAGS@ $(LIBS) +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. + +LIB=libdso.a + +OBJS=dso.o \ + +.c.o: + $(CC) $(CFLAGS) -c $(INCLUDES) $< + +all: $(LIB) + +clean: + $(RM) -f *.o *.a *.so + +distclean: clean + -$(RM) -f Makefile + +$(OBJS): Makefile + +$(LIB): $(OBJS) + $(RM) -f $@ + $(AR) cr $@ $(OBJS) + $(RANLIB) $@ + +# +# We really don't expect end users to use this rule. It works only with +# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# using it. +# +depend: + cp Makefile.in Makefile.in.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ + && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ + -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + > Makefile.in \ + && rm Makefile.new + +# DO NOT REMOVE +getopt.o: getopt.c misc.h ../../include/apr_config.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_pools.h \ + ../../include/apr_lib.h ../../include/apr_file_io.h \ + ../../include/apr_getopt.h +start.o: start.c misc.h ../../include/apr_config.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_pools.h \ + ../../include/apr_lib.h ../../include/apr_file_io.h \ + ../../include/apr_getopt.h diff --git a/dso/beos/dso.c b/dso/beos/dso.c new file mode 100644 index 000000000..3c63d8eaa --- /dev/null +++ b/dso/beos/dso.c @@ -0,0 +1,101 @@ +/* =================================================================== + * Copyright (c) 1996-2000 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE Apache Software Foundation ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE Apache Software Foundation OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ===================================================================+ * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Software Foundation and the Apache HTTP server + * project, please see <http://www.apache.org/>. + * + */ + +#include "dso.h" + + +ap_status_t ap_dso_init(void){ + return APR_SUCCESS; +} + +ap_status_t ap_dso_load(const char *path, ap_context_t *ctx, + ap_dso_handle_t **res_handle) +{ + image_id newid; + + if((newid = load_add_on(path)) < B_NO_ERROR) + return APR_EINIT; + + *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + (*res_handle)->handle = newid; + (*res_handle)->cont = ctx; + return APR_SUCCESS; +} + +ap_status_t ap_dso_unload(ap_dso_handle_t *handle) +{ + if(unload_add_on(handle->handle) < B_NO_ERROR) + return APR_EINIT; + + return APR_SUCCESS; +} + +ap_status_t ap_dso_sym(ap_dso_handle_t *handle, const char *symname, + ap_dso_handle_sym_t *ressym) +{ + int err; + + if (symname == NULL) + return APR_EINIT; + + err = get_image_symbol(handle->handle, symname, B_SYMBOL_TYPE_ANY, + ressym); + + if(err != B_OK) + return APR_EINIT; + + return APR_SUCCESS; +} diff --git a/dso/beos/dso.h b/dso/beos/dso.h new file mode 100644 index 000000000..e82564f1f --- /dev/null +++ b/dso/beos/dso.h @@ -0,0 +1,72 @@ +/* =================================================================== + * Copyright (c) 1996-2000 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE Apache Software Foundation ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE Apache Software Foundation OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ===================================================================+ * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Software Foundation and the Apache HTTP server + * project, please see <http://www.apache.org/>. + * + */ + +#ifndef DSO_H +#define DSO_H + +#include "apr_config.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_errno.h" +#include "apr_dso.h" +#include <kernel/image.h> + +struct ap_dso_handle_st { + image_id handle; /* Handle to the DSO loaded */ + ap_context_t *cont; +}; + +#endif
\ No newline at end of file diff --git a/dso/os2/Makefile.in b/dso/os2/Makefile.in new file mode 100644 index 000000000..d0dfd0438 --- /dev/null +++ b/dso/os2/Makefile.in @@ -0,0 +1,60 @@ +#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) +#LIBS=$(EXTRA_LIBS) $(LIBS1) +#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) +#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) + +CC=@CC@ +RANLIB=@RANLIB@ +CFLAGS=@CFLAGS@ @OPTIM@ +LIBS=@LIBS@ +LDFLAGS=@LDFLAGS@ $(LIBS) +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. + +LIB=libdso.a + +OBJS=dso.o \ + +.c.o: + $(CC) $(CFLAGS) -c $(INCLUDES) $< + +all: $(LIB) + +clean: + $(RM) -f *.o *.a *.so + +distclean: clean + -$(RM) -f Makefile + +$(OBJS): Makefile + +$(LIB): $(OBJS) + $(RM) -f $@ + $(AR) cr $@ $(OBJS) + $(RANLIB) $@ + +# +# We really don't expect end users to use this rule. It works only with +# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# using it. +# +depend: + cp Makefile.in Makefile.in.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ + && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ + -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + > Makefile.in \ + && rm Makefile.new + +# DO NOT REMOVE +getopt.o: getopt.c misc.h ../../include/apr_config.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_pools.h \ + ../../include/apr_lib.h ../../include/apr_file_io.h \ + ../../include/apr_getopt.h +start.o: start.c misc.h ../../include/apr_config.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_pools.h \ + ../../include/apr_lib.h ../../include/apr_file_io.h \ + ../../include/apr_getopt.h diff --git a/dso/os2/dso.c b/dso/os2/dso.c new file mode 100644 index 000000000..4ea96655b --- /dev/null +++ b/dso/os2/dso.c @@ -0,0 +1,104 @@ +/* =================================================================== + * Copyright (c) 1996-2000 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE Apache Software Foundation ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE Apache Software Foundation OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ===================================================================+ * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Software Foundation and the Apache HTTP server + * project, please see <http://www.apache.org/>. + * + */ + +#include "misc.h" +#define INCL_DOS +#include <os2.h> +#include <stdio.h> +#include <string.h> + +ap_status_t ap_dso_init(void){ + return APR_SUCCESS; +} + +ap_status_t ap_dso_load(const char *path, ap_context_t *ctx, + ap_dso_handle_t **res_handle) +{ + char somebuf[1024]; + HMODULE handle; + int rc; + + if((rc = DosLoadModule(somebuf, sizeof(somebuf), path, &handle)) != 0) + return APR_EINIT; + + *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + (*res_handle)->handle = handle; + (*res_handle)->cont = ctx; + return APR_SUCCESS; +} + + +ap_status_t ap_dso_unload(ap_dso_handle_t *handle) +{ + DosFreeModule(handle->handle); + return APR_SUCCESS; +} + +ap_status_t ap_dso_sym(ap_dso_handle_t *handle, const char *symname, + ap_dso_handle_sym_t *ressym) +{ + PFN func; + int rc; + + if (symname == NULL || ressym == NULL) + return APR_EINIT; + + if((rc = DosQueryProcAddr(handle->handle, 0, symname, &func)) != 0) + return APR_EINIT; + + *ressym = func; + return APR_SUCCESS; +} diff --git a/dso/os2/dso.h b/dso/os2/dso.h new file mode 100644 index 000000000..1506ed209 --- /dev/null +++ b/dso/os2/dso.h @@ -0,0 +1,70 @@ +/* =================================================================== + * Copyright (c) 1996-2000 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE Apache Software Foundation ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE Apache Software Foundation OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ===================================================================+ * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Software Foundation and the Apache HTTP server + * project, please see <http://www.apache.org/>. + * + */ + +#ifndef DSO_H +#define DSO_H + +#include "apr_config.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_dso.h" + +struct ap_dso_handle_st { + HMODULE handle; /* Handle to the DSO loaded */ + ap_context_t cont; /* Context for returning error strings */ +}; + +#endif
\ No newline at end of file diff --git a/dso/unix/Makefile.in b/dso/unix/Makefile.in new file mode 100644 index 000000000..d0dfd0438 --- /dev/null +++ b/dso/unix/Makefile.in @@ -0,0 +1,60 @@ +#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) +#LIBS=$(EXTRA_LIBS) $(LIBS1) +#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) +#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) + +CC=@CC@ +RANLIB=@RANLIB@ +CFLAGS=@CFLAGS@ @OPTIM@ +LIBS=@LIBS@ +LDFLAGS=@LDFLAGS@ $(LIBS) +INCDIR=../../include +INCLUDES=-I$(INCDIR) -I$(INCDIR1) -I. + +LIB=libdso.a + +OBJS=dso.o \ + +.c.o: + $(CC) $(CFLAGS) -c $(INCLUDES) $< + +all: $(LIB) + +clean: + $(RM) -f *.o *.a *.so + +distclean: clean + -$(RM) -f Makefile + +$(OBJS): Makefile + +$(LIB): $(OBJS) + $(RM) -f $@ + $(AR) cr $@ $(OBJS) + $(RANLIB) $@ + +# +# We really don't expect end users to use this rule. It works only with +# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# using it. +# +depend: + cp Makefile.in Makefile.in.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \ + && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' \ + -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \ + > Makefile.in \ + && rm Makefile.new + +# DO NOT REMOVE +getopt.o: getopt.c misc.h ../../include/apr_config.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_pools.h \ + ../../include/apr_lib.h ../../include/apr_file_io.h \ + ../../include/apr_getopt.h +start.o: start.c misc.h ../../include/apr_config.h \ + ../../include/apr_general.h ../../include/apr.h \ + ../../include/apr_errno.h ../../include/apr_pools.h \ + ../../include/apr_lib.h ../../include/apr_file_io.h \ + ../../include/apr_getopt.h diff --git a/dso/unix/dso.c b/dso/unix/dso.c new file mode 100644 index 000000000..32ee4d915 --- /dev/null +++ b/dso/unix/dso.c @@ -0,0 +1,142 @@ +/* =================================================================== + * Copyright (c) 1996-2000 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE Apache Software Foundation ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE Apache Software Foundation OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ===================================================================+ * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Software Foundation and the Apache HTTP server + * project, please see <http://www.apache.org/>. + * + */ + +#include "dso.h" +#include "ltdl.h" + +/* + * ap_dso_init: Initialize the underlying DSO library + * + * Arguments: errstr = Location to store error result on failure. + * + * Return values: Returns APR_SUCCESS (on success), and APR_EINIT on failure. + * on failure, *errstr is valid. + */ + +ap_status_t ap_dso_init(void){ + if(lt_dlinit()) + return APR_EINIT; + + return APR_SUCCESS; +} + +/* + * ap_dso_load: Load a DSO library. + * + * Arguments: path = Path to the DSO library + * ctx = Context to use in allocation of the handle. + * res_handle = Location to store new handle for the DSO + * errstr = Location to store error string on failure. + * + * Return values: Returns APR_SUCCESS on success, else APR_EINIT + */ + +ap_status_t ap_dso_load(const char *path, ap_context_t *ctx, + ap_dso_handle_t **res_handle) +{ + lt_dlhandle dlhandle; + + if((dlhandle = lt_dlopen(path)) == NULL) + return APR_EINIT; + + *res_handle = ap_pcalloc(ctx, sizeof(*res_handle)); + (*res_handle)->handle = dlhandle; + (*res_handle)->cont = ctx; + return APR_SUCCESS; +} + +/* + * ap_dso_unload: Unload a DSO library. + * + * Arguments: handle = Handle to unload + * errstr = Location to store error string on failure. + * + * Return values: Returns APR_SUCCESS on success, else APR_EINIT + */ + +ap_status_t ap_dso_unload(ap_dso_handle_t *handle) +{ + if(lt_dlclose(handle->handle)) + return APR_EINIT; + + return APR_SUCCESS; +} + +/* + * ap_dso_sym: Load a symbol from a DSO handle. + * + * Arguments: handle = DSO handle to load from + * symname = Symbol name to load + * ressym = Location to store pointer to the symbol + * errstr = Location to store error string on failure. + * + * Return values: Returns APR_SUCCESS on success, else APR_EINIT + */ + +ap_status_t ap_dso_sym(ap_dso_handle_t *handle, const char *symname, + ap_dso_handle_sym_t *ressym) +{ + lt_ptr_t sym; + + if (symname == NULL || ressym == NULL) + return APR_EINIT; + + if((sym = lt_dlsym(handle->handle, symname)) == NULL) + return APR_EINIT; + + *ressym = sym; + return APR_SUCCESS; +} diff --git a/dso/unix/dso.h b/dso/unix/dso.h new file mode 100644 index 000000000..b0081e3c8 --- /dev/null +++ b/dso/unix/dso.h @@ -0,0 +1,70 @@ +/* =================================================================== + * Copyright (c) 1996-2000 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE Apache Software Foundation ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE Apache Software Foundation OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ===================================================================+ * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Software Foundation and the Apache HTTP server + * project, please see <http://www.apache.org/>. + * + */ + +#ifndef DSO_H +#define DSO_H + +#include "apr_config.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_dso.h" + +struct ap_dso_handle_st { + lt_dlhandle handle; /* libtool handle */ + ap_context_t cont; +}; + +#endif
\ No newline at end of file diff --git a/include/arch/beos/dso.h b/include/arch/beos/dso.h new file mode 100644 index 000000000..e82564f1f --- /dev/null +++ b/include/arch/beos/dso.h @@ -0,0 +1,72 @@ +/* =================================================================== + * Copyright (c) 1996-2000 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE Apache Software Foundation ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE Apache Software Foundation OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ===================================================================+ * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Software Foundation and the Apache HTTP server + * project, please see <http://www.apache.org/>. + * + */ + +#ifndef DSO_H +#define DSO_H + +#include "apr_config.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_errno.h" +#include "apr_dso.h" +#include <kernel/image.h> + +struct ap_dso_handle_st { + image_id handle; /* Handle to the DSO loaded */ + ap_context_t *cont; +}; + +#endif
\ No newline at end of file diff --git a/include/arch/os2/dso.h b/include/arch/os2/dso.h new file mode 100644 index 000000000..1506ed209 --- /dev/null +++ b/include/arch/os2/dso.h @@ -0,0 +1,70 @@ +/* =================================================================== + * Copyright (c) 1996-2000 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE Apache Software Foundation ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE Apache Software Foundation OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ===================================================================+ * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Software Foundation and the Apache HTTP server + * project, please see <http://www.apache.org/>. + * + */ + +#ifndef DSO_H +#define DSO_H + +#include "apr_config.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_dso.h" + +struct ap_dso_handle_st { + HMODULE handle; /* Handle to the DSO loaded */ + ap_context_t cont; /* Context for returning error strings */ +}; + +#endif
\ No newline at end of file diff --git a/include/arch/unix/dso.h b/include/arch/unix/dso.h new file mode 100644 index 000000000..b0081e3c8 --- /dev/null +++ b/include/arch/unix/dso.h @@ -0,0 +1,70 @@ +/* =================================================================== + * Copyright (c) 1996-2000 The Apache Software Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Software Foundation. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Software Foundation + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE Apache Software Foundation ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE Apache Software Foundation OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ===================================================================+ * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Software Foundation and the Apache HTTP server + * project, please see <http://www.apache.org/>. + * + */ + +#ifndef DSO_H +#define DSO_H + +#include "apr_config.h" +#include "apr_general.h" +#include "apr_pools.h" +#include "apr_dso.h" + +struct ap_dso_handle_st { + lt_dlhandle handle; /* libtool handle */ + ap_context_t cont; +}; + +#endif
\ No newline at end of file |