bio/find.c File Reference

#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 Documentation

#define BIO_FIND_CHK (  ) 
Value:
{                                                                   \
    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,
 )     (strcpy(buffer,(p)), strcat(buffer,"/"), strcat(buffer,(q)));

Function Documentation

void bio_find ( const char const *  in_query,
char *  result 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated on Sun Sep 11 09:40:45 2011 for NPSML by  doxygen 1.6.3