home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************************
-
-
- PDC Prolog
-
- Copyright (c) 1986, 90 by Prolog Development Center
-
-
- FileName: CTEST.C
- PURPOSE: Demo program
-
- ═══════════════╦══════╦════════════════════════════════════════════════════
- Date Modified,║ By, ║ Comments.
- ═══════════════╬══════╬════════════════════════════════════════════════════
- ║ ║
- ***************************************************************************/
-
- #include <dos.h>
- #include <alloc.h>
- #include <stdio.h>
- #include <string.h>
-
-
- /***************************************************************************
- Test Example
- ***************************************************************************/
-
- /* Exported from Prolog test module */
- void write_string(char *);
- void write_storage_left(void);
- void write_double(double);
- void test_for_keypressed(void);
- void write_char(char);
- void mk_prolog_file(void);
- void wait(char*);
-
- void testproc(void)
- {
- FILE *in;
- char line[80];
-
- wait("Hello now we are in C again, test allocation");
-
- write_storage_left();
-
- wait("Now we allocate 1000 bytes");
-
- (void)malloc(1000);
-
- write_storage_left();
-
- wait("Test file system");
-
- mk_prolog_file();
-
- if ((in = fopen("mytest.txt", "rt")) == NULL)
- write_string("unable to open mytest.txt");
- else
- {
- while (fgets(line, 79, in) != NULL)
- write_string(line);
- fclose(in);
- }
-
- wait("Goodbye from C sub function");
- }
-