Questions tagged [glib]

GLib is a general-purpose and cross-platform utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on.

GLib is a general-purpose and cross-platform utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on.

For many applications, C with GLib and GObject is an alternative to C++ with STL. It works on many UNIX-like platforms, Windows, OS/2 and BeOS. GLib is released under the GNU Library General Public License (GNU LGPL).

The GLib reference manual can be found at the GNOME developer site.

1529 questions
0
votes
1 answer

How to get the file size pointed by a Windows shortcut under MinGW?

I want to get the file size pointed by a Windows shortcut lnk file (not file-junction/symlink) under MinGW/GLib. The g_stat function in GLib tells me the size of a file or file-junction but not the size of the file pointed by an lnk file. Can anyone…
Anindya Chatterjee
  • 5,824
  • 13
  • 58
  • 82
0
votes
1 answer

Under Gtk+/Glib are there any utility functions, where we can read and write config File?

I have a config file in which I have keys and values, like this: key1=value1 key2=value2 key3=value3 So is there any utility functions in Gtk/Glib that can read this file and retrieve the value corresponds to key?
User7723337
  • 11,857
  • 27
  • 101
  • 182
0
votes
3 answers

GLib-GObject-Warning when creating gobject

I am trying to create a flume-thrift client in c (c_glib) but have trouble creating the gobject that shall be sent to the server. I get the following error at the line in main.c: `GLib-GObject-WARNING **: IA__g_object_new_valist: object class…
user1766169
  • 1,932
  • 3
  • 22
  • 44
0
votes
1 answer

Read values from config text using glib

I have the following Config.cfg [Power] Power8=8 Temp=5=1001 Hum=7=1002 Link=8=1003 Vol=9=1004 [Power] Power10=10 Temp=5=1012 Hum=7=1013 Link=8=1014 Vol=9=1015 and with the usage of glib I want to read the values of each Power. I want something…
dali1985
  • 3,263
  • 13
  • 49
  • 68
0
votes
2 answers

How to export GObjects to various languages

The GObject Reference Manual states that the GObject system was designed to export functions written in C to other languages by using some generic glue code. It is also noted that this glue exists for perl and python explicitly. Omitted however, is…
XZS
  • 2,374
  • 2
  • 19
  • 38
0
votes
1 answer

invalid conversion from 'int' to 'GKeyFileFlags'

I have the following config file Config.cfg [DD] user=** password=*** database=**** IPServidor=**** port=3306 [Machine] Machine1=8 Temp=5=1001 Hum=7=1002 Link=8=1003 Volt=9=1004 With the usage of GLib GKeyFile Parser in this tutorial I would like…
dali1985
  • 3,263
  • 13
  • 49
  • 68
0
votes
3 answers

Extract pointer to data from GPtrArray

I'm using GPtrArray structure to hold pointers to chunks of dynamically allocated memory. As I need as simple as possible and correct freeing of memory I set callback g_ptr_array_new_with_free_func () which will free one element of pointer array.…
likern
  • 3,744
  • 5
  • 36
  • 47
0
votes
1 answer

RRDTOOL configure script not picking up glib-2.0

I'm trying to build rrdtool-1.4.8 on a machine with CentOS 4.1, and when I run the configure script, despite adding -I/usr/include/glib-2.0 and -I/usr/lib64/glib-2.0/include to CPPFLAGS: # ./configure --disable-tcl --disable-python…
SidR
  • 2,964
  • 1
  • 18
  • 32
0
votes
1 answer

How to read a unicode file line by line using glib

There are tons of example of reading unicode file in C, but could not find anything specific to using glib library in a platform independent way. I am totally newbie in this stuff (coming from .net world). My requirement is to read a Unicode file…
Anindya Chatterjee
  • 5,824
  • 13
  • 58
  • 82
0
votes
1 answer

Modifying the Unity Piratebay Scope to open URI with a torrent streamer instead of the default client

Honestly don't entirely know what I am doing but I am trying to make the Pirate Bay Scope open its results with Acestream Player. One of the problems being Acestream doesn't know how to handle magnetic links. The original code, which follows, uses…
0
votes
1 answer

Using a GList datatype in python function via SWIG

I'm create a python script which calls some C functions via SWIG. I haven't had a problem calling most functions, but one particular function takes a GList datatype as an argument: The C function is defined along the along the lines of: void…
Loftx
  • 1,760
  • 4
  • 29
  • 50
0
votes
1 answer

GLib program compile error

I am trying to learn glib programming to see the flow when I create an object using g_object_new() but get this error when I compile, need some tips, what am I doing wrong with G_DEFINE_TYPE (line 25)? gcc -Wall `pkg-config --cflags --libs glib-2.0`…
user2399453
  • 2,930
  • 5
  • 33
  • 60
0
votes
2 answers

GIOChannel sometimes it reads sometimes not

Here is piece of my code. I will explain the problem right after. GIOStatus ret; GError *err = NULL; gchar *msg; gsize *len; ret = g_io_channel_read_chars (koncentrator, &msg, 13, &len, err); printf ("Read %u bytes: %hx\n", len, msg); My device…
Marek
  • 1,413
  • 2
  • 20
  • 36
0
votes
1 answer

g_array_sort() called but not sorting

This is my code : gint compare_ulong_function (gconstpointer a, gconstpointer b) { return *(unsigned long *)a - *(unsigned long *)b; } GArray* build_priority_queue(unsigned char* const input_data, unsigned int const input_size) { …
Juskie
  • 67
  • 1
  • 12
0
votes
1 answer

Unittesting with glib results in segfault with g_test_fail()

I have been trying out glib for unittesting and have run into trouble. I am interested for a way to not abort the remaining part of the test if a single part fails. I have been trying to do this using g_test_fail() which works but results in a…
Kenneth
  • 1,167
  • 1
  • 13
  • 26