]> sjero.net Git - wget/blob - src/utils.h
[svn] Generalize connect_with_timeout into run_with_timeout.
[wget] / src / utils.h
1 /* Declarations for utils.c.
2    Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3
4 This file is part of GNU Wget.
5
6 GNU Wget is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 GNU Wget is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Wget; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
19
20 #ifndef UTILS_H
21 #define UTILS_H
22
23 enum accd {
24    ALLABS = 1
25 };
26
27 /* A linked list of strings.  The list is ordered alphabetically.  */
28 typedef struct _slist
29 {
30   char *string;
31   struct _slist *next;
32 } slist;
33
34 struct hash_table;
35
36 struct file_memory {
37   char *content;
38   long length;
39   int mmap_p;
40 };
41
42 struct wget_timer;
43
44 char *time_str PARAMS ((time_t *));
45 char *datetime_str PARAMS ((time_t *));
46
47 #ifdef DEBUG_MALLOC
48 void print_malloc_debug_stats ();
49 #endif
50
51 char *xstrdup_lower PARAMS ((const char *));
52 int count_char PARAMS ((const char *, char));
53
54 char *strdupdelim PARAMS ((const char *, const char *));
55 char **sepstring PARAMS ((const char *));
56 int frontcmp PARAMS ((const char *, const char *));
57 char *pwd_cuserid PARAMS ((char *));
58 void fork_to_background PARAMS ((void));
59
60 void touch PARAMS ((const char *, time_t));
61 int remove_link PARAMS ((const char *));
62 int file_exists_p PARAMS ((const char *));
63 int file_non_directory_p PARAMS ((const char *));
64 int make_directory PARAMS ((const char *));
65 char *unique_name PARAMS ((const char *));
66 char *file_merge PARAMS ((const char *, const char *));
67
68 int acceptable PARAMS ((const char *));
69 int accdir PARAMS ((const char *s, enum accd));
70 char *suffix PARAMS ((const char *s));
71 int match_tail PARAMS ((const char *, const char *));
72
73 int has_html_suffix_p PARAMS ((const char *));
74
75 char *read_whole_line PARAMS ((FILE *));
76 struct file_memory *read_file PARAMS ((const char *));
77 void read_file_free PARAMS ((struct file_memory *));
78
79 void free_vec PARAMS ((char **));
80 char **merge_vecs PARAMS ((char **, char **));
81 slist *slist_append PARAMS ((slist *, const char *));
82 slist *slist_prepend PARAMS ((slist *, const char *));
83 slist *slist_nreverse PARAMS ((slist *));
84 int slist_contains PARAMS ((slist *, const char *));
85 void slist_free PARAMS ((slist *));
86
87 void string_set_add PARAMS ((struct hash_table *, const char *));
88 int string_set_contains PARAMS ((struct hash_table *, const char *));
89 void string_set_free PARAMS ((struct hash_table *));
90 void free_keys_and_values PARAMS ((struct hash_table *));
91
92 char *legible PARAMS ((long));
93 char *legible_very_long PARAMS ((VERY_LONG_TYPE));
94 int numdigit PARAMS ((long));
95 char *number_to_string PARAMS ((char *, long));
96
97 struct wget_timer *wtimer_allocate PARAMS ((void));
98 struct wget_timer *wtimer_new PARAMS ((void));
99 void wtimer_delete PARAMS ((struct wget_timer *));
100 void wtimer_reset PARAMS ((struct wget_timer *));
101 long wtimer_elapsed PARAMS ((struct wget_timer *));
102 long wtimer_granularity PARAMS ((void));
103
104 char *html_quote_string PARAMS ((const char *));
105
106 int determine_screen_width PARAMS ((void));
107 int random_number PARAMS ((int));
108
109 int run_with_timeout PARAMS ((long, void (*) (void *), void *));
110
111 #endif /* UTILS_H */