-static void _do_section(t_fileio *fio, int key, gmx_bool bRead, const char *src,
- int line)
-{
- char buf[STRLEN];
- gmx_bool bDbg;
-
- if (gmx_fio_getftp(fio) == efTPA)
- {
- if (!bRead)
- {
- gmx_fio_write_string(fio, itemstr[key]);
- bDbg = gmx_fio_getdebug(fio);
- gmx_fio_setdebug(fio, FALSE);
- gmx_fio_write_string(fio, comment_str[key]);
- gmx_fio_setdebug(fio, bDbg);
- }
- else
- {
- if (gmx_fio_getdebug(fio))
- {
- fprintf(stderr, "Looking for section %s (%s, %d)",
- itemstr[key], src, line);
- }
-
- do
- {
- gmx_fio_do_string(fio, buf);
- }
- while ((gmx_strcasecmp(buf, itemstr[key]) != 0));
-
- if (gmx_strcasecmp(buf, itemstr[key]) != 0)
- {
- gmx_fatal(FARGS, "\nCould not find section heading %s", itemstr[key]);
- }
- else if (gmx_fio_getdebug(fio))
- {
- fprintf(stderr, " and found it\n");
- }
- }
- }
-}
-
-#define do_section(fio, key, bRead) _do_section(fio, key, bRead, __FILE__, __LINE__)
-