mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
Alte Stylesheets entfernt. Wir haben ja Themes.
Ne Menge Pakete geloescht, da wir nicht den Eindruck hatten, dass diese benutzt werden. Initscripts fuer Amavisd-new und Spamassassin gebaut. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@978 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
45
src/initscripts/init.d/amavisd
Normal file
45
src/initscripts/init.d/amavisd
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
########################################################################
|
||||
# Begin $rc_base/init.d/amavisd
|
||||
#
|
||||
# Description : Amavisd Init Script
|
||||
#
|
||||
# Authors : Michael Tremer (ms@ipfire.org)
|
||||
#
|
||||
# Version : 01.00
|
||||
#
|
||||
# Notes :
|
||||
#
|
||||
########################################################################
|
||||
|
||||
. /etc/sysconfig/rc
|
||||
. ${rc_functions}
|
||||
|
||||
case "${1}" in
|
||||
start)
|
||||
boot_mesg "Starting AMaViS Daemon..."
|
||||
loadproc /usr/bin/amavisd
|
||||
;;
|
||||
|
||||
stop)
|
||||
boot_mesg "Stopping AMaViS Daemon..."
|
||||
killproc /usr/bin/amavisd
|
||||
;;
|
||||
|
||||
restart)
|
||||
${0} stop
|
||||
sleep 1
|
||||
${0} start
|
||||
;;
|
||||
|
||||
status)
|
||||
statusproc /usr/bin/amavisd
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: ${0} {start|stop|restart|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# End $rc_base/init.d/amavisd
|
||||
45
src/initscripts/init.d/spamassasssin
Normal file
45
src/initscripts/init.d/spamassasssin
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
########################################################################
|
||||
# Begin $rc_base/init.d/spamassassin
|
||||
#
|
||||
# Description : Spamassassin Init Script
|
||||
#
|
||||
# Authors : Michael Tremer (ms@ipfire.org)
|
||||
#
|
||||
# Version : 01.00
|
||||
#
|
||||
# Notes :
|
||||
#
|
||||
########################################################################
|
||||
|
||||
. /etc/sysconfig/rc
|
||||
. ${rc_functions}
|
||||
|
||||
case "${1}" in
|
||||
start)
|
||||
boot_mesg "Starting Spamassassin Daemon..."
|
||||
loadproc -n 10 /usr/bin/spamd -d
|
||||
;;
|
||||
|
||||
stop)
|
||||
boot_mesg "Stopping Spamassassin Daemon..."
|
||||
killproc /usr/bin/spamd
|
||||
;;
|
||||
|
||||
restart)
|
||||
${0} stop
|
||||
sleep 1
|
||||
${0} start
|
||||
;;
|
||||
|
||||
status)
|
||||
statusproc /usr/bin/spamd
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: ${0} {start|stop|restart|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# End $rc_base/init.d/spamassassin
|
||||
@@ -1,72 +1,72 @@
|
||||
/* IPCop setup program.
|
||||
*
|
||||
* This program is distributed under the terms of the GNU General Public
|
||||
* Licence. See the file COPYING for details.
|
||||
*
|
||||
* $Id: domainname.c
|
||||
*
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
extern FILE *flog;
|
||||
extern char *mylog;
|
||||
|
||||
extern char **ctr;
|
||||
|
||||
extern int automode;
|
||||
|
||||
int handledomainname(void)
|
||||
{
|
||||
char domainname[STRING_SIZE] = "localdomain";
|
||||
struct keyvalue *kv = initkeyvalues();
|
||||
char *values[] = { domainname, NULL }; /* pointers for the values. */
|
||||
struct newtWinEntry entries[] =
|
||||
{ { "", &values[0], 0,}, { NULL, NULL, 0 } };
|
||||
int rc;
|
||||
int result;
|
||||
|
||||
if (!(readkeyvalues(kv, CONFIG_ROOT "/main/settings")))
|
||||
{
|
||||
freekeyvalues(kv);
|
||||
errorbox(ctr[TR_UNABLE_TO_OPEN_SETTINGS_FILE]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
findkey(kv, "DOMAINNAME", domainname);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
rc = newtWinEntries(ctr[TR_DOMAINNAME], ctr[TR_ENTER_DOMAINNAME],
|
||||
50, 5, 5, 40, entries, ctr[TR_OK], ctr[TR_CANCEL], NULL);
|
||||
|
||||
if (rc == 1)
|
||||
{
|
||||
strcpy(domainname, values[0]);
|
||||
if (!(strlen(domainname)))
|
||||
errorbox(ctr[TR_DOMAINNAME_CANNOT_BE_EMPTY]);
|
||||
else if (strchr(domainname, ' '))
|
||||
errorbox(ctr[TR_DOMAINNAME_CANNOT_CONTAIN_SPACES]);
|
||||
else if (strlen(domainname) != strspn(domainname,
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-."))
|
||||
errorbox(ctr[TR_DOMAINNAME_NOT_VALID_CHARS]);
|
||||
else
|
||||
{
|
||||
replacekeyvalue(kv, "DOMAINNAME", domainname);
|
||||
writekeyvalues(kv, CONFIG_ROOT "/main/settings");
|
||||
writehostsfiles();
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(values[0]);
|
||||
freekeyvalues(kv);
|
||||
|
||||
return result;
|
||||
}
|
||||
/* IPCop setup program.
|
||||
*
|
||||
* This program is distributed under the terms of the GNU General Public
|
||||
* Licence. See the file COPYING for details.
|
||||
*
|
||||
* $Id: domainname.c
|
||||
*
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
extern FILE *flog;
|
||||
extern char *mylog;
|
||||
|
||||
extern char **ctr;
|
||||
|
||||
extern int automode;
|
||||
|
||||
int handledomainname(void)
|
||||
{
|
||||
char domainname[STRING_SIZE] = "localdomain";
|
||||
struct keyvalue *kv = initkeyvalues();
|
||||
char *values[] = { domainname, NULL }; /* pointers for the values. */
|
||||
struct newtWinEntry entries[] =
|
||||
{ { "", &values[0], 0,}, { NULL, NULL, 0 } };
|
||||
int rc;
|
||||
int result;
|
||||
|
||||
if (!(readkeyvalues(kv, CONFIG_ROOT "/main/settings")))
|
||||
{
|
||||
freekeyvalues(kv);
|
||||
errorbox(ctr[TR_UNABLE_TO_OPEN_SETTINGS_FILE]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
findkey(kv, "DOMAINNAME", domainname);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
rc = newtWinEntries(ctr[TR_DOMAINNAME], ctr[TR_ENTER_DOMAINNAME],
|
||||
50, 5, 5, 40, entries, ctr[TR_OK], ctr[TR_CANCEL], NULL);
|
||||
|
||||
if (rc == 1)
|
||||
{
|
||||
strcpy(domainname, values[0]);
|
||||
if (!(strlen(domainname)))
|
||||
errorbox(ctr[TR_DOMAINNAME_CANNOT_BE_EMPTY]);
|
||||
else if (strchr(domainname, ' '))
|
||||
errorbox(ctr[TR_DOMAINNAME_CANNOT_CONTAIN_SPACES]);
|
||||
else if (strlen(domainname) != strspn(domainname,
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-."))
|
||||
errorbox(ctr[TR_DOMAINNAME_NOT_VALID_CHARS]);
|
||||
else
|
||||
{
|
||||
replacekeyvalue(kv, "DOMAINNAME", domainname);
|
||||
writekeyvalues(kv, CONFIG_ROOT "/main/settings");
|
||||
writehostsfiles();
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(values[0]);
|
||||
freekeyvalues(kv);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,76 +1,76 @@
|
||||
/* SmoothWall setup program.
|
||||
*
|
||||
* This program is distributed under the terms of the GNU General Public
|
||||
* Licence. See the file COPYING for details.
|
||||
*
|
||||
* (c) Lawrence Manning, 2001
|
||||
* Stuff for setting the hostname.
|
||||
*
|
||||
* $Id: hostname.c,v 1.6.2.1 2004/04/14 22:05:41 gespinasse Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
extern FILE *flog;
|
||||
extern char *mylog;
|
||||
|
||||
extern char **ctr;
|
||||
|
||||
extern int automode;
|
||||
|
||||
int handlehostname(void)
|
||||
{
|
||||
char hostname[STRING_SIZE] = "";
|
||||
struct keyvalue *kv = initkeyvalues();
|
||||
char *values[] = { hostname, NULL }; /* pointers for the values. */
|
||||
struct newtWinEntry entries[] =
|
||||
{ { "", &values[0], 0,}, { NULL, NULL, 0 } };
|
||||
int rc;
|
||||
int result;
|
||||
|
||||
if (!(readkeyvalues(kv, CONFIG_ROOT "/main/settings")))
|
||||
{
|
||||
freekeyvalues(kv);
|
||||
errorbox(ctr[TR_UNABLE_TO_OPEN_SETTINGS_FILE]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
strcpy(hostname, SNAME);
|
||||
findkey(kv, "HOSTNAME", hostname);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
rc = newtWinEntries(ctr[TR_HOSTNAME], ctr[TR_ENTER_HOSTNAME],
|
||||
50, 5, 5, 40, entries, ctr[TR_OK], ctr[TR_CANCEL], NULL);
|
||||
|
||||
if (rc == 1)
|
||||
{
|
||||
strcpy(hostname, values[0]);
|
||||
if (!(strlen(hostname)))
|
||||
errorbox(ctr[TR_HOSTNAME_CANNOT_BE_EMPTY]);
|
||||
else if (strchr(hostname, ' '))
|
||||
errorbox(ctr[TR_HOSTNAME_CANNOT_CONTAIN_SPACES]);
|
||||
else if (strlen(hostname) != strspn(hostname,
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-"))
|
||||
errorbox(ctr[TR_HOSTNAME_NOT_VALID_CHARS]);
|
||||
else
|
||||
{
|
||||
replacekeyvalue(kv, "HOSTNAME", hostname);
|
||||
writekeyvalues(kv, CONFIG_ROOT "/main/settings");
|
||||
writehostsfiles();
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(values[0]);
|
||||
freekeyvalues(kv);
|
||||
|
||||
return result;
|
||||
}
|
||||
/* SmoothWall setup program.
|
||||
*
|
||||
* This program is distributed under the terms of the GNU General Public
|
||||
* Licence. See the file COPYING for details.
|
||||
*
|
||||
* (c) Lawrence Manning, 2001
|
||||
* Stuff for setting the hostname.
|
||||
*
|
||||
* $Id: hostname.c,v 1.6.2.1 2004/04/14 22:05:41 gespinasse Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
extern FILE *flog;
|
||||
extern char *mylog;
|
||||
|
||||
extern char **ctr;
|
||||
|
||||
extern int automode;
|
||||
|
||||
int handlehostname(void)
|
||||
{
|
||||
char hostname[STRING_SIZE] = "";
|
||||
struct keyvalue *kv = initkeyvalues();
|
||||
char *values[] = { hostname, NULL }; /* pointers for the values. */
|
||||
struct newtWinEntry entries[] =
|
||||
{ { "", &values[0], 0,}, { NULL, NULL, 0 } };
|
||||
int rc;
|
||||
int result;
|
||||
|
||||
if (!(readkeyvalues(kv, CONFIG_ROOT "/main/settings")))
|
||||
{
|
||||
freekeyvalues(kv);
|
||||
errorbox(ctr[TR_UNABLE_TO_OPEN_SETTINGS_FILE]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
strcpy(hostname, SNAME);
|
||||
findkey(kv, "HOSTNAME", hostname);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
rc = newtWinEntries(ctr[TR_HOSTNAME], ctr[TR_ENTER_HOSTNAME],
|
||||
50, 5, 5, 40, entries, ctr[TR_OK], ctr[TR_CANCEL], NULL);
|
||||
|
||||
if (rc == 1)
|
||||
{
|
||||
strcpy(hostname, values[0]);
|
||||
if (!(strlen(hostname)))
|
||||
errorbox(ctr[TR_HOSTNAME_CANNOT_BE_EMPTY]);
|
||||
else if (strchr(hostname, ' '))
|
||||
errorbox(ctr[TR_HOSTNAME_CANNOT_CONTAIN_SPACES]);
|
||||
else if (strlen(hostname) != strspn(hostname,
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-"))
|
||||
errorbox(ctr[TR_HOSTNAME_NOT_VALID_CHARS]);
|
||||
else
|
||||
{
|
||||
replacekeyvalue(kv, "HOSTNAME", hostname);
|
||||
writekeyvalues(kv, CONFIG_ROOT "/main/settings");
|
||||
writehostsfiles();
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(values[0]);
|
||||
freekeyvalues(kv);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,134 +1,134 @@
|
||||
/* SmoothWall setup program.
|
||||
*
|
||||
* This program is distributed under the terms of the GNU General Public
|
||||
* Licence. See the file COPYING for details.
|
||||
*
|
||||
* (c) Lawrence Manning, 2001
|
||||
* Stuff for setting the timezone.
|
||||
*
|
||||
* $Id: timezone.c,v 1.4.2.1 2004/04/14 22:05:41 gespinasse Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
extern FILE *flog;
|
||||
extern char *mylog;
|
||||
|
||||
extern char **ctr;
|
||||
|
||||
extern int automode;
|
||||
|
||||
#define MAX_FILENAMES 5000
|
||||
#define ZONEFILES "/usr/share/zoneinfo/posix"
|
||||
|
||||
static int filenamecount;
|
||||
static char *filenames[MAX_FILENAMES];
|
||||
static char *displaynames[MAX_FILENAMES];
|
||||
|
||||
static int process(char *prefix, char *path);
|
||||
static int cmp(const void *s1, const void *s2);
|
||||
|
||||
int handletimezone(void)
|
||||
{
|
||||
int c;
|
||||
int choice;
|
||||
char *temp;
|
||||
struct keyvalue *kv = initkeyvalues();
|
||||
int rc;
|
||||
int result;
|
||||
char timezone[STRING_SIZE];
|
||||
|
||||
filenamecount = 0;
|
||||
|
||||
process(ZONEFILES, "");
|
||||
filenames[filenamecount] = NULL;
|
||||
qsort(filenames, filenamecount, sizeof(char *), cmp);
|
||||
|
||||
for (c = 0; filenames[c]; c++)
|
||||
{
|
||||
displaynames[c] = malloc(STRING_SIZE);
|
||||
if ((temp = strstr(filenames[c], ZONEFILES)))
|
||||
strcpy(displaynames[c], temp + strlen(ZONEFILES) + 1);
|
||||
else
|
||||
strcpy(displaynames[c], filenames[c]);
|
||||
}
|
||||
displaynames[c] = NULL;
|
||||
|
||||
if (!(readkeyvalues(kv, CONFIG_ROOT "/main/settings")))
|
||||
{
|
||||
freekeyvalues(kv);
|
||||
errorbox(ctr[TR_UNABLE_TO_OPEN_SETTINGS_FILE]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
strcpy(timezone, ZONEFILES "/Europe/Berlin");
|
||||
findkey(kv, "TIMEZONE", timezone);
|
||||
|
||||
choice = 0;
|
||||
for (c = 0; filenames[c]; c++)
|
||||
{
|
||||
if (strcmp(timezone, filenames[c]) == 0)
|
||||
choice = c;
|
||||
}
|
||||
|
||||
rc = newtWinMenu(ctr[TR_TIMEZONE], ctr[TR_TIMEZONE_LONG], 50, 5, 5, 6, displaynames, &choice,
|
||||
ctr[TR_OK], ctr[TR_CANCEL], NULL);
|
||||
|
||||
strcpy(timezone, filenames[choice]);
|
||||
|
||||
if (rc != 2)
|
||||
{
|
||||
replacekeyvalue(kv, "TIMEZONE", timezone);
|
||||
writekeyvalues(kv, CONFIG_ROOT "/main/settings");
|
||||
unlink("/etc/localtime");
|
||||
link(timezone, "/etc/localtime");
|
||||
result = 1;
|
||||
}
|
||||
else
|
||||
result = 0;
|
||||
|
||||
for (c = 0; filenames[c]; c++)
|
||||
{
|
||||
free(filenames[c]);
|
||||
free(displaynames[c]);
|
||||
}
|
||||
freekeyvalues(kv);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static int process(char *prefix, char *path)
|
||||
{
|
||||
DIR *dir;
|
||||
struct dirent *de;
|
||||
char newpath[PATH_MAX];
|
||||
|
||||
snprintf(newpath, PATH_MAX, "%s%s", prefix, path);
|
||||
|
||||
if (!(dir = opendir(newpath)))
|
||||
{
|
||||
if (filenamecount > MAX_FILENAMES)
|
||||
return 1;
|
||||
|
||||
filenames[filenamecount] = (char *) strdup(newpath);
|
||||
filenamecount++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
while ((de = readdir(dir)))
|
||||
{
|
||||
if (de->d_name[0] == '.') continue;
|
||||
snprintf(newpath, PATH_MAX, "%s/%s", path, de->d_name);
|
||||
process(prefix, newpath);
|
||||
}
|
||||
closedir(dir);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Small wrapper for use with qsort(). */
|
||||
static int cmp(const void *s1, const void *s2)
|
||||
{
|
||||
return (strcmp(* (char **) s1, * (char **) s2));
|
||||
}
|
||||
/* SmoothWall setup program.
|
||||
*
|
||||
* This program is distributed under the terms of the GNU General Public
|
||||
* Licence. See the file COPYING for details.
|
||||
*
|
||||
* (c) Lawrence Manning, 2001
|
||||
* Stuff for setting the timezone.
|
||||
*
|
||||
* $Id: timezone.c,v 1.4.2.1 2004/04/14 22:05:41 gespinasse Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
extern FILE *flog;
|
||||
extern char *mylog;
|
||||
|
||||
extern char **ctr;
|
||||
|
||||
extern int automode;
|
||||
|
||||
#define MAX_FILENAMES 5000
|
||||
#define ZONEFILES "/usr/share/zoneinfo/posix"
|
||||
|
||||
static int filenamecount;
|
||||
static char *filenames[MAX_FILENAMES];
|
||||
static char *displaynames[MAX_FILENAMES];
|
||||
|
||||
static int process(char *prefix, char *path);
|
||||
static int cmp(const void *s1, const void *s2);
|
||||
|
||||
int handletimezone(void)
|
||||
{
|
||||
int c;
|
||||
int choice;
|
||||
char *temp;
|
||||
struct keyvalue *kv = initkeyvalues();
|
||||
int rc;
|
||||
int result;
|
||||
char timezone[STRING_SIZE];
|
||||
|
||||
filenamecount = 0;
|
||||
|
||||
process(ZONEFILES, "");
|
||||
filenames[filenamecount] = NULL;
|
||||
qsort(filenames, filenamecount, sizeof(char *), cmp);
|
||||
|
||||
for (c = 0; filenames[c]; c++)
|
||||
{
|
||||
displaynames[c] = malloc(STRING_SIZE);
|
||||
if ((temp = strstr(filenames[c], ZONEFILES)))
|
||||
strcpy(displaynames[c], temp + strlen(ZONEFILES) + 1);
|
||||
else
|
||||
strcpy(displaynames[c], filenames[c]);
|
||||
}
|
||||
displaynames[c] = NULL;
|
||||
|
||||
if (!(readkeyvalues(kv, CONFIG_ROOT "/main/settings")))
|
||||
{
|
||||
freekeyvalues(kv);
|
||||
errorbox(ctr[TR_UNABLE_TO_OPEN_SETTINGS_FILE]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
strcpy(timezone, ZONEFILES "/Europe/Berlin");
|
||||
findkey(kv, "TIMEZONE", timezone);
|
||||
|
||||
choice = 0;
|
||||
for (c = 0; filenames[c]; c++)
|
||||
{
|
||||
if (strcmp(timezone, filenames[c]) == 0)
|
||||
choice = c;
|
||||
}
|
||||
|
||||
rc = newtWinMenu(ctr[TR_TIMEZONE], ctr[TR_TIMEZONE_LONG], 50, 5, 5, 6, displaynames, &choice,
|
||||
ctr[TR_OK], ctr[TR_CANCEL], NULL);
|
||||
|
||||
strcpy(timezone, filenames[choice]);
|
||||
|
||||
if (rc != 2)
|
||||
{
|
||||
replacekeyvalue(kv, "TIMEZONE", timezone);
|
||||
writekeyvalues(kv, CONFIG_ROOT "/main/settings");
|
||||
unlink("/etc/localtime");
|
||||
link(timezone, "/etc/localtime");
|
||||
result = 1;
|
||||
}
|
||||
else
|
||||
result = 0;
|
||||
|
||||
for (c = 0; filenames[c]; c++)
|
||||
{
|
||||
free(filenames[c]);
|
||||
free(displaynames[c]);
|
||||
}
|
||||
freekeyvalues(kv);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static int process(char *prefix, char *path)
|
||||
{
|
||||
DIR *dir;
|
||||
struct dirent *de;
|
||||
char newpath[PATH_MAX];
|
||||
|
||||
snprintf(newpath, PATH_MAX, "%s%s", prefix, path);
|
||||
|
||||
if (!(dir = opendir(newpath)))
|
||||
{
|
||||
if (filenamecount > MAX_FILENAMES)
|
||||
return 1;
|
||||
|
||||
filenames[filenamecount] = (char *) strdup(newpath);
|
||||
filenamecount++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
while ((de = readdir(dir)))
|
||||
{
|
||||
if (de->d_name[0] == '.') continue;
|
||||
snprintf(newpath, PATH_MAX, "%s/%s", path, de->d_name);
|
||||
process(prefix, newpath);
|
||||
}
|
||||
closedir(dir);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Small wrapper for use with qsort(). */
|
||||
static int cmp(const void *s1, const void *s2)
|
||||
{
|
||||
return (strcmp(* (char **) s1, * (char **) s2));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user