File: mystring.h

package info (click to toggle)
prayer 1.3.5-dfsg1-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,596 kB
  • sloc: ansic: 43,163; makefile: 817; sh: 445; perl: 166
file content (78 lines) | stat: -rw-r--r-- 2,327 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
70
71
72
73
74
75
76
77
78
/* $Cambridge: hermes/src/prayer/lib/mystring.h,v 1.5 2011/11/09 14:44:20 dpc22 Exp $ */
/************************************************
 *    Prayer - a Webmail Interface              *
 ************************************************/

/* Copyright (c) University of Cambridge 2000 - 2008 */
/* See the file NOTICE for conditions of use and distribution. */

/* Some Basic utility functions */

char *string_itoa(struct pool *pool, unsigned long value);
char *string_itoa_tmp(unsigned long value);
BOOL string_isnumber(char *s);
BOOL ishex(char value);
unsigned long hex(char value);

BOOL string_atom_has_special(char *s);
char *string_atom_quote(struct pool *pool, char *s);

BOOL string_filename_valid(char *s);
char *string_prune(struct pool *pool, char *s, unsigned long maxlen);

char *string_trim_whitespace(char *string);

char *string_left(struct pool *p, char *string, unsigned long count);

BOOL string_isspace(char c);
BOOL string_iseol(char c);
char *string_next_token(char **sp);
char *string_get_token(char **sp);
BOOL string_skip_token(char **sp);

char *string_ustr(char *s, char *name);
char *string_get_value(char **sp);

char *string_next_line(char **sp);
char *string_get_line(char **sp);
char *string_get_lws_line(char **sp, BOOL squeeze);

char *string_canon_decode(char *string);
char *string_canon_encode(struct pool *pool, char *arg);

char *string_canon_path_encode(struct pool *pool, char *dir, char *file);
char *string_url_encode(struct pool *pool, char *arg);
char *string_url_decode(char *string);
char *string_url_decode_component(char **tp, char sep);

char *string_filename_encode(struct pool *pool, char *arg);

void string_malloc(void **ptr, unsigned long size);
void string_strdup(char **ptr, char *string);
void string_free(void **ptr);

char *string_ucase(char *s);
char *string_lcase(char *s);

BOOL string_has8bit(char *s0);
void string_strip8bit(char *s0);

void *
string_base64_decode(unsigned char *src,unsigned long srcl,unsigned long *len);

unsigned char *
string_qprint_decode(unsigned char *src,unsigned long srcl,
                     unsigned long *len);

char *string_expand(struct pool *pool, struct assoc *h, char *s);

char *
string_expand_crlf(struct pool *pool, char *s);

void
string_strip_crlf(char *s);

char *
string_email_split(struct pool *pool, char *s);