mightymandel v16

GPU-based Mandelbrot set explorer

metadata.h File Reference

(v16)

#include <stdbool.h>
+ Include dependency graph for metadata.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct metadatametadata_new ()
 Create a new empty metadata structure.
void metadata_delete (struct metadata *s)
 Deleta a metadata structure.
const char * metadata_lookup (struct metadata *s, const char *key)
 Look up a key in the metadata.
void metadata_update (struct metadata *s, const char *key, const char *value)
 Update a key value pair in the metadata.
void metadata_remove (struct metadata *s, const char *key)
 Remove a key from the metadata.
int metadata_strlen (const struct metadata *s, const char *prefix)
 Find the length of the metadata concatenated to a string.
bool metadata_string (const struct metadata *s, const char *prefix, char *string, int length)
 Concatenate the metadata to a string.

Function Documentation

void metadata_delete ( struct metadata s)

Deleta a metadata structure.

Parameters
sThe metadata structure.

Definition at line 31 of file metadata.c.

References metadata::head, metadata_node::key, metadata_node::next, metadata_node::prev, and metadata_node::value.

Referenced by collect_metadata_to_string().

+ Here is the caller graph for this function:

const char* metadata_lookup ( struct metadata s,
const char *  key 
)

Look up a key in the metadata.

If the key is found, return the value, otherwise 0.

Parameters
sThe metadata structure.
keyThe key.
Returns
The value, or 0.

Definition at line 55 of file metadata.c.

References metadata_find(), and metadata_node::value.

+ Here is the call graph for this function:

struct metadata* metadata_new ( )
read

Create a new empty metadata structure.

Returns
A new empty metadata structure.

Definition at line 24 of file metadata.c.

References metadata::head, metadata_node::next, metadata_node::prev, and metadata::tail.

Referenced by collect_metadata_to_string().

+ Here is the caller graph for this function:

void metadata_remove ( struct metadata s,
const char *  key 
)

Remove a key from the metadata.

If the key is found, remove it and its value.

Parameters
sThe metadata structure.
keyThe key.

Definition at line 79 of file metadata.c.

References metadata_node::key, metadata_find(), metadata_node::next, metadata_node::prev, and metadata_node::value.

+ Here is the call graph for this function:

bool metadata_string ( const struct metadata s,
const char *  prefix,
char *  string,
int  length 
)

Concatenate the metadata to a string.

Parameters
sThe metadata structure.
prefixA prefix to prepend to each line.
stringA buffer to write into.
lengthThe length of the buffer.
Returns
true if there was enough space, false otherwise.

Definition at line 101 of file metadata.c.

References metadata::head, metadata_node::key, metadata_node::next, and metadata_node::value.

Referenced by collect_metadata_to_string().

+ Here is the caller graph for this function:

int metadata_strlen ( const struct metadata s,
const char *  prefix 
)

Find the length of the metadata concatenated to a string.

Parameters
sThe metadata structure.
prefixA prefix to prepend to each line.
Returns
The length.

Definition at line 91 of file metadata.c.

References metadata::head, metadata_node::key, metadata_node::next, and metadata_node::value.

Referenced by collect_metadata_to_string().

+ Here is the caller graph for this function:

void metadata_update ( struct metadata s,
const char *  key,
const char *  value 
)

Update a key value pair in the metadata.

If the key is found, replace the value. Otherwise append the key value pair.

Parameters
sThe metadata structure.
keyThe key. Must not contain white space.
valueThe value. Must not contain newlines.

Definition at line 63 of file metadata.c.

References metadata_node::key, metadata_find(), metadata_node::next, metadata_node::prev, metadata::tail, and metadata_node::value.

Referenced by collect_metadata_to_string().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: