d9b1f9e68728d87e938c7a27e79f299c403c214f
[apps/madmutt.git] / lib-lib / str.h
1 /*
2  *  This program is free software; you can redistribute it and/or modify it
3  *  under the terms of the GNU General Public License as published by the Free
4  *  Software Foundation; either version 2 of the License, or (at your option)
5  *  any later version.
6  *
7  *  This program is distributed in the hope that it will be useful, but
8  *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9  *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
10  *  for more details.
11  *
12  *  You should have received a copy of the GNU General Public License along
13  *  with this program; if not, write to the Free Software Foundation, Inc.,
14  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  *  Copyright © 2006 Pierre Habouzit
17  */
18
19 #ifndef MUTT_LIB_LIB_STR_H
20 #define MUTT_LIB_LIB_STR_H
21
22 #include <string.h>
23 #include "../lib/str.h"
24
25 #include "mem.h"
26
27 static inline ssize_t m_strlen(const char *s) {
28     return s ? strlen(s) : 0;
29 }
30
31 static inline char* m_strdup(const char *s) {
32     return p_dupstr(s, m_strlen(s));
33 }
34
35 #endif /* MUTT_LIB_LIB_STR_H */