3 * This file is part of AnonAccess, an access system which can be used
4 * to open door or doing other things with an anonymity featured
6 * Copyright (C) 2006, 2007, 2008, 2009 Daniel Otte (daniel.otte@rub.de)
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef DBZ_STRINGS_H_
24 #define DBZ_STRINGS_H_
26 /** \file dbz_strings.h
28 * \email daniel.otte@rub.de
29 * \license GPLv3 or later
30 * \brief functions for handling of double-zero-terminated strings
35 #include <avr/pgmspace.h>
37 /** \fn uint8_t dbz_strcount(const char *str)
38 * \brief count stings in dbz-terminated string
40 * Count the single zero terminated strings in a
41 * double terminated string
42 * \param str pointer to the double-zero-terminated string
44 uint8_t dbz_strcount(const char *str);
46 /** \fn void dbz_splitup(char *dbzstr, char** strings)
47 * \brief split up a dbz-terminated string
49 * Fills an array with pointers to the single terminated string
50 * in a double-zero-terminated string
51 * \param dbzstr pointer to the double-zero-terminated string
52 * \param strings pointer to the array of strings (char pointers)
54 void dbz_splitup(char *dbzstr, char** strings);
56 /** \fn uint8_t dbz_strcount_P(PGM_P str)
57 * \brief count stings in dbz-terminated string in flash
59 * Count the single zero terminated string in a
60 * double terminated string which is placed in flash (progmem)
61 * \param str pointer to the double-zero-terminated string in flash
63 uint8_t dbz_strcount_P(PGM_P str);
65 /** \fn void dbz_splitup_P(PGM_P dbzstr, PGM_P *strings)
66 * \brief split up a dbz-terminated string in flash
68 * Fills an array with pointers (PGM_P) to the single terminated string
69 * in a double-zero-terminated string which is placed in flash
70 * \param dbzstr pointer to the double-zero-terminated string in flash
71 * \param strings pointer to the array of strings (PGM_P)
73 void dbz_splitup_P(PGM_P dbzstr, PGM_P *strings);
75 #endif /*DBZ_STRINGS_H_*/