wolfExamples.h
1 #ifndef _WOLFEXAMPLES_H_
2 #define _WOLFEXAMPLES_H_
3 
4 #include <rt.h>
5 
6 #ifdef __cplusplus
7  extern "C" {
8 #endif
9 
10 // support functions for all threads
11 BOOLEAN Catalog(RTHANDLE hProcess, RTHANDLE hObject, LPSTR lpszName);
12 void Cleanup(void);
13 void Fail(LPSTR lpszMessage, ...);
14 DWORD UsecsToKticks(DWORD dwUsecs);
15 
16 
17 /* Example API's */
18 int wolfExample_TLSServer(int port);
19 int wolfExample_TLSClient(const char* ip, int port);
20 int wolfExample_TLSLocal(int port);
21 
22 
23 // global type definitions
24 typedef enum {
25  BEFORE_INIT,
26  INIT_BUSY,
27  INIT_DONE,
28  CLEANUP_BUSY
29 } INIT_STATE;
30 
31 typedef struct {
32  RTHANDLE hMain; // RTHANDLE of main thread
33  INIT_STATE state; // main thread state
34  BOOLEAN bCataloged; // TRUE if we cataloged process name in root
35  BOOLEAN bShutdown; // TRUE if all threads have to terminate
36 } INIT_STRUCT;
37 
38 // global variables
39 extern RTHANDLE hRootProcess; // RTHANDLE of root process
40 extern DWORD dwKtickInUsecs; // length of one low level tick in usecs
41 extern INIT_STRUCT gInit; // structure describing all global objects
42 
43 #ifdef __cplusplus
44  } /* extern "C" */
45 #endif
46 
47 #endif /* _WOLFEXAMPLES_H_ */
Definition: wolfExamples.h:31