2019-01-22 14:14:56 +00:00
|
|
|
#ifndef __SSB_SCUTTLER_H__
|
|
|
|
# define __SSB_SCUTTLER_H__
|
2018-12-29 06:40:52 +00:00
|
|
|
|
2019-01-03 13:55:38 +00:00
|
|
|
# include <glib-object.h>
|
2019-01-07 14:41:54 +00:00
|
|
|
# include <gio/gio.h>
|
2018-12-29 06:40:52 +00:00
|
|
|
|
2019-01-03 13:55:38 +00:00
|
|
|
# define SSB_TYPE_SCUTTLER ssb_scuttler_get_type()
|
|
|
|
G_DECLARE_FINAL_TYPE(SsbScuttler, ssb_scuttler, SSB, SCUTTLER, GInitiallyUnowned)
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
SSB_SCUTTLER_ERROR_KEYGEN,
|
|
|
|
SSB_SCUTTLER_ERROR_KEYAUTH,
|
|
|
|
SSB_SCUTTLER_ERROR_KEYVERIFY,
|
|
|
|
SSB_SCUTTLER_ERROR_AUTH,
|
2019-01-04 12:16:50 +00:00
|
|
|
SSB_SCUTTLER_ERROR_REQUEST_TOO_LARGE,
|
|
|
|
SSB_SCUTTLER_ERROR_SEND,
|
2019-01-09 08:09:01 +00:00
|
|
|
SSB_SCUTTLER_ERROR_NOTCONNECTED,
|
2019-01-13 07:01:33 +00:00
|
|
|
SSB_SCUTTLER_ERROR_READ,
|
2019-01-22 14:14:56 +00:00
|
|
|
SSB_SCUTTLER_ERROR_CRYPTO,
|
2019-01-13 07:01:33 +00:00
|
|
|
SSB_SCUTTLER_ERROR_RESPONSE_TOO_LARGE,
|
|
|
|
SSB_SCUTTLER_ERROR_STREAM_END,
|
2019-01-22 14:14:56 +00:00
|
|
|
SSB_SCUTTLER_ERROR_CONFIG_ERROR,
|
2019-01-03 13:55:38 +00:00
|
|
|
} SsbScuttlerError;
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
2018-12-29 06:40:52 +00:00
|
|
|
|
|
|
|
gpointer scuttle(gchar *ssb_dir);
|
2019-01-03 13:55:38 +00:00
|
|
|
void stop_scuttling(void);
|
|
|
|
|
|
|
|
# define SSB_SCUTTLER_ERROR (ssb_scuttler_error_quark())
|
|
|
|
GQuark ssb_scuttler_error_quark(void);
|
2019-01-07 14:41:54 +00:00
|
|
|
gboolean ssb_scuttler_ensure(const gchar *ssb_dir);
|
|
|
|
SsbScuttler *ssb_scuttler_get(void);
|
|
|
|
void ssb_scuttler_connect_async(SsbScuttler *scuttler,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
gpointer user_data);
|
|
|
|
gboolean ssb_scuttler_connect_finish(SsbScuttler *scuttler,
|
|
|
|
GAsyncResult *result,
|
|
|
|
GError **error);
|
2019-01-10 14:03:17 +00:00
|
|
|
void ssb_scuttler_whoami_async(SsbScuttler *scuttler,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
gpointer user_data);
|
2019-01-03 13:55:38 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
2018-12-29 06:40:52 +00:00
|
|
|
|
2019-01-22 14:14:56 +00:00
|
|
|
#endif /* __SSB_SCUTTLER_H__ */
|