added hooks for sort

This commit is contained in:
John Beppu 1999-12-22 17:57:31 +00:00
parent 38efa7902e
commit 019513a59f
6 changed files with 52 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 $ */

View File

@ -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
View File

@ -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 $ */