diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-07-19 11:29:27 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-07-19 11:29:27 +0300 |
commit | 651babfefa21536112cbcd799932b3595aeb2da4 (patch) | |
tree | 6922b7ea70642f4ce7a8cb97f01e62115e97d940 /runcap.h | |
parent | 3e59cfb01443a14962547ed75bbbaaefa25a7633 (diff) | |
download | runcap-651babfefa21536112cbcd799932b3595aeb2da4.tar.gz runcap-651babfefa21536112cbcd799932b3595aeb2da4.tar.bz2 |
Rename struct filecapture to stream_capture; portability fixes
Diffstat (limited to 'runcap.h')
-rw-r--r-- | runcap.h | 39 |
1 files changed, 20 insertions, 19 deletions
@@ -19,18 +19,19 @@ -struct filecapture +struct stream_capture { - size_t fc_size; /* size of the buffer */ - off_t fc_leng; /* total length of captured data */ - size_t fc_nlines; /* number of captured lines */ - size_t fc_cur; /* current offset in buffer */ - char * fc_base; /* buffer space */ - size_t fc_level; /* number of characters currently in buffer */ - void (*fc_linemon) (const char *, size_t, void *); + int sc_fd; /* Input descriptor */ + char *sc_base; /* buffer space */ + size_t sc_size; /* size of the buffer */ + size_t sc_level; /* number of characters currently in buffer */ + size_t sc_cur; /* current offset in buffer */ + off_t sc_leng; /* total length of captured data */ + size_t sc_nlines; /* number of captured lines */ + int sc_storfd; /* Storage file descriptor */ + + void (*sc_linemon) (const char *, size_t, void *); /* Line monitor function */ - void *fc_monarg; /* Line monitor argument */ - int fc_tmpfd; /* Storage file descriptor */ - int fc_fd; /* Input descriptor */ + void *sc_monarg; /* Line monitor argument */ }; -#define FC_BUFSIZE 4096 +#define STRCAP_BUFSIZE 4096 @@ -48,3 +49,3 @@ struct runcap unsigned rc_timeout; /* [IN] Execution timeout */ - struct filecapture rc_cap[RUNCAP_NBUF]; + struct stream_capture rc_cap[RUNCAP_NBUF]; /* rc_cap[RUNCAP_STDIN] - [IN], rest - [OUT] */ @@ -63,4 +64,4 @@ struct runcap -int filecapture_init(struct filecapture *fc, size_t size); -void filecapture_free(struct filecapture *fc); +int stream_capture_init(struct stream_capture *fc, size_t size); +void stream_capture_free(struct stream_capture *fc); @@ -69,6 +70,6 @@ void runcap_free(struct runcap *rc); -static inline struct filecapture * -runcap_filecapture(struct runcap *rc, int stream) +static inline struct stream_capture * +runcap_stream_capture(struct runcap *rc, int stream) { - struct filecapture *fp; + struct stream_capture *fp; @@ -81,3 +82,3 @@ runcap_filecapture(struct runcap *rc, int stream) - if (!fp->fc_base || fp->fc_size == 0) { + if (!fp->sc_base || fp->sc_size == 0) { errno = EINVAL; |