Rudiments
filedescriptor.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information.
3
4 friend class securitycontext;
5 friend class gsscontext;
6 friend class tlscontext;
7 protected:
8
9 void construct();
10
11 bool setStreamWriteBufferSize(size_t size);
12 bool setStorageWriteBufferSize(size_t size);
13 bool unsetStreamWriteBuffer();
14 bool unsetStorageWriteBuffer();
15
16 bool setStreamReadBufferSize(size_t size);
17 bool setStorageReadBufferSize(size_t size);
18 bool unsetStreamReadBuffer();
19 bool unsetStorageReadBuffer();
20
21 void allocateWriteBuffer(size_t size);
22
23 off64_t setPosition(off64_t offset, int32_t whence);
24 off64_t getSize();
25 off64_t lseek(off64_t offset, int32_t whence);
26
27 ssize_t realignWriteBuffer(int32_t sec, int32_t usec);
28
29 ssize_t highLevelRead(byte_t *buf, size_t count);
30 ssize_t highLevelRead(byte_t *buf, size_t count,
31 int32_t sec, int32_t usec);
32 ssize_t highLevelWrite(const byte_t *buf, size_t count);
33 ssize_t highLevelWrite(const byte_t *buf, size_t count,
34 int32_t sec, int32_t usec);
35 ssize_t streamBufferedRead(byte_t *buf, size_t count,
36 int32_t sec, int32_t usec);
37 ssize_t streamBufferedWrite(const byte_t *buf,
38 size_t count,
39 int32_t sec, int32_t usec);
40 ssize_t storageBufferedRead(byte_t *buf, size_t count,
41 int32_t sec, int32_t usec);
42 ssize_t storageBufferedWrite(const byte_t *buf,
43 size_t count,
44 int32_t sec, int32_t usec);
45
46 ssize_t unBufferedRead(byte_t *buf, size_t count,
47 int32_t sec, int32_t usec);
48 ssize_t unBufferedWrite(const byte_t *buf, size_t count,
49 int32_t sec, int32_t usec);
50
51 int32_t getSockOpt(int32_t level, int32_t optname,
52 void *optval, socklen_t *optlen);
53 int32_t setSockOpt(int32_t level, int32_t optname,
54 const void *optval, socklen_t optlen);
55
56 virtual ssize_t lowLevelRead(void *buf,
57 size_t count);
58 virtual ssize_t lowLevelWrite(const void *buf,
59 size_t count);
60 virtual int32_t lowLevelClose();
61
62 const char *type();
63 void type(const char *tp);
64
65 int32_t fd();
66 void fd(int32_t filedes);
67
68 socketlayer *socklr();
69
70 private:
72 filedescriptor &operator=(filedescriptor &f) { return *this; };
73
75
76 public:
77 filedescriptor(int32_t fd);
78 static void *getHandleFromFileDescriptor(int32_t fd);
79 size_t getBytesBuffered();
80
81 ssize_t printfDelegate(const char *format, va_list *argp);
82 ssize_t printfDelegate(const wchar_t *format, va_list *argp);
83 ssize_t printfUcs2Delegate(const ucs2_t *format, va_list *argp);
84
85
Definition avltree.h:11
Definition filedescriptor.h:13
Definition gss.h:242
Definition securitycontext.h:11
Definition socketlayer.h:11
Definition tls.h:24