Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
teo_auth.h
Go to the documentation of this file.
1 
10 #ifndef TEO_AUTH_H
11 #define TEO_AUTH_H
12 
13 #include <stdio.h>
14 #include <pthread.h>
15 
16 #include <pbl.h>
17 
18 #include "../teo_web/teo_web.h"
19 
23 typedef struct teoAuthClass {
25  PblList* list;
26  pthread_mutex_t async_mutex;
27  pthread_t tid;
28  pthread_mutex_t cv_mutex;
29  pthread_cond_t cv_threshold;
30 
31  int stop;
32  int stopped;
33  int running;
34 } teoAuthClass;
35 
36 //typedef void (*command_callback)(void *error, void *success);
37 typedef void (*command_callback)(void *nc_p, char* err, char *result);
38 
42 typedef struct teoAuthData {
43  char *method;
44  char *url;
45  char *data;
46  char *headers;
47 
48  void *nc_p;
50 } teoAuthData;
51 
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
59 
60 int teoAuthProcessCommand(teoAuthClass *ta, const char *method, const char *url,
61  const char *data, const char *headers, void *nc_p,
62  command_callback callback);
63 
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif /* TEO_AUTH_H */
69 
struct teoAuthClass teoAuthClass
File: teo_auth.h Author: Kirill Scherba kirill@scherba.ru
const char data[]
Make it with: gcc -o post-callback post-callback.c -lcurl.
Definition: post-callback.c:23
File: teo_web.h Author: Kirill Scherba kirill@scherba.ru
Definition: teo_web.h:21
teoAuthClass * teoAuthInit(ksnHTTPClass *kh)
Initialize Teonet authenticate module.
Definition: teo_auth.c:93
pthread_cond_t cv_threshold
Command list condition variable.
Definition: teo_auth.h:29
pthread_t tid
Authentication module thread id.
Definition: teo_auth.h:27
PblList * list
Commands list.
Definition: teo_auth.h:25
char * headers
Definition: teo_auth.h:46
int err
Definition: test38.c:26
void * nc_p
Definition: teo_auth.h:48
void(* command_callback)(void *nc_p, char *err, char *result)
Definition: teo_auth.h:37
int teoAuthProcessCommand(teoAuthClass *ta, const char *method, const char *url, const char *data, const char *headers, void *nc_p, command_callback callback)
Store authentication command in list.
Definition: teo_auth.c:134
int running
Authentication module thread running state: 1 - running; 0 - waiting.
Definition: teo_auth.h:33
int stop
Stop Authentication module thread server flag.
Definition: teo_auth.h:31
command_callback callback
Definition: teo_auth.h:49
int stopped
Authentication module thread is stopped.
Definition: teo_auth.h:32
int result
Definition: grammar-filter.c:79
Teonet authentication request list data structure.
Definition: teo_auth.h:42
pthread_mutex_t cv_mutex
Command list condition variables mutex.
Definition: teo_auth.h:28
char * data
Definition: teo_auth.h:45
File: teo_auth.h Author: Kirill Scherba kirill@scherba.ru
Definition: teo_auth.h:23
pthread_mutex_t async_mutex
Command list mutex.
Definition: teo_auth.h:26
char * method
Definition: teo_auth.h:43
ksnHTTPClass * kh
Pointer to ksnHTTPClass.
Definition: teo_auth.h:24
char * url
Definition: teo_auth.h:44
struct teoAuthData teoAuthData
Teonet authentication request list data structure.
void teoAuthDestroy(teoAuthClass *ta)
Destroy Teonet authenticate module.
Definition: teo_auth.c:239