wdvi

network DVI viewer
Log | Files | Refs

data.h (855B)


      1 #ifndef DATA_H
      2 #define DATA_H
      3 
      4 struct rgb {
      5 	unsigned short	r, g, b;
      6 };
      7 
      8 #define	BMUNIT			unsigned int
      9 #define	BMBYTES			sizeof(BMUNIT)
     10 #define	BMBITS			(8 * BMBYTES)
     11 
     12 #define	ADD(a, b)	((BMUNIT *) (((char *) a) + b))
     13 #define	SUB(a, b)	((BMUNIT *) (((char *) a) - b))
     14 
     15 extern	BMUNIT	bit_masks[BMBITS + 1];
     16 
     17 /*
     18  * Bitmap structure for raster ops.
     19  */
     20 struct bitmap {
     21 	unsigned short	w, h;		/* width and height in pixels */
     22 	short		bytes_wide;	/* scan-line width in bytes */
     23 	char		*bits;		/* pointer to the bits */
     24 };
     25 
     26 /*
     27  *	AVL tree structures.
     28  */
     29 
     30 #define	AVL_COMMON							\
     31 	const char	*key;		/* key */			\
     32 	int		key_len;	/* length of key */		\
     33 	int		bal;		/* AVL balancing information */	\
     34 	struct avl	*left;						\
     35 	struct avl	*right
     36 
     37 struct avl {		/* generic data structure */
     38 	AVL_COMMON;
     39 };
     40 
     41 typedef	long	(*set_char_proc)(unsigned char);
     42 
     43 
     44 #endif