Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 33a34
- > #include <stdlib.h>
- 36,38c37,38
- < struct SCIP_File
- < {
- < gzFile file; /**< zlib file stream */
- ---
- > struct SCIP_File {
- > gzFile file; /**< zlib file stream */
- 41,43c41,50
- < SCIP_FILE* SCIPfopen(const char *path, const char *mode)
- < {
- < return (SCIP_FILE*)gzopen(path, mode);
- ---
- > SCIP_FILE *SCIPfopen(const char *path, const char *mode) {
- > gzFile f = gzopen(path, mode);
- >
- > if (f == NULL) {
- > return NULL;
- > } else {
- > SCIP_FILE *s = (SCIP_FILE *) malloc(sizeof(SCIP_FILE));
- > s->file = f;
- > return s;
- > }
- 46,48c53,62
- < SCIP_FILE* SCIPfdopen(int fildes, const char *mode)
- < {
- < return (SCIP_FILE*)gzdopen(fildes, mode);
- ---
- > SCIP_FILE *SCIPfdopen(int fildes, const char *mode) {
- > gzFile f = gzdopen(fildes, mode);
- >
- > if (f == NULL) {
- > return NULL;
- > } else {
- > SCIP_FILE *s = (SCIP_FILE *) malloc(sizeof(SCIP_FILE));
- > s->file = f;
- > return s;
- > }
- 51,53c65,66
- < size_t SCIPfread(void *ptr, size_t size, size_t nmemb, SCIP_FILE *stream)
- < {
- < return gzread((gzFile*)stream, ptr, size * nmemb);
- ---
- > size_t SCIPfread(void *ptr, size_t size, size_t nmemb, SCIP_FILE *stream) {
- > return gzread(stream->file, ptr, size * nmemb);
- 56,58c69,70
- < size_t SCIPfwrite(const void *ptr, size_t size, size_t nmemb, SCIP_FILE *stream)
- < {
- < return gzwrite((gzFile*)stream, ptr, size * nmemb);
- ---
- > size_t SCIPfwrite(const void *ptr, size_t size, size_t nmemb, SCIP_FILE *stream) {
- > return gzwrite(stream->file, ptr, size * nmemb);
- 61,65c73,80
- < int SCIPfprintf(SCIP_FILE *stream, const char *format, ...)
- < {
- < char buffer[BUFFER_LEN];
- < va_list ap;
- < int n;
- ---
- > int SCIPfprintf(SCIP_FILE *stream, const char *format, ...) {
- > char buffer[BUFFER_LEN];
- > va_list ap;
- > int n;
- >
- > va_start(ap, format); /*lint !e826*/
- > n = vsnprintf(buffer, BUFFER_LEN, format, ap);
- > va_end(ap);
- 67,72c82,86
- < va_start(ap, format); /*lint !e826*/
- < n = vsnprintf(buffer, BUFFER_LEN, format, ap);
- < va_end(ap);
- < if( n < 0 || n > BUFFER_LEN)
- < buffer[BUFFER_LEN-1] = '\0';
- < return gzputs((gzFile*)stream, buffer);
- ---
- > if (n < 0 || n > BUFFER_LEN) {
- > buffer[BUFFER_LEN-1] = '\0';
- > }
- >
- > return gzputs(stream->file, buffer);
- 75,77c89,90
- < int SCIPfputc(int c, SCIP_FILE *stream)
- < {
- < return gzputc((gzFile*)stream, c);
- ---
- > int SCIPfputc(int c, SCIP_FILE *stream) {
- > return gzputc(stream->file, c);
- 80,82c93,94
- < int SCIPfputs(const char *s, SCIP_FILE *stream)
- < {
- < return gzputs((gzFile*)stream, s);
- ---
- > int SCIPfputs(const char *s, SCIP_FILE *stream) {
- > return gzputs(stream->file, s);
- 85,87c97,98
- < int SCIPfgetc(SCIP_FILE *stream)
- < {
- < return gzgetc((gzFile*)stream);
- ---
- > int SCIPfgetc(SCIP_FILE *stream) {
- > return gzgetc(stream->file);
- 90,92c101,102
- < char* SCIPfgets(char *s, int size, SCIP_FILE *stream)
- < {
- < return gzgets((gzFile*)stream, s, size);
- ---
- > char* SCIPfgets(char *s, int size, SCIP_FILE *stream) {
- > return gzgets(stream->file, s, size);
- 95,97c105,106
- < int SCIPfflush(SCIP_FILE *stream)
- < {
- < return gzflush((gzFile*)stream, Z_SYNC_FLUSH);
- ---
- > int SCIPfflush(SCIP_FILE *stream) {
- > return gzflush(stream->file, Z_SYNC_FLUSH);
- 100,102c109,110
- < int SCIPfseek(SCIP_FILE *stream, long offset, int whence)
- < {
- < return gzseek((gzFile*)stream, offset, whence);
- ---
- > int SCIPfseek(SCIP_FILE *stream, long offset, int whence) {
- > return gzseek(stream->file, offset, whence);
- 105,107c113,114
- < void SCIPrewind(SCIP_FILE *stream)
- < {
- < gzrewind((gzFile*)stream);
- ---
- > void SCIPrewind(SCIP_FILE *stream) {
- > gzrewind(stream->file);
- 110,112c117,118
- < long SCIPftell(SCIP_FILE *stream)
- < {
- < return gztell((gzFile*)stream);
- ---
- > long SCIPftell(SCIP_FILE *stream) {
- > return gztell(stream->file);
- 115,117c121,122
- < int SCIPfeof(SCIP_FILE *stream)
- < {
- < return gzeof((gzFile*)stream);
- ---
- > int SCIPfeof(SCIP_FILE *stream) {
- > return gzeof(stream->file);
- 120,122c125,129
- < int SCIPfclose(SCIP_FILE *fp)
- < {
- < return gzclose((gzFile*)fp);
- ---
- > int SCIPfclose(SCIP_FILE *fp) {
- > int status = gzclose(fp->file);
- > free(fp);
- >
- > return status;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement