Re: [AD] Miscelaneous issues

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Wed, 2005-03-30 at 14:12 +0200, Elias Pschernig wrote:
> > 
> > Guess that means you're next in line? ;)
> 
> Well.. :) Hm, maybe in future, we should keep a list of "jobs" on
> allegro.cc, simple things like this which can be done by everyone in an
> hour or two.
> 

Ok, attached are some quick docs. For the expackf to work, I'm missing
the file "expackf.inc"..

-- 
Elias Pschernig
Index: docs/src/allegro._tx
===================================================================
RCS file: /cvsroot/alleg/allegro/docs/src/allegro._tx,v
retrieving revision 1.310
diff -u -p -r1.310 allegro._tx
--- docs/src/allegro._tx	29 Mar 2005 22:02:58 -0000	1.310
+++ docs/src/allegro._tx	30 Mar 2005 17:58:41 -0000
@@ -830,15 +830,41 @@ available in past/future versions of All
 @xref File and compression routines, pack_fopen, pack_fopen_chunk
 @shortdesc Packfile structure, similar to a stdio.h FILE structure.
 <codeblock>
-   int hndl;                   - System file handle
-   int flags;                  - PACKFILE_FLAG_* constants
-   char *filename;             - name of the file
+   AL_CONST PACKFILE_VTABLE *vtable;  - The PACKFILE_VTABLE for this packfile.
+   void *userdata;                    - The user data.
+   int is_normal_packfile;            - Flag telling if this is a normal Allegro
+                                        packfile.
 <endblock>
    A packfile structure, similar to a stdio.h FILE structure. Read chapter
    "File and compression routines" for a description on how to obtain/use
    this structure.
 
-   
+@@typedef struct @PACKFILE_VTABLE
+@xref File and compression routines, pack_fopen_vtable
+@shortdesc Packfile vtable structure, for custom packfiles.
+<codeblock>
+   int pf_fclose(void *userdata);
+   int pf_getc(void *userdata);
+   int pf_ungetc(int c, void *userdata);
+   long pf_fread(void *p, long n, void *userdata);
+   int pf_putc(int c, void *userdata);
+   long pf_fwrite(AL_CONST void *p, long n, void *userdata);
+   int pf_fseek(void *userdata, int offset);
+   int pf_feof(void *userdata);
+   int pf_ferror(void *userdata);
+<endblock>
+   This is the vtable which must be provided for custom packfiles, which then
+   can read from and write to wherever you like.
+
+@@typedef struct @LZSS_PACK_DATA
+@xref File and compression routines, create_lzss_pack_data
+@shortdesc Opaque structure for handling LZSS comression.
+   Opaque structure for handling LZSS comression.
+
+@@typedef struct @LZSS_UNPACK_DATA
+@xref File and compression routines, create_lzss_unpack_data
+@shortdesc Opaque structure for handling LZSS decomression.
+   Opaque structure for handling LZSS decomression.
 
 @heading
 Unicode routines
@@ -4824,7 +4850,7 @@ will not be known, so the file may be co
    avoid memory leaks.
 
 @@BITMAP *@load_bmp(const char *filename, RGB *pal);
-@domain.hid load_bitmap
+@xref load_bitmap, load_bmp_pf
 @shortdesc Loads a BMP bitmap from a file.
    Loads a 256-color or 24-bit truecolor Windows or OS/2 BMP file.
 @retval
@@ -4832,6 +4858,11 @@ will not be known, so the file may be co
    responsible for destroying the bitmap when you are finished with it to
    avoid memory leaks.
 
+@@BITMAP *@load_bmp_pf(PACKFILE *f, RGB *pal);
+@xref load_bmp
+@shortdesc Packfile version of load_bmp.
+   A version of load_bmp which reads from a packfile.
+
 @@BITMAP *@load_lbm(const char *filename, RGB *pal);
 @xref load_bitmap
 @shortdesc Loads an LBM bitmap from a file.
@@ -4851,6 +4882,11 @@ will not be known, so the file may be co
    responsible for destroying the bitmap when you are finished with it to
    avoid memory leaks.
 
+@@BITMAP *@load_pcx_pf(PACKFILE *f, RGB *pal);
+@xref load_pcx
+@shortdesc Packfile version of load_pcx.
+   A version of load_pcx which reads from a packfile.
+
 @@BITMAP *@load_tga(const char *filename, RGB *pal);
 @xref load_bitmap
 @shortdesc Loads a TGA bitmap from a file.
@@ -4861,6 +4897,11 @@ will not be known, so the file may be co
    responsible for destroying the bitmap when you are finished with it to
    avoid memory leaks.
 
+@@BITMAP *@load_tga_pf(PACKFILE *f, RGB *pal);
+@xref load_tga
+@shortdesc Packfile version of load_tga.
+   A version of load_tga which reads from a packfile.
+
 @@int @save_bitmap(const char *filename, BITMAP *bmp, const RGB *pal);
 @xref save_bmp, save_pcx, save_tga, load_bitmap, register_bitmap_file_type
 @shortdesc Saves a bitmap into any supported file format.
@@ -4893,6 +4934,11 @@ will not be known, so the file may be co
 @retval
    Returns non-zero on error.
 
+@@BITMAP *@save_bmp_pf(PACKFILE *f, RGB *pal);
+@xref save_bmp
+@shortdesc Packfile version of save_bmp.
+   A version of save_bmp which writes to a packfile.
+
 @@int @save_pcx(const char *filename, BITMAP *bmp, const RGB *pal);
 @xref save_bitmap
 @shortdesc Saves a bitmap into a PCX file.
