S60 Open C
Introduction to Glib

Introduction to Glib

Table of Contents

Using exported global variables for Glib

 


Using exported global variables for Glib

Glib on Linux has many global variables like g_idle_funcs exported from the .so file. Symbian OS does not support exporting global variables from the DLL. Therefore, the global variable of glib cannot be exported and hence used directly.

The users must include the header glib_global.h for libglib global variables and gobject_global.h for libgobject global variables. The other two DLLs - libgmodule and libgthread - do not have any exported global variables.

NOTE! The header must be included only after all the other headers in the file.

The following example code snippet explains the usage. This is a code that prints the version of glib being used.

The variables listed below are libglib global variables:
  • glib_major_version
  • glib_minor_version
  • glib_micro_version
#include <stdio.h>
#include <glib.h>
#include <glib_global.h> // Always include as the last include 


int main()
{
    /* glib_major_version,glib_minor_version and 
     * glib_micro_version are libglib global variables
     */
    printf("The version of glib that you are using is %d.%d.%d",
            glib_major_version,glib_minor_version,glib_micro_version);
    getchar();
    return 0;
}

Give feedback of this section


©Nokia 2007

Back to top


This material, including documentation and any related computer programs, is protected by copyright controlled by Nokia. All rights are reserved. Copying, including reproducing, storing, adapting or translating, any or all of this material requires the prior written consent of Nokia. This material also contains confidential information, which may not be disclosed to others without the prior written consent of Nokia.

Nokia is a registered trademark of Nokia Corporation. S60 and logo is a trademark of Nokia Corporation. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. Other company and product names mentioned herein may be trademarks or tradenames of their respective owners.