1
0

separate out libpsargs

This commit is contained in:
dtb 2023-09-12 22:05:20 -04:00
parent 51fec46387
commit c39523fff4
5 changed files with 11 additions and 13 deletions

1
libpsargs/Makefile Normal file
View File

@ -0,0 +1 @@
libpsargs.o:

View File

@ -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.
* 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;
}
#undef SCMPFLAT

View File

@ -1,6 +1,3 @@
#if !defined _PSARGS_H
# define _PSARGS_H
/* pscat(1) and pspipe(1) arguments are flanked by { '[', '\0' } 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.
@ -18,5 +15,3 @@ int check_arg(char **args, char l, char r);
* Returns the location of the argument with the corresponding left grouping
* symbol within argv. */
char **corresponding_arg(char **arg, char l, char r);
#endif

View File

@ -1,11 +1,11 @@
pscat: pscat.o psargs.o
$(CC) $(CFLAGS) -g -o pscat psargs.o pscat.o
pscat: pscat.o ../libpsargs/libpsargs.o
$(CC) $(CFLAGS) -g -o pscat ../libpsargs/libpsargs.o pscat.o
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
$(CC) $(CFLAGS) -c -o psargs.o psargs.c
../libpsargs/libpsargs.o:
$(MAKE) -C ../libpsargs
clean:
rm -f *.o pscat

View File

@ -4,7 +4,7 @@
#include <sys/types.h> /* <sys/wait.h> */
#include <sys/wait.h> /* wait(2) */
#include "psargs.h"
#include "libpsargs.h"
static char *program_name = "pscat";