#endif
}
-
-//! Check whether the file (opened by gmx_ffopen()) is a pipe.
-static bool is_pipe(FILE *fp)
-{
- tMPI_Thread_mutex_lock(&pstack_mutex);
-
- t_pstack *ps = pstack;
- while (ps != NULL)
- {
- if (ps->fp == fp)
- {
- tMPI_Thread_mutex_unlock(&pstack_mutex);
- return true;
- }
- ps = ps->prev;
- }
- tMPI_Thread_mutex_unlock(&pstack_mutex);
- return false;
-}
-
-
static FILE *uncompress(const char *fn, const char *mode)
{
FILE *fp;
}
}
-gmx_bool gmx_eof(FILE *fp)
-{
- char data[4];
- gmx_bool beof;
-
- if (is_pipe(fp))
- {
- return feof(fp);
- }
- else
- {
- if ((beof = fread(data, 1, 1, fp)) == 1)
- {
- gmx_fseek(fp, -1, SEEK_CUR);
- }
- return !beof;
- }
-}
-
static char *backup_fn(const char *file, int count_max)
{
/* Use a reasonably low value for countmax; we might