summaryrefslogtreecommitdiff
path: root/plugin/plugin.h
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2009-06-08 12:39:20 +0200
committerSamuel Lidén Borell <samuel@slbdata.se>2010-01-02 21:42:03 +0100
commit162b7545ba53f52bd5ea1d0a31e33ed7cb3045d3 (patch)
tree7e236346f84ebf4676a267982112e0cf14e98485 /plugin/plugin.h
parent6d725eb52ca68c443706c7f0bc34bec60d1ff8e9 (diff)
downloadfribid-162b7545ba53f52bd5ea1d0a31e33ed7cb3045d3.tar.gz
fribid-162b7545ba53f52bd5ea1d0a31e33ed7cb3045d3.tar.bz2
fribid-162b7545ba53f52bd5ea1d0a31e33ed7cb3045d3.zip
Made most of the code run in a separate process
This was done to avoid interference with the browser and some libraries.
Diffstat (limited to 'plugin/plugin.h')
-rw-r--r--plugin/plugin.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/plugin/plugin.h b/plugin/plugin.h
new file mode 100644
index 0000000..ea781b0
--- /dev/null
+++ b/plugin/plugin.h
@@ -0,0 +1,50 @@
+#ifndef __PLUGIN_H__
+#define __PLUGIN_H__
+
+typedef enum {
+ PT_Version,
+ PT_Authentication,
+} PluginType;
+
+typedef enum {
+ PE_OK = 0,
+ PE_UnknownError = 1, // Maybe this is used for something else in the original plugin?
+} PluginError;
+
+typedef struct {
+ PluginType type;
+
+ char *url;
+ char *hostname;
+ char *ip;
+ PluginError lastError;
+
+ union {
+ struct {
+ /* Input parameters */
+ char *challenge;
+ char *policys;
+ /* Output parameters */
+ char *signature;
+ } auth;
+ } info;
+} Plugin;
+
+/* Plugin creation */
+Plugin *plugin_new(PluginType pluginType, const char *url,
+ const char *hostname, const char *ip);
+void plugin_free(Plugin *plugin);
+
+/* Javascript API */
+char *version_getVersion(Plugin *plugin);
+
+char *auth_getParam(Plugin *plugin, const char *name);
+bool auth_setParam(Plugin *plugin, const char *name, const char *value);
+int auth_performAction(Plugin *plugin, const char *action);
+int auth_performAction_Authenticate(Plugin *plugin);
+int auth_getLastError(Plugin *plugin);
+// TODO more functions...
+
+#endif
+
+