comment/comment.c
author Mikael Berthe <mikael@lilotux.net>
Fri, 02 Apr 2010 23:45:20 +0200
changeset 22 b6b45c2eb022
parent 8 53b0091ecd47
child 37 a05815df848c
permissions -rw-r--r--
[extsay] Improve script portability
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     1
/*
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     2
   Copyright 2010 Mikael Berthe
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     3
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     4
  Module "comment"    -- adds a dummy /# command
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     5
                         (ignore the rest of the command line)
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     6
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     7
This module is free software: you can redistribute it and/or modify
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     8
it under the terms of the GNU General Public License as published by
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     9
the Free Software Foundation, either version 2 of the License, or
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    10
(at your option) any later version.
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    11
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    12
This program is distributed in the hope that it will be useful,
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    13
but WITHOUT ANY WARRANTY; without even the implied warranty of
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    15
GNU General Public License for more details.
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    16
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    17
You should have received a copy of the GNU General Public License
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    18
along with this program.  If not, see <http://www.gnu.org/licenses/>.
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    19
*/
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    20
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    21
#include <mcabber/modules.h>
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    22
#include <mcabber/commands.h>
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    23
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    24
static void comment_init(void);
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    25
static void comment_uninit(void);
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    26
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    27
/* Module description */
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    28
module_info_t info_comment = {
8
53b0091ecd47 Update modules to the new API scheme
Mikael Berthe <mikael@lilotux.net>
parents: 1
diff changeset
    29
        .branch         = MCABBER_BRANCH,
53b0091ecd47 Update modules to the new API scheme
Mikael Berthe <mikael@lilotux.net>
parents: 1
diff changeset
    30
        .api            = MCABBER_API_VERSION,
53b0091ecd47 Update modules to the new API scheme
Mikael Berthe <mikael@lilotux.net>
parents: 1
diff changeset
    31
        .version        = "1.00",
53b0091ecd47 Update modules to the new API scheme
Mikael Berthe <mikael@lilotux.net>
parents: 1
diff changeset
    32
        .description    = "Comment (no-op) pseudo-command\n"
53b0091ecd47 Update modules to the new API scheme
Mikael Berthe <mikael@lilotux.net>
parents: 1
diff changeset
    33
                          "(Pretty useless!)",
53b0091ecd47 Update modules to the new API scheme
Mikael Berthe <mikael@lilotux.net>
parents: 1
diff changeset
    34
        .requires       = NULL,
53b0091ecd47 Update modules to the new API scheme
Mikael Berthe <mikael@lilotux.net>
parents: 1
diff changeset
    35
        .init           = comment_init,
53b0091ecd47 Update modules to the new API scheme
Mikael Berthe <mikael@lilotux.net>
parents: 1
diff changeset
    36
        .uninit         = comment_uninit,
53b0091ecd47 Update modules to the new API scheme
Mikael Berthe <mikael@lilotux.net>
parents: 1
diff changeset
    37
        .next           = NULL,
1
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    38
};
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    39
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    40
static void do_comment(char *args)
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    41
{
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    42
  /* This is actually a no-op! */
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    43
}
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    44
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    45
/* Initialization */
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    46
static void comment_init(void)
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    47
{
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    48
  /* Add command */
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    49
  cmd_add("#", "Ignore", 0, 0, do_comment, NULL);
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    50
}
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    51
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    52
/* Deinitialization */
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    53
static void comment_uninit(void)
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    54
{
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    55
  /* Unregister command */
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    56
  cmd_del("comment");
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    57
}
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    58
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    59
/* vim: set expandtab cindent cinoptions=>2\:2(0:  For Vim users... */