"SfR Fresh" - the SfR Freeware/Shareware Archive 
Member "gtkfind-1.1/gtkfind.h" of archive gtkfind-1.1.tar.gz:
As a special service "SfR Fresh" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting with prefixed line numbers.
Alternatively you can here view or download the uninterpreted source code file.
That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
1 /* gtkfind.h */
2 /* globals, prototypes, and macros for gtkfind */
3
4 /*
5 gtkfind - a graphical "find" program
6 Copyright (C) 1999 Matthew Grossman <mattg@oz.net>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23 #ifndef GTKFIND_H
24 #define GTKFIND_H
25
26 /*********************/
27 /* includes */
28
29 #include"config.h"
30
31 #include<stdlib.h>
32 #include<sys/param.h>
33 #include<sys/types.h>
34
35 #if defined(HAVE_DIRENT_H)
36 #include<dirent.h>
37 #endif
38 #if defined(HAVE_NDIR_H)
39 #include<ndir.h>
40 #endif
41 #if defined(HAVE_SYS_DIR_H)
42 #include<sys/dir.h>
43 #endif
44 #if defined(HAVE_SYS_NDIR_H)
45 #include<sys/ndir.h>
46 #endif
47
48 /* report that SGI and Solaris need this */
49 #ifdef HAVE_ALLOCA_H
50 #include<alloca.h>
51 #endif /* HAVE_ALLOCA_H */
52
53 #include<sys/stat.h>
54
55 #ifdef HAVE_UNISTD_H
56 #include<unistd.h>
57 #endif
58
59 #include<grp.h>
60 #include<pwd.h>
61 #include<time.h>
62 #ifdef TM_IN_SYS_TIME
63 #include<sys/time.h>
64 #endif
65
66 #include<ctype.h>
67 #include<string.h>
68
69 #include<errno.h>
70
71 /* for "major" and "minor" macros */
72 #if defined MAJOR_IN_MKDEV
73
74 #if defined HAVE_SYS_MKDEV_H
75 #include<sys/mkdev.h>
76 #elif defined HAVE_MKDEV_H
77 #include<mkdev.h>
78 #endif /* HAVE_SYS_MKDEV_H */
79
80 #elif defined MAJOR_IN_SYSMACROS
81 #include<sys/sysmacros.h>
82 #endif /* MAJOR_IN_MKDEV */
83
84 #include<stdarg.h> /* for print_error */
85
86 #include<gtk/gtk.h>
87
88 #include"flags.h"
89 #include"util.h"
90 #include"create.h"
91
92 /*********************/
93 /* globals */
94
95 GtkWidget *output_toplevel;
96 GtkWidget *output_text;
97 static time_t global_atime;
98 static time_t global_ctime;
99 static time_t global_mtime;
100
101
102 /*********************/
103 /* externs */
104
105 /* variables */
106
107 extern GtkWidget *toplevel;
108
109 extern GtkWidget *directory; /* the directory to search in */
110
111 extern GtkWidget *pattern; /* the file pattern to search for */
112 extern GtkWidget *content_pattern;
113
114 extern GtkWidget *shell_command; /* if we run a shell command, this is it */
115
116 extern GtkWidget *login_entry;
117 extern GtkWidget *group_entry;
118
119 extern GtkWidget *atime_month_spin, *atime_day_spin, *atime_year_spin,
120 *atime_hour_spin, *atime_minute_spin, *atime_second_spin;
121 extern GtkWidget *mtime_month_spin, *mtime_day_spin, *mtime_year_spin,
122 *mtime_hour_spin, *mtime_minute_spin, *mtime_second_spin;
123 extern GtkWidget *ctime_month_spin, *ctime_day_spin, *ctime_year_spin,
124 *ctime_hour_spin, *ctime_minute_spin, *ctime_second_spin;
125
126 extern GtkWidget *stop_button;
127 extern int stop_flag;
128
129 /* functions */
130
131 /* widgets.h */
132 extern void make_widgets();
133
134 /* glob.h */
135 extern char **glob_string(char *pattern, char *string, int copy_stringp);
136 extern void free_glob_registers(char **registers);
137 extern char **allocate_glob_registers();
138
139 /* gtk_print1.h */
140 extern void gtk_print1(gchar *str);
141
142 /*********************/
143 /* prototypes */
144
145
146 void quit(gpointer *quit_button);
147 void find(gpointer *find_button, gpointer *pattern);
148 void find_and_print(char *dir_name, char *text,
149 char *content_string, int recursep);
150
151 void set_globals();
152
153 int execute_shell_command(char **registers, char *full_file_name,
154 struct stat sbuf);
155 char *substitute_filename(char *target, char **registers);
156
157 char *get_search_directory(GtkWidget *directory);
158
159 int match_type(unsigned short mode);
160 int match_mode(unsigned short mode);
161 int set_uid_and_gid();
162 int match_owner(struct stat sbuf);
163
164 void reset_window_output_text();
165 void output_toplevel_delete();
166 void make_output_window();
167 void print_to_window(char *text);
168 void save_output_callback();
169 void save_output_cancel(GtkWidget *w, GtkFileSelection *filesel);
170 void save_output_ok(GtkWidget *w, GtkFileSelection *filesel);
171
172 int match_atime(time_t t);
173 int match_mtime(time_t t);
174 int match_ctime(time_t t);
175
176 time_t get_user_time(GtkWidget *month, GtkWidget *day, GtkWidget *year,
177 GtkWidget *hour, GtkWidget *minute, GtkWidget *second);
178
179 void set_find_to_abort(gpointer *find_button);
180 void reset_find_button(gpointer *find_button);
181
182 int sane_date_p(GtkWidget *month, GtkWidget *day, GtkWidget *year);
183 int set_global_dates();
184 char **match_filename(char *text, char *filename);
185 int match_contents(char *d_name, struct stat sbuf, char *content_string);
186
187 char *make_long_format(char *full_file_name, char *short_file_name,
188 struct stat sbuf);
189 void output_file_data(char *full_file_name, char *short_file_name,
190 struct stat sbuf);
191 void print_error(const char *format, ...);
192
193 int valid_uid_p(uid_t uid);
194 int valid_gid_p(gid_t gid);
195 void make_uidlist();
196 void make_gidlist();
197
198 #endif /* !GTKFIND_H */