os.h revision 2bbc77736b206b2fad7556674abd4eeff0573b62
db93f1f441db5c05e281f4ed3738a3660527cd8eslive/* ====================================================================
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * The Apache Software License, Version 1.1
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd *
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * Copyright (c) 2000 The Apache Software Foundation. All rights
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * reserved.
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd *
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * Redistribution and use in source and binary forms, with or without
3f08db06526d6901aa08c110b5bc7dde6bc39905nd * modification, are permitted provided that the following conditions
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * are met:
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd *
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen * 1. Redistributions of source code must retain the above copyright
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen * notice, this list of conditions and the following disclaimer.
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen *
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen * 2. Redistributions in binary form must reproduce the above copyright
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * notice, this list of conditions and the following disclaimer in
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * the documentation and/or other materials provided with the
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * distribution.
d229f940abfb2490dee17979e9a5ff31b7012eb5rbowen *
3f08db06526d6901aa08c110b5bc7dde6bc39905nd * 3. The end-user documentation included with the redistribution,
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * if any, must include the following acknowledgment:
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * "This product includes software developed by the
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * Apache Software Foundation (http://www.apache.org/)."
4b5981e276e93df97c34e4da05ca5cf8bbd937dand * Alternately, this acknowledgment may appear in the software itself,
3f08db06526d6901aa08c110b5bc7dde6bc39905nd * if and wherever such third-party acknowledgments normally appear.
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd *
ed1d958582984a7c54a6ca859e15939a414fa733nd * 4. The names "Apache" and "Apache Software Foundation" must
ed1d958582984a7c54a6ca859e15939a414fa733nd * not be used to endorse or promote products derived from this
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd * software without prior written permission. For written
74f9e2dc9461c0e91b182eff6a9828fe42496dbcnd * permission, please contact apache@apache.org.
74f9e2dc9461c0e91b182eff6a9828fe42496dbcnd *
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd * 5. Products derived from this software may not be called "Apache",
1cc20a8827ff6056399d64e3106b44d31e8e0e53nd * nor may "Apache" appear in their name, without prior written
74f9e2dc9461c0e91b182eff6a9828fe42496dbcnd * permission of the Apache Software Foundation.
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen *
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluem * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluem * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
3f08db06526d6901aa08c110b5bc7dde6bc39905nd * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * SUCH DAMAGE.
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * ====================================================================
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd *
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * This software consists of voluntary contributions made by many
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * individuals on behalf of the Apache Software Foundation. For more
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * information on the Apache Software Foundation, please see
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * <http://www.apache.org/>.
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd *
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * Portions of this software are based upon public domain software
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * originally written at the National Center for Supercomputing Applications,
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * University of Illinois, Urbana-Champaign.
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd */
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#ifndef APACHE_OS_H
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#define APACHE_OS_H
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#define PLATFORM "OS/2"
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#define HAVE_CANONICAL_FILENAME
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#define HAVE_DRIVE_LETTERS
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#define HAVE_UNC_PATHS
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#include <apr_general.h>
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd/*
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * This file in included in all Apache source code. It contains definitions
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * of facilities available on _this_ operating system (HAVE_* macros),
5ae30adbe59946de742ab0cd6be3b7457471a698takashi * and prototypes of OS specific functions defined in os.c or os-inline.c
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd */
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#if defined(__GNUC__) && !defined(INLINE)
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd/* Compiler supports inline, so include the inlineable functions as
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * part of the header
5652dbe450e4fcfdf36d4cfb42d7f2345ded29a4maczniak */
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#define INLINE extern __inline__
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndINLINE int ap_os_is_path_absolute(const char *file);
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#include "os-inline.c"
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#endif
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#ifndef INLINE
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd/* Compiler does not support inline, so prototype the inlineable functions
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd * as normal
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd */
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndextern int ap_os_is_path_absolute(const char *file);
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#endif
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndchar *ap_os_canonical_filename(apr_pool_t *p, const char *file);
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndchar *ap_os_case_canonical_filename(apr_pool_t *p, const char *szFile);
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndchar *ap_os_systemcase_filename(apr_pool_t *p, const char *szFile);
ed1d958582984a7c54a6ca859e15939a414fa733nd/* FIXME: the following should be implemented on this platform */
ed1d958582984a7c54a6ca859e15939a414fa733nd#define ap_os_is_filename_valid(f) (1)
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd
74f9e2dc9461c0e91b182eff6a9828fe42496dbcnd/* Use a specialized kill() function */
74f9e2dc9461c0e91b182eff6a9828fe42496dbcndint ap_os_kill(int pid, int sig);
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd
1cc20a8827ff6056399d64e3106b44d31e8e0e53nd/* Maps an OS error code to an error message */
74f9e2dc9461c0e91b182eff6a9828fe42496dbcndchar *ap_os_error_message(int err);
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen/* OS/2 doesn't have symlinks so S_ISLNK is always false */
6116c12fdd3ed06d388fe6572e50a22e9320dfa5nd#define S_ISLNK(m) 0
5effc8b39fae5cd169d17f342bfc265705840014rbowen
d229f940abfb2490dee17979e9a5ff31b7012eb5rbowen/* Dynamic loading functions */
0d0ba3a410038e179b695446bb149cce6264e0abnd#define ap_os_dso_handle_t unsigned long
7fec19672a491661b2fe4b29f685bc7f4efa64d4ndvoid ap_os_dso_init(void);
7fec19672a491661b2fe4b29f685bc7f4efa64d4ndap_os_dso_handle_t ap_os_dso_load(const char *);
7fec19672a491661b2fe4b29f685bc7f4efa64d4ndvoid ap_os_dso_unload(ap_os_dso_handle_t);
6116c12fdd3ed06d388fe6572e50a22e9320dfa5ndvoid * ap_os_dso_sym(ap_os_dso_handle_t, const char *);
const char *ap_os_dso_error(void);
#endif /* ! APACHE_OS_H */