/* These macros are for C programmers - inserts a "for" template */
/* and an "if" template */

init()
{
  assign_key("formac", 6);    /* <CTRL> F */
  assign_key("ifmac",  5);    /* <CTRL> E */
}

formac()
{
  int col;
  int i;

  col = currcol();
  insert("for ( ; ; )\n");
  setcol(col);
  insert("{\n");
  setcol(col);
  insert("}");
  up();  up();
  for (i = 1;  i <= 4;  i += 1)
    right();
}

ifmac()
{
  int col;
  int i;

  col = currcol();
  insert("if ()\n");
  setcol(col);
  insert("{\n");
  setcol(col);
  insert("}\n");
  setcol(col);
  insert("else\n");
  setcol(col);
  insert("{\n");
  setcol(col);
  insert("}");
  for (i = 1;  i <= 5;  i++)
    up();
  for (i = 1;  i <= 3;  i++)
    right();
}
