You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lighttpd2/src/actions.h

78 lines
1.6 KiB
C

15 years ago
#ifndef _LIGHTTPD_ACTIONS_H_
#define _LIGHTTPD_ACTIONS_H_
15 years ago
#include "settings.h"
typedef enum {
ACTION_GO_ON,
ACTION_FINISHED,
ACTION_ERROR,
ACTION_WAIT_FOR_EVENT
} action_result;
15 years ago
// action type
15 years ago
typedef enum {
ACTION_TSETTING,
ACTION_TFUNCTION,
ACTION_TCONDITION
} action_type;
15 years ago
struct action;
typedef struct action action;
15 years ago
struct action_list;
typedef struct action_list action_list;
struct action_stack;
typedef struct action_stack action_stack;
15 years ago
15 years ago
struct action_stack {
GArray* stack;
};
15 years ago
15 years ago
struct server; struct connection;
typedef action_result (*action_func)(struct server *srv, struct connection *con, void* param);
15 years ago
15 years ago
#include "condition.h"
15 years ago
15 years ago
struct action_list {
15 years ago
gint refcount;
15 years ago
15 years ago
GArray* actions; /** array of (action*) */
15 years ago
};
15 years ago
15 years ago
struct action {
15 years ago
gint refcount;
15 years ago
action_type type;
15 years ago
union {
struct {
15 years ago
GArray *options; /** array of option_mark */
15 years ago
} setting;
15 years ago
struct {
condition *cond;
action_list* target; /** action target to jump to if condition is fulfilled */
} condition;
15 years ago
15 years ago
struct {
15 years ago
action_func func;
15 years ago
gpointer param;
15 years ago
} function;
15 years ago
} value;
};
15 years ago
LI_API void action_list_release(action_list *al);
LI_API action_list *action_list_new();
15 years ago
15 years ago
/* no new/free function, so just use the struct direct (i.e. not a pointer) */
LI_API void action_stack_init(action_stack *as);
LI_API void action_stack_reset(action_stack *as);
LI_API void action_stack_clear(action_stack *as);
15 years ago
15 years ago
/** handle sublist now, remember current position (stack) */
LI_API void action_enter(connection *con, action_list *al);
LI_API action_result action_execute(server *srv, connection *con);
15 years ago
#endif