Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / dmake / extern.h
blobc28eb02bda5dad2464d092067958ff543703a4d1
1 /*
2 --
3 -- SYNOPSIS
4 -- External declarations for dmake functions.
5 --
6 -- DESCRIPTION
7 -- ANSI is a macro that allows the proper handling of ANSI style
8 -- function declarations.
9 --
10 -- AUTHOR
11 -- Dennis Vadura, dvadura@dmake.wticorp.com
13 -- WWW
14 -- http://dmake.wticorp.com/
16 -- COPYRIGHT
17 -- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
19 -- This program is NOT free software; you can redistribute it and/or
20 -- modify it under the terms of the Software License Agreement Provided
21 -- in the file <distribution-root>/readme/license.txt.
23 -- LOG
24 -- Use cvs log to obtain detailed change logs.
27 #ifndef EXTERN_h
28 #define EXTERN_h
30 /* For MSVC++ needs to include windows.h first to avoid problems with
31 * type redefinitions. Include it also for MinGW for consistency. */
32 #if defined(__MINGW32__) || defined(_MSC_VER)
33 #include <windows.h>
34 #endif
36 #include "config.h"
38 /* Define this for the RS/6000 if it breaks something then we have to put a
39 * #ifdef around it. */
40 #if defined(rs6000)
41 #define _POSIX_SOURCE
42 #endif
44 #include <stdio.h>
45 #ifdef HAVE_LIMITS_H
46 # include <limits.h>
47 #endif
48 #include <stdlib.h>
49 #ifdef HAVE_UNISTD_H
50 # include <unistd.h>
51 #endif
52 #include <string.h>
53 #include <ctype.h>
54 #ifdef HAVE_FCNTL_H
55 # include <fcntl.h>
56 #endif
58 #if TIME_WITH_SYS_TIME
59 # include <sys/time.h>
60 # include <time.h>
61 #else
62 # if HAVE_SYS_TIME_H
63 # include <sys/time.h>
64 # else
65 # include <time.h>
66 # endif
67 #endif
69 #if HAVE_SYS_TYPES_H
70 # include <sys/types.h>
71 #else
72 # include <types.h>
73 #endif
74 #if HAVE_SYS_STAT_H
75 # include <sys/stat.h>
76 #endif
77 #if HAVE_UTIME_H
78 # include <utime.h>
79 #endif
81 #define DMPVOID void *
83 #include <signal.h>
84 #include "itypes.h"
85 #include "stdmacs.h"
86 #include "alloc.h"
87 #include "db.h"
88 #include "dstdarg.h"
89 #include "dmake.h"
90 #include "struct.h"
91 #include "vextern.h"
92 #include "public.h"
94 /* Include this last as it invalidates some functions that are defined
95 * externally above and turns them into no-ops. Have to do this after
96 * the extern declarations however. */
97 #include "posix.h"
101 /* Common declarations
102 * ===================
103 * are better made here then in local public.h. So far dmake didn't follow
104 * this strategy but new functions will be added here. */
106 /* Use our own implementation if no library function is present. */
107 #ifndef HAVE_STRLWR
108 /* from dmstring.c */
109 char *strlwr(char *p);
110 #endif
112 /* from function.c */
113 char *exec_normpath(char *args);
115 /* from make.c */
116 void Unmake(CELLPTR cp);
118 /* from path.c */
119 void Clean_path(char *path);
120 char *normalize_path(char *path);
122 /* from sysintf.c */
123 /* cygdospath()/DO_WINPATH() are only needed for the .WINPATH attribute
124 * on cygwin. */
125 #if __CYGWIN__
126 char *cygdospath(char *src, int winpath);
127 # define DO_WINPATH(p) cygdospath(p, UseWinpath)
128 #else
129 # define DO_WINPATH(p) p
130 #endif
133 /* Define some usefull macros. This is done here and not in config.h
134 * to keep this changes usefull even when not using the autotools based
135 * build, i.e. using config.h files that are local to the architecture. */
136 #if defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(OS2) || defined(__EMX__)
137 # define HAVE_DRIVE_LETTERS 1
138 #endif
140 #if defined(_WIN32) || defined(MSDOS) || defined(OS2) && !defined(__CYGWIN__)
141 # define NULLDEV "NUL"
142 #else
143 # define NULLDEV "/dev/null"
144 #endif
146 /* For MSVC 6.0 and newer and MinGW use the CreateProcess() function. */
147 #if defined(__MINGW32__) || defined(_MSC_VER) && _MSC_VER >= 1200
148 # define USE_CREATEPROCESS 1
149 #else
150 /* #undef USE_CREATEPROCESS */
151 #endif
153 /* CreateProcess() is spawn-like. */
154 #if ENABLE_SPAWN && ( HAVE_SPAWN_H || __CYGWIN__ || __EMX__) || defined(USE_CREATEPROCESS)
155 # define USE_SPAWN 1
156 #else
157 /* #undef USE_SPAWN */
158 #endif
160 /* Work around some of the functions that may or may not exist */
161 #if ! HAVE_TZSET
162 #if HAVE_SETTZ
163 # define tzset() settz()
164 #else
165 # warn "tzset is not supported, null out"
166 # define tzset()
167 #endif
168 #endif
170 /* Get the working directory fall back code */
171 #if ! HAVE_GETCWD
172 #if HAVE_GETWD
173 # define getcwd(buf,len) getwd(buf)
174 #else
175 # error "You have no supported way of getting working directory"
176 #endif
177 #endif
179 /* If setvbuf is not available set output to unbuffered */
180 #if ! HAVE_SETVBUF
181 # define setvbuf(fp,bp,type,len) setbuf(fp,NULL)
182 #endif
184 /* coreleft is used in some debug macros. Only Turbo C seems to provide
185 * this function. Define it here so that the code compiles. */
186 #ifdef DBUG
187 #define coreleft() 0L
188 #endif
190 #endif