File: rb_cairo_io.h

package info (click to toggle)
ruby-cairo 1.17.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,532 kB
  • sloc: ruby: 11,997; ansic: 10,183; sh: 48; makefile: 4
file content (46 lines) | stat: -rw-r--r-- 1,487 bytes parent folder | download | duplicates (5)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* -*- c-file-style: "gnu"; indent-tabs-mode: nil -*- */
/*
 * Ruby Cairo Binding
 *
 * Copyright 2005-2010 Kouhei Sutou <kou@cozmixng.org>
 *
 * This file is made available under the same terms as Ruby
 *
*/

#ifndef RB_CAIRO_IO_H
#define RB_CAIRO_IO_H

#include <rb_cairo.h>

typedef struct rb_cairo__io_callback_closure {
  VALUE target;
  VALUE error;
  unsigned char *data;
  unsigned int length;
} rb_cairo__io_callback_closure_t;

typedef struct rb_cairo__io_invoke_data {
  cr_callback_func_t func;
  VALUE data;
} rb_cairo__io_invoke_data_t;

RB_CAIRO_VAR ID rb_cairo__io_id_read;
RB_CAIRO_VAR ID rb_cairo__io_id_write;
RB_CAIRO_VAR ID rb_cairo__io_id_output;
RB_CAIRO_VAR ID rb_cairo__io_id_to_io;
RB_CAIRO_VAR ID rb_cairo__io_id_to_path;

rb_cairo__io_callback_closure_t *
               rb_cairo__io_closure_new     (VALUE                target);
void           rb_cairo__io_closure_destroy (rb_cairo__io_callback_closure_t *closure);
void           rb_cairo__io_closure_free    (void                *closure);
cairo_status_t rb_cairo__io_write_func      (void                *write_closure,
                                             const unsigned char *data,
                                             unsigned int         length);
cairo_status_t rb_cairo__io_read_func       (void                *read_closure,
                                             unsigned char       *data,
                                             unsigned int         length);


#endif