File: caca.c

package info (click to toggle)
libcaca 0.99.beta14-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 6,720 kB
  • ctags: 2,334
  • sloc: ansic: 18,652; cs: 1,171; objc: 835; cpp: 741; makefile: 446; sh: 289; python: 215; ruby: 190; asm: 93
file content (31 lines) | stat: -rw-r--r-- 790 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 *  libcaca Ruby bindings
 *  Copyright (c) 2007 Pascal Terjan <pterjan@linuxfr.org>
 *
 *  This library is free software. It comes without any warranty, to
 *  the extent permitted by applicable law. You can redistribute it
 *  and/or modify it under the terms of the Do What The Fuck You Want
 *  To Public License, Version 2, as published by Sam Hocevar. See
 *  http://sam.zoy.org/wtfpl/COPYING for more details.
 */

#include <ruby.h>
#include <caca.h>

#include "caca-display.h"
#include "caca-event.h"

static VALUE get_version(VALUE self)
{
    return rb_str_new2(caca_get_version());
}

void Init_caca()
{
    VALUE mCaca = rb_define_module("Caca");

    rb_define_singleton_method(mCaca, "version", get_version, 0);

    Init_caca_display(mCaca);
    Init_caca_event(mCaca);
}