1 /*************************************************************************** 2 3 getarg.h - Support routines for the giflib utilities 4 5 SPDX-License-Identifier: MIT 6 7 **************************************************************************/ 8 9 #ifndef _GETARG_H 10 #define _GETARG_H 11 12 #include "gif_lib.h" 13 #include <stdbool.h> 14 15 #define VERSION_COOKIE " Version %d.%d, " 16 17 /*************************************************************************** 18 Error numbers as returned by GAGetArg routine: 19 ***************************************************************************/ 20 #define CMD_ERR_NotAnOpt 1 /* None Option found. */ 21 #define CMD_ERR_NoSuchOpt 2 /* Undefined Option Found. */ 22 #define CMD_ERR_WildEmpty 3 /* Empty input for !*? seq. */ 23 #define CMD_ERR_NumRead 4 /* Failed on reading number. */ 24 #define CMD_ERR_AllSatis 5 /* Fail to satisfy (must-'!') option. */ 25 26 bool GAGetArgs(int argc, char **argv, char *CtrlStr, ...); 27 void GAPrintErrMsg(int Error); 28 void GAPrintHowTo(char *CtrlStr); 29 30 /****************************************************************************** 31 From qprintf.c 32 ******************************************************************************/ 33 extern bool GifNoisyPrint; 34 extern void GifQprintf(char *Format, ...); 35 extern void PrintGifError(int ErrorCode); 36 37 /****************************************************************************** 38 Color table quantization 39 ******************************************************************************/ 40 int GifQuantizeBuffer(unsigned int Width, unsigned int Height, 41 int *ColorMapSize, GifByteType * RedInput, 42 GifByteType * GreenInput, GifByteType * BlueInput, 43 GifByteType * OutputBuffer, 44 GifColorType * OutputColorMap); 45 46 /* These used to live in the library header */ 47 #define GIF_MESSAGE(Msg) fprintf(stderr, "\n%s: %s\n", PROGRAM_NAME, Msg) 48 #define GIF_EXIT(Msg) { GIF_MESSAGE(Msg); exit(-3); } 49 50 #endif /* _GETARG_H */ 51 52 /* end */ 53