| 1 |
/** BEGIN COPYRIGHT BLOCK |
| 2 |
* Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. |
| 3 |
* Copyright (C) 2005 Red Hat, Inc. |
| 4 |
* All rights reserved. |
| 5 |
* |
| 6 |
* License: GPL (version 3 or any later version). |
| 7 |
* See LICENSE for details. |
| 8 |
* END COPYRIGHT BLOCK **/ |
| 9 |
|
| 10 |
#ifdef HAVE_CONFIG_H |
| 11 |
#include <config.h> |
| 12 |
#endif |
| 13 |
|
| 14 |
#ifndef BASE_FILE_H |
| 15 |
#define BASE_FILE_H |
| 16 |
|
| 17 |
#ifndef NOINTNSAPI |
| 18 |
#define INTNSAPI |
| 19 |
#endif /* !NOINTNSAPI */ |
| 20 |
|
| 21 |
/* GLOBAL FUNCTIONS: |
| 22 |
* DESCRIPTION: |
| 23 |
* system-specific functions for reading/writing files |
| 24 |
*/ |
| 25 |
|
| 26 |
#ifndef NETSITE_H |
| 27 |
#include "../netsite.h" |
| 28 |
#endif /* !NETSITE_H */ |
| 29 |
|
| 30 |
/* --- Begin function prototypes --- */ |
| 31 |
|
| 32 |
#ifdef INTNSAPI |
| 33 |
|
| 34 |
NSPR_BEGIN_EXTERN_C |
| 35 |
|
| 36 |
void INTsystem_errmsg_init(void); |
| 37 |
|
| 38 |
NSAPI_PUBLIC SYS_FILE INTsystem_fopenRO(char *path); |
| 39 |
NSAPI_PUBLIC SYS_FILE INTsystem_fopenWA(char *path); |
| 40 |
NSAPI_PUBLIC SYS_FILE INTsystem_fopenRW(char *path); |
| 41 |
NSAPI_PUBLIC SYS_FILE INTsystem_fopenWT(char *path); |
| 42 |
NSAPI_PUBLIC int INTsystem_fread(SYS_FILE fd, char *buf, int sz); |
| 43 |
NSAPI_PUBLIC int INTsystem_fwrite(SYS_FILE fd, char *buf, int sz); |
| 44 |
NSAPI_PUBLIC int INTsystem_fwrite_atomic(SYS_FILE fd, char *buf, int sz); |
| 45 |
NSAPI_PUBLIC int INTsystem_lseek(SYS_FILE fd, int off, int wh); |
| 46 |
NSAPI_PUBLIC int INTsystem_fclose(SYS_FILE fd); |
| 47 |
NSAPI_PUBLIC int INTsystem_stat(char *name, struct stat *finfo); |
| 48 |
NSAPI_PUBLIC int INTsystem_rename(char *oldpath, char *newpath); |
| 49 |
NSAPI_PUBLIC int INTsystem_unlink(char *path); |
| 50 |
NSAPI_PUBLIC int INTsystem_tlock(SYS_FILE fd); |
| 51 |
NSAPI_PUBLIC int INTsystem_flock(SYS_FILE fd); |
| 52 |
NSAPI_PUBLIC int INTsystem_ulock(SYS_FILE fd); |
| 53 |
|
| 54 |
|
| 55 |
/* --- OBSOLETE ---------------------------------------------------------- |
| 56 |
* The following macros/functions are obsolete and are only maintained for |
| 57 |
* compatibility. Do not use them. 11-19-96 |
| 58 |
* ----------------------------------------------------------------------- |
| 59 |
*/ |
| 60 |
|
| 61 |
NSAPI_PUBLIC int INTsystem_nocoredumps(void); |
| 62 |
NSAPI_PUBLIC int INTfile_setinherit(SYS_FILE fd, int value); |
| 63 |
NSAPI_PUBLIC int INTfile_notfound(void); |
| 64 |
NSAPI_PUBLIC const char *INTsystem_errmsg(void); |
| 65 |
NSAPI_PUBLIC int INTsystem_errmsg_fn(char **buff, size_t maxlen); |
| 66 |
|
| 67 |
NSPR_END_EXTERN_C |
| 68 |
|
| 69 |
#define system_errmsg_init INTsystem_errmsg_init |
| 70 |
#define system_fopenRO INTsystem_fopenRO |
| 71 |
#define system_fopenWA INTsystem_fopenWA |
| 72 |
#define system_fopenRW INTsystem_fopenRW |
| 73 |
#define system_fopenWT INTsystem_fopenWT |
| 74 |
#define system_fread INTsystem_fread |
| 75 |
#define system_fwrite INTsystem_fwrite |
| 76 |
#define system_fwrite_atomic INTsystem_fwrite_atomic |
| 77 |
#define system_lseek INTsystem_lseek |
| 78 |
#define system_fclose INTsystem_fclose |
| 79 |
#define system_stat INTsystem_stat |
| 80 |
#define system_rename INTsystem_rename |
| 81 |
#define system_unlink INTsystem_unlink |
| 82 |
#define system_tlock INTsystem_tlock |
| 83 |
#define system_flock INTsystem_flock |
| 84 |
#define system_ulock INTsystem_ulock |
| 85 |
|
| 86 |
#define system_nocoredumps INTsystem_nocoredumps |
| 87 |
#define file_setinherit INTfile_setinherit |
| 88 |
#define file_notfound INTfile_notfound |
| 89 |
#define rtfile_notfound INTfile_notfound |
| 90 |
#define system_errmsg INTsystem_errmsg |
| 91 |
#define system_errmsg_fn INTsystem_errmsg_fn |
| 92 |
|
| 93 |
#endif /* INTNSAPI */ |
| 94 |
|
| 95 |
#endif /* BASE_FILE_H */ |