using comma separated strings instead of string arrays...
This commit is contained in:
@ -3,4 +3,6 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void files_exist(const char *const *f, size_t len);
|
||||
char *files_exist(const char *f);
|
||||
|
||||
void free_str(char *s);
|
||||
|
14
ctest/test.c
14
ctest/test.c
@ -1,15 +1,15 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
extern void files_exist(const char *const *f, size_t len);
|
||||
extern char *files_exist(const char *f);
|
||||
extern void free_str(char *s);
|
||||
|
||||
int main(int argc, char const* argv[])
|
||||
{
|
||||
const char *a[2];
|
||||
a[0] = "Hello";
|
||||
a[1] = "World!";
|
||||
files_exist(a, 2);
|
||||
char *world = "/home/nathan/Downloads/hackerman.jpg,/home/nathan/x.txt";
|
||||
char *chunk = files_exist(world);
|
||||
printf("C: %s", chunk);
|
||||
free_str(chunk);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user