home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Web / Utilities / wwwcount-2.3 / combine / allocim.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-02  |  1.5 KB  |  76 lines

  1. /*
  2.  *    AllocateImageStruct() - allocates Image struct and initializes each
  3.  *        member
  4.  *
  5.  *    RCS:
  6.  *        $Revision: 2.3 $
  7.  *        $Date: 1996/05/03 02:21:34 $
  8.  *
  9.  *    Security:
  10.  *        Unclassified
  11.  *
  12.  *    Description:
  13.  *        text
  14.  *
  15.  *    Input Parameters:
  16.  *        type    identifier    description
  17.  *
  18.  *        text
  19.  *
  20.  *    Output Parameters:
  21.  *        type    identifier    description
  22.  *
  23.  *        text
  24.  *
  25.  *    Return Values:
  26.  *        value    description
  27.  *
  28.  *    Side Effects:
  29.  *        text
  30.  *
  31.  *    Limitations and Comments:
  32.  *        text
  33.  *
  34.  *    Development History:
  35.  *        when    who        why
  36.  *    3/31/94        mm        first cut
  37.  */
  38.  
  39. #include "combine.h"
  40. #include "defines.h"
  41.  
  42. Image *AllocateImageStruct ()
  43. {
  44.     Image *alloc_image;
  45.  
  46.     alloc_image = (Image *) malloc (sizeof(Image));
  47.  
  48.     if (alloc_image == (Image *) NULL)
  49.     {
  50.         fprintf (stderr, "Unable to allocate memory for Image struct\n");
  51.         return ((Image *) NULL);
  52.     }
  53.     *alloc_image->filename = '\0';
  54.     alloc_image->fp = (FILE *) NULL;
  55.     (void) strcpy (alloc_image->type, "unknown");
  56.     alloc_image->comments = (char *) NULL;
  57.     alloc_image->id = UndefinedId;
  58.     alloc_image->class = DirectClass;
  59.     alloc_image->alpha = False;
  60.     alloc_image->compression = RunlengthEncodedCompression;
  61.     alloc_image->columns = 0;
  62.     alloc_image->rows = 0;
  63.     alloc_image->xorig = 0;
  64.     alloc_image->yorig = 0;
  65.     alloc_image->scene = 0;
  66.     alloc_image->colors = 0;
  67.     alloc_image->colormap = (RGB *) NULL;
  68.     alloc_image->signature = (char *) NULL;
  69.     alloc_image->pixels = (Runlength *) NULL;
  70.     alloc_image->packets = 0;
  71.     alloc_image->pack_siz = 0;
  72.     alloc_image->runlength = 0;
  73.  
  74.     return (alloc_image);
  75. }
  76.