/* ---------- */
/* najhtmdb.c */
/* ---------- */
/* naji html database functions */
/* this .c file is a part */
/* of libnaji version 0.6.1 */
/* libnaji is based on */
/* the original najitool */
/* both najitool and libnaji */
/* are public domain and are */
/* made by the same author */
/* please read license.txt */
/* made by NECDET COKYAZICI */
#include "libnaji.h"
char buffer_html[306];
FILE *naji_html_db_file;
void add_entry_html(char *entry)
{
printf(entry);
safegets(buffer_html, 300);
fprintf(naji_html_db_file, "%s%s
\n", entry, buffer_html);
fflush(naji_html_db_file);
return;
}
void add_entry_html_email(char *entry)
{
printf(entry);
safegets(buffer_html, 300);
fprintf(naji_html_db_file, "%s%s\n",
entry, buffer_html, buffer_html);
fflush(naji_html_db_file);
return;
}
void add_entry_html_link(char *entry)
{
printf(entry);
safegets(buffer_html, 300);
fprintf(naji_html_db_file, "%s%s
\n",
entry, buffer_html, buffer_html);
fflush(naji_html_db_file);
return;
}
void naji_html_database(void)
{
printf("\n\ntip: you should name it something like book.htm\n");
printf("so you can view it with your web browser.\n");
printf("enter a file name, if the file exists the data\n");
printf("will be added to the end of the file: ");
safegets(buffer_html, 300);
naji_html_db_file = fopen(buffer_html, "ab");
if (naji_html_db_file == NULL)
{
fprintf(stderr, "\n\nError opening file %s", buffer_html);
perror(" ");
fprintf(stderr, "\n\n");
exit(1);
}
loop
{
printf("\n\ntip: type N/A if it's not available.\n\n");
fprintf(naji_html_db_file, "