summaryrefslogtreecommitdiff
path: root/src/portable.h
blob: c5578a356342837aafecd29df570e188223d9bca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef PORTABLE_H
#define PORTABLE_H

#include <sys/types.h>
#include <stdio.h>
#include <qglobal.h>

#if defined(_WIN32)
typedef __int64 portable_off_t;
#else
typedef off_t portable_off_t;
#endif

/** @file
 *  @brief Portable versions of functions that are platform dependent.
 */

int            portable_system(const char *command,const char *args,bool commandHasConsole=TRUE);
uint           portable_pid();
const char *   portable_getenv(const char *variable);
void           portable_setenv(const char *variable,const char *value);
void           portable_unsetenv(const char *variable);
portable_off_t portable_fseek(FILE *f,portable_off_t offset, int whence);
portable_off_t portable_ftell(FILE *f);
FILE *         portable_fopen(const char *fileName,const char *mode);
char           portable_pathSeparator();
char           portable_pathListSeparator();
const char *   portable_ghostScriptCommand();
const char *   portable_commandExtension();
bool           portable_fileSystemIsCaseSensitive();
FILE *         portable_popen(const char *name,const char *type);
int            portable_pclose(FILE *stream);
void           portable_sysTimerStart();
void           portable_sysTimerStop();
double         portable_getSysElapsedTime();
void           portable_sleep(int ms);
bool           portable_isAbsolutePath(const char *fileName);
void           portable_correct_path(void);

extern "C" {
  void *         portable_iconv_open(const char* tocode, const char* fromcode);
  size_t         portable_iconv (void *cd, char** inbuf, size_t *inbytesleft, 
                                 char* * outbuf, size_t *outbytesleft);
  int            portable_iconv_close (void *cd);
}

#endif