mirror of
https://github.com/sheumann/hush.git
synced 2024-10-29 20:27:40 +00:00
added hooks for sort
This commit is contained in:
parent
38efa7902e
commit
019513a59f
@ -184,6 +184,9 @@ static const struct Applet applets[] = {
|
||||
#ifdef BB_SLEEP //bin
|
||||
{"sleep", sleep_main},
|
||||
#endif
|
||||
#ifdef BB_SORT //bin
|
||||
{"sort", sort_main},
|
||||
#endif
|
||||
#ifdef BB_SYNC //bin
|
||||
{"sync", sync_main},
|
||||
#endif
|
||||
|
@ -184,6 +184,9 @@ static const struct Applet applets[] = {
|
||||
#ifdef BB_SLEEP //bin
|
||||
{"sleep", sleep_main},
|
||||
#endif
|
||||
#ifdef BB_SORT //bin
|
||||
{"sort", sort_main},
|
||||
#endif
|
||||
#ifdef BB_SYNC //bin
|
||||
{"sync", sync_main},
|
||||
#endif
|
||||
|
@ -64,6 +64,7 @@
|
||||
//#define BB_SFDISK
|
||||
#define BB_SED
|
||||
#define BB_SLEEP
|
||||
#define BB_SORT
|
||||
#define BB_SWAPONOFF
|
||||
#define BB_SYNC
|
||||
#define BB_SYSLOGD
|
||||
|
@ -90,6 +90,17 @@ line_newFromFile(FILE *src)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Line destructor */
|
||||
static Line *
|
||||
line_release(Line *self)
|
||||
{
|
||||
if (self->data) {
|
||||
free(self->data);
|
||||
free(self);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
/* Comparison */
|
||||
|
||||
@ -148,7 +159,16 @@ list_writeToFile(List *self, FILE* dst)
|
||||
static List *
|
||||
list_release(List *self)
|
||||
{
|
||||
return self;
|
||||
Line *i;
|
||||
Line *die;
|
||||
|
||||
i = self->head;
|
||||
while (i) {
|
||||
die = i;
|
||||
i = die->next;
|
||||
line_delete(die);
|
||||
}
|
||||
return self; /* bad poetry? */
|
||||
}
|
||||
|
||||
|
||||
@ -195,4 +215,4 @@ sort_main(int argc, char **argv)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* $Id: sort.c,v 1.2 1999/12/22 00:30:29 beppu Exp $ */
|
||||
/* $Id: sort.c,v 1.3 1999/12/22 17:57:31 beppu Exp $ */
|
||||
|
@ -113,6 +113,7 @@ extern int sh_main(int argc, char** argv);
|
||||
extern int sfdisk_main(int argc, char** argv);
|
||||
extern int sed_main(int argc, char** argv);
|
||||
extern int sleep_main(int argc, char** argv);
|
||||
extern int sort_main(int argc, char** argv);
|
||||
extern int swap_on_off_main(int argc, char** argv);
|
||||
extern int sync_main(int argc, char** argv);
|
||||
extern int syslogd_main(int argc, char **argv);
|
||||
|
24
sort.c
24
sort.c
@ -90,6 +90,17 @@ line_newFromFile(FILE *src)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Line destructor */
|
||||
static Line *
|
||||
line_release(Line *self)
|
||||
{
|
||||
if (self->data) {
|
||||
free(self->data);
|
||||
free(self);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
/* Comparison */
|
||||
|
||||
@ -148,7 +159,16 @@ list_writeToFile(List *self, FILE* dst)
|
||||
static List *
|
||||
list_release(List *self)
|
||||
{
|
||||
return self;
|
||||
Line *i;
|
||||
Line *die;
|
||||
|
||||
i = self->head;
|
||||
while (i) {
|
||||
die = i;
|
||||
i = die->next;
|
||||
line_delete(die);
|
||||
}
|
||||
return self; /* bad poetry? */
|
||||
}
|
||||
|
||||
|
||||
@ -195,4 +215,4 @@ sort_main(int argc, char **argv)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* $Id: sort.c,v 1.2 1999/12/22 00:30:29 beppu Exp $ */
|
||||
/* $Id: sort.c,v 1.3 1999/12/22 17:57:31 beppu Exp $ */
|
||||
|
Loading…
Reference in New Issue
Block a user