slibc
string_templates_.hpp
Go to the documentation of this file.
00001 /* Copyright (C) 2011-2012 SBA Research gGmbh
00002 
00003    This file is part of the Slibc Library.
00004 
00005    The Slibc Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The Slibc library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the Slibc Library; if not, see
00017    <http://www.gnu.org/licenses/>.  
00018 */
00048 #ifndef SLIBC_STRING_TEMPLATES_HPP
00049 #define SLIBC_STRING_TEMPLATES_HPP
00050 
00051 #include "./string.h"
00052 
00065 template<rsize_t s1max> errno_t strcpy_s(char (&s1)[s1max], const char * restrict s2)
00066 {
00067         return strcpy_s(s1, s1max, s2);
00068 }
00069 
00084 template<rsize_t s1max> errno_t strncpy_s(char (&s1)[s1max], const char * restrict s2, rsize_t n)
00085 {
00086         return strncpy_s(s1, s1max, s2, n);
00087 }
00088 
00089 
00102 template<rsize_t s1max> errno_t strcat_s(char (&s1)[s1max],
00103                                                                                  const char * restrict s2)
00104 {
00105   return strcat_s(s1, s1max, s2);
00106 }
00107 
00121 template<rsize_t s1max> errno_t strncat_s(char (&s1)[s1max],
00122                                                                                  const char * restrict s2, rsize_t n)
00123 {
00124   return strncat_s(s1, s1max, s2, n);
00125 }
00126 
00127 #endif