You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
567 B

#include "modgmt_filters.h"
#include "modgmt_filter_headfoot.h"
int gmt_filter_default(int fd, std::string* res, void* p)
{
ssize_t br;
char buffer[4096];
do
{
br=read(fd,buffer,4096);
res->append(buffer,br);
} while(0!=br);
close(fd);
return 0;
}
int gmt_filter_headfoot(int fd, std::string* res, void* p)
{
yyscan_t scanner;
FILE* in;
in=fdopen(fd,"r");
gmt_filter_headfootlex_init_extra(res,&scanner);
gmt_filter_headfootset_in(in,scanner);
gmt_filter_headfootlex(scanner);
gmt_filter_headfootlex_destroy(scanner);
fclose(in);
return 0;
}