Back to index

tetex-bin  3.0
Functions | Variables
cmds.c File Reference
#include "system.h"
#include "cmds.h"
#include "defun.h"
#include "files.h"
#include "footnote.h"
#include "html.h"
#include "insertion.h"
#include "lang.h"
#include "macro.h"
#include "makeinfo.h"

Go to the source code of this file.

Functions

static void cm_exampleindent (void)
static void cm_firstparagraphindent (void)
static void cm_paragraphindent (void)
static void cm_novalidate (void)
static void cm_obsolete (int arg, int start, int end)
static void not_fixed_width (int arg)
void insert_self (int arg)
void insert_space (int arg)
void cm_comma (int arg)
void cm_asterisk (void)
void cm_dots (int arg)
void cm_enddots (int arg)
void cm_bullet (int arg)
void cm_minus (int arg)
void cm_dmn (int arg)
void cm_TeX (int arg)
void cm_LaTeX (int arg)
void cm_copyright (int arg)
void cm_registeredsymbol (int arg)
void cm_today (int arg)
void cm_comment (void)
static void cm_acronym_or_abbr (int arg, int is_abbr)
void cm_acronym (int arg)
void cm_abbr (int arg)
void cm_tt (int arg)
void cm_code (int arg)
void cm_kbd (int arg)
void cm_indicate_url (int arg, int start, int end)
void cm_key (int arg)
void cm_var (int arg, int start_pos, int end_pos)
void cm_sc (int arg, int start_pos, int end_pos)
void cm_dfn (int arg, int position)
void cm_emph (int arg)
void cm_verb (int arg)
void cm_strong (int arg, int start_pos, int end_pos)
void cm_cite (int arg, int position)
void cm_not_fixed_width (int arg, int start, int end)
void cm_i (int arg)
void cm_slanted (int arg)
void cm_b (int arg)
void cm_r (int arg)
void cm_sansserif (int arg)
void cm_titlefont (int arg)
void cm_math (int arg)
void cm_no_op (void)
void cm_w (int arg)
void cm_tie (int arg)
void cm_noindent (void)
void cm_noindent_cmd (void)
void cm_indent (void)
void cm_setfilename (void)
void cm_settitle (void)
void cm_ignore_arg (int arg, int start_pos, int end_pos)
void cm_ignore_line (void)
void cm_sp (void)
void cm_dircategory (void)
void cm_center (void)
void cm_result (int arg)
void cm_expansion (int arg)
void cm_equiv (int arg)
void cm_print (int arg)
void cm_error (int arg)
void cm_point (int arg)
void cm_exdent (void)
static void handle_include (int verbatim_include)
void cm_verbatiminclude (void)
void cm_include (void)
void cm_bye (void)
static int set_example_indentation_increment (char *string)
static int set_firstparagraphindent (char *string)
void cm_colon (void)
void cm_punct (int arg)

Variables

COMMAND command_table []
static ACRONYM_DESCacronyms_stack = NULL

Function Documentation

void cm_abbr ( int  arg)

Definition at line 776 of file cmds.c.

{
  cm_acronym_or_abbr (arg, 1);
}

Here is the call graph for this function:

void cm_acronym ( int  arg)

Definition at line 770 of file cmds.c.

{
  cm_acronym_or_abbr (arg, 0);
}

Here is the call graph for this function:

static void cm_acronym_or_abbr ( int  arg,
int  is_abbr 
) [static]

Definition at line 660 of file cmds.c.

