File: str.h

package info (click to toggle)
cdcd 0.6.6-11
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,112 kB
  • ctags: 440
  • sloc: ansic: 4,911; sh: 2,142; makefile: 29
file content (69 lines) | stat: -rw-r--r-- 2,320 bytes parent folder | download | duplicates (4)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
cdcd - Command Driven CD player
Copyright (C) 1998-99 Tony Arcieri
Copyright (C) 2001, 2002, 2003 Fabrice Bauzac

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef STR_H
#define STR_H

#include <stdarg.h>

/* TODO: We could explain how the functions work in .h's too.  For
   now, see str.c.  */

int strnlower (char *dest, const char *src, int len);
int strncasestr (const char *haystack, int haystacklen,
		 const char *needle, int needlelen);
#if ! defined(HAVE_STRCASESTR)
const char *strcasestr (const char *haystack, const char *needle);
#endif

struct pprintfd
{
  int col;			/* Cursor column.  */
  int liad;			/* Predicate: last is a dot?  */
};

/*

  These printf-like functions do word breaking.  MAXCOL is the column
  number at which the cursor can go at most (e.g. for 80-columns
  displays, it should be 79 (*)).  PPD is the current status: cursor
  position, and whether the last word terminated with a '.' (this is
  important in order to put an extra space after the end of a
  sentence).  FMT is the usual format string.

  (*) If the cursor went to position 80, thus after having written 80
  characters on the line, the cursor would jump to the next line,
  desynchronizing from pprintf's idea of the cursor position.

*/

void pprintf (int maxcol, char *fmt, ...);
void vpprintf (int maxcol, char *fmt, va_list v);
void pdprintf (int maxcol, struct pprintfd *ppd, char *fmt, ...);
void vpdprintf (int maxcol, struct pprintfd *ppd, char *fmt, va_list v);

char **cv2v0 (int argc, char **argv);
void freev0 (char **v);
char **my_tokenize (char *s);
char *quote_armor (char *s, char q);
char *unquote_armor (char *s);
char **unquote_params (char **argv);

#endif /* STR_H */