summaryrefslogtreecommitdiff
path: root/gnu/lib/libg++/g++-include/open.h
blob: ffe81a15ac17444750637fd1a416420b940da42d (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

#ifndef _open_h
#ifdef __GNUG__
#pragma once
#pragma interface
#endif
#define _open_h 1

#include <File.h>
#include <sys/file.h>           // needed to determine values of O_RDONLY...

/*

 translation stuff for opening files. 

*/


enum sys_open_cmd_io_mode  // These should be correct for most systems
{                        
  sio_read      = O_RDONLY,
  sio_write     = O_WRONLY,
  sio_readwrite = O_RDWR,
  sio_append    = O_APPEND
};

enum sys_open_cmd_access_mode
{
  sa_create     = O_CREAT,
  sa_truncate   = O_TRUNC,
  sa_createonly = O_EXCL | O_CREAT
};

  
int open_cmd_arg(io_mode i, access_mode a); // decode modes
char* fopen_cmd_arg(io_mode i);
int open_cmd_arg(const char* m);

#endif