comment/comment.c
author Mikael Berthe <mikael@lilotux.net>
Mon, 08 Mar 2010 22:00:09 +0100
changeset 5 fbfc64c5d6be
parent 1 99fd216641d8
child 8 53b0091ecd47
permissions -rw-r--r--
[extsay] Fix ncurses reinitialization
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 = {
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    29
        .mcabber_version = "0.10.0",
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    30
        .requires        = NULL,
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    31
        .init            = comment_init,
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    32
        .uninit          = comment_uninit,
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    33
};
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    34
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    35
static void do_comment(char *args)
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    36
{
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    37
  /* This is actually a no-op! */
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
/* Initialization */
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    41
static void comment_init(void)
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    42
{
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    43
  /* Add command */
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    44
  cmd_add("#", "Ignore", 0, 0, do_comment, NULL);
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    45
}
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    46
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    47
/* Deinitialization */
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    48
static void comment_uninit(void)
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    49
{
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    50
  /* Unregister command */
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    51
  cmd_del("comment");
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    52
}
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    53
99fd216641d8 Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    54
/* vim: set expandtab cindent cinoptions=>2\:2(0:  For Vim users... */