Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
212 dhylands 1
/****************************************************************************
2
*
3
*     Copyright (c) 2003 Dave Hylands
4
*           All Rights Reserved
5
*
6
*       Permission is granted to any individual or institution to use, copy, or
7
*       redistribute this software so long as it is not sold for profit, and that
8
*       this copyright notice is retained.
9
*
10
****************************************************************************/
11
/**
12
*
13
*  @file    Str.h
14
*
15
*  @brief   String Manipulation routines.
16
*
17
*  Definitions for a variety of string manipulation routine. These routines
18
*  are all bounded, to ensure that memory overwrites don't occur.
19
*
20
****************************************************************************/
21
/**
22
*  @defgroup   Str   String Manipulation
23
*
24
*  @brief   Provides a variety of string manipulation routines.
25
*/
26
 
27
// ---- Include Files -------------------------------------------------------
28
 
29
#if !defined( STR_H )
30
#define STR_H                 ///< Include Guard
31
 
32
#include <stddef.h>
33
#include <stdarg.h>
34
 
35
/**
36
 * @addtogroup Str
37
 * @{
38
 */
39
 
40
// ---- Constants and Types -------------------------------------------------
41
 
42
/**
43
 * Pointer to a function which outputs a single character. This function
44
 * is called by the strXPrintf()/vStrXPrintf() functions to output a
45
 * character.
46
 */
47
 
48
typedef int (*StrXPrintfFunc)( void *outParm, int ch );
49
 
50
/**
51
 * Maintains data used by StrTok
52
 */
53
 
54
// ---- Variable Externs ----------------------------------------------------
55
// ---- Function Prototypes -------------------------------------------------
56
 
57
char *StrMaxCpy( char *dst, const char *src, size_t maxLen );
58
char *StrMaxCat( char *dst, const char *src, size_t maxLen );
59
 
60
int StrPrintf( char *outStr, int maxLen, const char *fmt, ... );
61
int vStrPrintf( char *outStr, int maxLen, const char *fmt, va_list args );
62
 
63
int StrXPrintf( StrXPrintfFunc func, void *userParm, const char *fmt, ... );
64
int vStrXPrintf( StrXPrintfFunc func, void *userParm, const char *fmt, va_list args );
65
 
66
#endif // STR_H
67