/*

                                   _JNJ`                        
                               .JNMH`                           
                              JMMF`       `;.                   
                            .NMM)          `MN.                 
                            MMM)            (MML                
                           (MMM`             MMML               
                     M  I  D  N  I  G  H  T    C  o  D  E       
                           (NMMF             MHNH               
                            NMML            .MMM                
                             NMML          .NMH                 
                              4MMNL       .#F                   
                               `4HNNL_   `                      
                                   `"""`                        

                          Copyright (C) 2004-2007
       "Ian (Larry) Latter" <ian dot latter at midnightcode dot org>

    Midnight Code is a registered trademark of Ian Latter.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, and mirrored at the Midnight Code web
    site; as at version 2 of the License only.
  
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
  
    You should have received a copy of the GNU General Public License
    (version 2) along with this program; if not, write to the Free
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA, or see http://midnightcode.org/gplv2.txt

*/


/* midnightcode-syslog.h :: Midnight Code syslog (RFC3164) library	*/

/* Includes software to support RFCs :: 3164 */


#ifndef __MIDNIGHTCODE_SYSLOG_H
#define __MIDNIGHTCODE_SYSLOG_H 1


enum midnightcode_syslog_facility_t
{
  MIDNIGHTCODE_SYSLOG_FACILITY_KERNEL = 0,
  MIDNIGHTCODE_SYSLOG_FACILITY_USER = 1,
  MIDNIGHTCODE_SYSLOG_FACILITY_MAIL = 2,
  MIDNIGHTCODE_SYSLOG_FACILITY_SYSTEM = 3,
  MIDNIGHTCODE_SYSLOG_FACILITY_SECURITY = 4,
  MIDNIGHTCODE_SYSLOG_FACILITY_SYSLOG = 5,
  MIDNIGHTCODE_SYSLOG_FACILITY_PRINTER = 6,
  MIDNIGHTCODE_SYSLOG_FACILITY_NEWS = 7,
  MIDNIGHTCODE_SYSLOG_FACILITY_UUCP = 8,
  MIDNIGHTCODE_SYSLOG_FACILITY_TIME = 9,
  MIDNIGHTCODE_SYSLOG_FACILITY_AUTH = 10,
  MIDNIGHTCODE_SYSLOG_FACILITY_FTP = 11,
  MIDNIGHTCODE_SYSLOG_FACILITY_NTP = 12,
  MIDNIGHTCODE_SYSLOG_FACILITY_AUDIT = 13,
  MIDNIGHTCODE_SYSLOG_FACILITY_ALERT = 14,
  MIDNIGHTCODE_SYSLOG_FACILITY_CLOCK = 15,
  MIDNIGHTCODE_SYSLOG_FACILITY_LOCAL0 = 16,
  MIDNIGHTCODE_SYSLOG_FACILITY_LOCAL1 = 17,
  MIDNIGHTCODE_SYSLOG_FACILITY_LOCAL2 = 18,
  MIDNIGHTCODE_SYSLOG_FACILITY_LOCAL3 = 19,
  MIDNIGHTCODE_SYSLOG_FACILITY_LOCAL4 = 20,
  MIDNIGHTCODE_SYSLOG_FACILITY_LOCAL5 = 21,
  MIDNIGHTCODE_SYSLOG_FACILITY_LOCAL6 = 22,
  MIDNIGHTCODE_SYSLOG_FACILITY_LOCAL7 = 23
};

enum midnightcode_syslog_severity_t
{
  MIDNIGHTCODE_SYSLOG_SEVERITY_EMERG = 0,
  MIDNIGHTCODE_SYSLOG_SEVERITY_ALERT = 1,
  MIDNIGHTCODE_SYSLOG_SEVERITY_CRITICAL = 2,
  MIDNIGHTCODE_SYSLOG_SEVERITY_ERROR = 3,
  MIDNIGHTCODE_SYSLOG_SEVERITY_WARN = 4,
  MIDNIGHTCODE_SYSLOG_SEVERITY_NOTICE = 5,
  MIDNIGHTCODE_SYSLOG_SEVERITY_INFO = 6,
  MIDNIGHTCODE_SYSLOG_SEVERITY_DEBUG = 7
};

struct midnightcode_html_tag_element_t
{
  char * option;
  char * value;
  midnightcode_list_entry(midnightcode_html_tag_element_t)
};

midnightcode_list_head(midnightcode_html_tag_head_t,
                       midnightcode_html_tag_element_t)

struct midnightcode_html_document_element_t
{
  struct midnightcode_html_tag_head_t * tag;
  midnightcode_list_entry(midnightcode_html_document_element_t)
};

midnightcode_list_head(midnightcode_html_document_head_t,
                       midnightcode_html_document_element_t)

int midnightcode_syslog_facilitycheck(int facility);
int midnightcode_syslog_severitycheck(int severity);
int midnightcode_syslog_priority(int facility, int severity);

int midnightcode_html_urltype(char *parse_buf, int parse_len);
int midnightcode_html_urlbase(char *string_dst, char *parse_src, int parse_len,
                       int for_type);
int midnightcode_html_tagbit(char * parse_src, char * store_src,
                       int tag_state, int equal_state,
                       struct midnightcode_html_tag_element_t ** tag_element,
                       struct midnightcode_html_tag_head_t * tag,
                       struct midnightcode_html_document_head_t * document);
int midnightcode_html_parse(char *parse_buf, int parse_len,
                       struct midnightcode_html_document_head_t * document);

#endif
