You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@locus.apache.org on 2000/08/17 16:20:15 UTC
cvs commit: apache-2.0/src/lib/apr/dso/os390 .cvsignore Makefile.in dso.c dso.h
trawick 00/08/17 07:20:15
Modified: src CHANGES
Added: src/lib/apr/dso/os390 .cvsignore Makefile.in dso.c dso.h
Log:
Add support to APR for dsos on OS/390.
Submitted by: Greg Ames
Reviewed by: Jeff Trawick
Revision Changes Path
1.203 +2 -0 apache-2.0/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apache-2.0/src/CHANGES,v
retrieving revision 1.202
retrieving revision 1.203
diff -u -r1.202 -r1.203
--- CHANGES 2000/08/17 00:54:03 1.202
+++ CHANGES 2000/08/17 14:20:12 1.203
@@ -1,4 +1,6 @@
Changes with Apache 2.0a6
+ *) Add support to APR for dsos on OS/390. [Greg Ames]
+
*) Add a chunking filter to Apache. This brings us one step closer
to removing BUFF. [Ryan Bloom]
1.1 apache-2.0/src/lib/apr/dso/os390/.cvsignore
Index: .cvsignore
===================================================================
Makefile
1.1 apache-2.0/src/lib/apr/dso/os390/Makefile.in
Index: Makefile.in
===================================================================
#CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
#LIBS=$(EXTRA_LIBS) $(LIBS1)
#INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES)
#LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)
RM=@RM@
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
$(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.in. 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_private.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_private.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
1.1 apache-2.0/src/lib/apr/dso/os390/dso.c
Index: dso.c
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 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. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" 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 name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``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. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
#include "apr_strings.h"
#include "dso.h"
#include <errno.h>
#include <string.h>
#if APR_HAS_DSO
static apr_status_t dso_cleanup(void *thedso)
{
apr_dso_handle_t *dso = thedso;
return apr_dso_unload(dso);
}
apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path,
apr_pool_t *ctx)
{
dllhandle *handle;
int rc;
*res_handle = apr_pcalloc(ctx, sizeof(*res_handle));
if ((handle = dllload(path)) != NULL) {
(*res_handle)->handle = handle;
apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup);
return APR_SUCCESS;
}
(*res_handle)->failing_errno = errno;
return errno;
}
apr_status_t apr_dso_unload(apr_dso_handle_t *handle)
{
int rc;
if (handle->handle == 0)
return APR_SUCCESS;
rc = dllfree(handle->handle);
if (rc == 0) {
handle->handle = 0;
return APR_SUCCESS;
}
handle->failing_errno = errno;
return errno;
}
apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym,
apr_dso_handle_t *handle,
const char *symname)
{
void *func_ptr;
void *var_ptr;
if ((func_ptr = (void *)dllqueryfn(handle->handle, symname)) != NULL) {
*ressym = func_ptr;
return APR_SUCCESS;
}
if ((var_ptr = dllqueryvar(handle->handle, symname)) != NULL) {
*ressym = var_ptr;
return APR_SUCCESS;
}
handle->failing_errno = errno;
return errno;
}
const char *apr_dso_error(apr_dso_handle_t *handle, char *buffer,
apr_size_t buflen)
{
apr_cpystrn(buffer, strerror(handle->failing_errno), buflen);
return buffer;
}
#endif
1.1 apache-2.0/src/lib/apr/dso/os390/dso.h
Index: dso.h
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 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. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" 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 name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``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. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
#ifndef DSO_H
#define DSO_H
#include "apr_private.h"
#include "apr_general.h"
#include "apr_pools.h"
#include "apr_dso.h"
#include "apr.h"
#if APR_HAS_DSO
#include <dll.h>
struct apr_dso_handle_t {
dllhandle *handle; /* Handle to the DSO loaded */
int failing_errno; /* Don't save the buffer returned by
strerror(); it gets reused */
};
#endif
#endif