ELinks 0.18.0
Data Structures | Macros | Functions
tables.c File Reference
#include <stdlib.h>
#include <string.h>
#include "elinks.h"
#include "document/html/parser/parse.h"
#include "document/html/parser/table.h"
#include "document/html/parser.h"
#include "document/html/renderer.h"
#include "document/html/tables.h"
#include "document/options.h"
#include "terminal/draw.h"
#include "util/color.h"
#include "util/conv.h"
#include "util/error.h"
#include "util/memory.h"
#include "util/string.h"
#include "document/html/internal.h"
Include dependency graph for tables.c:

Data Structures

struct  table_frames
 

Macros

#define has_vline_width(table, col)   (get_vline_width(table, col) >= 0)
 
#define has_hline_width(table, row)   (get_hline_width(table, row) >= 0)
 
#define H_FRAME_POSITION(table, col, row)   frame[0][get_frame_pos(col, (table)->cols, row, (table)->rows)]
 
#define V_FRAME_POSITION(table, col, row)   frame[1][get_frame_pos(row, (table)->rows, col, (table)->cols)]
 

Functions

static void get_table_frames (struct table *table, struct table_frames *result)
 
int get_table_indent (struct html_context *html_context, struct table *table)
 
static struct part * format_cell (struct html_context *html_context, struct table *table, struct table_cell *cell, struct document *document, int x, int y, int width)
 
static void get_cell_width (struct html_context *html_context, char *start, char *end, int cellpadding, int width, int a, int *min, int *max, int link_num, int *new_link_num)
 
static void get_cell_widths (struct html_context *html_context, struct table *table)
 
static void distribute_values (int *values, int count, int wanted, int *limits)
 
static int get_vline_width (struct table *table, int col)
 
static int get_hline_width (struct table *table, int row)
 
static int get_column_widths (struct table *table)
 
static void get_table_width (struct table *table)
 
static int apply_stretch_method (struct table *table, int widths[], int max_widths[], int stretch_method, int max_cols_width)
 
static int stretch_columns (struct table *table, int widths[], int max_widths[], int spare_width, int total_width)
 
static void distribute_widths (struct table *table, int width)
 
int get_table_cellpadding (struct html_context *html_context, struct table *table)
 
void check_table_widths (struct html_context *html_context, struct table *table)
 
static void check_table_height (struct table *table, struct table_frames *frames, int y)
 
static int get_table_caption_height (struct html_context *html_context, struct table *table)
 
static int get_table_real_height (struct table *table)
 
void get_table_heights (struct html_context *html_context, struct table *table)
 
void draw_table_cell (struct table *table, int col, int row, int x, int y, struct html_context *html_context)
 
void draw_table_cells (struct table *table, int x, int y, struct html_context *html_context)
 
static int get_frame_pos (int a, int a_size, int b, int b_size)
 
static void draw_frame_point (struct table *table, signed char *frame[2], int x, int y, int col, int row, struct html_context *html_context)
 
static void draw_frame_hline (struct table *table, signed char *frame[2], int x, int y, int col, int row, struct html_context *html_context)
 
static void draw_frame_vline (struct table *table, signed char *frame[2], int x, int y, int col, int row, struct html_context *html_context)
 
static int table_row_has_group (struct table *table, int row)
 
static void init_table_rules (struct table *table, signed char *frame[2])
 
void draw_table_frames (struct table *table, int indent, int y, struct html_context *html_context)
 
void draw_table_caption (struct html_context *html_context, struct table *table, int x, int y)
 
static void draw_table_bad_html (struct html_context *html_context, struct table *table)
 
void distribute_table_widths (struct table *table)
 
void format_table (char *attr, char *html, char *eof, char **end, struct html_context *html_context)
 

Macro Definition Documentation

◆ H_FRAME_POSITION

#define H_FRAME_POSITION (   table,
  col,
  row 
)    frame[0][get_frame_pos(col, (table)->cols, row, (table)->rows)]

◆ has_hline_width

#define has_hline_width (   table,
  row 
)    (get_hline_width(table, row) >= 0)

◆ has_vline_width

#define has_vline_width (   table,
  col 
)    (get_vline_width(table, col) >= 0)

◆ V_FRAME_POSITION

#define V_FRAME_POSITION (   table,
  col,
  row 
)    frame[1][get_frame_pos(row, (table)->rows, col, (table)->cols)]

