RSA BSAFE Micro Edition Suite

Streamlined security for mobile and embedded devices

Search  Print

r_flg.h

Go to the documentation of this file.
00001 /* $Id: r_flg.h,v 1.14 2004/06/23 04:47:01 eay Exp $ */
00002 /*
00003  * Copyright (C) 1998-2003 RSA Security Inc. All rights reserved. 
00004  *
00005  * This work contains proprietary information of RSA Security. 
00006  * Distribution is limited to authorized licensees of RSA 
00007  * Security. Any unauthorized reproduction, distribution or 
00008  * modification of this work is strictly prohibited.
00009  */
00015 #ifndef HEADER_COMMON_R_FLG_H
00016 #define HEADER_COMMON_R_FLG_H
00017 
00018 #ifdef  __cplusplus
00019 extern "C" {
00020 #endif
00021 
00022 #ifndef R_FLG_BITS
00023 #define R_FLG_BITS        256
00024 #endif
00025 #define R_FLG_LONG_BITS   (sizeof(unsigned long)*8)
00026 #define R_FLG_LONGS       (R_FLG_BITS/R_FLG_LONG_BITS)
00027 
00028 typedef struct r_flg_st {
00029         unsigned long    dbg_bits[R_FLG_LONGS];
00030 } R_FLG;
00031 
00032 #define R_FLG_ZERO(mod_dbg)    \
00033                 Memset((char *)(mod_dbg),0,sizeof (*(mod_dbg)))
00034 
00035 #define R_FLG_SET_ALL(mod_dbg)    \
00036                 Memset((char *)(mod_dbg),0xFF,sizeof (*(mod_dbg)))
00037 
00038 #define R_FLG_SET(bitnum, mod_dbg)        \
00039                 ((mod_dbg)->dbg_bits[(bitnum)/R_FLG_LONG_BITS] |= \
00040                 ((unsigned long)1 << ((bitnum) % R_FLG_LONG_BITS)))
00041 
00042 #define R_FLG_CLR(bitnum, mod_dbg)        \
00043                 ((mod_dbg)->dbg_bits[(bitnum)/R_FLG_LONG_BITS] &= \
00044                 ~((unsigned long)1 << ((bitnum) % R_FLG_LONG_BITS)))
00045 
00046 #define R_FLG_ISSET(bitnum, mod_dbg)      \
00047                 ((mod_dbg)->dbg_bits[(bitnum)/R_FLG_LONG_BITS] & \
00048                 ((unsigned long)1 << ((bitnum) % R_FLG_LONG_BITS)))
00049 
00050 #ifdef  __cplusplus
00051 }
00052 #endif
00053 
00054 #endif /* HEADER_COMMON_R_FLG_H */

Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 072-001001-2100-001-000 - 2.1