📄 xos_generals.h.svn-base
字号:
//**************************************************************
//Copyright (C), 2008-2008, AnyLook Co., Ltd.
//File name: xOS_Generals.h
//Author: AnyLook
//Version: 1.0
//Date: 2008/07/31
//Description:
// xOS Include file
//Others:
//Function List:
//<Name> <desc>
//Simple
//History:
//<author> <time> <version > <desc>
// AnyLook 2008/07/31 1.0 build this moudle
//**************************************************************
#ifndef _xOS_Generals_H
#define _xOS_Generals_H
#ifdef __cplusplus
extern "C" {
#endif
#include "xOS_Generals_VTBL.h"
static INLINE void xOS_General_SetRanSeed(uint32 dwSeed)
{
if (GETGENERALS(g_pxOSList))
{
GETGENERALS(g_pxOSList)->SetRanSeed(dwSeed);
}
}
static INLINE uint32 xOS_General_GetRanNext(void)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->GetRanNext();
}
return 0;
}
static INLINE void xOS_General_GetRand(byte *pDest, int nSize)
{
if (GETGENERALS(g_pxOSList))
{
GETGENERALS(g_pxOSList)->GetRand(pDest, nSize);
}
}
static INLINE int xOS_General_GetDeviceInfo(xOSDevInfo *pInfo)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->GetDeviceInfo(pInfo);
}
return 0;
}
static INLINE void *xOS_General_memmove(void *pd, const void *ps, uint32 s)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->memmove(pd, ps, s);
}
return 0;
}
static INLINE void *xOS_General_memset(void *pd, int c, uint32 s)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->memset(pd, c, s);
}
return 0;
}
// Standard String Functions...
static INLINE char *xOS_General_strcpy(char *dst, const char *src)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->strcpy(dst, src);
}
return 0;
}
static INLINE char *xOS_General_strcat(char *dst, const char *src)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->strcat(dst, src);
}
return 0;
}
static INLINE int xOS_General_strcmp(const char *s1, const char *s2)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->strcmp(s1, s2);
}
return 0;
}
static INLINE uint32 xOS_General_strlen(const char *s)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->strlen(s);
}
return 0;
}
static INLINE char *xOS_General_strchr(const char *s1, int ch)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->strchr(s1, ch);
}
return 0;
}
static INLINE char *xOS_General_strrchr(const char *s, int ch)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->strrchr(s, ch);
}
return 0;
}
static INLINE int xOS_General_sprintf(char *pszDest, const char *pszFormat, ...)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->sprintf(pszDest, pszFormat);
}
return 0;
}
// Wide String Functions...
static INLINE wchar *xOS_General_wstrcpy(wchar *pDest, const wchar *pSrc)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->wstrcpy(pDest, pSrc);
}
return 0;
}
static INLINE wchar *xOS_General_wstrcat(wchar *pDest, const wchar *pSrc)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->wstrcat(pDest, pSrc);
}
return 0;
}
static INLINE int xOS_General_wstrcmp(const wchar *s1, const wchar *s2, uint32 nLen)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->wstrcmp(s1, s2, nLen);
}
return 0;
}
static INLINE int xOS_General_wstrlen(const wchar *p)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->wstrlen(p);
}
return 0;
}
static INLINE wchar *xOS_General_wstrchr(const wchar *s1, wchar ch)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->wstrchr(s1, ch);
}
return 0;
}
static INLINE wchar *xOS_General_wstrrchr(const wchar *s1, wchar ch)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->wstrrchr(s1, ch);
}
return 0;
}
//void (*wsprintf)(wchar *pDest, int nSize, const wchar *pFormat, ...);
// String Conversions...
static INLINE wchar *xOS_General_strtowstr(const char *pszIn, wchar *pDest, int nSize)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->strtowstr(pszIn, pDest, nSize);
}
return 0;
}
static INLINE char *xOS_General_wstrtostr(const wchar *In, char *pszDest, int nSize)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->wstrtostr(In, pszDest, nSize);
}
return 0;
}
static INLINE double xOS_General_wstrtofloat(const wchar *pszNum)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->wstrtofloat(pszNum);
}
return 0;
}
static INLINE boolean xOS_General_floattowstr(double val, wchar *psz, int nSize)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->floattowstr(val, psz, nSize);
}
return 0;
}
static INLINE boolean xOS_General_utf8towstr(const byte *pszIn, int nLen,
wchar *pszDest, int nSizeDestBytes)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->utf8towstr(pszIn, nLen, pszDest, nSizeDestBytes);
}
return 0;
}
static INLINE boolean xOS_General_wstrtoutf8(const wchar *pszIn, int nLen,
byte *pszDest, int nSizeDestBytes)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->wstrtoutf8(pszIn, nLen, pszDest, nSizeDestBytes);
}
return 0;
}
static INLINE void xOS_General_wstrlower(wchar *pszDest)
{
if (GETGENERALS(g_pxOSList))
{
GETGENERALS(g_pxOSList)->wstrlower(pszDest);
}
}
static INLINE void xOS_General_wstrupper(wchar *pszDest)
{
if (GETGENERALS(g_pxOSList))
{
GETGENERALS(g_pxOSList)->wstrupper(pszDest);
}
}
// AEE/BREW version, See above for flags
//uint32 (*GetVersion)(byte *pszFormatted, int nSize, uint16 wFlags);
// ATOI
static INLINE int xOS_General_atoi(const char *psz)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->atoi(psz);
}
return 0;
}
// Floating point - covers issues related to floating point usage across
// ARM/THUMB
static INLINE double xOS_General_f_op(double v1, double v2, int nType)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->f_op(v1, v2, nType);
}
return 0;
}
static INLINE boolean xOS_General_f_cmp(double v1, double v2, int nType)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->f_cmp(v1, v2, nType);
}
return 0;
}
// Debug
static INLINE void xOS_General_dbgprintf(const char *psz, ...)
{
if (GETGENERALS(g_pxOSList))
{
GETGENERALS(g_pxOSList)->dbgprintf(psz);
}
}
static INLINE uint32 xOS_General_GetTimeMS(void)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->GetTimeMS();
}
return 0;
}
static INLINE uint32 xOS_General_GetUpTimeMS(void)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->GetUpTimeMS();
}
return 0;
}
//uint32 (*GetSeconds)(void);
static INLINE void xOS_General_GetDateTime(uint32 dwSecs, xOSDateTime *pDate)
{
if (GETGENERALS(g_pxOSList))
{
GETGENERALS(g_pxOSList)->GetDateTime(dwSecs, pDate);
}
}
// Applet helper function - current applet
static INLINE uint32 xOS_General_strtoul(const char *nptr, char **endptr, int base)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->strtoul(nptr, endptr, base);
}
return 0;
}
static INLINE char *xOS_General_strncpy(char *strDest, const char *strSource,uint32 count)
{
if (GETGENERALS(g_pxOSList))
{
return GETGENERALS(g_pxOSList)->strncpy(strDest, strSource, count);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -