~ubuntu-branches/ubuntu/trusty/weechat/trusty-proposed

« back to all changes in this revision

Viewing changes to src/plugins/irc/irc-command.h

  • Committer: Bazaar Package Importer
  • Author(s): Emmanuel Bouthenot
  • Date: 2009-09-15 20:58:07 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090915205807-nd2nx3kof2aldqbt
Tags: 0.3.0-1
* New (final) upstream release.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org>
 
3
 * See README for License detail, AUTHORS for developers list.
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 3 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
 
 
20
#ifndef __WEECHAT_IRC_COMMAND_H
 
21
#define __WEECHAT_IRC_COMMAND_H 1
 
22
 
 
23
struct t_irc_server;
 
24
struct t_irc_channel;
 
25
 
 
26
#define IRC_COMMAND_TOO_FEW_ARGUMENTS(__buffer, __command)              \
 
27
    weechat_printf (__buffer,                                           \
 
28
                    _("%s%s: too few arguments for \"%s\" command"),    \
 
29
                    weechat_prefix ("error"), IRC_PLUGIN_NAME,          \
 
30
                    __command);                                         \
 
31
    return WEECHAT_RC_OK;
 
32
 
 
33
#define IRC_COMMAND_CHECK_SERVER(__command, __check_connection)         \
 
34
    if (!ptr_server)                                                    \
 
35
    {                                                                   \
 
36
        weechat_printf (NULL,                                           \
 
37
                        _("%s%s: command \"%s\" must be executed on "   \
 
38
                          "irc buffer (server or channel)"),            \
 
39
                        weechat_prefix ("error"), IRC_PLUGIN_NAME,      \
 
40
                        __command);                                     \
 
41
        return WEECHAT_RC_OK;                                           \
 
42
    }                                                                   \
 
43
    if (__check_connection && !ptr_server->is_connected)                \
 
44
    {                                                                   \
 
45
        weechat_printf (NULL,                                           \
 
46
                        _("%s%s: command \"%s\" must be executed on "   \
 
47
                          "connected irc server"),                      \
 
48
                        weechat_prefix ("error"), IRC_PLUGIN_NAME,      \
 
49
                        __command);                                     \
 
50
        return WEECHAT_RC_OK;                                           \
 
51
    }
 
52
 
 
53
extern void irc_command_away_server (struct t_irc_server *server,
 
54
                                     const char *arguments,
 
55
                                     int reset_unread_marker);
 
56
extern void irc_command_join_server (struct t_irc_server *server,
 
57
                                     const char *arguments);
 
58
extern void irc_command_mode_server (struct t_irc_server *server,
 
59
                                     struct t_irc_channel *channel,
 
60
                                     const char *arguments);
 
61
extern void irc_command_part_channel (struct t_irc_server *server,
 
62
                                      const char *channel_name,
 
63
                                      const char *part_message);
 
64
extern void irc_command_quit_server (struct t_irc_server *server,
 
65
                                     const char *arguments);
 
66
extern void irc_command_init ();
 
67
 
 
68
#endif /* irc-command.h */