/*
*  RAL -- Rubrica Addressbook Library
*  file: types.h
*  
*  Copyright (C) Nicola Fragale <nicolafragale@libero.it>
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 3 of the License
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#ifndef _R_LOOKUP_TABLE_H
#define _R_LOOKUP_TABLE_H

#include <glib.h>


typedef struct _lookuptable {
  gchar* str;       /* a string                             */
  gchar* lbl;       /* the string translation               */
  gint   val;       /* the value associated to the string   */
} RLookupTable;


typedef struct _pairtable {
  gchar* str;       /* a string                       */
  gint   left;      /* first value associated to str  */
  gint   right;     /* second value associated to str */
} RPairTable;


gint   r_lookup_table_str2enum (RLookupTable *table, gchar* str);
gchar* r_lookup_table_enum2str (RLookupTable *table, gint value);

gchar* r_lookup_table_str2lbl  (RLookupTable *table, gchar* str);
gchar* r_lookup_table_enum2lbl (RLookupTable *table, gint value);


gint   r_lookup_table_get_pair_left  (RPairTable *table, gint item);
gint   r_lookup_table_get_pair_right (RPairTable *table, gint item);
gchar* r_lookup_table_pair2str       (RPairTable *table, gint item);

#endif
