~ubuntu-branches/ubuntu/wily/weechat/wily

« back to all changes in this revision

Viewing changes to src/plugins/ruby/weechat-ruby-api.c

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bouthenot
  • Date: 2014-02-13 12:11:54 UTC
  • mfrom: (29.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140213121154-k6sdmtnralvjbmgq
Tags: 0.4.3-2
* Add missing symlink for Polish manpage
* Change ruby-* Build-Depends to gem2deb so that ruby plugin will be
  built against the newest Ruby interpreter available (Closes: #738685)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * weechat-ruby-api.c - ruby API functions
3
3
 *
4
 
 * Copyright (C) 2003-2013 Sebastien Helleu <flashcode@flashtux.org>
 
4
 * Copyright (C) 2003-2014 Sébastien Helleu <flashcode@flashtux.org>
5
5
 * Copyright (C) 2005-2007 Emmanuel Bouthenot <kolter@openics.org>
6
6
 * Copyright (C) 2012 Simon Arlott
7
7
 *
156
156
                                             "version %s (%s)"),
157
157
                            RUBY_PLUGIN_NAME, c_name, c_version, c_description);
158
158
        }
 
159
        ruby_current_script->interpreter = (VALUE *)ruby_current_module;
159
160
    }
160
161
    else
161
162
    {
3649
3650
}
3650
3651
 
3651
3652
static VALUE
 
3653
weechat_ruby_api_hook_set (VALUE class, VALUE hook, VALUE property,
 
3654
                           VALUE value)
 
3655
{
 
3656
    char *c_hook, *c_property, *c_value;
 
3657
 
 
3658
    API_FUNC(1, "hook_set", API_RETURN_ERROR);
 
3659
    if (NIL_P (hook) || NIL_P (property) || NIL_P (value))
 
3660
        API_WRONG_ARGS(API_RETURN_ERROR);
 
3661
 
 
3662
    Check_Type (hook, T_STRING);
 
3663
    Check_Type (property, T_STRING);
 
3664
    Check_Type (value, T_STRING);
 
3665
 
 
3666
    c_hook = StringValuePtr (hook);
 
3667
    c_property = StringValuePtr (property);
 
3668
    c_value = StringValuePtr (value);
 
3669
 
 
3670
    weechat_hook_set (API_STR2PTR(c_hook),
 
3671
                      c_property,
 
3672
                      c_value);
 
3673
 
 
3674
    API_RETURN_OK;
 
3675
}
 
3676
 
 
3677
static VALUE
3652
3678
weechat_ruby_api_unhook (VALUE class, VALUE hook)
3653
3679
{
3654
3680
    char *c_hook;
6066
6092
    API_DEF_FUNC(hook_info_hashtable, 6);
6067
6093
    API_DEF_FUNC(hook_infolist, 6);
6068
6094
    API_DEF_FUNC(hook_focus, 3);
 
6095
    API_DEF_FUNC(hook_set, 3);
6069
6096
    API_DEF_FUNC(unhook, 1);
6070
6097
    API_DEF_FUNC(unhook_all, 0);
6071
6098
    API_DEF_FUNC(buffer_new, 5);