MINOR: actions: mutualise the action keyword lookup

Each (http|tcp)-(request|response) action use the same method
for looking up the action keyword during the cofiguration parsing.

This patch mutualize the code.
diff --git a/include/proto/action.h b/include/proto/action.h
new file mode 100644
index 0000000..5f71067
--- /dev/null
+++ b/include/proto/action.h
@@ -0,0 +1,47 @@
+/*
+ * include/proto/action.h
+ * This file contains actions prototypes.
+ *
+ * Copyright (C) 2000-2010 Willy Tarreau - w@1wt.eu
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, version 2.1
+ * exclusively.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef _PROTO_ACTION_H
+#define _PROTO_ACTION_H
+
+#include <types/action.h>
+
+static inline struct action_kw *action_lookup(struct list *keywords, const char *kw)
+{
+	struct action_kw_list *kw_list;
+	int i;
+
+	if (LIST_ISEMPTY(keywords))
+		return NULL;
+
+	list_for_each_entry(kw_list, keywords, list) {
+		for (i = 0; kw_list->kw[i].kw != NULL; i++) {
+			if (kw_list->kw[i].match_pfx &&
+			    strncmp(kw, kw_list->kw[i].kw, strlen(kw_list->kw[i].kw)) == 0)
+				return &kw_list->kw[i];
+			if (!strcmp(kw, kw_list->kw[i].kw))
+				return &kw_list->kw[i];
+		}
+	}
+	return NULL;
+}
+
+#endif /* _PROTO_ACTION_H */
diff --git a/include/types/action.h b/include/types/action.h
index 9fb0878..b8b4cd4 100644
--- a/include/types/action.h
+++ b/include/types/action.h
@@ -1,6 +1,6 @@
 /*
  * include/types/action.h
- * This file contains TCP protocol definitions.
+ * This file contains actions definitions.
  *
  * Copyright (C) 2000-2010 Willy Tarreau - w@1wt.eu
  *