/*
* Copyright (C) 2011 - 2015 Nominum, Inc.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose with or without fee is hereby granted,
* provided that the above copyright notice and this permission notice
* appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define ISC_BUFFER_USEINLINE
#include "datafile.h"
#include "log.h"
#include "os.h"
#include "util.h"
struct perf_datafile {
int pipe_fd;
int fd;
unsigned int maxruns;
unsigned int nruns;
};
static inline void
{
unsigned char *data;
*data = '\0';
}
{
perf_log_fatal("out of memory");
} else {
}
}
return dfile;
}
void
{
}
void
{
}
void
{
}
static void
{
} else {
perf_log_fatal("cannot reread input");
}
}
static isc_result_t
{
unsigned char *data;
ssize_t n;
-1);
if (result != ISC_R_SUCCESS)
return (result);
}
if (n < 0)
return (ISC_R_FAILURE);
return (ISC_R_SUCCESS);
}
static isc_result_t
{
const char *cur;
while (ISC_TRUE) {
/* Get the current line */
/*
* If the current line contains the rest of the buffer,
* we need to read more (unless the full file is cached).
*/
if (result != ISC_R_SUCCESS)
return (result);
}
return (ISC_R_EOF);
}
continue;
}
/* We now have a line. Advance the buffer past it. */
/* If the line is empty or a comment, we need to try again. */
break;
}
isc_buffer_putuint8(lines, 0);
return (ISC_R_SUCCESS);
}
{
const char *current;
goto done;
}
goto done;
}
}
}
if (result != ISC_R_SUCCESS) {
goto done;
}
if (is_update) {
while (ISC_TRUE) {
}
if (result != ISC_R_SUCCESS ||
break;
};
}
done:
return (result);
}
unsigned int
{
}