source: trunk/third/rep-gtk/gnomelib-support.c @ 18404

Revision 18404, 1.7 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18403, which included commits to RCS files with non-trunk default branches.
Line 
1/* gnomelib-support.c -- helper functions for GNOME binding
2   $Id: gnomelib-support.c,v 1.1.1.2 2003-01-05 00:30:04 ghudson Exp $ */
3
4#include <config.h>
5#include <assert.h>
6#include <gnome.h>
7#include "rep-gtk.h"
8#include "rep-gnome.h"
9#include <string.h>
10
11
12/* metadata */
13
14#ifdef XXX
15
16GnomeMetadataError_t
17sgtk_gnome_metadata_set (const char *file, const char *name, repv data)
18{
19    if (rep_STRINGP (data))
20    {
21        return gnome_metadata_set (file, name,
22                                   rep_STRING_LEN (data), rep_STR (data));
23    }
24    else
25        return GNOME_METADATA_NOT_FOUND;
26}
27
28repv
29sgtk_gnome_metadata_get (const char *file, const char *name)
30{
31    int size;
32    char *buffer;
33    if (gnome_metadata_get (file, name, &size, &buffer) == 0)
34    {
35        repv ret = rep_string_dupn (buffer, size);
36        g_free (buffer);
37        return ret;
38    }
39    else
40        return Qnil;
41}
42
43repv
44sgtk_gnome_metadata_get_fast (const char *file, const char *name)
45{
46    int size;
47    char *buffer;
48    if (gnome_metadata_get_fast (file, name, &size, &buffer) == 0)
49    {
50        repv ret = rep_string_dupn (buffer, size);
51        g_free (buffer);
52        return ret;
53    }
54    else
55        return Qnil;
56}
57
58void
59sgtk_gnome_metadata_regex_add (const char *regex, const char *key, repv data)
60{
61    if (rep_STRINGP (data))
62    {
63        gnome_metadata_regex_add (regex, key,
64                                  rep_STRING_LEN (data), rep_STR (data));
65    }
66}
67
68void
69sgtk_gnome_metadata_type_add (const char *regex, const char *key, repv data)
70{
71    if (rep_STRINGP (data))
72    {
73        gnome_metadata_type_add (regex, key,
74                                 rep_STRING_LEN (data), rep_STR (data));
75    }
76}
77
78#endif /* XXX */
79
80
81/* dl hooks / init */
82
83repv
84rep_dl_init (void)
85{
86    repv s = rep_push_structure ("gui.gtk-2.gnome-lib");
87    sgtk_gnome_init_gnome_glue ();
88    return rep_pop_structure (s);
89}
Note: See TracBrowser for help on using the repository browser.