20 #ifndef _tdsguard_a5iqP6Ed7kDGP9L1OvOL7W_ 21 #define _tdsguard_a5iqP6Ed7kDGP9L1OvOL7W_ 23 #ifndef _tdsguard_hfOrWb5znoUCWdBPoNQvqN_ 24 #error Include tds.h first 28 #include <freetds/tds/iconv.h> 29 #include <freetds/pushvis.h> 33 typedef off_t offset_type;
34 #elif defined(_WIN32) || defined(_WIN64) 36 typedef __int64 offset_type;
38 #if defined(HAVE__FSEEKI64) && defined(HAVE__FTELLI64) 39 #define fseeko(f,o,w) _fseeki64((f),o,w) 40 #define ftello(f) _ftelli64((f)) 42 #define fseeko(f,o,w) (_lseeki64(fileno(f),o,w) == -1 ? -1 : 0) 43 #define ftello(f) _telli64(fileno(f)) 47 #define fseeko(f,o,w) fseek(f,o,w) 48 #define ftello(f) ftell(f) 49 typedef long offset_type;
92 void tds_fileout_stream_init(
TDSFILEOUTSTREAM * s, FILE * fp,
int buff_mode);
95 TDSRET tds_fileout_stream_put(
TDSFILEOUTSTREAM * s,
const void *src,
size_t n);
162 { TDSFILESTREAM_BLOCKSIZE = 512 };
184 char inbuf[TDSFILESTREAM_BLOCKSIZE];
190 TDSRET tds_file_stream_init(
TDSFILESTREAM * stream, FILE * f);
193 size_t tds_file_stream_read_raw(
TDSFILESTREAM * stream,
void *ptr,
size_t n);
194 TDSRET tds_file_stream_seek_set(
TDSFILESTREAM * stream, offset_type seek_to);
198 #include <freetds/popvis.h>
void ** buf
where is stored the pointer
Definition: stream.h:145
void tds_staticin_stream_init(TDSSTATICINSTREAM *stream, const void *ptr, size_t len)
Initialize an input stream for read from a static allocated buffer.
Definition: stream.c:286
size_t size
size of data inside buffer
Definition: stream.h:149
char * buffer
write buffer.
Definition: stream.h:75
TDSRET tds_copy_stream(TDSINSTREAM *istream, TDSOUTSTREAM *ostream)
Reads and writes from a stream to another.
Definition: stream.c:163
TDSRET tds_convert_stream(TDSSOCKET *tds, TDSICONV *char_conv, TDS_ICONV_DIRECTION direction, TDSINSTREAM *istream, TDSOUTSTREAM *ostream)
Reads and writes from a stream converting characters.
Definition: stream.c:71
const char * terminator
Terminator to compare against - Memory not owned by the TDSFILESTREAM; make sure to not leave danglin...
Definition: stream.h:180
void tds_datain_stream_init(TDSDATAINSTREAM *stream, TDSSOCKET *tds, size_t wire_size)
Initialize a data input stream.
Definition: stream.c:204
TDSINSTREAM stream
common fields, must be the first field
Definition: stream.h:167
size_t allocated
currently allocated buffer
Definition: stream.h:147
int(* read)(struct tds_input_stream *stream, void *ptr, size_t len)
read some data Return 0 if end of stream Return <0 if error (actually not defined) ...
Definition: stream.h:60
input stream to read data from tds protocol
Definition: stream.h:106
define a stream of data used for input
Definition: stream.h:54
void tds_staticout_stream_init(TDSSTATICOUTSTREAM *stream, void *ptr, size_t len)
Initialize an output stream for write into a static allocated buffer.
Definition: stream.c:313
input stream to read data from a static buffer
Definition: stream.h:124
Information for a server connection.
Definition: tds.h:1189
size_t wire_size
bytes still to read
Definition: stream.h:108
Output stream that writes to file.
Definition: stream.h:82
void tds_dataout_stream_init(TDSDATAOUTSTREAM *stream, TDSSOCKET *tds)
Initialize a data output stream.
Definition: stream.c:244
int buff_mode
How to buffer the data – _IONBF, _IOLBF or _IOFBF (default).
Definition: stream.h:89
output stream to write data to a dynamic buffer
Definition: stream.h:142
output stream to write data to tds protocol
Definition: stream.h:115
TDSRET tds_dynamic_stream_init(TDSDYNAMICSTREAM *stream, void **ptr, size_t allocated)
Initialize a dynamic output stream.
Definition: stream.c:354
define a stream of data used for output
Definition: stream.h:64
FILE * f
file to read from
Definition: stream.h:170
output stream to write data to a static buffer.
Definition: stream.h:135