home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * SYSTEM.C Dynamically check whether we are running under 1.3 or 1.4
- *
- * (c)Copyright 1990, Matthew Dillon, All Rights Reserved
- */
-
- #include <exec/types.h>
- #include <exec/libraries.h>
-
- #ifdef INCLUDE_VERSION /* doesn't exist in 1.3 */
- #include <dos/dostags.h>
- #endif
-
- extern struct Library *DOSBase;
-
- system(buf)
- const char *buf;
- {
- int r;
-
- #ifdef INCLUDE_VERSION
- if (DOSBase->lib_Version >= 36) {
- static struct TagItem TI[] = {
- SYS_Input , 0,
- SYS_Output, 0,
- TAG_DONE, 0
- };
- TI[0].ti_Data = Input();
- TI[1].ti_Data = Output();
- r = System(buf, TI);
- } else {
- #endif
- r = Execute(buf, NULL, NULL);
- if (r == 0)
- r = -1;
- else if (r == -1)
- r = 0;
- #ifdef INCLUDE_VERSION
- }
- #endif
- return(r);
- }
-
-