/**
 * @file    sas_system.h
 * @brief   系统共用预定义量,本系统的每个源程序都应该包含它
 *
 * @version $Revision: 1.2 $
 * @date    $Date: 2018/12/20 01:06:15 $
 * @author  $Author: lizhongming $
 * @state   $State: Exp $
 *
 * @latest  $Id: sas_system.h,v 1.2 2018/12/20 01:06:15 lizhongming Exp $
 *
 */
 
#ifndef INC_SAS_SYSTEM_H
#define INC_SAS_SYSTEM_H
 
/** maximum length of name buffer */
#define LONGNAME            64
#define SHORTNAME           16

#define MAX_DRV_BUFSIZ      1500

 

#define CONFIG_FILEPATH			"../etc/"		/**< 配置文件目录						*/

/** !!!----( System reserved ) - 0x40000000 and 0x80000000 ---!!! */

#ifndef MAKEINT32
#define MAKEINT32(a, b)      ((uint32_t)(((uint16_t)((uint32_t)(a) & 0xffff)) | ((uint32_t)((uint16_t)((uint32_t)(b) & 0xffff))) << 16))
#endif

#ifndef MAKEINT16
#define MAKEINT16(a, b)      ((uint16_t)((((uint16_t)((byte_t)(b))) << 8) | (byte_t)(a)))
#endif

#ifndef LOWORD
#define LOWORD(l)            ((uint16_t)((uint32_t)(l) & 0xffff))
#endif

#ifndef HIWORD
#define HIWORD(l)            ((uint16_t)((uint32_t)(l) >> 16))
#endif

#ifndef LOBYTE
#define LOBYTE(w)            ((byte_t)((uint16_t)(w) & 0xff))
#endif

#ifndef HIBYTE
#define HIBYTE(w)            ((byte_t)((uint16_t)(w) >> 8))
#endif
/*
#ifndef max
#define max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
#define min(a,b)            (((a) < (b)) ? (a) : (b))
#endif
*/
#ifndef __cplusplus

#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif

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

//APR_DECLARE_DATA extern apr_pool_t         *g_root_pool;
//APR_DECLARE_DATA extern apr_pool_t         *g_cfg_pool;
//APR_DECLARE_DATA extern apr_pool_t         *g_tmp_pool;
//APR_DECLARE_DATA extern apr_pool_t         *g_rdb_pool;
//APR_DECLARE_DATA extern apr_pool_t         *g_hdb_pool;
//APR_DECLARE_DATA extern apr_pool_t         *g_drv_pool;
//APR_DECLARE_DATA extern apr_pool_t         *g_fun_pool;
//APR_DECLARE_DATA extern apr_thread_mutex_t *g_rdb_mutex;
//APR_DECLARE_DATA extern char               *g_home_path;

#ifdef __cplusplus
}
#endif

#endif /* INC_SAS_SYSTEM_H */
