omtk - a platform independent GUI toolkit

Documentation

 

Dictionary

Structures

typedef struct OmtkDictionary

typedef struct
{
} OmtkDictionary;

You shouldn't access this structure directly, because it may change.

Macros

OMTK_DICTIONARY_FOREACH()

#define OMTK_DICTIONARY_FOREACH(dict, key, object)

Functions

omtk_dictionary_create()

OmtkDictionary *omtk_dictionary_create(void);

Creates a new dictionary. A dictionary is something like a list with key-object pairs, for example:

                           OmtkDictionary
                      ------------------------
Key (here: month):        1     2     3   ...
Object (here: income):   4500  4000  4250 ...

omtk_dictionary_object_add()

void omtk_dictionary_object_add(OmtkDictionary *dictionary, void *key, \
    void *object);

Adds a new key-object pair to the dictionary.

Example:

omtk_dictionary_object_add(dict, (void *)1, (void *)4500);

omtk_dictionary_object_get()

int omtk_dictionary_object_get(OmtkDictionary *dict, void *key, void **object);

Stores the object of key in object.

Example:

int x;
if (omtk_dictionary_object_get(dict, (void *)2, &x))
  printf("The income was %d dollars.\n", x);

omtk_dictionary_rewind()

void omtk_dictionary_rewind(OmtkDictionary *dict);

omtk_dictionary_next()

int omtk_dictionary_next(OmtkDictionary *dict, void **key, void **object);

omtk_dictionary_count()

int omtk_dictionary_count(OmtkDictionary *dict);

omtk_dictionary_print()

void omtk_dictionary_print(OmtkDictionary *dict);

omtk_dictionary_free()

void omtk_dictionary_free(OmtkDictionary *dict);

You have to call this function to free the dictionary.



Zurück zu www.eggdrop.ch | Back to www.eggdrop.ch

Last update: 20.02.04

Copyright (C) 2004, 2005 by Thomas "tom" Steinacher <tom at eggdrop.ch>

SourceForge.net Logo Valid HTML 4.0!