separate out libpsargs
This commit is contained in:
parent
51fec46387
commit
c39523fff4
1
libpsargs/Makefile
Normal file
1
libpsargs/Makefile
Normal file
@ -0,0 +1 @@
|
|||||||
|
libpsargs.o:
|
@ -1,6 +1,6 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h> /* size_t */
|
||||||
|
|
||||||
#include "psargs.h"
|
#include "libpsargs.h"
|
||||||
|
|
||||||
/* Test string containing { c, '\0' } without iteration.
|
/* Test string containing { c, '\0' } without iteration.
|
||||||
* Theoretically saves a little bit of time compared to strcmp(3). */
|
* Theoretically saves a little bit of time compared to strcmp(3). */
|
||||||
@ -54,3 +54,5 @@ corresponding_arg(char **arg, char l, char r){
|
|||||||
|
|
||||||
return arg;
|
return arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef SCMPFLAT
|
@ -1,6 +1,3 @@
|
|||||||
#if !defined _PSARGS_H
|
|
||||||
# define _PSARGS_H
|
|
||||||
|
|
||||||
/* pscat(1) and pspipe(1) arguments are flanked by { '[', '\0' } and
|
/* pscat(1) and pspipe(1) arguments are flanked by { '[', '\0' } and
|
||||||
* { ']', '\0' }. Nesting is allowed to facilitate nesting of pscat(1) and
|
* { ']', '\0' }. Nesting is allowed to facilitate nesting of pscat(1) and
|
||||||
* pspipe(1). This checks to make sure grouping symbols in args are balanced.
|
* pspipe(1). This checks to make sure grouping symbols in args are balanced.
|
||||||
@ -18,5 +15,3 @@ int check_arg(char **args, char l, char r);
|
|||||||
* Returns the location of the argument with the corresponding left grouping
|
* Returns the location of the argument with the corresponding left grouping
|
||||||
* symbol within argv. */
|
* symbol within argv. */
|
||||||
char **corresponding_arg(char **arg, char l, char r);
|
char **corresponding_arg(char **arg, char l, char r);
|
||||||
|
|
||||||
#endif
|
|
@ -1,11 +1,11 @@
|
|||||||
pscat: pscat.o psargs.o
|
pscat: pscat.o ../libpsargs/libpsargs.o
|
||||||
$(CC) $(CFLAGS) -g -o pscat psargs.o pscat.o
|
$(CC) $(CFLAGS) -g -o pscat ../libpsargs/libpsargs.o pscat.o
|
||||||
|
|
||||||
pscat.o: pscat.c
|
pscat.o: pscat.c
|
||||||
$(CC) $(CFLAGS) -c -o pscat.o pscat.c
|
$(CC) $(CFLAGS) -c -I../libpsargs -o pscat.o pscat.c
|
||||||
|
|
||||||
psargs.o: psargs.c
|
../libpsargs/libpsargs.o:
|
||||||
$(CC) $(CFLAGS) -c -o psargs.o psargs.c
|
$(MAKE) -C ../libpsargs
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o pscat
|
rm -f *.o pscat
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <sys/types.h> /* <sys/wait.h> */
|
#include <sys/types.h> /* <sys/wait.h> */
|
||||||
#include <sys/wait.h> /* wait(2) */
|
#include <sys/wait.h> /* wait(2) */
|
||||||
|
|
||||||
#include "psargs.h"
|
#include "libpsargs.h"
|
||||||
|
|
||||||
static char *program_name = "pscat";
|
static char *program_name = "pscat";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user