File: str.h

package info (click to toggle)
fitsh 0.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,768 kB
  • ctags: 4,050
  • sloc: ansic: 53,352; makefile: 1,120; sh: 25
file content (35 lines) | stat: -rw-r--r-- 1,400 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*****************************************************************************/
/* str.h								     */
/*****************************************************************************/

#ifndef	__STR_H_INCLUDED
#define	__STR_H_INCLUDED	1

/*****************************************************************************/

/* strkcpy():
   It works like strncpy() but ensures that 'out' is zero-terminated 
   (therefore, the length of 'out' is always _less_ than 'max').	     */
char *	strkcpy(char *out,char *in,int max);

/* strappend():
   Appends the string 'cat' to the dynamically allocated string 'string'.  
   'string' can be NULL, in this case, the function works like strdup().     */
int	strappend(char **string,char *cat);

/* strappendf():
   It is a combination of realloc(), strcat() and sprintf(). Appends the 
   printf-formatted argument 'format' to the dynamically allocated string
   'string'. It is a bit primitive, therefore use only if long-long strings
   could not occur (otherwise it also works, but can be slow).		     */
int	strappendf(char **string,char *format,...);

/* vstrappendf(): */
int	vstrappendf(char **string,char *format,va_list ap);

/*****************************************************************************/

#endif

/*****************************************************************************/