home *** CD-ROM | disk | FTP | other *** search
- /******************************************
- * CPYVARGS.C *
- * Copyright TimeSlice, Inc. 1985, 86, 87. *
- ******************************************/
- #include <ts.h>
-
-
- #if defined(MS) || defined(MD)
- #define CODEPTR 1
-
- #else // if defined(MP) || defined(ML)
- #define CODEPTR 2
- #endif
-
- /***
- * CPYVARGS( FRST, FROM, TO )
- * Copy all arguments of calling function from argument FROM.
- * These arguments are copied to end up just under TO. Thus TO will
- * point 1 byte above the last arg copied. The address of the first
- * argument of the callling function is passed as FRST.
- * Return a pointer to the bottom of the arguments copied.
- ***/
- int *cpyvargs( frst, from, to )
- int *frst, *from, *to;
- {
- union {
- int *ptr;
- struct {
- int off, seg;
- } i;
- } bp;
-
- #if defined(TURBOC) && (defined(MS) || defined(MP))
- bp.i.off = frst[ - CODEPTR - 3 ];
- #elseif defined(TURBOC) && (defined(ML) || defined(MD))
- bp.i.off = frst[ - CODEPTR - 2 ];
- #else
- bp.i.off = frst[ - CODEPTR - 1 ];
- #endif
- #if defined(ML) || defined(MD)
- bp.i.seg = d_seg( from );
- #endif
- while( from < bp.ptr )
- *--to = *--bp.ptr;
- return to;
- }
-