home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 137_01 / lsup.c < prev    next >
Text File  |  1985-03-10  |  2KB  |  93 lines

  1. /************************************************************************
  2. *                                    *
  3. *    lsup.c                created: 25-Mar-84        *
  4. *                                    *
  5. *    long pointer support for small memory model 8086 C compilers.    *
  6. *                                    *
  7. *    version 1.00 as of 25-Mar-84                    *
  8. *                                    *
  9. *    Copyright 1984 (c) Anthony Skjellum.                *
  10. *    All rights reserved.                          *
  11. *                                    *
  12. *    This program may be freely distributed for all non-commercial    *
  13. *    purposes, but may not be sold.                    *
  14. *                                    *
  15. *    The routines contained here are designed to be portable to    *
  16. *    a large variety of compilers.  Currently they have been tested    *
  17. *    with Aztec C86 v 1.05i only.                    *
  18. *                                    *
  19. *    Modules comprising this package:                *
  20. *                                    *
  21. *        lsup.c        this file.                *
  22. *        lsup.h        header/definition file.            *
  23. *        _lsup.h        lower level header for this file    *
  24. *        llsup.asm    assembly language support (compiler    *
  25. *                independent)                *
  26. *        llint.asm    compiler interface code   (compiler    *
  27. *                dependent)                *
  28. *                                    *
  29. *    Subroutines included here:                    *
  30. *    (those marked with an asterisk are only included if compiler    *
  31. *     used lacks some preprocessor support feature)            *
  32. *                                    *
  33. *                                    *
  34. *                                    *
  35. ************************************************************************/
  36.  
  37. #include "_lsup.h"        /* header with definitions */
  38.  
  39. /*
  40.     Special routines: Included only if compiler lacks one of
  41.     several features.
  42. */
  43.  
  44. /* lassign(dest,source): assignment of type LPTR to the left */
  45.  
  46. #ifndef    MSUBST
  47.  
  48. lassign(dest,source)
  49. LPTR dest;
  50. LPTR source;
  51. {
  52.     dest._llong = source._llong;    /* assignment */
  53. }
  54.  
  55. #endif
  56.  
  57. /*
  58.     General purpose routines:
  59. */
  60.  
  61. /* llstrcpy(dest,src):    copy null terminated strings between long ptrs */
  62.  
  63. llstrcpy(dest,src)
  64. LPTR *dest;
  65. LPTR *src;
  66. {
  67.     char chr;            /* temporary */
  68.  
  69.     while(1)            /* loop */
  70.     {
  71.         chr = lchr(&src);    /* get   a character */
  72.         l_stchr(&dest,chr);    /* store a character */
  73.  
  74.         linc(&dest);        /* increment destination ptr */
  75.         linc(&src);        /* and source pointer */
  76.  
  77.         if(!chr)        /* we are done at eos */
  78.             break;
  79.     }
  80.  
  81. }
  82.  
  83. /* debugging routines: */
  84.  
  85. lprint(lptr)
  86. LPTR *lptr;
  87. {
  88.     printf("%lx",lptr->_llong);
  89. }
  90.  
  91.  
  92.  
  93.