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

dbus - register object to remote on interface NULL

I have to deal with a binary blob dbus service/server which I need to connect to via dbus (session). The introspection of the interface is as following (obtained via gdbus-codegen). We register a function to the remote so we get notified if a…
drahnr
  • 6,782
  • 5
  • 48
  • 75
0
votes
1 answer

Check path equivalence using glib

I need do check the equivalence of two filepaths using glib. I did it with Qt long time ago, via reduction paths. But I can't find similar instruments in glib. Can someone suggest the common way to do this? Thanks
shved
  • 386
  • 1
  • 12
0
votes
2 answers

Very short code, but, failed to release memory

First, I insert key=str1,value=header_buff Second, I use str2 to lookup the pointer Third, I free the pointer which I malloc'd, but failed. Why? #include #include int main() { GHashTable *hash; ///define my hashtable char…
0
votes
1 answer

I can't get the result with g_hash_table_look_up()

I want to use string for key, and find my value, my value mustbe a pointer. #include #include int main() { GHashTable *hash_list; ///denfine my hashtable char str1[32]; sprintf(str1, "key"); char str2[32]; sprintf(str2,…
user2692266
0
votes
1 answer

Message queue with GLIB {issue in receiving message back after posting}

This is a very simple message queue that i am trying to understand I am able to post the message to the queue but when i am trying to receive the message back i am not receiving. Please guide what is the error. am a noob to…
Ragav
  • 942
  • 4
  • 19
  • 37
0
votes
1 answer

Qt Creator does not find functions inside library

I'm on Ubuntu 13.04 trying to use functions from the gsettingsschema.h library This is my .pro…
hytromo
  • 1,501
  • 2
  • 27
  • 57
0
votes
1 answer

Iterative folder read using C and GSList

I'm trying to create an iterative program that reads all the folders from a specific starting folder using GSList and C. I haven't managed to find what the flaw in my code is for now. The problem I'm having is that it reads each folder and all of…
Ravior
  • 1
  • 2
0
votes
1 answer

error using g_idle_add() in C++, same thing works in C

I need to use g_idle_add() in a C++ code, where a GSourceFunc is another class function and have to pass some arguments also. Have seen its use in C code only. So may be I am not getting the things right While using g_idle_add() in a C code is…
user2618142
  • 1,035
  • 2
  • 18
  • 35
0
votes
1 answer

How do I get a specific error from g_poll?

The g_poll() function returns -1 "on error or if the call was interrupted". (See: https://developer.gnome.org/glib/2.28/glib-The-Main-Event-Loop.html#g-poll). If g_poll returns -1 how do I determine if this was because the call was interrupted vs.…
benno
  • 2,077
  • 1
  • 19
  • 23
0
votes
1 answer

GLib/GObject intercept errors / structure code for testing, reporting or debugging

Situation: I am working on upgrading some code at my work place. The code is for a process that is based off of GMime. We currently use GMime 2.2 and I recently upgraded our code to use GMime 2.4. The proces runs just fine and doesn't crash, but I…
Dodzi Dzakuma
  • 1,406
  • 2
  • 21
  • 39
0
votes
1 answer

g_main_loop never returns

I am using Gegl to render some output and to create a window and GLib to create an event loop. The problem I am struggling with is that the g_main_loop_run() function never returns (that is when I close the application widow (or hit Alt+F4), the…
jcxz
  • 1,226
  • 2
  • 12
  • 25
0
votes
1 answer

How to get /etc/ directory

I have function: gint isfileexists(gchar *filename) { struct stat buffer; gint i = stat(filename, &buffer); if (i == 0) { return 1; } return 0; } and if I call them: isfileexists("/etc/myfile") it search "myfile" in "/home/user/etc/myfile".…
Nips
  • 13,162
  • 23
  • 65
  • 103
0
votes
1 answer

glib main loop hangs after Popen

I'm trying to build a script that logs the window title when a different window becomes active. This is what I have so far: import glib import dbus from dbus.mainloop.glib import DBusGMainLoop def notifications(bus, message): if…
henk
  • 288
  • 1
  • 5
  • 17
0
votes
1 answer

Solaris configuration file parser

Is there any api in Solaris for configuration file parsing. Currently I am using GLib's GKeyFile Parser in Linux, but need to port the application into Solaris. Don't want to compile glib on Solaris.
Ibrar Ahmed
  • 1,039
  • 1
  • 13
  • 25
0
votes
1 answer

Ustring error (during printing)

I want to parse UTF-8 file to ustring, I read this file in str. There is an error: terminate called after throwing an instance of 'Glib::ConvertError'. What should I do? char* cs = (char*) malloc(sizeof(char) * str.length()); strcpy(cs,…
user1635327