pike.git / src / modules / Gz / zlibmod.c

version» Context lines:

pike.git/src/modules/Gz/zlibmod.c:1: - /*\ + ;/*\   ||| This file is part of Pike. For copyright information see COPYRIGHT.   ||| Pike is distributed under GPL, LGPL and MPL. See the file COPYING   ||| for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: zlibmod.c,v 1.48 2002/08/25 12:27:12 agehall Exp $"); + RCSID("$Id: zlibmod.c,v 1.49 2002/08/26 09:08:33 grendel Exp $");      #include "zlib_machine.h"      #if !defined(HAVE_LIBZ) && !defined(HAVE_LIBGZ)   #undef HAVE_ZLIB_H   #endif      #ifdef HAVE_ZLIB_H      #include "interpret.h"
pike.git/src/modules/Gz/zlibmod.c:568:    mode);    } else {    THIS->gzfile = gzopen(sp[-args].u.string->str,    mode);    }       pop_n_elems(args);    push_int(THIS->gzfile != NULL);   }    - /*! @decl create(void|string gzFile, void|string mode) + /*! @decl void create(void|string gzFile, void|string mode)    *! Opens a gzip file for reading.    */   void gz_file_create(INT32 args)   {    THIS->gzfile = NULL;    if (args) {    gz_file_open(args);    if (sp[-1].u.integer == 0) {    Pike_error("Failed to open file.\n");    }    pop_n_elems(1);    }   }      /*! @decl int close()    *! closes the file -  *! @returns 1 if successful +  *! @returns +  *! 1 if successful    */   void gz_file_close(INT32 args)   {    if (args!=0) {    Pike_error("Bad number of arguments to file->close()\n"    "Got %d, expected 0.\n", args);    }       if (THIS->gzfile!=NULL) {    gzclose(THIS->gzfile);
pike.git/src/modules/Gz/zlibmod.c:647:    }       buf[res] = '\0';       push_string(make_shared_string(buf));    free(buf);   }      /*! @decl int write(string data)    *! Writes the data to the file. -  *! @returns the number of bytes written to the file. +  *! @returns +  *! the number of bytes written to the file.    */   void gz_file_write(INT32 args)   {    int res = 0;       if (args!=1) {    Pike_error("Bad number of arguments to gz_file->write()\n"    "Got %d, expected 1.\n", args);    }   
pike.git/src/modules/Gz/zlibmod.c:682:   }      /*! @decl int seek(int pos, void|int type)    *! Seeks within the file.    *! @param pos    *! Position relative to the searchtype.    *! @param type    *! SEEK_SET = set current position in file to pos    *! SEEK_CUR = new position is current+pos    *! SEEK_END is not supported. -  *! @returns New position or negative number if seek failed. +  *! @returns +  *! New position or negative number if seek failed.    */   void gz_file_seek(INT32 args)   {    int res, newpos;    int type = SEEK_SET;       if (args>2) {    Pike_error("Bad number of arguments to file->seek()\n"    "Got %d, expected 1 or 2.\n", args);    }
pike.git/src/modules/Gz/zlibmod.c:719:    newpos = sp[-args].u.integer;       pop_n_elems(args);       res = gzseek(THIS->gzfile, newpos, type);       push_int(res);   }      /*! @decl int seek() -  *! @returns the current position within the file. +  *! @returns +  *! the current position within the file.    */   void gz_file_tell(INT32 args)   {    if (args!=0) {    Pike_error("Bad number of arguments to file->tell()\n"    "Got %d, expected 0.\n", args);    }       if (THIS->gzfile == NULL) {    Pike_error("File not open!\n");    }       push_int(gztell(THIS->gzfile));      }      /*! @decl int(0..1) eof() -  *! @returns 1 if EOF has been reached. +  *! @returns +  *! 1 if EOF has been reached.    */   void gz_file_eof(INT32 args)   {    if (args!=0) {    Pike_error("Bad number of arguments to file->eof()\n"    "Got %d, expected 0.\n", args);    }       push_int(gzeof(THIS->gzfile));   }