|
Image Demosaicking with Contour Stencils
|
Template substitution. More...

Go to the source code of this file.
Macros | |
| #define | LINE_BUFFER_SIZE 256 |
| Size of the line buffer for template substitution. More... | |
Functions | |
| int | FillTemplate (const char *OutputFilename, const char *TemplateFilename, char *Keys[], char *Subs[]) |
| Fill a template file according to key-substitution pairs. More... | |
| char ** | AddPair (char **Keys[], char **Subs[], char *Key, char *SubFormat,...) |
| Add a key-substitution pair to a key-substitution table. More... | |
| void | StringAppend (char **Str, const char *Format,...) |
| Append to a string with a printf format string. More... | |
| void | VStringAppend (char **Str, const char *Format, va_list Args) |
| Variable argument list (va_list) version of StringAppend() More... | |
| void | FreeStringArray (char *Strs[]) |
| Free an array of strings created with AddPair() More... | |
Template substitution.
Copyright (c) 2010-2011, Pascal Getreuer All rights reserved.
This program is free software: you can use, modify and/or redistribute it under the terms of the simplified BSD License. You should have received a copy of this license along this program. If not, see http://www.opensource.org/licenses/bsd-license.html.
Definition in file temsub.c.
| #define LINE_BUFFER_SIZE 256 |
| char** AddPair | ( | char ** | Keys[], |
| char ** | Subs[], | ||
| char * | Key, | ||
| char * | SubFormat, | ||
| ... | |||
| ) |
Add a key-substitution pair to a key-substitution table.
| Keys | the template keys, an array of strings |
| Subs | the corresponding substitutions, an array of strings |
| Key | the new key to add |
| SubFormat | format string for the corresponding substitution |
This routine allocates memory for adding the new strings. Use FreeStringArray() to free the memory.
Definition at line 186 of file temsub.c.


| int FillTemplate | ( | const char * | OutputFilename, |
| const char * | TemplateFilename, | ||
| char * | Keys[], | ||
| char * | Subs[] | ||
| ) |
Fill a template file according to key-substitution pairs.
| OutputFilename | the name of the filled output file |
| TemplateFilename | the name of the template file |
| Keys | the template keys, an array of strings |
| Subs | the corresponding substitutions, an array of strings |
Fills a template file by replacing strings of the form "${KEYNAME}" with the substitution specified in Subs. The functions AddPair() and StringAppend() can be used to build the Keys and Subs arrays.
Several key-substitution pairs are provided by default:
Definition at line 44 of file temsub.c.

| void FreeStringArray | ( | char * | Strs[] | ) |
| void StringAppend | ( | char ** | Str, |
| const char * | Format, | ||
| ... | |||
| ) |
| void VStringAppend | ( | char ** | Str, |
| const char * | Format, | ||
| va_list | Args | ||
| ) |
Variable argument list (va_list) version of StringAppend()
Definition at line 237 of file temsub.c.

1.8.3.1