moved typedefs to beginning of files to solve some include problems

splitted authenticator to have a separate implementation for each auth_method_t
using va_copy to clone va_lists, should fix proplems on AMD64
some other cleanups
This commit is contained in:
Martin Willi
2006-10-30 14:07:05 +00:00
parent 09cb5472bc
commit 382b481795
119 changed files with 1196 additions and 1120 deletions
+5 -5
View File
@@ -161,10 +161,10 @@ static int get_thread_number(private_bus_t *this)
{
static int current_num = 0, stored_num;
stored_num = (int)pthread_getspecific(this->thread_id);
stored_num = (int)(intptr_t)pthread_getspecific(this->thread_id);
if (stored_num == 0)
{ /* first call of current thread */
pthread_setspecific(this->thread_id, (void*)++current_num);
pthread_setspecific(this->thread_id, (void*)(intptr_t)++current_num);
return current_num;
}
else
@@ -237,7 +237,8 @@ static signal_t listen_(private_bus_t *this, level_t *level, int *thread,
*thread = listener->thread;
*ike_sa = listener->ike_sa;
*format = listener->format;
*args = listener->args;
va_copy(*args, listener->args);
va_end(listener->args);
return listener->signal;
}
@@ -285,7 +286,7 @@ static void vsignal(private_bus_t *this, signal_t signal, level_t level,
bus_listener_t *listener;
active_listener_t *active_listener;
ike_sa_t *ike_sa;
int thread;
long thread;
ike_sa = pthread_getspecific(this->thread_sa);
thread = get_thread_number(this);
@@ -336,7 +337,6 @@ static void vsignal(private_bus_t *this, signal_t signal, level_t level,
{
pthread_cond_wait(&active_listener->cond, &this->mutex);
}
va_end(active_listener->args);
}
iterator->destroy(iterator);
+5 -9
View File
@@ -23,14 +23,17 @@
#ifndef BUS_H_
#define BUS_H_
typedef enum signal_t signal_t;
typedef enum level_t level_t;
typedef struct bus_listener_t bus_listener_t;
typedef struct bus_t bus_t;
#include <stdarg.h>
#include <sa/ike_sa.h>
#include <sa/child_sa.h>
typedef enum signal_t signal_t;
/**
* @brief signals emitted by the daemon.
*
@@ -123,8 +126,6 @@ enum signal_t {
*/
extern enum_name_t *signal_names;
typedef enum level_t level_t;
/**
* Signal levels used to control output verbosity.
*/
@@ -179,8 +180,6 @@ enum level_t {
#define SIG_TYPE(sig) (sig > DBG_MAX ? SIG_ANY : sig)
typedef struct bus_listener_t bus_listener_t;
/**
* @brief Interface for registering at the signal bus.
*
@@ -213,9 +212,6 @@ struct bus_listener_t {
int thread, ike_sa_t *ike_sa, char* format, va_list args);
};
typedef struct bus_t bus_t;
/**
* @brief Signal bus which sends signals to registered listeners.
*
+4 -5
View File
@@ -23,17 +23,16 @@
#ifndef FILE_LOGGER_H_
#define FILE_LOGGER_H_
#include <bus/bus.h>
typedef struct file_logger_t file_logger_t;
#include <bus/bus.h>
/**
* @brief Logger to files which implements bus_listener_t.
*
*
* @b Constructors:
* - file_logger_create()
*
*
* @ingroup listeners
*/
struct file_logger_t {
+4 -5
View File
@@ -23,19 +23,18 @@
#ifndef SYS_LOGGER_H_
#define SYS_LOGGER_H_
typedef struct sys_logger_t sys_logger_t;
#include <syslog.h>
#include <bus/bus.h>
typedef struct sys_logger_t sys_logger_t;
/**
* @brief Logger for syslog which implements bus_listener_t.
*
*
* @b Constructors:
* - sys_logger_create()
*
*
* @ingroup listeners
*/
struct sys_logger_t {