• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

saf-env.h

Go to the documentation of this file.
00001 /****************************************************************************
00002  *
00003  * Copyright (C) 2006-2014 Micro Focus. All rights reserved.
00004  *
00005  * The software and information contained herein are proprietary to, and
00006  * comprise valuable trade secrets of, Micro Focus,
00007  * which intends to preserve as trade secrets such software and 
00008  * information. This software is an unpublished copyright of Micro Focus  
00009  * and may not be used, copied, transmitted, or stored in any manner.  
00010  * This software and information or any other copies thereof may not be
00011  * provided or otherwise made available to any other person.
00012  *
00013  *      Enterprise Server SAF (Security) Manager
00014  *      Processing Environment
00015  *
00016  *      @(#)saf-env.h   $Revision: 621664 $     
00017  *
00018  *      $Date: 2014-08-11 20:08:36 -0400 (Mon, 11 Aug 2014) $
00019  *
00020  ****************************************************************************/
00021 
00022 /* Start of source module saf-env.h */
00023 #if !defined(SafENV_H)
00024 #define SafENV_H
00025 
00026 #include <stdarg.h>
00027 
00037 /* Declare structures defined elsewhere */
00038 struct SafInit;
00039 struct SafPTab;
00040 struct SafACEE;
00041 struct SafStore;
00042 struct SafLockInfo;
00043 
00044 
00051 enum SafMsgLvl
00052 {
00053    SafMsgINFO,       
00054    SafMsgWARN,       
00055    SafMsgERR,        
00056    SafMsgCRIT,       
00057    SafMsgInvalid
00058 };
00059 
00060 
00063 #define SafESM_LCK_CHG    0  
00064 #define SafESM_LCK_HAVE   1  
00065 #define SafESM_LCK_TEST   2  
00066 #define SafESM_LCK_USE    3  
00067 #define SafESM_LCK_NOWAIT 3  
00068 #define SafESM_LCK_NONE   4  
00070 
00071 
00073 #define SafESM_LCK_UOW    11 
00074 #define SafESM_LCK_TASK   12 
00075 #define SafESM_LCK_PROC   13 
00077 
00078 
00080 #define SafESM_LCK_SHR   0   
00081 #define SafESM_LCK_EXCL  1   
00083 
00084 
00090 typedef enum
00091 {
00092    SafLockOK      =  0,    
00093    SafLockOWN     =  1,    
00094    SafLockHELD    =  2,    
00096    SafLockNHELD   =  3,    
00097    SafLockNEXIST  =  4,    
00098    SafLockDENY    =  5,    
00099    SafLockERR     =  6,    
00100    SafLockPARAM   =  7,    
00101    SafLockInvalid
00102 } SafLockRet;
00103 
00104 
00105 /* Processing Environment Interface */
00106 mf_uns32 SafEnvInit(struct SafInit *);
00107 
00108 
00109 /* Processing Environment Functions */
00110 SafRet SafShmOpen(const char *Name, size_t *Size, void **Area);
00111 SafRet SafModLoad(const char *ModPath, struct SafPTab * (**Entry)(void));
00112 SafRet SafModUnload(const char *ModPath);
00113 SafRet SafGetInstPath(char *Path, size_t MaxLen);
00114 SafRet SafLog(int Num, enum SafMsgLvl, const char *DefaultText, ...);
00115 SafRet SafLogLit(int Num, enum SafMsgLvl Level, const char *Text);
00116 SafRet SafAceeAlloc(const char *Name, const char *Group,
00117                     struct SafACEE **AceeP, int *IsNew);
00118 SafRet SafAceeIterate(void *Data, int (*Callback)(struct SafACEE *Acee,
00119                                                   void *Data));
00120 
00121 SafLockRet SafLockEnq(const char *QName, const char *RName, int Type,
00122                       int Exclusive, int Lifetime, struct SafLockInfo *Info);
00123 SafLockRet SafThrLock(const char *Name, int Exclusive);
00124 SafLockRet SafShmLock(const char *Name, int Exclusive);
00125 SafLockRet SafLockDeq(const char *QName, const char *RName,
00126                       struct SafLockInfo *Info);
00127 SafLockRet SafThrUnlock(const char *Name);
00128 SafLockRet SafShmUnlock(const char *Name);
00129 SafRet SafIncreaseLockWaitTimeout(int Timeout);
00130 
00131 int SafIsMT(void);
00132 int SafIsSharedMemory(void);
00133 unsigned long SafThreadId(void);
00134 const char *SafServerName(void);
00135 
00136 /* The string functions (SafStrcmpCI, etc) are prototyped in safmgr.h. */
00137 
00138 /* Associative Store Functions (saf-store.c) */
00139 SafRet SafAllocStore(struct SafStore **StoreP);
00140 SafRet SafFreeStore(struct SafStore *Store);
00141 SafRet SafClearStore(struct SafStore *Store);
00142 SafRet SafStoreRemove(struct SafStore *Store, const char *C, const char *N);
00143 SafRet SafStoreIterate(struct SafStore *Store, const char *Class,
00144                        SafRet (*Visitor)(const char *Class, const char *Name,
00145                                          void *Value, void *Data),
00146                        void *Data, SafRet *VisitorErrP);
00147 SafRet SafStoreAdd(struct SafStore *S, const char *C, const char *N, void *P);
00148 SafRet SafStoreFind(struct SafStore *S, const char *C, const char *N, void **P);
00149 SafRet SafStoreLoad(struct SafStore *Store, const char *Text);
00150 
00151 
00152 /* Utility functions */
00153 int SafVSnprintf(char *Buffer, size_t BufLen, const char *Format, va_list Args);
00154 int SafSnprintf(char *Buffer, size_t BufLen, const char *Format, ...);
00155 mf_uns32 SafGetProcessID(void);
00156 unsigned long SafRandom(unsigned long Range);
00157 
00158 
00159 /* Internal Environment Functions */
00160 SafRet SafGetEnvFunc(int (**FuncP)(), const char *Name, const char *Env);
00161 
00162 #endif
00163 
00164 /* End of saf-env.h */
00165