ODUtil.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* OpenDoors Online Software Programming Toolkit
  2. * (C) Copyright 1991 - 1999 by Brian Pirie.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. *
  18. *
  19. * File: ODUtil.h
  20. *
  21. * Description: Contains prototypes and definitions for use by non-platform
  22. * specific utility functions. These functions are implemented in
  23. * odutil.c. Platform-specific utility functions are defined in
  24. * odplat.h, and implemented in odplat.c.
  25. *
  26. * Revisions: Date Ver Who Change
  27. * ---------------------------------------------------------------
  28. * Nov 01, 1994 6.00 BP Created.
  29. * Dec 31, 1994 6.00 BP Added ODMakeFilename().
  30. * Nov 13, 1995 6.00 BP 32-bit portability.
  31. * Nov 23, 1995 6.00 BP Added ODDWordDivide().
  32. * Nov 23, 1995 6.00 BP Added ODDStringHasTail().
  33. * Nov 23, 1995 6.00 BP Added ODFileSize().
  34. * Feb 19, 1996 6.00 BP Changed version number to 6.00.
  35. * Mar 03, 1996 6.10 BP Begin version 6.10.
  36. * Mar 06, 1996 6.10 BP Added ODDWordMultiply().
  37. */
  38. #ifndef _INC_ODUTIL
  39. #define _INC_ODUTIL
  40. #include "ODGen.h"
  41. #include "ODTypes.h"
  42. #include "OpenDoor.h"
  43. /* General string manipulation functions. */
  44. void ODStringCopy(char *pszDest, CONST char *pszSource, INT nSizeofDest);
  45. char *ODStringCToPascal(char *psPascalString, BYTE btMaxPascalLength,
  46. char *pszCString);
  47. char *ODStringPascalToC(char *pszCString, char *psPascalString,
  48. BYTE btMaxLength);
  49. BOOL ODStringHasTail(char *pszFullString, char *pszTail);
  50. /* File-related functions. */
  51. tODResult ODMakeFilename(char *pszOut, CONST char *pszPath,
  52. CONST char *pszFilename, INT nMaxOutSize);
  53. DWORD ODFileSize(FILE *pfFile);
  54. /* DWORD math functions. */
  55. DWORD ODDWordShiftLeft(DWORD dwValue, BYTE btDistance);
  56. DWORD ODDWordShiftRight(DWORD dwValue, BYTE btDistance);
  57. BOOL ODDWordDivide(DWORD *pdwQuotient, DWORD *pdwRemainder,
  58. DWORD dwDividend, DWORD dwDivisor);
  59. DWORD ODDWordMultiply(DWORD dwMultiplicand, DWORD dwMultiplier);
  60. #endif /* !_INC_ODUTIL */