Utilities

Name

Utilities -- Random misc utilities to manipulate OAF_ServerInfo structures.

Synopsis


#include <liboaf/liboaf.h>


struct      OAF_Property;
struct      OAF_PropertyValue;
enum        OAF_PropertyType;
OAF_Property* oaf_server_info_prop_find     (OAF_ServerInfo *server,
                                             const char *prop_name);
struct      OAFActivationInfo;
char*       oaf_actinfo_stringify           (const OAFActivationInfo *actinfo);
OAFActivationInfo* oaf_servinfo_to_actinfo  (const OAF_ServerInfo *servinfo);
OAFActivationInfo* oaf_actid_parse          (const OAF_ActivationID actid);
void        oaf_actinfo_free                (OAFActivationInfo *actinfo);
OAF_ServerInfo* OAF_ServerInfo_duplicate    (const OAF_ServerInfo *original);

Description

Details

struct OAF_Property

   typedef struct
   {
      CORBA_char *name;
      OAF_PropertyValue v;
   }
   OAF_Property;


struct OAF_PropertyValue

   typedef struct
   {
      OAF_PropertyType _d;
      union
      {
	 CORBA_char *value_string;
	 CORBA_double value_number;
	 CORBA_boolean value_boolean;
	 GNOME_stringlist value_stringv;
      }
      _u;
   }
   OAF_PropertyValue;


enum OAF_PropertyType

   typedef enum
   {
      OAF_P_STRING,
      OAF_P_NUMBER,
      OAF_P_BOOLEAN,
      OAF_P_STRINGV
   }
   OAF_PropertyType;


oaf_server_info_prop_find ()

OAF_Property* oaf_server_info_prop_find     (OAF_ServerInfo *server,
                                             const char *prop_name);

Tries to find a server with the given property. Returns NULL if not found.

server : the server where to seek the data.
prop_name : the data to seek in the server.
Returns : a pointer to the OAF_Property structure.


struct OAFActivationInfo

typedef struct
{
	char *iid;		/* Implementation ID */
	char *user;		/* You owe this field to boc */
	char *host;		/* DNS name or IP address */
	char *domain;		/* This is not a DNS domain, but an activation domain */
} OAFActivationInfo;


oaf_actinfo_stringify ()

char*       oaf_actinfo_stringify           (const OAFActivationInfo *actinfo);

Serializes actinfo into a char *. Should be freed with g_free().

actinfo : the OAFActivationInfo to flatten.
Returns : the serialized version of actinfo.


oaf_servinfo_to_actinfo ()

OAFActivationInfo* oaf_servinfo_to_actinfo  (const OAF_ServerInfo *servinfo);

This function converts a OAF_ServerInfo structure to a OAFActivationInfo structure. The returned structure should be freed with oaf_actinfo_free.

servinfo : An array of OAF_ServerInfo structures.
Returns : a newly allocated initialized OAFActivationInfo structure.


oaf_actid_parse ()

OAFActivationInfo* oaf_actid_parse          (const OAF_ActivationID actid);

Returns a pointer to a newly allocated OAFActivationInfo structure (to be freed with oaf_actinfo_free) initialized with the data of actid.

actid : the activation id structure.
Returns : the OAFActivationInfo corresponding to actid.


oaf_actinfo_free ()

void        oaf_actinfo_free                (OAFActivationInfo *actinfo);

Frees actinfo.

actinfo : the OAFActivationInfo structure to free.


OAF_ServerInfo_duplicate ()

OAF_ServerInfo* OAF_ServerInfo_duplicate    (const OAF_ServerInfo *original);

The return value should befreed with CORBA_free().

original : ServerInfo to copy.
Returns : a newly allocated copy of original.