]> git.cryptolib.org Git - avr-crypto-lib.git/blob - test_src/dbz_strings.h
adjusting test system uart reference
[avr-crypto-lib.git] / test_src / dbz_strings.h
1 /* dbz_strings.h */
2 /*
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
5  *    account managment.
6  *   Copyright (C) 2006, 2007, 2008, 2009  Daniel Otte (daniel.otte@rub.de)
7  *
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.
12  *
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.
17  *
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/>.
20  */
21
22
23 #ifndef DBZ_STRINGS_H_
24 #define DBZ_STRINGS_H_
25
26 /** \file dbz_strings.h
27  * \author  Daniel Otte
28  * \email   daniel.otte@rub.de
29  * \license GPLv3 or later
30  * \brief functions for handling of double-zero-terminated strings
31  * 
32  */
33
34 #include <stdint.h>
35 #include <avr/pgmspace.h>
36
37 /** \fn uint8_t dbz_strcount(const char *str)
38  * \brief count stings in dbz-terminated string
39  * 
40  * Count the single zero terminated strings in a 
41  * double terminated string
42  * \param str pointer to the double-zero-terminated string
43  */
44 uint8_t dbz_strcount(const char *str);
45
46 /** \fn void dbz_splitup(char *dbzstr, char** strings)
47  * \brief split up a dbz-terminated string
48  * 
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)
53  */
54 void dbz_splitup(char *dbzstr, char** strings);
55
56 /** \fn uint8_t dbz_strcount_P(PGM_P str)
57  * \brief count stings in dbz-terminated string in flash
58  * 
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
62  */
63 uint8_t dbz_strcount_P(PGM_P str);
64
65 /** \fn void dbz_splitup_P(PGM_P dbzstr, PGM_P *strings)
66  * \brief split up a dbz-terminated string in flash
67  * 
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)
72  */
73 void dbz_splitup_P(PGM_P dbzstr, PGM_P *strings);
74
75 #endif /*DBZ_STRINGS_H_*/