xm_base.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //****************************************************************************
  2. //
  3. // Copyright (C) 2010 ShenZhen ExceedSpace
  4. //
  5. // Author ZhuoYongHong
  6. //
  7. // File name: xm_base.h
  8. // constant,macro & basic typedef definition of kernel service
  9. //
  10. // Revision history
  11. //
  12. // 2010.09.01 ZhuoYongHong Initial version
  13. //
  14. //****************************************************************************
  15. #ifndef _XM_BASE_H_
  16. #define _XM_BASE_H_
  17. #include <xm_type.h>
  18. #if defined (__cplusplus)
  19. extern "C"{
  20. #endif
  21. #ifndef _XMBOOL_DEFINED_
  22. #define _XMBOOL_DEFINED_
  23. typedef unsigned char XMBOOL; // BOOL类型
  24. #endif
  25. // typedef definition
  26. // structure definition
  27. // 系统时间
  28. typedef struct tagXMSYSTEMTIME {
  29. WORD wYear;
  30. WORD wMonth;
  31. WORD wDayOfWeek;
  32. WORD wDay;
  33. WORD wHour;
  34. WORD wMinute;
  35. WORD wSecond;
  36. WORD wMilliseconds;
  37. } XMSYSTEMTIME, *PXMSYSTEMTIME;
  38. // 时间设置/读取函数
  39. // 返回1表示系统时间已设置
  40. // 返回0表示系统时间未设置,系统返回缺省定义时间
  41. int XM_GetLocalTime (XMSYSTEMTIME* pSystemTime);
  42. // 返回1设置系统时间成功
  43. // 返回0设置系统时间失败
  44. int XM_SetLocalTime (const XMSYSTEMTIME *pSystemTime);
  45. // 获取机器启动后的滴答计数 (1ms为一滴答计数单位)
  46. DWORD XM_GetTickCount (void);
  47. // 获取机器启动后高精度的滴答计数,以微秒为计数单位
  48. XMINT64 XM_GetHighResolutionTickCount (void);
  49. void XM_Sleep (DWORD dwMilliseconds); // 延时,毫秒单位
  50. void XM_Delay (unsigned int ms);
  51. void XM_lock (void);
  52. void XM_unlock (void);
  53. #if defined (__cplusplus)
  54. }
  55. #endif /* end of __cplusplus */
  56. #endif // _XM_BASE_H_