00001 /* 00002 * This software is copyrighted as noted below. It may be freely copied, 00003 * modified, and redistributed, provided that the copyright notice is 00004 * preserved on all copies. 00005 * 00006 * There is no warranty or other guarantee of fitness for this software, 00007 * it is provided solely "as is". Bug reports or fixes may be sent 00008 * to the author, who may or may not act on them as he desires. 00009 * 00010 * You may not include this software in a program or other software product 00011 * without supplying the source, or without informing the end-user that the 00012 * source is available for no extra charge. 00013 * 00014 * If you modify this software, you should include a notice giving the 00015 * name of the person performing the modification, the date of modification, 00016 * and the reason for such modification. 00017 */ 00018 /* 00019 * svfb.h - Definitions and a few global variables for svfb. 00020 * 00021 * Author: Spencer W. Thomas 00022 * Computer Science Dept. 00023 * University of Utah 00024 * Date: Mon Aug 9 1982 00025 * Copyright (c) 1982 Spencer W. Thomas 00026 * 00027 * $Header: /cvsroot/brlcad/brlcad/include/svfb.h,v 14.2 2005/10/23 04:44:26 brlcad Exp $ 00028 */ 00029 00030 /* **************************************************************** 00031 * Dispatch table for different output types. 00032 */ 00033 typedef int sv_fn(); 00034 struct sv_dispatch_tab { 00035 char *magic; /* magic type flags */ 00036 sv_fn *setup, /* startup function */ 00037 *skipBlankLines, 00038 *setColor, 00039 *skipPixels, 00040 *newScanLine, 00041 *putdat, /* put a set of differing pixels */ 00042 *putrn, /* put a run all the same */ 00043 *blockHook, /* hook called at start of new */ 00044 /* output block */ 00045 *putEof; /* write EOF marker (if possible) */ 00046 }; 00047 00048 extern struct sv_dispatch_tab sv_DTable[]; 00049 00050 /* 00051 * These definitions presume the existence of a variable called 00052 * "fileptr", declared "long * fileptr". *fileptr should be 00053 * initialized to 0 before calling Setup(). 00054 * A pointer "globals" declared "struct sv_globals * globals" is also 00055 * presumed to exist. 00056 */ 00057 #define sv_magic (sv_DTable[(int)globals->sv_dispatch].magic) 00058 #define Setup() (*sv_DTable[(int)globals->sv_dispatch].setup)(globals) 00059 #define SkipBlankLines(n) (*sv_DTable[(int)globals->sv_dispatch].skipBlankLines)(n, globals) 00060 #define SetColor(c) (*sv_DTable[(int)globals->sv_dispatch].setColor)(c, globals) 00061 #define SkipPixels(n, l, r) (*sv_DTable[(int)globals->sv_dispatch].skipPixels)(n,l,r, globals) 00062 #define NewScanLine(flag) (*sv_DTable[(int)globals->sv_dispatch].newScanLine)(flag, globals) 00063 #define putdata(buf, len) (*sv_DTable[(int)globals->sv_dispatch].putdat)(buf, len, globals) 00064 #define putrun(val, len, f) (*sv_DTable[(int)globals->sv_dispatch].putrn)(val,len,f, globals) 00065 #define BlockHook() (*sv_DTable[(int)globals->sv_dispatch].blockHook)(globals) 00066 #define PutEof() (*sv_DTable[(int)globals->sv_dispatch].putEof)(globals) 00067 00068 /* 00069 * States for run detection 00070 */ 00071 #define DATA 0 00072 #define RUN2 1 00073 #define RUN3 2 00074 #define RUN4 3 00075 #define INRUN -1 00076 00077 /* 00078 * Local Variables: 00079 * mode: C 00080 * tab-width: 8 00081 * c-basic-offset: 4 00082 * indent-tabs-mode: t 00083 * End: 00084 * ex: shiftwidth=4 tabstop=8 00085 */