#include "oorexxapi.h"
#include "StreamNative.hpp"
#include "StreamCommandParser.h"
#include "Utilities.hpp"
#include <fcntl.h>
#include <sys/stat.h>
#include <string.h>
#include <errno.h>
Go to the source code of this file.
Macros | |
#define | CHAR_positional "positional" |
#define | RDWR_CREAT (RX_O_RDWR | RX_O_CREAT) |
#define | WR_CREAT (RX_O_WRONLY | RX_O_CREAT) |
#define | IREAD_IWRITE (RX_S_IREAD | RX_S_IWRITE) |
Functions | |
StreamInfo * | checkStreamInfo (RexxMethodContext *context, void *streamPtr, RexxObjectPtr result) |
int | reclength_token (TokenDefinition *ttsp, StreamToken &tokenizer, void *userparms) |
int | position_offset (TokenDefinition *ttsp, StreamToken &tokenizer, void *userparms) |
int | unknown_tr (TokenDefinition *ttsp, StreamToken &tokenizer, void *userparms) |
bool | hasNoBufferOption (const char *opts) |
RexxMethod3 (RexxStringObject, stream_charin, CSELF, streamPtr, OPTIONAL_int64_t, position, OPTIONAL_size_t, read_length) | |
RexxMethod3 (size_t, stream_charout, CSELF, streamPtr, OPTIONAL_RexxStringObject, data, OPTIONAL_int64_t, position) | |
RexxMethod3 (RexxStringObject, stream_linein, CSELF, streamPtr, OPTIONAL_int64_t, position, OPTIONAL_size_t, count) | |
RexxMethod2 (int, stream_arrayin, CSELF, streamPtr, RexxArrayObject, result) | |
RexxMethod2 (int64_t, stream_lines, CSELF, streamPtr, OPTIONAL_CSTRING, option) | |
RexxMethod1 (int64_t, stream_chars, CSELF, streamPtr) | |
RexxMethod3 (int, stream_lineout, CSELF, streamPtr, OPTIONAL_RexxStringObject, string, OPTIONAL_int64_t, position) | |
RexxMethod1 (CSTRING, stream_close, CSELF, streamPtr) | |
RexxMethod1 (CSTRING, stream_uninit, CSELF, streamPtr) | |
RexxMethod1 (CSTRING, stream_flush, CSELF, streamPtr) | |
RexxMethod2 (CSTRING, stream_open, CSELF, streamPtr, OPTIONAL_CSTRING, options) | |
RexxMethod2 (int, handle_set, CSELF, streamPtr, int, fh) | |
RexxMethod1 (int, std_set, CSELF, streamPtr) | |
RexxMethod2 (int64_t, stream_position, CSELF, streamPtr, CSTRING, options) | |
RexxMethod2 (RexxObjectPtr, stream_query_position, CSELF, streamPtr, OPTIONAL_CSTRING, options) | |
RexxMethod1 (CSTRING, qualify, CSELF, streamPtr) | |
RexxMethod1 (CSTRING, query_exists, CSELF, streamPtr) | |
RexxMethod1 (RexxObjectPtr, query_handle, CSELF, streamPtr) | |
RexxMethod1 (CSTRING, query_streamtype, CSELF, streamPtr) | |
RexxMethod1 (RexxObjectPtr, query_size, CSELF, streamPtr) | |
RexxMethod1 (CSTRING, query_time, CSELF, streamPtr) | |
RexxMethod1 (CSTRING, stream_state, CSELF, streamPtr) | |
RexxMethod1 (RexxStringObject, stream_description, CSELF, streamPtr) | |
RexxMethod2 (RexxObjectPtr, stream_init, OSELF, self, CSTRING, name) | |
Variables | |
const char * | StreamInfoProperty = "CSELF" |
const int | operation_read = 0x01 |
const int | operation_write = 0x02 |
const int | operation_nocreate = 0x04 |
const int | position_by_char = 0x04 |
const int | position_by_line = 0x08 |
const int | position_offset_specified = 0x10 |
const int | query_read_position = 0x01 |
const int | query_write_position = 0x02 |
const int | query_char_position = 0x04 |
const int | query_line_position = 0x08 |
const int | query_system_position = 0x10 |
#define CHAR_positional "positional" |
Definition at line 55 of file StreamNative.cpp.
#define IREAD_IWRITE (RX_S_IREAD | RX_S_IWRITE) |
Definition at line 91 of file StreamNative.cpp.
#define RDWR_CREAT (RX_O_RDWR | RX_O_CREAT) |
Definition at line 89 of file StreamNative.cpp.
#define WR_CREAT (RX_O_WRONLY | RX_O_CREAT) |
Definition at line 90 of file StreamNative.cpp.
StreamInfo* checkStreamInfo | ( | RexxMethodContext * | context, |
void * | streamPtr, | ||
RexxObjectPtr | result | ||
) |
Helper routine for the method stubs to validate the stream info pointer to ensure that the stream has not been uninited already. This can occur when an uninit method for another object attempts to use a stream.
context | The method context |
streamPtr | The CSELF value |
result | A potential result object set into the context. |
Definition at line 106 of file StreamNative.cpp.
References Rexx_Error_System_service, and StreamInfo::setContext().
Referenced by RexxMethod1(), RexxMethod2(), and RexxMethod3().
bool hasNoBufferOption | ( | const char * | opts | ) |
Helper function to determine if opts contains the no buffer option.
opts | String to search in for NOBUFFER. |
Definition at line 558 of file StreamNative.cpp.
References Utilities::strupper().
Referenced by StreamInfo::openStd().
int position_offset | ( | TokenDefinition * | ttsp, |
StreamToken & | tokenizer, | ||
void * | userparms | ||
) |
Token parsing routine for position offsets.
ttsp | The token action definition associated with this parse. |
token | The current token. |
userparms | An opaque user parameter info. |
Definition at line 160 of file StreamNative.cpp.
References StreamToken::nextToken(), and StreamToken::toNumber().
Referenced by StreamInfo::streamPosition().
int reclength_token | ( | TokenDefinition * | ttsp, |
StreamToken & | tokenizer, | ||
void * | userparms | ||
) |
Token parsing routine for record length parsing.
ttsp | The token action definition associated with this parse. |
token | The current token. |
userparms | An opaque user parameter info. |
Definition at line 129 of file StreamNative.cpp.
References StreamToken::nextToken(), StreamToken::previousToken(), and StreamToken::toNumber().
Referenced by StreamInfo::handleOpen(), and StreamInfo::streamOpen().
Definition at line 3385 of file StreamNative.cpp.
References StreamInfo::getQualifiedName(), and StreamInfo::setContext().
Definition at line 3436 of file StreamNative.cpp.
References StreamInfo::setContext(), and StreamInfo::streamExists().
Definition at line 3494 of file StreamNative.cpp.
References StreamInfo::getStreamType().
Definition at line 3571 of file StreamNative.cpp.
References StreamInfo::getTimeStamp(), and StreamInfo::setContext().
Definition at line 2123 of file StreamNative.cpp.
References StreamInfo::setContext(), and StreamInfo::streamClose().
Definition at line 2214 of file StreamNative.cpp.
References checkStreamInfo(), and StreamInfo::streamFlush().
Definition at line 3608 of file StreamNative.cpp.
References StreamInfo::getState(), and StreamInfo::setContext().
Definition at line 2154 of file StreamNative.cpp.
References StreamInfo::setContext(), and StreamInfo::streamClose().
RexxMethod1 | ( | int | , |
std_set | , | ||
CSELF | , | ||
streamPtr | |||
) |
Definition at line 2609 of file StreamNative.cpp.
References StreamInfo::setStandard().
Definition at line 1968 of file StreamNative.cpp.
References StreamInfo::chars(), and checkStreamInfo().
RexxMethod1 | ( | RexxObjectPtr | , |
query_handle | , | ||
CSELF | , | ||
streamPtr | |||
) |
Definition at line 3461 of file StreamNative.cpp.
References StreamInfo::queryHandle(), and StreamInfo::setContext().
RexxMethod1 | ( | RexxObjectPtr | , |
query_size | , | ||
CSELF | , | ||
streamPtr | |||
) |
Definition at line 3559 of file StreamNative.cpp.
References StreamInfo::getStreamSize(), and StreamInfo::setContext().
RexxMethod1 | ( | RexxStringObject | , |
stream_description | , | ||
CSELF | , | ||
streamPtr | |||
) |
Definition at line 3692 of file StreamNative.cpp.
References StreamInfo::getDescription(), and StreamInfo::setContext().
Definition at line 2555 of file StreamNative.cpp.
References checkStreamInfo(), and StreamInfo::streamOpen().
RexxMethod2 | ( | int | , |
handle_set | , | ||
CSELF | , | ||
streamPtr | , | ||
int | , | ||
fh | |||
) |
Definition at line 2588 of file StreamNative.cpp.
References checkStreamInfo(), and StreamInfo::setHandle().
RexxMethod2 | ( | int | , |
stream_arrayin | , | ||
CSELF | , | ||
streamPtr | , | ||
RexxArrayObject | , | ||
result | |||
) |
Definition at line 1788 of file StreamNative.cpp.
References StreamInfo::arrayin(), and checkStreamInfo().
Definition at line 1901 of file StreamNative.cpp.
References checkStreamInfo(), StreamInfo::lines(), and Rexx_Error_Incorrect_method.
Definition at line 2993 of file StreamNative.cpp.
References checkStreamInfo(), and StreamInfo::streamPosition().
RexxMethod2 | ( | RexxObjectPtr | , |
stream_init | , | ||
OSELF | , | ||
self | , | ||
CSTRING | , | ||
name | |||
) |
Definition at line 3725 of file StreamNative.cpp.
References NULLOBJECT.
RexxMethod2 | ( | RexxObjectPtr | , |
stream_query_position | , | ||
CSELF | , | ||
streamPtr | , | ||
OPTIONAL_CSTRING | , | ||
options | |||
) |
Definition at line 3229 of file StreamNative.cpp.
References checkStreamInfo(), and StreamInfo::queryStreamPosition().
RexxMethod3 | ( | int | , |
stream_lineout | , | ||
CSELF | , | ||
streamPtr | , | ||
OPTIONAL_RexxStringObject | , | ||
string | , | ||
OPTIONAL_int64_t | , | ||
position | |||
) |
Definition at line 2083 of file StreamNative.cpp.
References argumentExists, checkStreamInfo(), and StreamInfo::lineout().
RexxMethod3 | ( | RexxStringObject | , |
stream_charin | , | ||
CSELF | , | ||
streamPtr | , | ||
OPTIONAL_int64_t | , | ||
position | , | ||
OPTIONAL_size_t | , | ||
read_length | |||
) |
Definition at line 1549 of file StreamNative.cpp.
References argumentExists, argumentOmitted, StreamInfo::charin(), and checkStreamInfo().
RexxMethod3 | ( | RexxStringObject | , |
stream_linein | , | ||
CSELF | , | ||
streamPtr | , | ||
OPTIONAL_int64_t | , | ||
position | , | ||
OPTIONAL_size_t | , | ||
count | |||
) |
Definition at line 1713 of file StreamNative.cpp.
References argumentExists, argumentOmitted, checkStreamInfo(), and StreamInfo::linein().
RexxMethod3 | ( | size_t | , |
stream_charout | , | ||
CSELF | , | ||
streamPtr | , | ||
OPTIONAL_RexxStringObject | , | ||
data | , | ||
OPTIONAL_int64_t | , | ||
position | |||
) |
Definition at line 1632 of file StreamNative.cpp.
References argumentExists, StreamInfo::charout(), and checkStreamInfo().
int unknown_tr | ( | TokenDefinition * | ttsp, |
StreamToken & | tokenizer, | ||
void * | userparms | ||
) |
Token parsing routine for unknown tokens. This just forces a parsing error.
ttsp | The token action definition associated with this parse. |
token | The current token. |
userparms | An opaque user parameter info. |
Definition at line 190 of file StreamNative.cpp.
Referenced by StreamInfo::handleOpen(), StreamInfo::queryStreamPosition(), and StreamInfo::streamOpen().
const int operation_nocreate = 0x04 |
Definition at line 72 of file StreamNative.cpp.
Referenced by StreamInfo::chars(), StreamInfo::implicitOpen(), StreamInfo::lines(), StreamInfo::readSetup(), StreamInfo::setPosition(), and StreamInfo::streamPosition().
const int operation_read = 0x01 |
Definition at line 70 of file StreamNative.cpp.
Referenced by StreamInfo::streamPosition().
const int operation_write = 0x02 |
Definition at line 71 of file StreamNative.cpp.
Referenced by StreamInfo::implicitOpen(), StreamInfo::streamPosition(), and StreamInfo::writeSetup().
const int position_by_char = 0x04 |
Definition at line 73 of file StreamNative.cpp.
Referenced by StreamInfo::streamPosition().
const int position_by_line = 0x08 |
Definition at line 74 of file StreamNative.cpp.
Referenced by StreamInfo::streamPosition().
const int position_offset_specified = 0x10 |
Definition at line 75 of file StreamNative.cpp.
const int query_char_position = 0x04 |
Definition at line 83 of file StreamNative.cpp.
Referenced by StreamInfo::queryStreamPosition().
const int query_line_position = 0x08 |
Definition at line 84 of file StreamNative.cpp.
Referenced by StreamInfo::queryStreamPosition().
const int query_read_position = 0x01 |
Definition at line 81 of file StreamNative.cpp.
Referenced by StreamInfo::queryStreamPosition().
const int query_system_position = 0x10 |
Definition at line 85 of file StreamNative.cpp.
Referenced by StreamInfo::queryStreamPosition().
const int query_write_position = 0x02 |
Definition at line 82 of file StreamNative.cpp.
Referenced by StreamInfo::queryStreamPosition().
const char* StreamInfoProperty = "CSELF" |
Definition at line 64 of file StreamNative.cpp.