home *** CD-ROM | disk | FTP | other *** search
- /*--------------------------- INTTEST.C -----------------------------------*/
- #include "stdio.h";
-
- typedef struct {
- int count; /* number of chars now in the buffer*/
- int start; /* offset of next character to take */
- int size; /* size of the buffer */
- char *buffer; /* Address of the buffer */
- } RING;
-
- extern RING ibuf; /* input buffer */
- extern RING obuf; /* output buffer */
-
- char *calloc();
- /*-------------------------------------------------------------------------*/
- main()
- {
- int chgot;
- char *ispace, *ospace;
-
- ispace = calloc(256, 1); /* Space for input buffer */
- ospace = calloc(256, 1);
-
- initbuf(&ibuf, ispace, 256); /* See Figure 16.11 */
- initbuf(&obuf, ospace, 256);
-
- intinit(); /* intinit.asm */
-
- comparm(1200, 0, 1, 8); /* See Figure 16.5 */
-
- printf("%s \n", "Done intinit");
-
- for (;;) {
-
- if (kbhit()) { /* User can terminate with esc */
- if (getch() == 27)
- exit();
- }
-
- if (getbuf(&ibuf, &chgot)) { /* We have got a character */
- fputc(chgot, stdout); /* Show it */
- }
- }
- }
-
- /*-------------------------------------------------------------------------*/