Back to index

tetex-bin  3.0
Classes | Typedefs | Functions
float.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  float_elt

Typedefs

typedef struct float_elt FLOAT_ELT

Functions

void add_new_float (char *id, char *title, char *shorttitle, char *type, char *position)
void current_float_set_title_used (void)
char * current_float_id (void)
char * current_float_title (void)
char * current_float_shorttitle (void)
char * current_float_type (void)
char * current_float_position (void)
char * current_float_number (void)
char * get_float_ref (char *id)
int count_floats_of_type_in_chapter (char *type, char *chapter)
int current_float_used_title (void)

Class Documentation

struct float_elt

Definition at line 25 of file float.h.

Collaboration diagram for float_elt:
Class Members
int defining_line
char * id
struct float_elt * next
char * number
char * position
char * section
char * section_name
char * shorttitle
char * title
short title_used
char * type

Typedef Documentation

typedef struct float_elt FLOAT_ELT

Function Documentation

void add_new_float ( char *  id,
char *  title,
char *  shorttitle,
char *  type,
char *  position 
)

Definition at line 34 of file float.c.

{
  FLOAT_ELT *new = xmalloc (sizeof (FLOAT_ELT));
  unsigned long num_len;

  new->id = id;
  new->type = type;
  new->title = title;
  new->shorttitle = shorttitle;
  new->position = position;
  new->title_used = 0;
  new->defining_line = line_number - 1;

  new->number = current_chapter_number ();
  /* Append dot if not @unnumbered.  */
  num_len = strlen (new->number);
  if (num_len > 0)
    {
      new->number = xrealloc (new->number, num_len + 1 + 1);
      new->number[num_len] = '.';
      new->number[num_len+1] = '\0';
    }

  { /* Append the current float number.  */
    unsigned len = strlen (new->number) + 21;  /* that's 64 bits */
    char *s = xmalloc (len + 1);

    sprintf (s, "%s%d", new->number,
                count_floats_of_type_in_chapter (text_expansion (type),
                                                 new->number) + 1); 
    free (new->number);
    new->number = xstrdup (s);
  }

  /* Plain text output needs sectioning number and its title,
     when listing floats.  */
  if (!html && !xml && no_headers)
    {
      new->section = current_sectioning_number ();
      if (strlen (new->section) == 0)
        new->section_name = current_sectioning_name ();
      else
        new->section_name = "";
    }

  new->next = float_stack;
  float_stack = new;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int count_floats_of_type_in_chapter ( char *  type,
char *  chapter 
)

Definition at line 85 of file float.c.

{
  int i = 0;
  int l = strlen (chapter);
  FLOAT_ELT *temp = float_stack;

  while (temp && strncmp (temp->number, chapter, l) == 0)
    {
      if (strlen (temp->id) > 0 && STREQ (text_expansion (temp->type), type))
        i++;
      temp = temp->next;
    }

  return i;
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* current_float_id ( void  )

Definition at line 132 of file float.c.

{
  return float_stack->id;
}

Here is the caller graph for this function:

Definition at line 126 of file float.c.

{
  return float_stack->number;
}

Here is the caller graph for this function:

Definition at line 120 of file float.c.

{
  return float_stack->position;
}

Here is the caller graph for this function:

Definition at line 427 of file float.c.

Here is the caller graph for this function:

Definition at line 108 of file float.c.

{
  return float_stack->shorttitle;
}

Definition at line 102 of file float.c.

{
  return float_stack->title;
}

Here is the caller graph for this function:

char* current_float_type ( void  )

Definition at line 114 of file float.c.

{
  return float_stack->type;
}

Here is the caller graph for this function:

Definition at line 422 of file float.c.

{
       return float_stack->title_used;
}

Here is the caller graph for this function:

char* get_float_ref ( char *  id)

Definition at line 138 of file float.c.

{
  FLOAT_ELT *temp = float_stack;

  while (temp)
    {
      if (STREQ (id, temp->id))
        {
          char *s = xmalloc (strlen (temp->type) + strlen (temp->number) + 2);
          sprintf (s, "%s %s", temp->type, temp->number);
          return s;
        }
      temp = temp->next;
    }

  return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function: