comment/comment.c
author Mikael Berthe <mikael@lilotux.net>
Sun, 11 Apr 2010 15:27:59 +0200
changeset 37 a05815df848c
parent 8 53b0091ecd47
child 40 5cd4b42ada91
permissions -rw-r--r--
Update headers
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
/*
37
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
     2
 *  Module "comment"    -- adds a dummy /# command
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
     3
 *                        (ignore the rest of the command line)
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
     4
 *
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
     5
 * Copyright (C) 2010 Mikael Berthe <mikael@lilotux.net>
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
     6
 *
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
     7
 * This module is free software: you can redistribute it and/or modify
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
     8
 * it under the terms of the GNU General Public License as published by
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
     9
 * the Free Software Foundation, either version 2 of the License, or
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
    10
 * (at your option) any later version.
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
    11
 *
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
    12
 * This program is distributed in the hope that it will be useful,
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
    13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
    14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
    15
 * GNU General Public License for more details.
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
    16
 *
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
    17
 * You should have received a copy of the GNU General Public License
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
    18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
a05815df848c Update headers
Mikael Berthe <mikael@lilotux.net>
parents: 8
diff changeset
    19
 */
1
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... */