Mercurial > dwindows
comparison compat.h @ 41:af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
name in applications, as well as some GTK updates for using dialogs
before calling dw_main().
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 23 Oct 2001 18:37:46 +0000 |
parents | cddb02f847e1 |
children | 8add9a616d0e |
comparison
equal
deleted
inserted
replaced
40:88c9c7410c22 | 41:af0a78aa0d45 |
---|---|
2 | 2 |
3 /* This header includes and defines everything needed for a given OS/compiler */ | 3 /* This header includes and defines everything needed for a given OS/compiler */ |
4 #if !defined(__EMX__) && !defined(__IBMC__) && !defined(__WIN32__) && !defined(WINNT) | 4 #if !defined(__EMX__) && !defined(__IBMC__) && !defined(__WIN32__) && !defined(WINNT) |
5 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #define msleep(a) usleep(a*1000) | 7 #include <sys/stat.h> |
8 #include <unistd.h> | |
9 void msleep(long period); | |
8 #endif /* Unix */ | 10 #endif /* Unix */ |
11 | |
12 #ifndef __TARGET__ | |
13 #define __TARGET__ "dw" | |
14 #endif | |
9 | 15 |
10 #include <sys/types.h> | 16 #include <sys/types.h> |
11 #if HAVE_DIRENT_H | 17 #if HAVE_DIRENT_H |
12 #include <dirent.h> | 18 #include <dirent.h> |
13 #define NAMLEN(dirent) strlen((dirent)->d_name) | 19 #define NAMLEN(dirent) strlen((dirent)->d_name) |
36 #define DIRSEP "\\" | 42 #define DIRSEP "\\" |
37 #define INIDIR "." | 43 #define INIDIR "." |
38 #define TYPDIR "." | 44 #define TYPDIR "." |
39 #else | 45 #else |
40 #define DIRSEP "/" | 46 #define DIRSEP "/" |
41 #define INIDIR "~/.handyftp" | 47 #define INIDIR "~/." __TARGET__ |
42 #define TYPDIR "/usr/local/handyftp" | 48 #define TYPDIR "/usr/local/" __TARGET__ |
43 #endif | 49 #endif |
44 | 50 |
45 /* OS/2 */ | 51 /* OS/2 */ |
46 #if defined(__EMX__) || defined(__IBMC__) | 52 #if defined(__EMX__) || defined(__IBMC__) |
47 #define INCL_WIN | 53 #define INCL_WIN |
74 | 80 |
75 #ifndef BKS_TABBEDDIALOG | 81 #ifndef BKS_TABBEDDIALOG |
76 #define BKS_TABBEDDIALOG 0x0800 | 82 #define BKS_TABBEDDIALOG 0x0800 |
77 #endif | 83 #endif |
78 | 84 |
79 #define PIPENAME "\\socket\\handyftp%d" | 85 #define PIPENAME "\\socket\\" __TARGET__ "%d" |
80 #define TPIPENAME "\\socket\\handyftpt%d" | 86 #define TPIPENAME "\\socket\\" __TARGET__ "%d" |
81 #else | 87 #else |
82 #define PIPENAME "/tmp/handyftp%d" | 88 #define PIPENAME "/tmp/" __TARGET__ "%d" |
83 #define TPIPENAME "/tmp/handyftpt%d" | 89 #define TPIPENAME "/tmp/" __TARGET__ "%d" |
84 #endif /* __EMX__ || __IBMC__ */ | 90 #endif /* __EMX__ || __IBMC__ */ |
85 | 91 |
86 #ifdef __IBMC__ | 92 #ifdef __IBMC__ |
87 #define BSD_SELECT | 93 #define BSD_SELECT |
88 | 94 |
154 #if defined(STDC_HEADERS) || defined(__EMX__) | 160 #if defined(STDC_HEADERS) || defined(__EMX__) |
155 #include <stdarg.h> | 161 #include <stdarg.h> |
156 #include <string.h> | 162 #include <string.h> |
157 #endif /* STDC_HEADERS */ | 163 #endif /* STDC_HEADERS */ |
158 #endif /* !WIN32 */ | 164 #endif /* !WIN32 */ |
165 #include <ctype.h> | |
159 | 166 |
160 #ifndef _MAX_PATH | 167 #ifndef _MAX_PATH |
161 #define _MAX_PATH 255 | 168 #define _MAX_PATH 255 |
162 #endif | 169 #endif |
163 | 170 |
185 int sockpipe(int *pipes); | 192 int sockpipe(int *pipes); |
186 void sockinit(void); | 193 void sockinit(void); |
187 void sockshutdown(void); | 194 void sockshutdown(void); |
188 int makedir(char *path); | 195 int makedir(char *path); |
189 void nonblock(int fd); | 196 void nonblock(int fd); |
197 void block(int fd); | |
190 void setfileinfo(char *filename, char *url); | 198 void setfileinfo(char *filename, char *url); |
191 #if defined(__IBMC__) || defined(__WIN32__) | 199 #if defined(__IBMC__) || defined(__WIN32__) |
192 unsigned long drivesize(int drive); | 200 unsigned long drivesize(int drive); |
193 unsigned long drivefree(int drive); | 201 unsigned long drivefree(int drive); |
194 #else | 202 #else |
195 unsigned long long drivefree(int drive); | 203 unsigned long long drivefree(int drive); |
196 unsigned long long drivesize(int drive); | 204 unsigned long long drivesize(int drive); |
197 #endif | 205 #endif |
198 int isdrive(int drive); | 206 int isdrive(int drive); |
207 void getfsname(int drive, char *buf, int len); | |
199 FILE *fsopen(char *path, char *modes); | 208 FILE *fsopen(char *path, char *modes); |
200 int fsclose(FILE *fp); | 209 int fsclose(FILE *fp); |
201 char *fsgets(char *str, int size, FILE *stream); | 210 char *fsgets(char *str, int size, FILE *stream); |
202 int fsseek(FILE *stream, long offset, int whence); | 211 int fsseek(FILE *stream, long offset, int whence); |
203 | 212 |