00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CTRLPROXY_LINE_H__
00021 #define __CTRLPROXY_LINE_H__
00022
00023 #include <gmodule.h>
00024 #include <time.h>
00025
00026 #ifndef G_MODULE_EXPORT
00027 #define G_MODULE_EXPORT
00028 #endif
00029
00030 #ifndef G_GNUC_WARN_UNUSED_RESULT
00031 #define G_GNUC_WARN_UNUSED_RESULT
00032 #endif
00033
00034 #ifndef G_GNUC_NULL_TERMINATED
00035 #define G_GNUC_NULL_TERMINATED
00036 #endif
00037
00043 enum has_endcolon { COLON_UNKNOWN = 0, WITH_COLON = 1, WITHOUT_COLON = 2 } ;
00044
00048 struct irc_line {
00049 char *origin;
00050 char **args;
00051 size_t argc;
00052 enum has_endcolon has_endcolon;
00053 };
00054
00058 G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT G_MODULE_EXPORT struct irc_line *linedup(const struct irc_line *l);
00059 G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT G_MODULE_EXPORT struct irc_line *irc_parse_line(const char *data);
00060 G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT G_MODULE_EXPORT struct irc_line *virc_parse_line(const char *origin, va_list ap);
00061 G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT G_MODULE_EXPORT char *irc_line_string(const struct irc_line *l);
00062 G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT G_MODULE_EXPORT char *irc_line_string_nl(const struct irc_line *l);
00063 G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT G_MODULE_EXPORT char *line_get_nick(const struct irc_line *l);
00064 G_MODULE_EXPORT void free_line(struct irc_line *l);
00065 G_GNUC_NULL_TERMINATED G_MODULE_EXPORT GIOStatus irc_send_args(GIOChannel *, GIConv, GError **, ...);
00066 G_GNUC_PRINTF(4, 5) G_MODULE_EXPORT GIOStatus irc_sendf(GIOChannel *, GIConv, GError **, char *fmt, ...);
00067 G_GNUC_WARN_UNUSED_RESULT G_MODULE_EXPORT GIOStatus irc_send_line(
00068 GIOChannel *, GIConv,
00069 const struct irc_line *l,
00070 GError **);
00071 G_GNUC_PRINTF(1, 2) G_GNUC_WARN_UNUSED_RESULT G_MODULE_EXPORT struct irc_line *irc_parse_linef(
00072 const char *origin, ... );
00073 G_GNUC_NULL_TERMINATED G_GNUC_WARN_UNUSED_RESULT G_MODULE_EXPORT struct irc_line *irc_parse_line_args(
00074 const char *origin, ... );
00075
00080 G_GNUC_WARN_UNUSED_RESULT G_MODULE_EXPORT GIOStatus irc_recv_line(GIOChannel *c, GIConv iconv,
00081 GError **err,
00082 struct irc_line **);
00083
00084 G_MODULE_EXPORT gboolean line_add_arg(struct irc_line *l, const char *arg);
00085
00086 G_MODULE_EXPORT struct irc_line *line_prefix_time(struct irc_line *l, time_t t);
00087
00088 #endif