home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pcmagazi / 1991 / 08 / strrev.c < prev    next >
Text File  |  1991-03-03  |  981b  |  32 lines

  1. /* STRREV.C
  2.    STRREV.BIN source, compile/link with:
  3.    TCC -mc -c strrev                 : memory model MUST BE compact,
  4.    TLINK /i strrev,,,D:\TC\LIB\CC    : data is far, use dBIV's stack
  5.                                      : assuming CC.LIB is in D:\TC\LIB\
  6.    EXE2BIN strrev                    : creates STRREV.BIN
  7.    DEL strrev.obj
  8.    DEL strrev.exe
  9.  
  10.    to use from dBASE:
  11.    .LOAD strrev
  12.    .m="whatever"
  13.    .CALL strrev WITH m
  14.    * m will be reversed
  15. */
  16.  
  17. #include <dos.h>                                     /* for MK_FP() */
  18. #include <string.h>
  19. void far main(void)
  20. {
  21.    char *param;                       /* compact model forces "far" */
  22.  
  23.    if (_DS == 0)                         /* if no parameters passed */
  24.       return;                                             /* return */
  25.  
  26.    param = MK_FP(_DS,_BX);          /* address the passed parameter */
  27.  
  28.    strrev(param);                           /* call library routine */
  29.    return;
  30. }
  31.  
  32.