structures.h

Ir para a documentação deste ficheiro.
00001 
00010 #ifndef STRUCTURES_H_
00011 #define STRUCTURES_H_
00012 
00013 #include "defines.h"
00014 #include <stdlib.h>
00015 #include <string.h>
00016 #include <time.h>
00017 #include <sys/types.h>
00018 #include <unistd.h>
00019 #include <stdio.h>
00020 #include <pthread.h>
00021 #include "hashtables.h"
00022 #include "debug.h"
00023 
00024 typedef struct
00025   {
00026   char *login;
00027   char *password;
00028   }t_conta;
00029   
00030 typedef struct
00031   {
00032   char *ip;
00033   HASHTABLE_T *logins;
00034   LISTA_GENERICA_T *pastas;
00035   }t_maquina;
00036 
00037 typedef struct
00038   {
00039   char sessionid[MAX_SESSINON_ID];
00040   char *login;
00041   time_t working_time;
00042   }t_session;
00043 
00044 typedef struct
00045   {
00046   HASHTABLE_T *sessions;
00047   int session_len;
00048   pthread_mutex_t *mutex;
00049   pthread_cond_t *cond;
00050   }t_args_monitor;
00051   
00052 typedef struct
00053   {
00054   HASHTABLE_T *hash_sessions, *hash_contas, *hash_maquinas;
00055   int session_len;
00056   pthread_mutex_t *mutex;
00057   }t_args_processor;
00058  
00059 /*
00060  * Funcao que permite libertar a memoria ocupada pela estrutura 't_conta'
00061  */
00062 void free_conta(t_conta *conta);
00063 
00064 /*
00065  * A funcao permite criar e alocar espaco para a estrutura 't_conta'
00066  */
00067 t_conta *create_conta(char *login, char *password);
00068 
00069 /*
00070  * Funcao que permite libertar memoria ocupada pela estrutura 't_maquina'
00071  */
00072 void free_maquina(t_maquina *maq);
00073 
00074 /*
00075  * A funcao permite criar e alocar espaco para a estrutura 't_maquina'
00076  */
00077 t_maquina *create_maquina(char *ip, HASHTABLE_T *logins, LISTA_GENERICA_T *pastas);
00078 
00079 /*
00080  * Funcao que permite libertar memoria ocupada pela estrutura 't_session'
00081  */
00082 void free_session(t_session *session);
00083 
00084 /*
00085  * A funcao permite criar e alocar espaco para a estrutura 't_session'
00086  */
00087 t_session *create_session(char *login);
00088 
00089 /*
00090  * Funcao que permite libertar memoria ocupada pela estrutura 't_args_processor'
00091  */
00092 void free_args_processor(t_args_processor *args);
00093 
00094 /*
00095  * A funcao permite criar e alocar espaco para a estrutura 't_args_processor'
00096  */
00097 t_args_processor *create_args_processor(HASHTABLE_T *sessions, HASHTABLE_T *contas, HASHTABLE_T *maquinas, int tempo, pthread_mutex_t *mutex);
00098 
00099 /*
00100  * Funcao que permite libertar memoria ocupada pela estrutura 't_args_monitor'
00101  */
00102 void free_args_monitor(t_args_monitor *args);
00103 
00104 /*
00105  * A funcao permite criar e alocar espaco para a estrutura 't_args_monitor'
00106  */
00107 t_args_monitor *create_args_monitor(HASHTABLE_T *sessions, int tempo, pthread_mutex_t *mutex, pthread_cond_t *cond);
00108 
00109 #endif /*STRUCTURES_H_*/

Gerado em Fri Nov 25 18:42:04 2005 para Securitas por  doxygen 1.4.4