Function Documentation

◆ apply_stretch_method()

static int apply_stretch_method ( struct table *  table,
int  widths[],
int  max_widths[],
int  stretch_method,
int  max_cols_width 
)
inlinestatic

◆ check_table_height()

static void check_table_height ( struct table *  table,
struct table_frames *  frames,
int  y 
)
static

◆ check_table_widths()

void check_table_widths ( struct html_context *  html_context,
struct table *  table 
)

◆ distribute_table_widths()

void distribute_table_widths ( struct table *  table)

◆ distribute_values()

static void distribute_values ( int *  values,
int  count,
int  wanted,
int *  limits 
)
inlinestatic

◆ distribute_widths()

static void distribute_widths ( struct table *  table,
int  width 
)
static

◆ draw_frame_hline()

static void draw_frame_hline ( struct table *  table,
signed char *  frame[2],
int  x,
int  y,
int  col,
int  row,
struct html_context *  html_context 
)
inlinestatic

◆ draw_frame_point()

static void draw_frame_point ( struct table *  table,
signed char *  frame[2],
int  x,
int  y,
int  col,
int  row,
struct html_context *  html_context 
)
inlinestatic

◆ draw_frame_vline()

static void draw_frame_vline ( struct table *  table,
signed char *  frame[2],
int  x,
int  y,
int  col,
int  row,
struct html_context *  html_context 
)
inlinestatic

◆ draw_table_bad_html()

static void draw_table_bad_html ( struct html_context *  html_context,
struct table *  table 
)
static

◆ draw_table_caption()

void draw_table_caption ( struct html_context *  html_context,
struct table *  table,
int  x,
int  y 
)

◆ draw_table_cell()

void draw_table_cell ( struct table *  table,
int  col,
int  row,
int  x,
int  y,
struct html_context *  html_context 
)

◆ draw_table_cells()

void draw_table_cells ( struct table *  table,
int  x,
int  y,
struct html_context *  html_context 
)

◆ draw_table_frames()

void draw_table_frames ( struct table *  table,
int  indent,
int  y,
struct html_context *  html_context 
)

◆ format_cell()

static struct part * format_cell ( struct html_context *  html_context,
struct table *  table,
struct table_cell *  cell,
struct document *  document,
int  x,
int  y,
int  width 
)
inlinestatic

◆ format_table()

void format_table ( char *  attr,
char *  html,
char *  eof,
char **  end,
struct html_context *  html_context 
)

◆ get_cell_width()

static void get_cell_width ( struct html_context *  html_context,
char *  start,
char *  end,
int  cellpadding,
int  width,
int  a,
int *  min,
int *  max,
int  link_num,
int *  new_link_num 
)
inlinestatic

◆ get_cell_widths()

static void get_cell_widths ( struct html_context *  html_context,
struct table *  table 
)
static

◆ get_column_widths()

static int get_column_widths ( struct table *  table)
static

◆ get_frame_pos()

static int get_frame_pos ( int  a,
int  a_size,
int  b,
int  b_size 
)
inlinestatic

◆ get_hline_width()

static int get_hline_width ( struct table *  table,
int  row 
)
static

◆ get_table_caption_height()

static int get_table_caption_height ( struct html_context *  html_context,
struct table *  table 
)
static

◆ get_table_cellpadding()

int get_table_cellpadding ( struct html_context *  html_context,
struct table *  table 
)

◆ get_table_frames()

static void get_table_frames ( struct table *  table,
struct table_frames *  result 
)
static

◆ get_table_heights()

void get_table_heights ( struct html_context *  html_context,
struct table *  table 
)

◆ get_table_indent()

int get_table_indent ( struct html_context *  html_context,
struct table *  table 
)

◆ get_table_real_height()

static int get_table_real_height ( struct table *  table)
static

◆ get_table_width()

static void get_table_width ( struct table *  table)
static

◆ get_vline_width()

static int get_vline_width ( struct table *  table,
int  col 
)
inlinestatic

◆ init_table_rules()

static void init_table_rules ( struct table *  table,
signed char *  frame[2] 
)
static

◆ stretch_columns()

static int stretch_columns ( struct table *  table,
int  widths[],
int  max_widths[],
int  spare_width,
int  total_width 
)
inlinestatic

◆ table_row_has_group()

static int table_row_has_group ( struct table *  table,
int  row 
)
inlinestatic