⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 misc.h

📁 在ADS环境下MiniGUI的源码
💻 H
字号:
/*
** $Id: misc.h,v 1.18 2004/08/02 04:05:02 snig Exp $
**
** misc.h: the head file for Miscellous module.
**
** Copyright (C) 2003 Feynman Software.
** Copyright (C) 1999 ~ 2002 Wei Yongming.
**
** Create date: 1999/01/03
*/

#ifndef GUI_MISC_H
    #define GUI_MISC_H

/* Function definitions */

#ifdef __cplusplus
extern "C" {
#endif  /* __cplusplus */


#if defined(__CC_ARM) || defined (__VXWORKS__)

struct timeval {
    long    tv_sec;         /* seconds */
    long    tv_usec;        /* microseconds */
};

struct timezone {
    int  tz_minuteswest; /* minutes W of Greenwich */
    int  tz_dsttime;     /* type of dst correction */
};

#else
  #include <sys/time.h>
#endif

void __mg_os_time_delay (int ms);

typedef struct _ETCSECTION
{
    int key_nr;               /* key number in the section */
    char *name;               /* name of the section */
    char **keys;              /* key string arrays */
    char **values;            /* value string arrays */
} ETCSECTION;
typedef ETCSECTION* PETCSECTION;

typedef struct _ETC_S
{
    int section_nr;           /* number of sections */
    PETCSECTION sections;     /* pointer to section arrays */
} ETC_S;


extern GHANDLE hMgEtc;

#ifndef _INCORE_RES

/* Initialize MiniGUI etc file object, call before accessing MiniGUI etc value */
static inline BOOL InitMgEtc (void)
{
    if (hMgEtc)
        return TRUE;

    if ( !(hMgEtc = LoadEtcFile (ETCFILEPATH)) )
        return FALSE;
    return TRUE;
}

/* Terminate MiniGUI etc file object */
static inline void TerminateMgEtc (void)
{
    UnloadEtcFile (hMgEtc);
    hMgEtc = 0;
}

#else

extern ETC_S MGETC;

static inline BOOL InitMgEtc (void)
{
    extern ETC_S MGETC;
    hMgEtc = (GHANDLE) &MGETC;
    return TRUE;
}

static inline void TerminateMgEtc (void) { }

#endif /* _INCORE_RES */

BOOL InitMisc (void);
void TerminateMisc (void);

BOOL InitSystemRes (void);
void TerminateSystemRes (void);

#ifdef __cplusplus
}
#endif  /* __cplusplus */

#endif  /* GUI_MISC_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -