aboutsummaryrefslogtreecommitdiff
path: root/src/eclat.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/eclat.h')
-rw-r--r--src/eclat.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/eclat.h b/src/eclat.h
new file mode 100644
index 0000000..0fb4fd7
--- /dev/null
+++ b/src/eclat.h
@@ -0,0 +1,81 @@
+/* This file is part of Eclat.
+ Copyright (C) 2012 Sergey Poznyakoff.
+
+ Eclat is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Eclat 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+#include <sysexits.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <curl/curl.h>
+#include "grecs.h"
+#include "wordsplit.h"
+#include "libeclat.h"
+
+#define ECLAT_DEBCAT_MAIN 0
+#define ECLAT_DEBCAT_CFGRAM 1
+#define ECLAT_DEBCAT_CFLEX 2
+#define ECLAT_DEBCAT_CONF 3
+#define ECLAT_DEBCAT_MAX 4
+
+extern const char *program_name;
+extern int debug_level[];
+
+extern char *default_host;
+extern int use_ssl;
+extern char *region_name;
+extern char *access_file_name;
+extern char *access_key;
+extern char *secret_key;
+extern char *url_base;
+
+#define debug(cat, lev, s) \
+ do { \
+ if (debug_level[cat] >= (lev)) \
+ debug_printf s; \
+ } while(0)
+
+void die(int status, const char *fmt, ...);
+void vdiag(grecs_locus_t const *locus, const char *qual, const char *fmt,
+ va_list ap);
+void diag(grecs_locus_t const *locus, const char *qual, const char *fmt, ...);
+void err(const char *fmt, ...);
+void warn(const char *fmt, ...);
+void debug_printf(const char *fmt, ...);
+
+typedef int (*config_finish_hook_t) (void*);
+
+void add_config_finish_hook(config_finish_hook_t fun, void *data);
+
+void config_help(void);
+void config_init(void);
+void config_finish(struct grecs_node *tree);
+int run_config_finish_hooks(void);
+
+enum eclat_command {
+ eclat_command_unspecified,
+ eclat_command_start_instances,
+ eclat_command_stop_instances
+};
+
+extern enum eclat_command eclat_command;
+
+typedef int (*eclat_command_handler_t) (CURL *curl, int argc, char **argv);
+
+int eclat_start_instance(CURL *curl, int argc, char **argv);
+int eclat_stop_instance(CURL *curl, int argc, char **argv);

Return to:

Send suggestions and report system problems to the System administrator.