home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / gfx / misc / imagefx_sdk / include / scan / errors.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-18  |  4.5 KB  |  134 lines

  1. /*
  2.  * ImageFX Development Header File
  3.  * Copyright © 1991-1995 Nova Design, Inc.
  4.  * Written by Thomas Krehbiel
  5.  *
  6.  * Error Codes
  7.  *
  8.  */
  9.  
  10. /*
  11.  * Each of these error codes has an associated message.  If possible,
  12.  * your modules or hook should use these error codes.  For example,
  13.  * if your hook cannot work on greyscale images, you can do:
  14.  *
  15.  *       SetError(ERR_MustBeColor);
  16.  *       Error();
  17.  *       return(FALSE);
  18.  *
  19.  * This provides a consistent error reporting scheme.  If you need
  20.  * to show your own error message but still need to set an error code,
  21.  * you can do this:
  22.  *
  23.  *       Errorf("The fudge is not chocolate!");
  24.  *       SetError(ERR_UserCancel);
  25.  *       return(FALSE);
  26.  *
  27.  * ImageFX does not display a requester for the ERR_UserCancel error code.
  28.  *
  29.  */
  30.  
  31. enum ERR_Tag
  32. {
  33.    ERR_Error = 512,        /* Some kinda error */
  34.    ERR_ChipMem,            /* Out of chip memory */
  35.    ERR_Memory,             /* Out of public memory */
  36.    ERR_Open,               /* Cannot open file */
  37.    ERR_Screen,             /* Cannot open screen */
  38.    ERR_Window,             /* Cannot open window */
  39.  
  40.    /* Library Errors: */
  41.    ERR_NoIntuit,           /* Cannot open Intuition.library */
  42.    ERR_NoGfx,              /* Cannot open Gfx.library */
  43.    ERR_NoHame,             /* Cannot open Hame.library */
  44.    ERR_NoArp,              /* Cannot open Arp.library */
  45.  
  46.    /* IFF Errors */
  47.    ERR_NotIFF,             /* Not on IFF File */
  48.    ERR_BadIFF,             /* IFF is mangled */
  49.  
  50.    /* ILBM Errors */
  51.    ERR_NotILBM,            /* IFF is not an ILBM */
  52.    ERR_Depth0,             /* Image depth is 0 */
  53.    ERR_Depth6,             /* Image depth > 6 */
  54.    ERR_Depth24,            /* Image depth not 24-bit */
  55.  
  56.    /* Misc Errors */
  57.    ERR_NoHEInit,           /* HAME_Init() failed */
  58.    ERR_DiffBM,             /* Bitmaps are different */
  59.  
  60.    ERR_LastError,          /* User errors begin here */
  61.  
  62.    /*
  63.     * Basically just indicators.
  64.     */
  65.    ERR_UserCancel = 2001,     /* user cancelled operation */
  66.    ERR_AtBoundary,            /* at buffer boundary */
  67.    ERR_NOP,                   /* nothing to do */
  68.    ERR_UserHalt,              /* user halted macro */
  69.    ERR_dummy02,
  70.    ERR_dummy03,
  71.    ERR_dummy04,
  72.    ERR_dummy05,
  73.    ERR_dummy06,
  74.  
  75.    /*
  76.     * Arexx- and command processing-specific errors.
  77.     */
  78.    ERR_BadCommand,            /* unknown command */
  79.    ERR_BadArgs,               /* invalid arguments */
  80.    ERR_dummy10,
  81.    ERR_dummy11,
  82.    ERR_dummy12,
  83.    ERR_dummy13,
  84.    ERR_dummy14,
  85.    ERR_dummy15,
  86.    ERR_dummy16,
  87.    ERR_dummy17,
  88.    ERR_dummy18,
  89.    ERR_dummy19,
  90.  
  91.    /*
  92.     * Other error codes.
  93.     */
  94.    ERR_NoSerial,              /* cannot open serial device */
  95.    ERR_NoBuffer,              /* no image buffer to work on */
  96.    ERR_MustBeColor,           /* image must be color */
  97.    ERR_MustBeGrey,            /* image must be grey */
  98.    ERR_NotOnDisk,             /* cannot process disk buffer */
  99.    ERR_BadFileType,           /* unknown file type */
  100.    ERR_NoPalette,             /* no palette in file */
  101.    ERR_NotOnRegion,           /* cannot be done to region */
  102.    ERR_ClipEmpty,             /* clipboard empty */
  103.    ERR_NoImage,               /* no image in file */
  104.    ERR_NeedAlpha,             /* need an alpha channel */
  105.    ERR_NeedBrush,             /* need a brush to work with */
  106.    ERR_NeedRegion,            /* need a region defined */
  107.    ERR_NoIffParse,            /* iffparse.library not found */
  108.    ERR_ModOpenFail,           /* module open failed */
  109.    ERR_VmemDisabled,          /* virtual memory disabled */
  110.    ERR_VmemFull,              /* virtual memory device full */
  111.    ERR_MaxBufSize,            /* max buf size is 32768x32768 */
  112.    ERR_Write,                 /* write error */
  113.    ERR_Read,                  /* read error */
  114.    ERR_BadDepth,              /* bad image depth */
  115.    ERR_UnknownForm,           /* unknown form of image file */
  116.    ERR_HookFailed,            /* hook program failed */
  117.    ERR_NotOnBrush,            /* cannot perform op on brush */
  118.    ERR_NotOnExternal,         /* cannot perform on external image */
  119.    ERR_SysNotFound,           /* system module not found */
  120.    ERR_HookNotFound,          /* hook program not found */
  121.    ERR_LibNotFound,           /* library not found or failed to open */
  122.    ERR_NeedSwap,              /* this operation requires a swap buffer */
  123.    ERR_VmemMemory,            /* unable to allocate vmem RAM buffer */
  124.  
  125.    ERR_MaxError
  126. };
  127.  
  128. /*
  129.  * Handy macros:
  130.  */
  131. #define ReturnError(x,v)   { SetError((x)); return ((v)); }
  132. #define GotoError(x,L)     { SetError((x)); goto L; }
  133.  
  134.