"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "xlab-0.8.3/fd.h" of archive xlab-0.8.3.tar.gz:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 /*
    2  * $Id: fd.h,v 1.4 1998/07/24 11:59:14 marc Exp $
    3  *
    4  * header file file descriptor (FD) code
    5  *
    6  *	James Peterson, 1987
    7  *	(c) Copyright MCC, 1987
    8  *	(c) Copyright Marc Vertes 1998
    9  */
   10 
   11 #ifndef _FD_H_
   12 #define _FD_H_
   13 
   14 #define Boolean short
   15 #define true 1
   16 #define false 0
   17 
   18 /*
   19  * the following structure remembers for each file descriptor its
   20  * state.  In particular, we need to know if it is busy or free
   21  * and if it is in use, by whom.
   22  */
   23 
   24 typedef int FD;
   25 
   26 struct FDDescriptor
   27 {
   28     Boolean Busy;
   29     int     (*InputHandler)();
   30 };
   31 
   32 extern struct FDDescriptor *FDD; /* array of FD descriptors */
   33 extern short   MaxFD; /* maximum number of FD's possible */
   34 
   35 extern short   nFDsInUse; /* number of FD's actually in use */
   36 
   37 extern long    ReadDescriptors;/* bit map of FD's in use -- for select  */
   38 extern short   HighestFD;	/* highest FD in use -- for select */
   39 
   40 typedef unsigned long int TimerID;
   41 
   42 #if __STDC__ || defined(__cplusplus)
   43 #define P_(s) s
   44 #else
   45 #define P_(s) ()
   46 #endif
   47 
   48 /* fd.c */
   49 TimerID CreateTimer P_((unsigned long int delay, void (*handler)(void), void *user_data));
   50 void DeleteTimer P_((TimerID timer));
   51 void InitializeFD P_((void));
   52 void UsingFD P_((FD fd, int (*Handler)(void)));
   53 void NotUsingFD P_((FD fd));
   54 void EOFonFD P_((FD fd));
   55 void MainLoop P_((void));
   56 
   57 #undef P_
   58 
   59 #endif /* _FD_H_ */