acutads.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //
  2. //////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Copyright 2015 Autodesk, Inc. All rights reserved.
  5. //
  6. // Use of this software is subject to the terms of the Autodesk license
  7. // agreement provided at the time of installation or download, or which
  8. // otherwise accompanies this software in either electronic or hard copy form.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. #ifndef _acutilads_h
  12. #define _acutilads_h 1
  13. #include "adsdef.h"
  14. #include "AdAChar.h"
  15. #include "acdbport.h"
  16. // These functions are exported with both extern "C" and C++ linkage. We may
  17. // eventually drop support for C applications.
  18. #pragma pack (push, 8)
  19. void acad__assert(const ACHAR *, const ACHAR *, int);
  20. int acutCvUnit (ads_real value, const ACHAR *oldunit,
  21. const ACHAR *newunit, ads_real *result);
  22. int acutWcMatch (const ACHAR *string, const ACHAR *pattern);
  23. int acutPrintf (const ACHAR *format, ...);
  24. int acutSPrintf (ACHAR *buffer, size_t nBufLen, const ACHAR *format, ...);
  25. struct resbuf *acutNewRb (int v);
  26. int acutRelRb (struct resbuf *rb);
  27. struct resbuf *acutBuildList (int rtype, ...);
  28. int acutRbDup(const struct resbuf *source, struct resbuf **result);
  29. ads_real acutAngle (const ads_point pt1, const ads_point pt2);
  30. ads_real acutDistance (const ads_point pt1, const ads_point pt2);
  31. void acutPolar (const ads_point pt, ads_real angle,
  32. ads_real dist, ads_point ptres);
  33. int acutIsAlpha (int c);
  34. int acutIsUpper (int c);
  35. int acutIsLower (int c);
  36. int acutIsDigit (int c);
  37. int acutIsXDigit (int c);
  38. int acutIsSpace (int c);
  39. int acutIsPunct (int c);
  40. int acutIsAlNum (int c);
  41. int acutIsPrint (int c);
  42. int acutIsGraph (int c);
  43. int acutIsCntrl (int c);
  44. int acutToUpper (int c);
  45. int acutToLower (int c);
  46. #pragma pack (pop)
  47. #ifdef __cplusplus
  48. int acutVSPrintf(wchar_t *buf, size_t nBufLen, const wchar_t *fmt, va_list va);
  49. template<size_t nBufLen> inline int acutSPrintf(wchar_t (& buf)[nBufLen], const ACHAR *format, ...)
  50. {
  51. va_list va;
  52. va_start(va, format);
  53. const int nRet = ::acutVSPrintf(buf, nBufLen, format, va);
  54. va_end(va);
  55. return nRet;
  56. }
  57. template<size_t nBufLen> inline int acutVSPrintf(wchar_t (& buf)[nBufLen], const ACHAR *format,
  58. va_list va)
  59. {
  60. return ::acutVSPrintf(buf, nBufLen, format, va);
  61. }
  62. #endif
  63. #endif // !acutilads.h