1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00
libpsyc/include/psyc/method.h

120 lines
3.6 KiB
C
Raw Normal View History

2013-07-16 14:53:51 +00:00
/*
This file is part of libpsyc.
Copyright (C) 2011,2012 Carlo v. Loesch, Gabor X Toth, Mathias L. Baumann,
and other contributing authors.
libpsyc is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version. As a special exception, libpsyc is distributed with additional
permissions to link libpsyc libraries with non-AGPL works.
libpsyc 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 Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License and
the linking exception along with libpsyc in a COPYING file.
*/
2011-11-30 12:51:50 +00:00
#ifndef PSYC_METHOD_H
#define PSYC_METHOD_H
1984-04-04 00:44:05 +00:00
/** Characteristics attributed to certain method families. */
typedef enum {
2011-11-30 12:51:50 +00:00
PSYC_METHOD_TEMPLATE = 1 << 0,
PSYC_METHOD_REPLY = 1 << 1,
PSYC_METHOD_VISIBLE = 1 << 2,
PSYC_METHOD_LOGGABLE = 1 << 3,
PSYC_METHOD_MANUAL = 1 << 4,
} PsycMethodFlag;
1984-04-04 00:44:05 +00:00
/**
* This is a preliminary set of methods, you will encounter a lot more in
* the wild. The definitive standardization and definition of compact methods
* will follow. "mc" is an old abbreviation for method.
*/
typedef enum {
2011-11-30 12:51:50 +00:00
PSYC_MC_UNKNOWN,
1984-04-04 00:44:05 +00:00
PSYC_MC_CONVERSE,
2011-11-30 12:51:50 +00:00
PSYC_MC_DATA,
PSYC_MC_ECHO,
PSYC_MC_ECHO_CONTEXT_ENTER,
PSYC_MC_ECHO_CONTEXT_LEAVE,
2012-01-04 22:33:43 +00:00
PSYC_MC_ECHO_HELLO,
2011-11-30 12:51:50 +00:00
PSYC_MC_ERROR,
PSYC_MC_FAILURE,
PSYC_MC_FAILURE_ALIAS_NONEXISTANT,
PSYC_MC_FAILURE_ALIAS_UNAVAILABLE,
2011-11-30 12:51:50 +00:00
PSYC_MC_INFO,
1984-04-04 00:44:05 +00:00
PSYC_MC_MESSAGE, // deprecated, use _converse
PSYC_MC_MESSAGE_ACTION, // deprecated, use _converse
2011-11-30 12:51:50 +00:00
PSYC_MC_NOTICE,
2012-01-25 17:05:44 +00:00
PSYC_MC_NOTICE_ALIAS_ADD,
PSYC_MC_NOTICE_ALIAS_CHANGE,
PSYC_MC_NOTICE_ALIAS_REMOVE,
2011-11-30 12:51:50 +00:00
PSYC_MC_NOTICE_CONTEXT_ENTER,
PSYC_MC_NOTICE_CONTEXT_LEAVE,
2012-01-25 17:05:44 +00:00
PSYC_MC_NOTICE_FRIENDSHIP,
2012-01-17 09:53:34 +00:00
PSYC_MC_NOTICE_LINK,
2012-03-06 01:36:30 +00:00
PSYC_MC_NOTICE_PEER_CONNECT,
PSYC_MC_NOTICE_PEER_DISCONNECT,
2012-01-25 17:05:44 +00:00
PSYC_MC_NOTICE_SET,
PSYC_MC_NOTICE_UNLINK,
2011-11-30 12:51:50 +00:00
PSYC_MC_REQUEST,
PSYC_MC_REQUEST_CONTEXT_ENTER,
PSYC_MC_REQUEST_CONTEXT_LEAVE,
2012-01-25 17:05:44 +00:00
PSYC_MC_REQUEST_FRIENDSHIP,
2011-11-30 12:51:50 +00:00
PSYC_MC_STATUS,
PSYC_MC_STATUS_CONTEXTS_ENTERED,
2011-12-27 16:50:25 +00:00
PSYC_MC_STATUS_HELLO,
2011-11-30 12:51:50 +00:00
PSYC_MC_WARNING,
PSYC_METHODS_NUM,
} PsycMethod;
1984-04-04 00:44:05 +00:00
/* Same list of typical but non-final methods again */
2011-11-30 12:51:50 +00:00
typedef union PsycTemplates {
PsycString a[PSYC_METHODS_NUM];
struct {
PsycString _;
1984-04-04 00:44:05 +00:00
PsycString _converse;
2011-11-30 12:51:50 +00:00
PsycString _data;
PsycString _echo;
PsycString _echo_context_enter;
PsycString _echo_context_leave;
2012-01-04 22:33:43 +00:00
PsycString _echo_hello;
2011-11-30 12:51:50 +00:00
PsycString _error;
PsycString _failure;
2012-01-25 17:05:44 +00:00
PsycString _failure_alias_nonexistant;
PsycString _failure_alias_unavailable;
2011-11-30 12:51:50 +00:00
PsycString _info;
1984-04-04 00:44:05 +00:00
PsycString _message; // deprecated, use _converse
PsycString _message_action; // deprecated, use _converse
2011-11-30 12:51:50 +00:00
PsycString _notice;
2012-01-25 17:05:44 +00:00
PsycString _notice_alias_add;
PsycString _notice_alias_change;
PsycString _notice_alias_remove;
2011-11-30 12:51:50 +00:00
PsycString _notice_context_enter;
PsycString _notice_context_leave;
2012-01-25 17:05:44 +00:00
PsycString _notice_friendship;
2012-01-17 09:53:34 +00:00
PsycString _notice_link;
2012-03-06 01:36:30 +00:00
PsycString _notice_peer_connect;
PsycString _notice_peer_disconnect;
2012-01-25 17:05:44 +00:00
PsycString _notice_set;
PsycString _notice_unlink;
2011-11-30 12:51:50 +00:00
PsycString _request;
PsycString _request_context_enter;
PsycString _request_context_leave;
2012-01-25 17:05:44 +00:00
PsycString _request_friendship;
2011-11-30 12:51:50 +00:00
PsycString _status;
PsycString _status_contexts_entered;
2011-12-27 16:50:25 +00:00
PsycString _status_hello;
2011-11-30 12:51:50 +00:00
PsycString _warning;
} s;
} PsycTemplates;
#endif