/* Author: Ram Samudrala (me@ram.org)
 * Version: O1.0
 * Detail: <http://www.ram.org/computing/cgi_common/cgi_common.html>
 * November 22, 1996.
 *
 * See the URL above for more information.
 */

#include "cgi_common.h"
#include "cgi_defines.h"

/******************************************************************/

void display_content_type(char string[])
{
  extern int content_type_displayed;

  if (!content_type_displayed)
    {
/*      printf("HTTP/1.0 200 OK%s", HEADER_DELIMITER); */
      printf("Content-type: text/html%s", HEADER_DELIMITER);
      printf("%s", HEADER_DELIMITER);
      if (string[0] != '\0')
	printf("<title> %s </title>\n", string);
      content_type_displayed = TRUE;
    }
  return;
}

/******************************************************************/

int display_signature(char signature_file[])
{
  FILE *signature_fp;
  static char line[LINE_LENGTH];
  
  if ((signature_fp = fopen(signature_file, "r")) != NULL)
    {
      printf("<hr>\n");
      while (fgets(line, LINE_LENGTH, signature_fp))
	puts(line);
      printf("<hr>\n");
    }  
  else
    {
      printf("<hr>\n<a href=\"http://www.twisted-helices.com/th/\">TWISTED HELICES</a> <b>||</b>\n");
      printf("<a href=\"http://www.ram.org\">Ram Samudrala</a> <b>||</b>\n");
      printf("<var><a href=\"mailto:ram@twisted-helices.com\">ram@twisted-helices.com</a></var>\n<hr>\n");  
    }
  return TRUE;
}

/******************************************************************/

