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

📄 aapicmn.h

📁 彩信MMS的全部代码
💻 H
字号:
/*
 * Copyright (C) Obigo AB, 2002-2005.
 * All rights reserved.
 *
 * This software is covered by the license agreement between
 * the end user and Obigo AB, and may be 
 * used and copied only in accordance with the terms of the 
 * said agreement.
 *
 * Obigo AB assumes no responsibility or 
 * liability for any errors or inaccuracies in this software, 
 * or any consequential, incidental or indirect damage arising
 * out of the use of the software.
 *
 */

/******************************************************************************
 * File:            $Workfile:   aapicmn.h  $
 *
 * Date:            $Date: 2005-01-20 06:58:45 GMT $
 *
 * Revision:        $Revision: \main\26 $
 *
 *****************************************************************************/

/*! \file aapicmn.h
 *  \brief  The adapter functions from the common utilities
 *
 * Adapter functions from the COMMON functions to the MMS Application.
 * For every adapter function, the following data are listed:
 * - A brief one line description of the function
 * - A longer description of the function
 * - The type of the function. It can be either:
 *     -# Answer Adapter: The MMS Application has requested a service, via a 
 *        Service Connector, from COMMON. The result is returned in this adapter.
 *     -# Service Adapter: COMMON requestes a service from the MMS Application
 *        via this adapter. The result will be returned in an Answer Connector.
 * - The name of the corresponding connector function
 * - The parameters for the function
 */

#ifndef _AAPICMN_H
#define _AAPICMN_H

#ifndef _CMNCONF_H  /* Check so that the cmnconf.h file is included before this file */
#error You must #include cmnconf.h before this file. Otherwise it will not work!
#error The file cmnconf.h contains configuration data for all other common files.
#error Please change the .c file that stopped from compiling because you came here
#error so that it includes cmnconf.h before aapicmn.h.
#endif /* _CMNCONF_H */

/*--- Definitions/Declarations ---*/

/*--- Types ---*/
typedef int CMN_BOOL;               /*!< Boolean data type */
typedef unsigned char CmnClientId;  /*!< Clients towards the common functions */

/*! \enum CmnCharset Supported character sets. */
typedef enum
{
    CMN_CHARSET_UNKNOWN     = 0,
    CMN_CHARSET_US_ASCII    = 3,
    CMN_CHARSET_ISO_8859_1  = 4,
    CMN_CHARSET_LATIN_1     = 4,
    CMN_CHARSET_UTF_8       = 106,
    CMN_CHARSET_UCS_2       = 1000,
    CMN_CHARSET_UTF_16BE    = 1013,
    CMN_CHARSET_UTF_16LE    = 1014,
    /*< UTF-16 is to be used only if the document starts with a UTF-16 BOM  */
    CMN_CHARSET_UTF_16      = 1015
} CmnCharset;

/*! \enum CmnMsgAttribute Attributes that can be assigned to a message in
 *  the index table. */
typedef enum
{
    CMN_ATTRIBUTE_VALID     = 0x01, /*!< Msg is valid */
    CMN_ATTRIBUTE_READ      = 0x02, /*!< Msg is read */
    CMN_ATTRIBUTE_NOTIF     = 0x04, /*!< Msg is a notification */
    CMN_ATTRIBUTE_PROTECTED = 0x08  /*!< Msg is protected */
} CmnMsgAttribute;

/*--- Constants ---*/

/*--- Forwards ---*/

/*--- Externs ---*/

/*--- Macros ---*/
/*! Check if msg is read */
#define CMN_IS_READ(m)      (((m) & CMN_ATTRIBUTE_READ) != 0)
/*! Check if msg is protected */
#define CMN_IS_PROTECTED(m) (((m) & CMN_ATTRIBUTE_PROTECTED) != 0)

#if CMN_LOG_EXTERNAL
    /*! Macro enabling external logging */
    #define CMN_LOG_E(x)     CMNa_log x
#else
    /*! Macro disabling external logging */
    #define CMN_LOG_E(x)
#endif

#if CMN_LOG_INTERNAL
    /*! Macro enabling internal logging */
    #define CMN_LOG_I(x)     CMNa_log x
#else
    /*! Macro disabling internal logging */
    #define CMN_LOG_I(x)
#endif

/*--- Prototypes ---*/

/*!
 * Type: Service Adapter
 *
 * Related Connector: None.
 *
 * This adapter function is somewhat different from other adapters since it 
 * returns a value. It returns the current time in seconds since 1-1-1970, GMT. 
 *****************************************************************************/
unsigned long CMNa_currentTime(void);

/*!
 * Type: Service Adapter
 *
 * Related Connector: None.
 * 
 * This function logs different kinds of messages from COMMON, for example
 * into a log file. It must only be used during development and debugging.
 *
 * \param format A format string (as in printf)
 * \param ...    Variable number of arguments to the format string
 *****************************************************************************/
void CMNa_log(const char *format, ...);

/*!
 * Type: Service Adapter
 *
 * Related Connector: None.
 *
 * This adapter function is somewhat different from other adapters since it 
 * returns a value. It returns the number of seconds since the target device
 * or the MMS Client was started. 
 *****************************************************************************/
unsigned long CMNa_upTime(void);

#endif /* _AAPIMMS_H */

⌨️ 快捷键说明

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