Here is my shaga.h:
-----------------------------------------
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <mysql.h>
#include <sys/types.h>
#include <time.h>
#include <syslog.h>

#ifndef SHAGA_H
#define SHAGA_H

#define UNAME_L 8
#define PWD_L 8
#define Q_LINE_L 512

#define SHAGA_IDENT "ShagaEngine"
#define shaga_logfile "/var/log/shaga.log"
#define TMP_TABLE "tmp_traff"
//
int  db_connect(char *,char *,char *,char *,unsigned int);  /* 0 - success,1
- failure */
int  initShagaEngine(void);
void log_debug(char *);
void log_to_shaga(char *);
void log_to_syslog(char *);
int shutdownShagaEngine(void);
int isBlockedUser(char *);
struct _tr_info isOverdrafted(char *);
int __exit(int);
int blockUser(char *); /* returns 0 on sucsess,1 on failure */
int unblockUser(char *); // --|^|
int writeToDB(time_t __time,char *username,char * ip_address,char * bytes);

char MYSQL_ERR[Q_LINE_L];
char ERR_CONNECT[Q_LINE_L];
char ERR_INIT[Q_LINE_L];
char MSG_INIT[Q_LINE_L];
char ERR_VARIOUS[Q_LINE_L];
char DEBUG_STRING[Q_LINE_L];
char QBLOCKED_USER[Q_LINE_L];
char QOVERDRAFT_USER[Q_LINE_L];
char QBLOCK_USER[Q_LINE_L];
char QADD_REC_TODB[Q_LINE_L];
//
char timestr[25];
//const char SHAGA_IDENT[] = "ShagaEngine";
//const char shaga_logfile[] = "/var/log/shaga.log";
time_t ticks;
FILE *log_fd;
struct tm *thistime;
//
enum _logtype{ shaga,system_logger };
enum _onoff{ off , on };
//

//
struct _tr_info{

        u_int traffic_lim;
        u_int traffic_cur;
        u_int traffic_over;
        u_int reached; /* 0 - not reached,1 reached */
};
struct shaga_user{
        u_int id;
        char username[UNAME_L]; 
        char password[PWD_L];
        struct _tr_info tr_info; 
        u_int isBlocked; /* 0 - user is not blocked,1 - user is blocked */
};



int u_count; /* users count */

char *db_host;
char *db_name;
char *db_user;
char *db_pwd;
unsigned int db_port;

MYSQL_RES *result;
MYSQL_ROW row;
MYSQL *connection, mysql;
int state;
//
#endif

-- 
View this message in context: 
http://www.nabble.com/about-cf.data.pre-and-squid-compiling-tf4044722.html#a11691579
Sent from the Squid - Development mailing list archive at Nabble.com.

Reply via email to