1 /*===========================================================================* 2 * general.h * 3 * * 4 * very general stuff * 5 * * 6 *===========================================================================*/ 7 8 /* 9 * Copyright (c) 1995 The Regents of the University of California. 10 * All rights reserved. 11 * 12 * Permission to use, copy, modify, and distribute this software and its 13 * documentation for any purpose, without fee, and without written agreement is 14 * hereby granted, provided that the above copyright notice and the following 15 * two paragraphs appear in all copies of this software. 16 * 17 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR 18 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT 19 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF 20 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21 * 22 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 23 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 24 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 25 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO 26 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 27 */ 28 29 /* 30 * $Header: /n/picasso/project/mpeg/mpeg_dist/mpeg_encode/headers/RCS/general.h,v 1.7 1995/08/04 23:34:13 smoot Exp $ 31 * $Log: general.h,v $ 32 * Revision 1.7 1995/08/04 23:34:13 smoot 33 * jpeg5 changed the silly HAVE_BOOLEAN define.... 34 * 35 * Revision 1.6 1995/01/19 23:54:49 eyhung 36 * Changed copyrights 37 * 38 * Revision 1.5 1994/11/12 02:12:48 keving 39 * nothing 40 * 41 * Revision 1.4 1993/07/22 22:24:23 keving 42 * nothing 43 * 44 * Revision 1.3 1993/07/09 00:17:23 keving 45 * nothing 46 * 47 * Revision 1.2 1993/06/03 21:08:53 keving 48 * nothing 49 * 50 * Revision 1.1 1993/02/22 22:39:19 keving 51 * nothing 52 * 53 */ 54 55 56 #ifndef GENERAL_INCLUDED 57 #define GENERAL_INCLUDED 58 59 60 /* prototypes for library procedures 61 * 62 * if your /usr/include headers do not have these, then pass -DMISSING_PROTOS 63 * to your compiler 64 * 65 */ 66 #ifdef MISSING_PROTOS 67 int fprintf(); 68 int fwrite(); 69 int fread(); 70 int fflush(); 71 int fclose(); 72 73 int sscanf(); 74 int bzero(); 75 int bcopy(); 76 int system(); 77 int time(); 78 int perror(); 79 80 int socket(); 81 int bind(); 82 int listen(); 83 int accept(); 84 int connect(); 85 int close(); 86 int read(); 87 int write(); 88 89 int pclose(); 90 91 #endif 92 93 94 /*===========* 95 * CONSTANTS * 96 *===========*/ 97 98 #ifndef NULL 99 #define NULL 0 100 #endif 101 102 #ifndef TRUE 103 #define TRUE 1 104 #define FALSE 0 105 #endif 106 107 #define SPACE ' ' 108 #define TAB '\t' 109 #define SEMICOLON ';' 110 #define NULL_CHAR '\0' 111 #define NEWLINE '\n' 112 113 114 /*==================* 115 * TYPE DEFINITIONS * 116 *==================*/ 117 118 typedef int boolean; 119 /* this is for JPEG stuff */ 120 #define BOOLEAN_DEFINED 121 #define HAVE_BOOLEAN 122 123 typedef unsigned char uint8; 124 typedef char int8; 125 typedef unsigned short uint16; 126 typedef short int16; 127 128 /* LONG_32 should only be defined iff 129 * 1) long's are 32 bits and 130 * 2) int's are not 131 */ 132 #ifdef LONG_32 133 typedef unsigned long uint32; 134 typedef long int32; 135 #else 136 typedef unsigned int uint32; 137 typedef int int32; 138 #endif 139 140 141 /*========* 142 * MACROS * 143 *========*/ 144 145 #undef max 146 #define max(a,b) ((a) > (b) ? (a) : (b)) 147 #undef min 148 #define min(a,b) ((a) < (b) ? (a) : (b)) 149 #undef abs 150 #define abs(a) ((a) >= 0 ? (a) : -(a)) 151 152 153 #endif 154