diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-02-19 22:50:50 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-02-19 22:50:50 +0100 |
| commit | a985af97b7a1e208ea0379308cc0e03db28787dc (patch) | |
| tree | 37f9b73217fb2312dda89879617b449d671fc010 /generators-replace-table.h | |
| parent | 2330399247af870aa4a20db27011f86bd977b436 (diff) | |
| download | cataract-a985af97b7a1e208ea0379308cc0e03db28787dc.tar.xz | |
Introduce tag replace table, part I.
Diffstat (limited to 'generators-replace-table.h')
| -rw-r--r-- | generators-replace-table.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/generators-replace-table.h b/generators-replace-table.h new file mode 100644 index 0000000..5646e5b --- /dev/null +++ b/generators-replace-table.h @@ -0,0 +1,53 @@ +/* Cataract - Static web photo gallery generator + * Copyright (C) 2009 Tomas Bzatek <tbzatek@users.sourceforge.net> + * + * 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 2 + * of the License, or 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include <glib.h> + + +typedef GHashTable ReplaceTable; + +/* + * write_html_album: process album and index template files + * + * template_src = template file of the album/index + * dst = save generated file as + * items = array of items in the album/index + * + */ +ReplaceTable *replace_table_new (); + +void replace_table_free (ReplaceTable *table); + + +/* + * replace_table_add_key: add tag/value pair to replace + * + * tag, value will be referenced inside + * + */ +void replace_table_add_key (ReplaceTable *table, const gchar *tag, const gchar *value); +void replace_table_add_key_int (ReplaceTable *table, const gchar *tag, gint value); + +/* + * replace_table_process: process buffer and replace all tags filled in the replace table + * + * - reallocates source buffer + * + */ +void replace_table_process (gchar **buffer, ReplaceTable *table); + |