{
  char *aa, *description;
  unsigned len;

  /* We do everything at START.  */
  if (arg == END)
    return;

  get_until_in_braces (",", &aa);
  if (input_text[input_text_offset] == ',')
    input_text_offset++;
  get_until_in_braces ("}", &description);

  canon_white (aa);
  canon_white (description);

  /* If not enclosed in braces, strip after comma to be compatible
     with texinfo.tex.  */
  if (description[0] != '{' && strchr (description, ',') != NULL)
    {
      int i = 0;
      while (description[i] != ',')
        i++;
      /* For now, just terminate the string at comma.  */
      description[i] = 0;
    }

  /* Get description out of braces.  */
  if (description[0] == '{')
    description++;

  len = strlen (description);
  if (len && description[len-1] == '}')
    description[len-1] = 0;

  /* Save new description.  */
  if (strlen (description) > 0)
    {
      ACRONYM_DESC *new = xmalloc (sizeof (ACRONYM_DESC));

      new->acronym = xstrdup (aa);
      new->description = xstrdup (description);
      new->next = acronyms_stack;
      acronyms_stack = new;
    }

  if (html)
    {
      add_word (is_abbr ? "<abbr" : "<acronym");

      if (strlen (description) > 0)
        add_word_args (" title=\"%s\"", text_expansion (description));
      else if (acronyms_stack)
        {
          /* No second argument, get from previous.  Search order is from
             last to first defined, so we get the most recent version of
             the description.  */
          ACRONYM_DESC *temp = acronyms_stack;

          while (temp)
            {
              if (STREQ (aa, temp->acronym)
                  && strlen (temp->description) > 0)
                {
                  add_word_args (" title=\"%s\"",
                                 text_expansion (temp->description));
                  break;
                }
              temp = temp->next;
            }
        }

      add_char ('>');
      execute_string ("%s", aa);
      add_word (is_abbr ? "</abbr>" : "</acronym>");
    }
  else if (docbook)
    {
      xml_insert_element (is_abbr ? ABBREV : ACRONYM, START);
      execute_string ("%s", aa);
      xml_insert_element (is_abbr ? ABBREV : ACRONYM, END);
    }
  else if (xml)
    {
      xml_insert_element (is_abbr ? ABBREV : ACRONYM, START);

      xml_insert_element (is_abbr ? ABBREVWORD : ACRONYMWORD, START);
      execute_string ("%s", aa);
      xml_insert_element (is_abbr ? ABBREVWORD : ACRONYMWORD, END);

      if (strlen (description) > 0)
        {
          xml_insert_element (is_abbr ? ABBREVDESC : ACRONYMDESC, START);
          execute_string ("%s", description);
          xml_insert_element (is_abbr ? ABBREVDESC : ACRONYMDESC, END);
        }

      xml_insert_element (is_abbr ? ABBREV : ACRONYM, END);
    }
  else
    execute_string ("%s", aa);

  /* Put description into parenthesis after the acronym for all outputs
     except XML.  */
  if (strlen (description) > 0 && (!xml || docbook))
    add_word_args (" (%s)", description);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 406 of file cmds.c.

{
  if (html)
    add_word ("<br>");
  else if (xml && !docbook)
    xml_insert_entity ("linebreak");
  else if (docbook) 
    xml_asterisk ();
  else
    {
      close_single_paragraph ();
      cm_noindent ();
    }
}

Here is the call graph for this function:

void cm_b ( int  arg)

Definition at line 1176 of file cmds.c.

{
  /* See cm_i comments.  */
  extern int printing_index;
  if (docbook && !filling_enabled && !printing_index)
    xml_insert_element (LINEANNOTATION, arg);
  else if (docbook && arg == START)
    xml_insert_element_with_attribute (B, arg, "role=\"bold\"");
  else if (xml)
    xml_insert_element (B, arg);
  else if (html)
    insert_html_tag (arg, "b");
  else
    not_fixed_width (arg);
}

Here is the call graph for this function:

void cm_bullet ( int  arg)

Definition at line 461 of file cmds.c.

{
  if (arg == START)
    {
      if (html)
        add_word ("&bull;");
      else if (xml && !docbook)
       xml_insert_entity ("bullet");
      else if (docbook)
       xml_insert_entity ("bull");
      else
        add_char ('*');
    }
}

Here is the call graph for this function:

void cm_bye ( void  )

Definition at line 1748 of file cmds.c.

{
  discard_braces (); /* should not have any unclosed braces left */
  input_text_offset = input_text_length;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1491 of file cmds.c.

{
  if (xml)
    {
      char *line;
      xml_insert_element (CENTER, START);
      get_rest_of_line (0, &line);
      execute_string ("%s", line);
      free (line);
      xml_insert_element (CENTER, END);
    }
  else
    {
      int i, start, length;
      char *line;
      int save_indented_fill = indented_fill;
      int save_filling_enabled = filling_enabled;
      int fudge_factor = 1;

      filling_enabled = indented_fill = 0;
      cm_noindent ();
      start = output_paragraph_offset;

      if (html)
        add_html_block_elt ("<div align=\"center\">");

      inhibit_output_flushing ();
      get_rest_of_line (0, &line);
      execute_string ("%s", line);
      free (line);
      uninhibit_output_flushing ();
      if (html)
        add_html_block_elt ("</div>");

       else
         {
           i = output_paragraph_offset - 1;
           while (i > (start - 1) && output_paragraph[i] == '\n')
             i--;

           output_paragraph_offset = ++i;
           length = output_paragraph_offset - start;

           if (length < (fill_column - fudge_factor))
             {
               line = xmalloc (1 + length);
               memcpy (line, (char *)(output_paragraph + start), length);

               i = (fill_column - fudge_factor - length) / 2;
               output_paragraph_offset = start;

               while (i--)
                 insert (' ');

               for (i = 0; i < length; i++)
                 insert (line[i]);

               free (line);
             }
         }

      insert ('\n');
      filling_enabled = save_filling_enabled;
      indented_fill = save_indented_fill;
      close_single_paragraph ();
      if (looking_at("\n"))
        insert ('\n');
    }
}

Here is the call graph for this function:

void cm_cite ( int  arg,
int  position 
)

Definition at line 1119 of file cmds.c.

{
  if (xml)
    xml_insert_element (CITE, arg);        
  else if (html)
    insert_html_tag (arg, "cite");
  else
    {
      if (arg == START)
        add_char ('`');
      else
        add_char ('\'');
    }
}

Here is the call graph for this function:

void cm_code ( int  arg)

Definition at line 792 of file cmds.c.

{
  if (arg == START)
    in_fixed_width_font++;

  if (xml)
    {
      if (STREQ (command, "command"))
       xml_insert_element (COMMAND_TAG, arg);
      else if (STREQ (command, "env"))
       xml_insert_element (ENV, arg);
      else if (STREQ (command, "file"))
       xml_insert_element (FILE_TAG, arg);
      else if (STREQ (command, "option"))
       xml_insert_element (OPTION, arg);
      else if (STREQ (command, "samp"))
        {
          if (docbook && arg == START)
            {
              /* Even though @samp is in_fixed_width_font, it
                 should always start a paragraph.  Unfortunately,
                 in_fixed_width_font inhibits that.  */
              xml_start_para ();
              xml_insert_entity ("lsquo");
            }
          xml_insert_element (SAMP, arg);
          if (docbook && arg == END)
            xml_insert_entity ("rsquo");
        }
      else
       xml_insert_element (CODE, arg);
    }
  else if (html)
    {
      if (STREQ (command, "code"))
        insert_html_tag (arg, "code");
      else
        { /* Use <samp> tag in general to get typewriter.  */
          if (arg == START)
            { /* If @samp specifically, add quotes a la TeX output.  */
              if (STREQ (command, "samp")) add_char ('`');
              add_word ("<samp>");
            }
          insert_html_tag_with_attribute (arg, "span", "class=\"%s\"",command);
          if (arg == END)
            {
              add_word ("</samp>");
              if (STREQ (command, "samp")) add_char ('\'');
            }
        }
    }
  else
    {
      extern int printing_index;

      if (!printing_index)
        {
          if (arg == START)
            add_char ('`');
          else
            add_meta_char ('\'');
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1829 of file cmds.c.

{
  if (xml)
    {
      if (strchr (".?!:", input_text[input_text_offset-3]) != NULL)
        {
          /* Erase literal character that's there, except `>', which is
             part of the XML tag.  */
          if (output_paragraph[output_paragraph_offset-1] != '>')
            output_paragraph_offset--;

          switch (input_text[input_text_offset-3])
            {
            case '.':
              xml_insert_entity ("period");
              break;
            case '?':
              xml_insert_entity ("quest");
              break;
            case '!':
              xml_insert_entity ("excl");
              break;
            case ':':
              xml_insert_entity ("colon");
              break;
            }
        }
    }
}

Here is the call graph for this function:

void cm_comma ( int  arg)

Definition at line 397 of file cmds.c.

{
  if (arg == START)
    add_char (',');
}

Here is the call graph for this function:

Definition at line 598 of file cmds.c.

{
  /* For HTML, do not output comments before HTML header is written,
     otherwise comments before @settitle cause an empty <title> in the
     header.  */
  if ((html && html_output_head_p) || xml)
    {
      char *line;
      get_rest_of_line (0, &line);

      if (strlen (line) > 0)
        {
          int save_inhibit_indentation = inhibit_paragraph_indentation;
          int save_paragraph_is_open = paragraph_is_open;
          int save_escape_html = escape_html;
          int save_xml_no_para = xml_no_para;
          int i;

          inhibit_paragraph_indentation = 1;
          escape_html = 0;
          xml_no_para = 1;

          /* @c and @comment can appear between @item and @itemx,
             @deffn and @deffnx.  */
          xml_dont_touch_items_defs++;

          /* Use insert for HTML, and XML when indentation is enabled.
             For Docbook, use add_char.  */
          if (xml && xml_indentation_increment > 0
              && output_paragraph[output_paragraph_offset-1] != '\n')
            insert ('\n');

          /* Crunch double hyphens in comments.  */
          add_html_block_elt ("<!-- ");
          for (i = 0; i < strlen (line); i++)
            if (line[i] != '-' || (i && line[i-1] != '-'))
              add_char (line[i]);
          add_word (" -->");

          if (html)
            add_char ('\n');

          inhibit_paragraph_indentation = save_inhibit_indentation;
          paragraph_is_open = save_paragraph_is_open;
          escape_html = save_escape_html;
          xml_no_para = save_xml_no_para;
          xml_dont_touch_items_defs--;
        }

      free (line);
    }
  else
    cm_ignore_line ();
}

Here is the call graph for this function:

void cm_copyright ( int  arg)

Definition at line 549 of file cmds.c.

{
  if (arg == START)
    {
    if (html)
      add_word ("&copy;");
    else if (xml && !docbook)
      xml_insert_entity ("copyright");
    else if (docbook)
      xml_insert_entity ("copy");
    else
      add_word ("(C)");
    }
}

Here is the call graph for this function:

void cm_dfn ( int  arg,
int  position 
)

Definition at line 988 of file cmds.c.

{
  if (xml)
    xml_insert_element (DFN, arg);
  else
    {
  if (html)
    insert_html_tag (arg, "dfn");
  else if (arg == START)
    add_char ('"');
  else
    add_meta_char ('"');
    }
}

Here is the call graph for this function:

Definition at line 1457 of file cmds.c.

{
  char *line;

  if (html || docbook)
    cm_ignore_line ();
  else if (xml)
    {
      xml_insert_element (DIRCATEGORY, START);
      get_rest_of_line (1, &line);
      insert_string (line);
      free (line);
      xml_insert_element (DIRCATEGORY, END);
    }
  else
    {
      get_rest_of_line (1, &line);

      if (!no_headers && !html)
        {
          kill_self_indent (-1); /* make sure there's no indentation */
          insert_string ("INFO-DIR-SECTION ");
          insert_string (line);
          insert ('\n');
        }

      free (line);
    }
}

Here is the call graph for this function:

void cm_dmn ( int  arg)

Definition at line 492 of file cmds.c.

{
  if (html)
    insert_html_tag_with_attribute (arg, "span", "class=\"dmn\"");
  else if (docbook)
    /* No units in docbook yet.  */
    ;
  else if (xml)
    xml_insert_element (DIMENSION, arg);
}

Here is the call graph for this function:

void cm_dots ( int  arg)

Definition at line 423 of file cmds.c.

{
  if (arg == START)
    {
      if (xml && !docbook)
        xml_insert_entity ("dots");
      else if (docbook)
        xml_insert_entity ("hellip");
      else
       if (html && !in_fixed_width_font)
         insert_string ("<small class=\"dots\">...</small>");
       else
         add_word ("...");
    }
}

Here is the call graph for this function:

void cm_emph ( int  arg)

Definition at line 1004 of file cmds.c.

{
  if (xml)
    xml_insert_element (EMPH, arg);
  else if (html)
    insert_html_tag (arg, "em");
  else
    add_char ('_');
}

Here is the call graph for this function:

void cm_enddots ( int  arg)

Definition at line 441 of file cmds.c.

{
  if (arg == START)
    {
      if (xml && !docbook)
       xml_insert_entity ("enddots");
      else if (docbook)
       {
         xml_insert_entity ("hellip");
         add_char ('.');
       }
      else
       if (html && !in_fixed_width_font)
         insert_string ("<small class=\"enddots\">....</small>");
       else
         add_word ("....");
    }
}

Here is the call graph for this function:

void cm_equiv ( int  arg)

Definition at line 1579 of file cmds.c.

{
  if (arg == END)
    add_word ("==");
}

Here is the call graph for this function:

void cm_error ( int  arg)

Definition at line 1595 of file cmds.c.

{
  if (arg == END)
    add_word (html ? "error--&gt;" : "error-->");
}

Here is the call graph for this function:

static void cm_exampleindent ( void  ) [static]

Definition at line 1783 of file cmds.c.

{
  char *arg;
  
  get_rest_of_line (1, &arg);
  if (set_example_indentation_increment (arg) != 0)
    line_error (_("Bad argument to @%s"), command);

  if (input_text[input_text_offset] == '\n')
    close_single_paragraph ();

  free (arg);
}

Here is the call graph for this function:

Definition at line 1612 of file cmds.c.

{
  char *line;
  int save_indent = current_indent;
  int save_in_fixed_width_font = in_fixed_width_font;

  /* Read argument.  */
  get_rest_of_line (0, &line);

  /* Exdent the output.  Actually this may be a no-op.   */
  if (current_indent)
    current_indent -= default_indentation_increment;

  /* @exdent arg is supposed to be in roman.  */
  in_fixed_width_font = 0;
  
  /* The preceding newline already inserted the `current_indent'.
     Remove one level's worth.  */
  kill_self_indent (default_indentation_increment);

  if (html)
    add_word ("<br>");
  else if (docbook)
    xml_insert_element (LINEANNOTATION, START);
  else if (xml)
    xml_insert_element (EXDENT, START);

  /* Can't close_single_paragraph, then we lose preceding blank lines.  */
  flush_output ();
  execute_string ("%s", line);
  free (line);

  if (html)
    add_word ("<br>");
  else if (xml)
    {
      xml_insert_element (docbook ? LINEANNOTATION : EXDENT, END);
      insert ('\n');
    }

  close_single_paragraph ();

  current_indent = save_indent;
  in_fixed_width_font = save_in_fixed_width_font;
  if (!xml)
    start_paragraph ();
}

Here is the call graph for this function:

void cm_expansion ( int  arg)

Definition at line 1571 of file cmds.c.

{
  if (arg == END)
    add_word (html ? "==&gt;" : "==>");
}

Here is the call graph for this function:

Definition at line 1813 of file cmds.c.

{
  char *arg;

  get_rest_of_line (1, &arg);
  if (set_firstparagraphindent (arg) != 0)
    line_error (_("Bad argument to %c%s"), COMMAND_PREFIX, command);

  free (arg);
}

Here is the call graph for this function:

void cm_i ( int  arg)

Definition at line 1144 of file cmds.c.

{
  /* Make use of <lineannotation> of Docbook, if we are
     inside an @example or similar.  */
  extern int printing_index;
  if (docbook && !filling_enabled && !printing_index)
    xml_insert_element (LINEANNOTATION, arg);
  else if (xml)
    xml_insert_element (I, arg);
  else if (html)
    insert_html_tag (arg, "i");
  else
    not_fixed_width (arg);
}

Here is the call graph for this function:

void cm_ignore_arg ( int  arg,
int  start_pos,
int  end_pos 
)

Definition at line 1389 of file cmds.c.

{
  if (arg == END)
    output_paragraph_offset = start_pos;
}

Definition at line 1397 of file cmds.c.

{
  discard_until ("\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1739 of file cmds.c.

{
  handle_include (0); 
}

Here is the call graph for this function:

Definition at line 1338 of file cmds.c.

{
  inhibit_paragraph_indentation = 0;
  xml_no_indent = 0;
  skip_whitespace_and_newlines();
  
  if (xml)
    xml_start_para ();
  else if (html && !paragraph_is_open)
    add_html_block_elt ("<p class=\"indent\">");
  else
    start_paragraph ();
}

Here is the call graph for this function:

void cm_indicate_url ( int  arg,
int  start,
int  end 
)

Definition at line 880 of file cmds.c.

{
  if (xml)
    xml_insert_element (URL, arg);
  else if (html)
    {
      if (arg == START)
        add_word ("&lt;");
      insert_html_tag (arg, "code");
      if (arg != START)
        add_word ("&gt;");
    }
  else
    if (arg == START)
      add_word ("<");
    else
      add_word (">");
}

Here is the call graph for this function:

void cm_kbd ( int  arg)

Definition at line 858 of file cmds.c.

{
  if (xml)
    xml_insert_element (KBD, arg);
  else if (html)
    { /* Seems like we should increment in_fixed_width_font for Info
         format too, but then the quote-omitting special case gets
         confused.  Punt.  */
      if (arg == START)
        in_fixed_width_font++;
      insert_html_tag (arg, "kbd");
    }
  else
    { /* People use @kbd in an example to get the "user input" font.
         We don't want quotes in that case.  */
      if (!in_fixed_width_font)
        cm_code (arg);
    }
}

Here is the call graph for this function:

void cm_key ( int  arg)

Definition at line 900 of file cmds.c.

{
  if (xml)
    xml_insert_element (KEY, arg);
  else if (html)
    add_word (arg == START ? "&lt;" : "&gt;");
  else
    add_char (arg == START ? '<' : '>');
}

Here is the call graph for this function:

void cm_LaTeX ( int  arg)

Definition at line 527 of file cmds.c.

{
  static int last_position;

  if (arg == START)
    {
      if (xml)
        xml_insert_entity ("latex");
      else
        add_word ("LaTeX");

      last_position = output_paragraph_offset;
    }
  else if (last_position != output_paragraph_offset)
    {
      warning (_("arguments to @%s ignored"), command);
      output_paragraph_offset = last_position;
    }
}

Here is the call graph for this function:

void cm_math ( int  arg)

Definition at line 1245 of file cmds.c.

{
  if (xml && !docbook)
    xml_insert_element (MATH, arg);
}

Here is the call graph for this function:

void cm_minus ( int  arg)

Definition at line 477 of file cmds.c.

{
  if (arg == START)
    {
      if (xml)
       xml_insert_entity ("minus");
      else if (html)
        add_word ("&minus;");
      else
       add_char ('-');
    }
}

Here is the call graph for this function:

Definition at line 1253 of file cmds.c.

{
}

Here is the caller graph for this function:

Definition at line 1312 of file cmds.c.

{
  if (!inhibit_paragraph_indentation)
    inhibit_paragraph_indentation = -1;
}

Here is the caller graph for this function:

Definition at line 1319 of file cmds.c.

{
  cm_noindent ();
  xml_no_indent = 1;
  skip_whitespace_and_newlines();

  if (xml)
    xml_start_para ();
  else if (html && !paragraph_is_open)
    add_html_block_elt ("<p class=\"noindent\">");
  else
    {
      paragraph_is_open = 0;
      start_paragraph ();
    }
}

Here is the call graph for this function:

void cm_not_fixed_width ( int  arg,
int  start,
int  end 
)

Definition at line 1136 of file cmds.c.

{
  if (xml)
    xml_insert_element (NOTFIXEDWIDTH, arg);
  not_fixed_width (arg);
}

Here is the call graph for this function:

Definition at line 1260 of file cmds.c.

{
  validating = 0;
}
static void cm_obsolete ( int  arg,
int  start,
int  end 
) [static]

Definition at line 1302 of file cmds.c.

{
  if (arg == START)
    warning (_("%c%s is obsolete"), COMMAND_PREFIX, command);
}

Here is the call graph for this function:

Definition at line 1757 of file cmds.c.

{
  char *arg;

  get_rest_of_line (1, &arg);
  if (set_paragraph_indent (arg) != 0)
    line_error (_("Bad argument to %c%s"), COMMAND_PREFIX, command);

  free (arg);
}

Here is the call graph for this function:

void cm_point ( int  arg)

Definition at line 1603 of file cmds.c.

{
  if (arg == END)
    add_word ("-!-");
}

Here is the call graph for this function:

void cm_print ( int  arg)

Definition at line 1587 of file cmds.c.

{
  if (arg == END)
    add_word ("-|");
}

Here is the call graph for this function:

void cm_punct ( int  arg)

Definition at line 1862 of file cmds.c.

{
  if (xml && !docbook)
    {
      switch (input_text[input_text_offset-1])
        {
        case '.':
          xml_insert_entity ("eosperiod");
          break;
        case '?':
          xml_insert_entity ("eosquest");
          break;
        case '!':
          xml_insert_entity ("eosexcl");
          break;
        }
    }
  else
    {
      insert_self (arg);
    }
}

Here is the call graph for this function:

void cm_r ( int  arg)

Definition at line 1193 of file cmds.c.

{
  /* See cm_i comments.  */
  extern int printing_index;
  if (docbook && !filling_enabled && !printing_index)
    xml_insert_element (LINEANNOTATION, arg);
  else if (xml)
    xml_insert_element (R, arg);
  else if (html)
    insert_html_tag_with_attribute (arg, "span", "class=\"roman\"");
  else
    not_fixed_width (arg);
}

Here is the call graph for this function:

Definition at line 566 of file cmds.c.

{
  if (arg == START)
    {
      if (html)
        add_word ("&reg;");
      else if (docbook)
        xml_insert_entity ("reg");
      else if (xml && !docbook)
        xml_insert_entity ("registered");
      else
        add_word ("(R)");
    }
}

Here is the call graph for this function:

void cm_result ( int  arg)

Definition at line 1563 of file cmds.c.

{
  if (arg == END)
    add_word (html ? "=&gt;" : "=>");
}

Here is the call graph for this function:

void cm_sansserif ( int  arg)

Definition at line 1208 of file cmds.c.

{
  /* See cm_i comments.  */
  extern int printing_index;
  if (docbook && !filling_enabled && !printing_index)
    xml_insert_element (LINEANNOTATION, arg);
  else if (xml)
    xml_insert_element (SANSSERIF, arg);
  else if (html)
    insert_html_tag_with_attribute (arg, "span", "class=\"sansserif\"");
  else
    not_fixed_width (arg);
}

Here is the call graph for this function:

void cm_sc ( int  arg,
int  start_pos,
int  end_pos 
)

Definition at line 945 of file cmds.c.

{
  if (xml)
    xml_insert_element (SC, arg);
  else
    {
      not_fixed_width (arg);

      if (arg == START)
        {
          if (html)
            insert_html_tag_with_attribute (arg, "span", "class=\"sc\"");
        }
      else
        {
          int all_upper;

          if (html)
            start_pos += sizeof ("<span class=\"sc\">") - 1; /* skip <span> */

          /* Avoid the warning below if there's no text inside @sc{}, or
             when processing menus under --no-headers.  */
          all_upper = start_pos < end_pos;

          while (start_pos < end_pos)
            {
              unsigned char c = output_paragraph[start_pos];
              if (!isupper (c))
                all_upper = 0;
              if (!html)
                output_paragraph[start_pos] = coerce_to_upper (c);
              start_pos++;
            }
          if (all_upper)
            warning (_("@sc argument all uppercase, thus no effect"));

          if (html)
            insert_html_tag (arg, "span");
        }
    }
}

Here is the call graph for this function:

Definition at line 1359 of file cmds.c.

{
  char *filename;
  get_rest_of_line (1, &filename);
  /* warning ("`@%s %s' encountered and ignored", command, filename); */
  if (xml)
    add_word_args ("<setfilename>%s</setfilename>", filename);
  free (filename);
}

Here is the call graph for this function:

Definition at line 1370 of file cmds.c.

Here is the call graph for this function:

void cm_slanted ( int  arg)

Definition at line 1160 of file cmds.c.

{
  /* Make use of <lineannotation> of Docbook, if we are
     inside an @example or similar.  */
  extern int printing_index;
  if (docbook && !filling_enabled && !printing_index)
    xml_insert_element (LINEANNOTATION, arg);
  else if (xml)
    xml_insert_element (SLANTED, arg);
  else if (html)
    insert_html_tag (arg, "i");
  else
    not_fixed_width (arg);
}

Here is the call graph for this function:

void cm_sp ( void  )

Definition at line 1404 of file cmds.c.

{
  int lines;
  char *line;

  /* Due to tricky stuff in execute_string(), @value{} can't be expanded.
     So there is really no reason to enable expansion for @sp parameters.  */
  get_rest_of_line (0, &line);

  if (sscanf (line, "%d", &lines) != 1 || lines <= 0)
    line_error (_("@sp requires a positive numeric argument, not `%s'"), line);
  else
    {
      if (xml)
       {
          /* @sp can appear between @item and @itemx, @deffn and @deffnx.  */
          xml_dont_touch_items_defs++;
         xml_insert_element_with_attribute (SP, START, "lines=\"%s\"", line);
         /*     insert_string (line);*/
         xml_insert_element (SP, END);
          xml_dont_touch_items_defs--;
       }
      else
        {
          /* Must disable filling since otherwise multiple newlines is like
             multiple spaces.  Must close paragraph since that's what the
             manual says and that's what TeX does.  */
          int save_filling_enabled = filling_enabled;
          filling_enabled = 0;

          /* close_paragraph generates an extra blank line.  */
          close_single_paragraph ();

          if (lines && html && !executing_string)
            html_output_head ();

          if (html)
            add_html_block_elt ("<pre class=\"sp\">\n");

          while (lines--)
            add_char ('\n');

          if (html)
            add_html_block_elt ("</pre>\n");

          filling_enabled = save_filling_enabled;
        }
    }
  free (line);
}

Here is the call graph for this function:

void cm_strong ( int  arg,
int  start_pos,
int  end_pos 
)

Definition at line 1093 of file cmds.c.

{
  if (docbook && arg == START)
    xml_insert_element_with_attribute (B, arg, "role=\"bold\"");
  else if (xml)
    xml_insert_element (STRONG, arg);
  else if (html)
    insert_html_tag (arg, "strong");
  else
    add_char ('*');
  
  if (!xml && !html && !docbook && !no_headers
      && arg == END
      && end_pos - start_pos >= 6
      && (STRNCASEEQ ((char *) output_paragraph + start_pos, "*Note:", 6)
          || STRNCASEEQ ((char *) output_paragraph + start_pos, "*Note ", 6)))
    {
      /* Translators: "Note:" is literal here and should not be
         translated.  @strong{Nota}, say, does not cause the problem.  */
      warning (_("@strong{Note...} produces a spurious cross-reference in Info; reword to avoid that"));
      /* Adjust the output to avoid writing the bad xref.  */
      output_paragraph[start_pos + 5] = '_';
    }
}

Here is the call graph for this function:

void cm_TeX ( int  arg)

Definition at line 505 of file cmds.c.

{
  static int last_position;

  if (arg == START)
    {
      if (xml)
       xml_insert_entity ("tex");
      else
       add_word ("TeX");

      last_position = output_paragraph_offset;
    }
  else if (last_position != output_paragraph_offset)
    {
      warning (_("arguments to @%s ignored"), command);
      output_paragraph_offset = last_position;
    }
}

Here is the call graph for this function:

void cm_tie ( int  arg)

Definition at line 1288 of file cmds.c.

{
  if (arg == START)
    {
      cm_w (START);
      add_char (' ');
    }
  else
    cm_w (END);
}

Here is the call graph for this function:

void cm_titlefont ( int  arg)

Definition at line 1223 of file cmds.c.

{
  if (xml)
    xml_insert_element (TITLEFONT, arg);
  else
   {
     not_fixed_width (arg);
     if (html)
       {
         html_title_written = 1; /* suppress title from @settitle */
         if (arg == START)
           add_word ("<h1 class=\"titlefont\">");
         else
           add_word ("</h1>\n");
       }
   }
}

Here is the call graph for this function:

void cm_today ( int  arg)

Definition at line 582 of file cmds.c.

{
  static char *months[12] =
    { N_("January"), N_("February"), N_("March"), N_("April"), N_("May"),
      N_("June"), N_("July"), N_("August"), N_("September"), N_("October"),
      N_("November"), N_("December") };
  if (arg == START)
    {
      time_t timer = time (0);
      struct tm *ts = localtime (&timer);
      add_word_args ("%d %s %d", ts->tm_mday, _(months[ts->tm_mon]),
                     ts->tm_year + 1900);
    }
}

Here is the call graph for this function:

void cm_tt ( int  arg)

Definition at line 782 of file cmds.c.

{
  /* @t{} is a no-op in Info.  */
  if (html)
    insert_html_tag (arg, "tt");
  else if (xml)
    xml_insert_element (TT, arg);
}

Here is the call graph for this function:

void cm_var ( int  arg,
int  start_pos,
int  end_pos 
)

Definition at line 920 of file cmds.c.

{
  if (xml)
    xml_insert_element (VAR, arg);
  else
    {
  not_fixed_width (arg);

  if (html)
    insert_html_tag (arg, "var");
  else if (arg == END)
    {
      while (start_pos < end_pos)
        {
          unsigned char c = output_paragraph[start_pos];
          if (strchr ("[](),", c))
            warning (_("unlikely character %c in @var"), c);
          output_paragraph[start_pos] = coerce_to_upper (c);
          start_pos++;
        }
    }
    }
}

Here is the call graph for this function:

void cm_verb ( int  arg)

Definition at line 1015 of file cmds.c.

{
  int character;
  int delimiter = 0; /* avoid warning */
  int seen_end = 0;

  in_fixed_width_font++;
  /* are these necessary ? */
  last_char_was_newline = 0;

  if (html)
    add_word ("<tt>");

  if (input_text_offset < input_text_length)
    {
      character = curchar ();
      if (character == '{')
       input_text_offset++;
      else
       line_error (_("`{' expected, but saw `%c'"), character);
    }
    
  if (input_text_offset < input_text_length)
    {
      delimiter = curchar ();
      input_text_offset++;
    }

  while (input_text_offset < input_text_length)
    {
      character = curchar ();

      if (character == '\n')
        {
          line_number++;
          if (html)
            add_word ("<br>\n");
        }

      else if (html && character == '<')
        add_word ("&lt;");

      else if (html && character == '&')
        add_word ("&amp;");

      else if (character == delimiter && input_text[input_text_offset+1] == '}')
       { /* Assume no newlines in END_VERBATIM. */
         seen_end = 1;
         input_text_offset++;
         break;
       }

      else
        add_char (character);

      input_text_offset++;
    }

  if (!seen_end)
    warning (_("end of file inside verb block"));
  
  if (input_text_offset < input_text_length)
    {
      character = curchar ();
      if (character == '}')
       input_text_offset++;
      else
       line_error (_("`}' expected, but saw `%c'"), character);
    }

  if (html)
    add_word ("</tt>");

  in_fixed_width_font--;
}

Here is the call graph for this function:

Definition at line 1731 of file cmds.c.

{
  handle_include (1); 
}

Here is the call graph for this function:

void cm_w ( int  arg)

Definition at line 1268 of file cmds.c.

{
  if (arg == START)
    non_splitting_words++;
  else
    {
      if (docbook || html || xml)
        /* This is so @w{$}Log$ doesn't end up as <dollar>Log<dollar>
           in the output.  */
        insert_string ("<!-- /@w -->");
        
      non_splitting_words--;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void handle_include ( int  verbatim_include) [static]

Definition at line 1666 of file cmds.c.

{
  char *arg, *filename;

  if (macro_expansion_output_stream && !executing_string)
    me_append_before_this_command ();

  if (!insertion_stack)
    close_paragraph ();  /* No blank lines etc. if not at outer level.  */
    
  get_rest_of_line (0, &arg);
  /* We really only want to expand @value, but it's easier to just do
     everything.  TeX will only work with @value.  */
  filename = text_expansion (arg);
  free (arg);

  if (macro_expansion_output_stream && !executing_string)
    remember_itext (input_text, input_text_offset);

  pushfile ();

  /* In verbose mode we print info about including another file. */
  if (verbose_mode)
    {
      int i = 0;
      FSTACK *stack = filestack;

      for (i = 0, stack = filestack; stack; stack = stack->next, i++);

      i *= 2;

      printf ("%*s", i, "");
      printf ("%c%s `%s'\n", COMMAND_PREFIX, command, filename);
      fflush (stdout);
    }

  if (!find_and_load (filename, 1))
    {
      popfile ();
      line_number--;

      /* /wh/bar:5: @include/@verbatiminclude `foo': No such file or dir */
      line_error ("%c%s `%s': %s", COMMAND_PREFIX, command, filename,
                  strerror (errno));

      free (filename);
      return;
    }
  else
    {
      if (macro_expansion_output_stream && !executing_string)
       remember_itext (input_text, input_text_offset);

      if (!verbatim_include)
       reader_loop ();
      else
       handle_verbatim_environment (0);
    }
  free (filename);
  popfile ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void insert_self ( int  arg)

Definition at line 376 of file cmds.c.

{
  if (arg == START)
    add_word (command);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void insert_space ( int  arg)

Definition at line 383 of file cmds.c.

{
  if (arg == START)
    {
      if (xml && !docbook)
        xml_insert_entity ("space");
      else
        add_char (' ');
    }
}

Here is the call graph for this function:

Definition at line 912 of file cmds.c.

{
  if (arg == START)
    in_fixed_width_font = 0;
}

Here is the caller graph for this function:

static int set_example_indentation_increment ( char *  string) [static]

Definition at line 1771 of file cmds.c.

{
  if (strcmp (string, "asis") == 0 || strcmp (string, _("asis")) == 0)
    ;
  else if (strcmp (string, "none") == 0 || strcmp (string, _("none")) == 0)
    example_indentation_increment = 0;
  else if (sscanf (string, "%d", &example_indentation_increment) != 1)
    return -1;
  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int set_firstparagraphindent ( char *  string) [static]

Definition at line 1801 of file cmds.c.

{
  if (STREQ (string, "insert") || STREQ (string, _("insert")))
    do_first_par_indent = 1;
  else if (STREQ (string, "none") || STREQ (string, _("none")))
    do_first_par_indent = 0;
  else
    return -1;
  return 0;
}

Here is the caller graph for this function:


Variable Documentation

Definition at line 657 of file cmds.c.

Definition at line 53 of file cmds.c.