diff options
Diffstat (limited to 'Build/source/libs/gd/libgd-src/src/gd_io_stream.cxx')
-rw-r--r-- | Build/source/libs/gd/libgd-src/src/gd_io_stream.cxx | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/Build/source/libs/gd/libgd-src/src/gd_io_stream.cxx b/Build/source/libs/gd/libgd-src/src/gd_io_stream.cxx index 0d64c72c2b7..d4f27494fd1 100644 --- a/Build/source/libs/gd/libgd-src/src/gd_io_stream.cxx +++ b/Build/source/libs/gd/libgd-src/src/gd_io_stream.cxx @@ -1,3 +1,7 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#ifdef ENABLE_CPP_API /* ***************************************************************************** ** Initial file written and documented by: ** Kevin Shepherd <kshepherd@php.net> December 2007 @@ -25,7 +29,7 @@ If an error occurs, or the end-of-file is reached, the return value is a short byte count (or zero). */ -int istreamIOCtx::Getbuf (struct gdIOCtx * ctx, void * buf, int size) +int istreamIOCtx::Getbuf(gdIOCtxPtr ctx, void *buf, int size) { stream_type * _str = ( (istreamIOCtx * ) ctx )->_M_stream; _str->read((char * )buf, size); @@ -36,7 +40,7 @@ int istreamIOCtx::Getbuf (struct gdIOCtx * ctx, void * buf, int size) If an error occurs, or the end-of-file is reached, the return value is a short byte count (or zero). */ -int istreamIOCtx::Putbuf (struct gdIOCtx * , const void * , int ) +int istreamIOCtx::Putbuf(gdIOCtxPtr, const void *, int) { return 0; } @@ -44,7 +48,7 @@ int istreamIOCtx::Putbuf (struct gdIOCtx * , const void * , int ) /** Reads the next character from stream and returns it as an unsigned char cast to an int, or EOF on end of file or error. */ -int istreamIOCtx::Getchar (struct gdIOCtx * ctx) +int istreamIOCtx::Getchar(gdIOCtxPtr ctx) { stream_type * _str = ( (istreamIOCtx * ) ctx )->_M_stream; return _str->get(); @@ -52,14 +56,14 @@ int istreamIOCtx::Getchar (struct gdIOCtx * ctx) /** Write the character to stream Character is cast to unsigned char before writing */ -void istreamIOCtx::Putchar (struct gdIOCtx * , int ) +void istreamIOCtx::Putchar(gdIOCtxPtr, int) { } /** Seek to position offset from the beginning of the stream must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! */ -int istreamIOCtx::Seek (struct gdIOCtx * ctx, const int pos) +int istreamIOCtx::Seek(gdIOCtxPtr ctx, const int pos) { stream_type * _str = ( (istreamIOCtx * ) ctx )->_M_stream; _str->seekg(pos); @@ -68,14 +72,14 @@ int istreamIOCtx::Seek (struct gdIOCtx * ctx, const int pos) /** Obtains the current value of the stream position. Returns -1 on error. */ -long istreamIOCtx::Tell (struct gdIOCtx * ctx) +long istreamIOCtx::Tell(gdIOCtxPtr ctx) { stream_type * _str = ( (istreamIOCtx * ) ctx )->_M_stream; return _str->tellg(); } /** Deallocate the context */ -void istreamIOCtx::FreeCtx (struct gdIOCtx * ctx) +void istreamIOCtx::FreeCtx(gdIOCtxPtr ctx) { delete (istreamIOCtx * )ctx; } @@ -85,7 +89,7 @@ void istreamIOCtx::FreeCtx (struct gdIOCtx * ctx) If an error occurs, or the end-of-file is reached, the return value is a short byte count (or zero). */ -int ostreamIOCtx::Getbuf (struct gdIOCtx * , void * , int ) +int ostreamIOCtx::Getbuf(gdIOCtxPtr, void *, int) { return 0; } @@ -94,7 +98,7 @@ int ostreamIOCtx::Getbuf (struct gdIOCtx * , void * , int ) If an error occurs, or the end-of-file is reached, the return value is a short byte count (or zero). */ -int ostreamIOCtx::Putbuf (struct gdIOCtx * ctx, const void * buf, int size) +int ostreamIOCtx::Putbuf(gdIOCtxPtr ctx, const void * buf, int size) { stream_type * _str = ( (ostreamIOCtx * ) ctx )->_M_stream; _str->write((const char * )buf, size); @@ -104,14 +108,14 @@ int ostreamIOCtx::Putbuf (struct gdIOCtx * ctx, const void * buf, int size) /** Reads the next character from stream and returns it as an unsigned char cast to an int, or EOF on end of file or error. */ -int ostreamIOCtx::Getchar (struct gdIOCtx * ) +int ostreamIOCtx::Getchar(gdIOCtxPtr) { return EOF; } /** Write the character to stream Character is cast to unsigned char before writing */ -void ostreamIOCtx::Putchar (struct gdIOCtx * ctx, int c) +void ostreamIOCtx::Putchar(gdIOCtxPtr ctx, int c) { stream_type * _str = ( (ostreamIOCtx * ) ctx )->_M_stream; _str->put((char)c); @@ -120,7 +124,7 @@ void ostreamIOCtx::Putchar (struct gdIOCtx * ctx, int c) /** Seek to position offset from the beginning of the stream must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! */ -int ostreamIOCtx::Seek (struct gdIOCtx * ctx, const int pos) +int ostreamIOCtx::Seek(gdIOCtxPtr ctx, const int pos) { stream_type * _str = ( (ostreamIOCtx * ) ctx )->_M_stream; _str->seekp(pos); @@ -129,16 +133,17 @@ int ostreamIOCtx::Seek (struct gdIOCtx * ctx, const int pos) /** Obtains the current value of the stream position. Returns -1 on error. */ -long ostreamIOCtx::Tell (struct gdIOCtx * ctx) +long ostreamIOCtx::Tell(gdIOCtxPtr ctx) { stream_type * _str = ( (ostreamIOCtx * ) ctx )->_M_stream; return _str->tellp(); } /** Deallocate the context */ -void ostreamIOCtx::FreeCtx (struct gdIOCtx * ctx) +void ostreamIOCtx::FreeCtx(gdIOCtxPtr ctx) { delete (ostreamIOCtx * )ctx; } #endif /* __cplusplus */ +#endif //ENABLE_CPP_API
\ No newline at end of file |