home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / MacGzip 1.1.1 / Mac / GzPStrings.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-20  |  911 b   |  45 lines  |  [TEXT/KAHL]

  1. /*
  2.  * SPDStrings.h
  3.  * (C) SPDsoft, August 13, 1995
  4.  *
  5.  * Some String utils
  6.  */
  7.  
  8. #ifndef _SPD_STRINGS_
  9. #define _SPD_STRINGS_
  10.  
  11. #ifndef __POWERC__
  12. #    define    PStrCpy(dest,src)        BlockMove((src), (dest), *(src) + 1 )
  13. #else
  14.  
  15. /*
  16.  * From keith@taligent.com (Keith Rollin), Jim Reekes
  17.  *
  18.  * This way, C will create an inline loop that copies the
  19.  * string 4 bytes at a time in 64 iterations.
  20.  *
  21.  * (works with MPW C and Symantec C, at least
  22.  */
  23.  
  24. /*
  25.  * 68000 gives address error, so, use this only for PPC
  26.  */
  27.  
  28. typedef struct {
  29.      Str255 string;
  30. } Str255Struct;
  31.  
  32. #    define    PStrCpy(a,b)  *(Str255Struct*) (a) = *(Str255Struct*) (b)
  33.  
  34. #endif
  35.  
  36.  
  37. void    PStrCat( Str255 sio, Str255 si );
  38. void    CStrToStr255( Str255 pstr, char *s );
  39. void    Str255ToCStr( char *s, Str255 pstr );
  40.  
  41.  
  42. OSType    Str255ToOSType( Str255 pstr );
  43. #define OSTypeToStr255( pstr, osty ) BlockMove( (osty), (pstr) + 1, sizeof(OSType)); *pstr = sizeof(OSType)
  44.  
  45. #endif