libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

pack.h (1810B)


      1 /*
      2 Catlib Copyright Notice
      3 
      4 The author of this software is Christopher Adam Telfer
      5 Copyright (c) 1998, 1999, 2000, 2001, 2002
      6 by Christopher Adam Telfer.  All Rights Reserved.
      7 
      8 Permission to use, copy, modify, and distribute this software for any
      9 purpose without fee is hereby granted, provided that the above copyright
     10 notice, this paragraph, and the following two paragraphs appear in all
     11 copies, modifications, and distributions.
     12 
     13 IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
     14 SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
     15 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
     16 THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     17 
     18 THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
     19 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
     20 PARTICULAR PURPOSE.  THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF
     21 ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS".   THE AUTHOR HAS NO
     22 OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
     23 MODIFICATIONS.
     24 
     25 
     26 */
     27 
     28 #ifndef __CAT_PACK_H
     29 #define __CAT_PACK_H
     30 
     31 /*
     32    "bhwAcslPBHWCSL"
     33 
     34    Small letters: do not convert (not implemented for arrays and P)
     35    Captial letters: convert from network byte order to host byte order
     36 
     37    b - byte
     38    h - half-word
     39    w - word
     40    a - array (32-byte unsigned long + that many bytes)
     41    c - signed 8 bit value
     42    s - signed 16 bit value
     43    l - signed 32 bit value
     44    x - signed 64 bit value
     45    p - (unpack only) value is a pointer to a pointer.  Generate the buffer
     46        to hold the data.
     47  */
     48 int
     49 EXTRACTOR_common_cat_unpack (const void *buf,
     50                              const char *fmt,
     51                              ...);
     52 
     53 struct cat_bvec
     54 {
     55   unsigned long len;
     56   void *data;
     57 };
     58 
     59 
     60 #endif /* __CAT_PACK_H */