/* $Id: tbl_data.c,v 1.41 2015/10/06 18:32:20 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2015 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software 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 THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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 "config.h"
#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "mandoc.h"
#include "mandoc_aux.h"
#include "libmandoc.h"
#include "libroff.h"
int, const char *, int *);
struct tbl_row *);
static void
{
int sv;
/* Advance to the next layout cell, skipping spanners. */
/*
* Stop processing when we reach the end of the available layout
* cells. This means that we have extra input.
*/
/* Skip to the end... */
while (p[*pos])
(*pos)++;
return;
}
else
break;
else
(*pos)++;
/*
* Check for a continued-data scope opening. This consists of a
* trailing `T{' at the end of the line. Subsequent lines,
* until a standalone `T}', are included in our cell.
*/
return;
}
if (p[*pos])
(*pos)++;
else
}
int
{
pos += 2;
pos++;
while (p[pos] != '\0')
return 1;
} else if (p[pos] == '\0') {
return 1;
}
/* Fallthrough: T} is part of a word. */
}
} else
return 0;
}
static struct tbl_span *
{
} else
return dp;
}
void
{
/*
* Choose a layout row: take the one following the last parsed
* span's. If that doesn't exist, use the last parsed span's.
* If there's no last parsed span, use the first row. Lastly,
* if the last span was a horizontal line, use the same layout
* (it doesn't "consume" the layout).
*/
case TBL_CELL_HORIZ:
continue;
case TBL_CELL_DHORIZ:
continue;
default:
break;
}
break;
}
} else
} else
if ( ! strcmp(p, "_")) {
return;
} else if ( ! strcmp(p, "=")) {
return;
}
while (p[pos] != '\0')
}