@@ -4900,6 +4946,11 @@ will not be known, so the file may be co
 @retval
    Returns non-zero on error.
 
+@@BITMAP *@save_pcx_pf(PACKFILE *f, RGB *pal);
+@xref save_pcx
+@shortdesc Packfile version of save_pcx.
+   A version of save_pcx which writes to a packfile.
+
 @@int @save_tga (const char *filename, BITMAP *bmp, const RGB *pal);
 @xref save_bitmap
 @shortdesc Saves a bitmap into a TGA file.
@@ -4908,6 +4959,11 @@ will not be known, so the file may be co
 @retval
    Returns non-zero on error.
 
+@@BITMAP *@save_tga_pf(PACKFILE *f, RGB *pal);
+@xref save_tga
+@shortdesc Packfile version of save_tga.
+   A version of save_tga which writes to a packfile.
+
 @\void @register_bitmap_file_type(const char *ext,
 @\          BITMAP *(*load)(const char *filename, RGB *pal),
 @@          int (*save)(const char *filename, BITMAP *bmp, const RGB *pal));
@@ -8358,11 +8414,21 @@ Digital sample routines
 @shortdesc Loads a sample from a RIFF WAV file.
    Loads a sample from a RIFF WAV file.
 
+@@BITMAP *@load_wav_pf(PACKFILE *f);
+@xref load_wav
+@shortdesc Packfile version of load_wav.
+   A version of load_wav which reads from a packfile.
+
 @@SAMPLE *@load_voc(const char *filename);
 @xref load_sample, register_sample_file_type
 @shortdesc Loads a sample from a Creative Labs VOC file.
    Loads a sample from a Creative Labs VOC file.
 
+@@BITMAP *@load_voc_pf(PACKFILE *f);
+@xref load_voc
+@shortdesc Packfile version of load_voc.
+   A version of load_voc which reads from a packfile.
+
 @@int @save_sample(const char *filename, SAMPLE *spl);
 @xref load_sample, register_sample_file_type
 @shortdesc Writes a sample into a file.
@@ -9294,7 +9360,7 @@ directories, but not hidden files and di
 
 @@PACKFILE *@pack_fopen(const char *filename, const char *mode);
 @xref pack_fclose, pack_fopen_chunk, packfile_password, pack_fread, pack_getc
-@domain.hid file_select_ex
+@xref file_select_ex, pack_fopen_vtable
 @shortdesc Opens a file according to mode.
    Opens a file according to mode, which may contain any of the flags:
 <ul><li>
@@ -9349,6 +9415,22 @@ directories, but not hidden files and di
    load_pcx to read an image from a datafile, you should import it as a 
    binary block rather than as a BITMAP object.
 
+@@PACKFILE *@pack_fopen_vtable(AL_CONST PACKFILE_VTABLE *vtable, void *userdata));
+@xref pack_fopen
+   Creates a new packfile structure that uses the functions specified in
+   the vtable instead of the standard functions. On success, it returns a
+   pointer to a file structure, and on error it returns NULL and
+   stores an error code in errno.
+
+   The vtable and userdata must remain available for the lifetime of the
+   created packfile.
+
+   Opening chunks using pack_fopen_chunk() on top of the returned packfile
+   is not possible at this time.
+
+   packfile_password() does not have any effect on packfiles opened
+   with pack_fopen_vtable().
+
 @@int @pack_fclose(PACKFILE *f);
 @xref pack_fopen, packfile_password
 @shortdesc Closes a stream previously opened with pack_fopen().
@@ -9549,7 +9631,42 @@ directories, but not hidden files and di
    Closes a sub-chunk of a file, previously obtained by calling 
    pack_fopen_chunk().
 
-
+@@LZSS_PACK_DATA *@create_lzss_pack_data(void);
+@xref free_lzss_pack_data
+@shortdesc Creates an LZSS structure for compression.
+   Creates an LZSS_PACK_DATA structure, which can be used for LZSS compression.
+
+@@void @free_lzss_pack_data(LZSS_PACK_DATA *dat);
+@xref create_lzss_pack_data
+@shortdesc Frees an LZSS structure.
+   Frees an LZSS_PACK_DATA structure created with create_lzss_pack_data.
+
+@\int @lzss_write(PACKFILE *file, LZSS_PACK_DATA *dat, int size,
+@@ unsigned char *buf, int last);
+@xref create_lzss_pack_data
+@shortdesc Compresses data using LZSS.
+    Packs size bytes from buf, using the pack information contained in dat.
+@retval
+   Returns 0 on success.
+
+@@LZSS_UNPACK_DATA *@create_lzss_unpack_data(void);
+@xref free_lzss_unpack_data
+@shortdesc Creates an LZSS structure for decompression.
+   Creates an LZSS_UNPACK_DATA structure, which can be used for LZSS decompression.
+
+@@void @free_lzss_unpack_data(LZSS_UNPACK_DATA *dat);
+@xref create_lzss_unpack_data
+@shortdesc Frees an LZSS structure.
+   Frees an LZSS_UNPACK_DATA structure created with create_lzss_pack_data.
+
+@\int @lzss_read(PACKFILE *file, LZSS_UNPACK_DATA *dat, int s,
+@@ unsigned char *buf);
+@xref free_lzss_unpack_data
+@shortdesc Decompresses data using LZSS.
+   Unpacks from dat into buf, until either EOF is reached or s bytes have
+   been extracted.
+@retval
+   Returns the number of bytes added to the buffer.
 
 @heading
 Datafile routines


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/