Annotation of libwww/Library/src/HTSQLLog.html, revision 2.3

2.1       frystyk     1: <HTML>
                      2: <HEAD>
                      3:   <TITLE>W3C Sample Code Library libwww SQL Log Class</TITLE>
                      4: </HEAD>
                      5: <BODY>
                      6: <H1>
                      7:   SQL Log Class
                      8: </H1>
                      9: <PRE>
                     10: /*
                     11: **     (c) COPYRIGHT MIT 1995.
                     12: **     Please first read the full copyright statement in the file COPYRIGH.
                     13: */
                     14: </PRE>
                     15: <P>
                     16: This SQL based log class generates a SQL database and a set of tables storing
                     17: the results of a request. The result is stored in different tables depending
                     18: on whether it is information about the request or the resource returned.
                     19: <P>
                     20: This requires that you have linked against a <A href="http://www.tcx.se/">MySQL
                     21: library</A>. See the <A href="../../INSTALL.html">installation instructions</A>
                     22: for details.
                     23: <P>
2.2       frystyk    24: This module is implemented by <A HREF="HTSQLLog.c">HTSQLLog.c</A>, and it
2.3     ! frystyk    25: is a part of the <A HREF="http://www.w3.org/Library/"> W3C Sample
2.2       frystyk    26: Code Library</A>.
2.1       frystyk    27: <PRE>
                     28: #ifndef HTSQLLOG_H
                     29: #define HTSQLLOG_H
                     30: 
                     31: #include "HTReq.h"
                     32: </PRE>
                     33: <H2>
                     34:   Open and Close the Logs
                     35: </H2>
                     36: <H3>
                     37:   Connect to the SQL Server
                     38: </H3>
                     39: <P>
                     40: Create a new SQLLog object and connect to the SQL server.
                     41: <PRE>
                     42: typedef struct _HTSQLLog HTSQLLog;
                     43: 
                     44: extern HTSQLLog * HTSQLLog_connect (const char * host,
                     45:                                     const char * user, const char * pw);
                     46: </PRE>
                     47: <H3>
                     48:   Close Connection to the SQL Server
                     49: </H3>
                     50: <P>
                     51: Close the log file and delete the log object
                     52: <PRE>
                     53: extern BOOL HTSQLLog_close (HTSQLLog * me);
                     54: </PRE>
                     55: <H3>
                     56:   Open the Log Database
                     57: </H3>
                     58: <P>
                     59: This module creates its own database with a set of tables. If the database
                     60: already exists then open it and make sure i has the right tables.
                     61: <PRE>
                     62: typedef enum _HTSQLLogFlags {
                     63:     HTSQLLOG_CLEAR_URIS_TABLE          = 0x1,
                     64:     HTSQLLOG_CLEAR_LINKS_TABLE         = 0x2,
                     65:     HTSQLLOG_CLEAR_REQUESTS_TABLE      = 0x4,
                     66:     HTSQLLOG_CLEAR_RESOURCES_TABLE     = 0x8,
                     67:     HTSQLLOG_DROP_URIS_TABLE           = 0x10,
                     68:     HTSQLLOG_DROP_LINKS_TABLE          = 0x20,
                     69:     HTSQLLOG_DROP_REQUESTS_TABLE       = 0x40,
                     70:     HTSQLLOG_DROP_RESOURCES_TABLE      = 0x80
                     71: } HTSQLLogFlags; 
                     72: 
                     73: extern BOOL HTSQLLog_openDB (HTSQLLog * me, const char * db, HTSQLLogFlags flags);
                     74: </PRE>
                     75: <H2>
                     76:   Write Logdata to the Database
                     77: </H2>
                     78: <H3>
                     79:   Add a Log Entry
                     80: </H3>
                     81: <PRE>
                     82: extern BOOL HTSQLLog_addEntry (HTSQLLog * me, HTRequest * request, int status);
                     83: </PRE>
                     84: <H3>
                     85:   Add a Link Relationship Entry
                     86: </H3>
                     87: <PRE>
                     88: extern BOOL HTSQLLog_addLinkRelationship (HTSQLLog * me,
                     89:                                          const char * src_uri,
                     90:                                          const char * dst_uri,
                     91:                                          const char * link_type,
                     92:                                           const char * comment);
                     93: </PRE>
                     94: <H2>
                     95:   Options and Flags
                     96: </H2>
                     97: <H3>
                     98:   Make URIs Relative to this Base
                     99: </H3>
                    100: <P>
                    101: Instead of inserting the absolute URI then you can log relative URIs instead
                    102: which often saves a lot of space. Set the base URI using this function
                    103: <PRE>
                    104: extern BOOL HTSQLLog_makeRelativeTo (HTSQLLog * me, const char * relative);
                    105: </PRE>
                    106: <H3>
                    107:   How many times has this Log Object Been Accessed?
                    108: </H3>
                    109: <P>
                    110: This has nothing to do with the SQL database but merely returns the access
                    111: count number to the log or -1 if error.
                    112: <PRE>
                    113: extern int HTSQLLog_accessCount (HTSQLLog * me);
                    114: </PRE>
                    115: <PRE>
                    116: #endif
                    117: </PRE>
                    118: <P>
                    119:   <HR>
                    120: <ADDRESS>
2.3     ! frystyk   121:   @(#) $Id: HTSQLLog.html,v 2.2 1998/05/05 01:04:23 frystyk Exp $
2.1       frystyk   122: </ADDRESS>
                    123: </BODY></HTML>

Webmaster