glib

MD5 routines that are GLib friendly?

Does anyone know of an MD5/SHA1/etc routine that is easily used with GLib (i.e. you can give it a GIOChannel, etc)? ...

GLib v APR pros and cons of each

I have a couple of hobby C programming projects that I would like to start. I am looking for an open source library that has a liberal license (I want credit, but pretty much anybody can use). The library needs to have strings better than the C standard library and some portable threading primitives. I am considering GLib and APR. Wh...

Material to learn GObject and Glib

I am comfortable with C. but need to learn GObject and Glib for gstreamer. All i found on net is Gobject reference manual. Its good but looking for tutorial for Gobject/Glib as the main focus is on gstreamer. So pls share any other resources to learn the glib and gobject. ...

GLib Hash Table Loop Problem

I am going to use GLib's Hash table implementation in a C program and just for now I am just experimenting with it. I wrote the following piece of code for testing: #include <glib.h> #include <stdlib.h> #include <stdint.h> #include <stdio.h> #include <string.h> int main(){ // Some codes and declerations here GHashTable *g_hash...

gtkmm: update gui from other thread?

I am using gtkmm (and glibmm), and I would like to update the GUI from another thread. I have followed the example on http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/thread_2dispatcher_8cc-example.html#_a1 but I have 2 questions: Instead of a Glib::MainLoop receiving the events, is it possible for a Gtk::Main (that runs my...

Is it possible for a default log handler in glib to be passed multiple log levels?

The glib GLogLevelFlags enum is defined as: typedef enum { /* log flags */ G_LOG_FLAG_RECURSION = 1 << 0, G_LOG_FLAG_FATAL = 1 << 1, /* GLib log levels */ G_LOG_LEVEL_ERROR = 1 << 2, /* always fatal */ G_LOG_LEVEL_CRITICAL = 1 << 3, G_LOG_LEVEL_WARNING = 1 << 4, ...

Are there multiple branches of Glib?

I'm trying to build Firefox from source and I'm getting hung up on some of the requirements. I'm trying to build libIDL, which requires glib. I got glib built and installed to /usr/local, but when I try and configure libIDL, I get a failure at: checking for LIBIDL... configure: error: Package requirements (glib-2.0 >= 2.4.0) were not m...

If I have two instances of Glib::IOChannel, they block until both written. What is the correct way to do this?

I have modified the example found here to use two io channels. None of the callbacks seem to be called before I have written to both channels. After that they are called individually when writing to the fifos. Am I forgetting something? Start the test program in one shell window. Write echo "abc" > testfifo1 in second shell window. -> ...

Absolute path of executable start directory

Hi, I am trying to figure out how to grab the start directory for my program. I am using C and have access to GLib. On the Linux side it is easy, g_get_current_directory as soon as the program is launched, and store this value for later use. I tried using the same method on windows but g_get_current_directory returns whatever %APPDATA% ...

Why can't I build a "hello world" for glib?

So here's the world's simplest glib program: #include <glib.h> I try to compile it with gcc test.c and I get: test.c:1:18: error: glib.h: No such file or directory So I make sure that I have the right packages: # dpkg -l | grep libglib ii libglib-perl 1:1.183-1 Perl inter...

g_slice_new doesn't accept my struct type

that is how I build it: gcc pkg-config --cflags --libs gtk+-2.0 -o spawn spawn_with_pipes.c In the snippet of example below, I get an error: syntax error before "Data - it refers to data= g_slice_new(Data); #include <gtk/gtk.h> typedef struct { /* Buffers that will display output */ GtkTextBuffer *out; GtkTextBuffer *err...

how can I create pipe and pass to g_io_channel_win32_new_fd

I'm using gtk on windows and I need an ability to create a pipe for communication between processes via g_io_channel_win32_new_fd. How do you do that on windows? ...

How to compile & use GLib with MinGW

I want to use the Gnome GLib in a Windows environment using the free MinGW compiler to develop in C. The problem is, I have absolutely no idea how to compile this library. Would any of you please explain what tools are needed to accomplish this and what instructions need to be followed? ...

C/Glib Memory Management [no dangling reference > whyy!??] {SOLVED}

Hi everybody I have a program that call a function with undefined arguments, like this: #include <stdargs.h> ... /* code */ int main () { GArray *garray = g_array_new (FALSE, FALSE, sizeof (char *)); /* the code above initialize the GArray, and say that the garray expect a pointer to char. */ function_name (garray, "arg2", "arg3...

Where can I find a good example GAsyncQueue usages between process and thread

Beyond explanation of GAsyncQueue I cannot find anything on how to use this data structure, examples, patterns. I am trying to use to as a IPC mechanism between thread and the main process. Can someone demonstrate it? Thanks ...

How to create a case insensitive Glib Hash Table?

Is there any simply way how to create a case insensitive (String -> String) Glib Hash Table? The result should fit this: GHashTable *table; //there should be definition of table g_hash_table_insert(table, "KeY", "Something"); //insert //every command should return the line in table g_hash_table_lookup(table, "Key"); g_hash_table_look...

I cant find any documentation for g_io_channel_win32_make_pollfd

Is there a documentation available for g_io_channel_win32_make_pollfd I want to use this function to create FDs on windows for IPC between main thread and the separate thread. It is only briefly mentioned here and doesn't really explain how to use it. I really need an example. thx ...

C/Glib Strings that should be freed by the caller. {SOLVED}

Hi, I am using glib, it has a lot of functions that return strings that should be freed myself.Can I, pass these functions to other functions? Example: function1 returns a string that must be freed for the caller. function2 returns a pointer to a string that must be freed also. gchar *string = function2(function1("something")); g_fre...

What are the numbers in glib errors and warnings?

(myapp:11228): GLib-CRITICAL **: g_date_strftime: assertion `slen > 0' failed What does the number after myapp mean? It doesn't correspond to any source-code line nor does its hex or binary interpretation correspond to a relevant location in the binary. The number has always mystified me and looking at the GLib source it appears that i...

build webkit on ubuntu 9.04

i have checked out webkit source code from they svn server, when i issued ./autogen, it gave me following error, checking for GLIB... configure: error: Package requirements (glib-2.0 >= 2.21.3 gobject-2.0 >= 2.0 gthread-2.0 >= 2.0) were not met: Requested 'glib-2.0 >= 2.21.3' but version of GLib is ...