/* $Id$ */ /* * Cantus Tag Editor * Copyright © 2002-2004 by Samuel Abels * Copyright © 2007 by Tim Huetz * * 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, or * (at your option) any later version. * * 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, see **/ #ifdef HAVE_CONFIG_H # include #endif #ifndef HAVE_CANTUSHASHVALUE_H #define HAVE_CANTUSHASHVALUE_H #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct { int type; void *value; } CantusHashValue; // Common for all containers. CantusHashValue *new_value(void); CantusHashValue *value_duplicate(CantusHashValue *hvalue); void value_delete(CantusHashValue *hvalue); int value_get_type(CantusHashValue *hvalue); void value_set(CantusHashValue *hvalue, int type, void *value); // Integer container. void value_set_int(CantusHashValue *hvalue, int value); int value_get_int(CantusHashValue *hvalue); CantusHashValue *value_duplicate_int(CantusHashValue *hvalue); // Bool container. void value_set_bool(CantusHashValue *hvalue, gboolean value); gboolean value_get_bool(CantusHashValue *hvalue); CantusHashValue *value_duplicate_bool(CantusHashValue *hvalue); // Pointer container. void value_set_pointer(CantusHashValue *hvalue, void *value); void *value_get_pointer(CantusHashValue *hvalue); CantusHashValue *value_duplicate_pointer(CantusHashValue *hvalue); // Char container. void value_set_char(CantusHashValue *hvalue, const gchar *value); const gchar *value_get_char(CantusHashValue *hvalue); CantusHashValue *value_duplicate_char(CantusHashValue *hvalue); #ifdef __cplusplus } #endif #endif