#include <stdio.h>
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <glob.h>
#include <string.h>
#include <assert.h>
#include "env.c"
#include <stdlib.h>
Defines | |
#define | BIO_FIND_SET(p, q) (strcpy(buffer,(p)), strcat(buffer,"/"), strcat(buffer,(q))); |
#define | BIO_FIND_CHK(p) |
Functions | |
void | bio_find (const char const *in_query, char *result) |
#define BIO_FIND_CHK | ( | p | ) |
{ \ long glb_res = glob(p,0,NULL,&glb); \ if (glb_res != 0 && glb_res != (long)GLOB_NOMATCH) \ fprintf(stderr,"bio_find: glb fail: %s\n",p), exit(1); \ for (g_count = 0; g_count < (long)glb.gl_pathc; g_count++) { \ st_res = stat((glb.gl_pathv[g_count]),&st); \ if (!st_res) { \ if (!S_ISDIR(st.st_mode)) { \ strncpy(result,glb.gl_pathv[g_count],PATH_MAX); \ free(bio_path); \ globfree(&glb); \ return; \ } \ } \ } \ globfree(&glb); \ } \
#define BIO_FIND_SET | ( | p, | |||
q | ) | (strcpy(buffer,(p)), strcat(buffer,"/"), strcat(buffer,(q))); |
void bio_find | ( | const char const * | in_query, | |
char * | result | |||
) |