[go: up one dir, main page]

File: duhtag.c

package info (click to toggle)
libdumb 1%3A0.9.3-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, jessie, jessie-kfreebsd, stretch
  • size: 1,056 kB
  • ctags: 1,270
  • sloc: ansic: 9,403; makefile: 290; sh: 23
file content (38 lines) | stat: -rw-r--r-- 1,370 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*  _______         ____    __         ___    ___
 * \    _  \       \    /  \  /       \   \  /   /       '   '  '
 *  |  | \  \       |  |    ||         |   \/   |         .      .
 *  |  |  |  |      |  |    ||         ||\  /|  |
 *  |  |  |  |      |  |    ||         || \/ |  |         '  '  '
 *  |  |  |  |      |  |    ||         ||    |  |         .      .
 *  |  |_/  /        \  \__//          ||    |  |
 * /_______/ynamic    \____/niversal  /__\  /____\usic   /|  .  . ibliotheque
 *                                                      /  \
 *                                                     / .  \
 * duhtag.c - Function to return the tags stored      / / \  \
 *            in a DUH struct (typically author      | <  /   \_
 *            information).                          |  \/ /\   /
 *                                                    \_  /  > /
 * By entheh.                                           | \ / /
 *                                                      |  ' /
 *                                                       \__/
 */

#include <string.h>

#include "dumb.h"
#include "internal/dumb.h"



const char *duh_get_tag(DUH *duh, const char *key)
{
	int i;
	ASSERT(key);
	if (!duh || !duh->tag) return NULL;

	for (i = 0; i < duh->n_tags; i++)
		if (strcmp(key, duh->tag[i][0]) == 0)
			return duh->tag[i][1];

	return NULL;
}