GT 4.0 Component Guide to Public Interfaces: C Common Libraries

1. Semantics and syntax of APIs

1.1. Component API

See the C API pages for other API documentation on globus_common.

1.2. Internationalization Infrastructure

The Globus Toolkit C Common Library now has optional infrastructure support for internationalization, which is used by GridFTP and its dependencies (pre-ws authorization/authentication and XIO).

This means that user-presented strings are wrapped in a lookup function, which, if the globus_i18n module is installed and the GLOBUS_I18N environment variable is set to "YES", will lookup the string in a resource bundle using ICU4C. If GLOBUS_I18N is set to "NO", or the globus_i18n module is not installed, or the string value cannot be found in the resource bundle, the default string (exactly what was being looked up) is returned.

1.3. Developer Information

There are two functions that are used for string lookup.

The first is the preferred function; you supply a module descriptor and the string that you want to look up:

globus_common_i18n_get_string(
                  globus_module_descriptor_t * module,
                        char * key);

The second function is used if you need to look up a particular locale. A NULL value for locale will look up from the default locale:

globus_common_i18n_get_string_by_key(
                       char * locale,
                       char * resource_name,
                       char * key);

Typically, one or more macros will be defined on a per-module basis that supply the module descriptor, to reduce clutter in the code. Within the toolkit, these are typically _???SL where ??? are some mnemonic for the module in question (for example _GCSL is defined for globus_common).

The resource bundles used for the string lookups are created using ICU4C (see IBM documentation on Resource Bundles).

Our resource bundles are very simple; they contain simply a set of keys and strings. The key is actually the string itself: it is hashed using the globus_hashtable_string_hash function, then converted to contain only invariant characters ( #!@[]^`{|}~ are converted to '_'). See globus_i18n_resource_init.c in the globus_i18n source for an example of creating keys.

While resource bundles for the Globus Toolkit are not by default created as part of the build process nor distributed in our binary distributions, there is a tool distributed with the globus_i18n package that makes them simple to construct.

Invoking globus-i18n-resource-create <module name> from the top level directory of a built (or at least configured) source package will generate a resource bundle for that package which can then be moved to $GLOBUS_LOCATION/share/i18n/.

globus-i18n-resource-create is part of the globus_i18n package, and will be installed if --enable-i18n was given as a configure option to the installer. globus-i18n-resource-create uses globus-i18n-resource-init and genrb from ICU4C to create the resource bundles.

Resource bundles must be installed in $GLOBUS_LOCATION/share/i18n/.

2. Semantics and syntax of the WSDL

There is no support for this type of interface.

3. Command-line tools

There are no command line interfaces to the C common libraries.

4. Overview of Graphical User Interface

There is no support for this type of interface.

5. Semantics and syntax of domain-specific interface

There is no support for this type of interface.

6. Configuration interface

6.1. Configuration overview

There is no configuration interface to the C common libraries.

7. Environment variable interface

  • GLOBUS_ERROR_VERBOSE=1 can be set to enable verbose error messages.
  • GLOBUS_ERROR_OUTPUT=1 can be set to enable output of all errors (including some that should be ignored).