2004 by Marc J. Rochkind. All rights reserved. Portions marked "Open Source" may be copied under license.

 

Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

c4/x4.c File Reference


Detailed Description

Miscellaneous examples for Chap. 4 [Chap. 4].

Definition in file x4.c.

Go to the source code of this file.

Defines

#define EMPTY   '\0'
#define MAXFDS   100

Enumerations

enum  CR_STATUS { CR_READY, CR_NOTREADY, CR_EOF }

Functions

bool getln (char *s, ssize_t max, bool *iseof)
bool getln2 (char *s, ssize_t max, bool *iseof)
void test_setblock (void)
void test_setblock2 (void)
void test_Bfdopen (void)
bool cready (CR_STATUS *statusp)
bool cget (CR_STATUS *statusp, int *cp)
int readany (int fds[], int nfds, int *whichp)
int readany2 (int fds[], int nfds, int *whichp)
int readany3 (int fds[], int nfds, int *whichp)
void readany_test (void)
void readany_test2 (void)
void readany_test3 (void)
int main (void)

Variables

unsigned char cbuf = EMPTY


Define Documentation

#define EMPTY   '\0'
 

Definition at line 191 of file x4.c.

Referenced by cget(), and cready().

#define MAXFDS   100
 

Definition at line 319 of file x4.c.

Referenced by readany3().


Enumeration Type Documentation

enum CR_STATUS
 

Enumeration values:
CR_READY 
CR_NOTREADY 
CR_EOF 

Definition at line 193 of file x4.c.

Referenced by main().


Function Documentation

bool cget CR_STATUS statusp,
int *  cp
 

Definition at line 224 of file x4.c.

References cbuf, CR_EOF, CR_READY, EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, EMPTY, errno, read(), and setblock().

Referenced by main().

bool cready CR_STATUS statusp  ) 
 

Definition at line 195 of file x4.c.

References cbuf, CR_EOF, CR_NOTREADY, CR_READY, EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, EMPTY, errno, read(), and setblock().

Referenced by main().

bool getln char *  s,
ssize_t  max,
bool *  iseof
 

Definition at line 27 of file x4.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, and read().

Referenced by main(), and test_setblock2().

bool getln2 char *  s,
ssize_t  max,
bool *  iseof
 

Definition at line 53 of file x4.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, errno, and read().

Referenced by main().

int main void   ) 
 

Definition at line 427 of file x4.c.

References cget(), CR_EOF, CR_NOTREADY, CR_READY, CR_STATUS, cready(), EC_CLEANUP_BGN, EC_CLEANUP_END, ec_false, exit(), FD_ISSET(), FD_SET(), FD_ZERO(), getln(), getln2(), readany_test2(), set(), and setblock().

int readany int  fds[],
int  nfds,
int *  whichp
 

Definition at line 256 of file x4.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, errno, read(), setblock(), and sleep().

Referenced by readany_test().

int readany2 int  fds[],
int  nfds,
int *  whichp
 

Definition at line 286 of file x4.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, ec_neg1, errno, FD_ISSET(), FD_SET(), FD_ZERO(), read(), and select().

Referenced by readany_test2().

int readany3 int  fds[],
int  nfds,
int *  whichp
 

Definition at line 321 of file x4.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, ec_neg1, errno, pollfd::events, pollfd::fd, MAXFDS, poll(), read(), and pollfd::revents.

Referenced by readany_test3().

void readany_test void   )  [static]
 

Definition at line 355 of file x4.c.

References close(), EC_CLEANUP, EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FLUSH, ec_neg1, open(), and readany().

void readany_test2 void   )  [static]
 

Definition at line 379 of file x4.c.

References close(), EC_CLEANUP, EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FLUSH, ec_neg1, open(), and readany2().

Referenced by main().

void readany_test3 void   )  [static]
 

Definition at line 403 of file x4.c.

References close(), EC_CLEANUP, EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FLUSH, ec_neg1, open(), and readany3().

void test_Bfdopen void   )  [static]
 

Definition at line 145 of file x4.c.

References Bclose(), Bfdopen(), Bgetc(), EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, ec_false, EC_FLUSH, ec_null, and errno.

void test_setblock void   )  [static]
 

Definition at line 85 of file x4.c.

References difftime(), EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, ec_false, EC_FLUSH, ec_neg1, errno, read(), setblock(), sleep(), and time().

void test_setblock2 void   )  [static]
 

Definition at line 123 of file x4.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_false, EC_FLUSH, getln(), and setblock().


Variable Documentation

unsigned char cbuf = EMPTY [static]
 

Definition at line 192 of file x4.c.

Referenced by cget(), and cready().


Generated on Fri Apr 23 10:57:08 2004 for AUP2 Example Source by doxygen 1.3.1