
#include<stdio.h>
#include<unistd.h>
#include<netinet/in.h>
#include<string.h>
#include<stdlib.h>
#include<pthread.h>


#include"zither.h"
#include<almemsys/almemsys.h>



int path_check(char *chA)
{
int bu, count, co;
char ch[34][IP_LEN];
count = 0;

for(co = 0; co < 34; co++){
   memset(ch[co], 0x00, IP_LEN);
   }

char * non="NON";
char * err_log="ERR_LOG";
char * con_log="CON_LOG";
char * file_lock="FILE_LOCK";
char * file_conf="FILE_CONF";
char * sock_ipaddr="SOCK_IPADDR";
char * sock_port="SOCK_PORT";
char * pro_count="PRO_COUNT";
char * mail_from="MAIL_FROM";
char * mail_rcptto="MAIL_RCPTTO";
char * mail_serv="MAIL_SERV";
char * life_int="LIFE_INT";
char * life_los="LIFE_LOS";
char * mail_cc="MAIL_CC";
char * uid="UID"; 
char * mail_onoff="MAIL_ONOFF"; 
char * cfile_lock="CFILE_LOCK";
char * pg_data="PG_DATA";
char * pg_web="PG_WEB";
char * life_onoff="LIFE_ONOFF"; 
char * mysql_server="MYSQL_SERVER";
char * mysql_username="MYSQL_USERNAME";
char * mysql_password="MYSQL_PASSWORD";
char * mysql_db="MYSQL_DB"; 
char * db_select="DB_SELECT";
char * on_bcc="ON_BCC";
char * cron_onoff="CRON_ONOFF";
char * sig_filename="SIG_FILENAME";
char * sig_interval="SIG_INTERVAL";
char * midump_filename ="MIDUMP_FILE";
char * midump_filename_2 ="MIDUMP_FILE_2";
char * mid_max ="MID_MAX";
char * mid_int="MID_INT";

self_memcpy(ch[0], non, IP_LEN);
self_memcpy(ch[1], err_log, IP_LEN);
self_memcpy(ch[2], file_conf, IP_LEN);
self_memcpy(ch[3], sock_ipaddr, IP_LEN);
self_memcpy(ch[4], sock_port, IP_LEN);
self_memcpy(ch[5], pro_count, IP_LEN);
self_memcpy(ch[6], mail_from, IP_LEN);
self_memcpy(ch[7], mail_rcptto, IP_LEN);
self_memcpy(ch[8], mail_serv, IP_LEN);
self_memcpy(ch[9], life_int, IP_LEN);
self_memcpy(ch[10], life_los, IP_LEN);
self_memcpy(ch[11], mail_cc, IP_LEN);
self_memcpy(ch[12], file_lock, IP_LEN);
self_memcpy(ch[13], uid, IP_LEN);
self_memcpy(ch[14], mail_onoff, IP_LEN);
self_memcpy(ch[15], cfile_lock, IP_LEN);
self_memcpy(ch[16], con_log, IP_LEN);
self_memcpy(ch[17], pg_data, IP_LEN);
self_memcpy(ch[18], pg_web, IP_LEN);
self_memcpy(ch[19], life_onoff, IP_LEN);
self_memcpy(ch[20], mysql_server, IP_LEN);
self_memcpy(ch[21], mysql_username, IP_LEN);
self_memcpy(ch[22], mysql_password, IP_LEN);
self_memcpy(ch[23], mysql_db, IP_LEN);
self_memcpy(ch[24], db_select, IP_LEN);
self_memcpy(ch[25], on_bcc, IP_LEN);
self_memcpy(ch[26], cron_onoff, IP_LEN);
self_memcpy(ch[27], sig_filename, IP_LEN);
self_memcpy(ch[28], sig_interval, IP_LEN);
self_memcpy(ch[29], midump_filename, IP_LEN);
self_memcpy(ch[30], midump_filename_2, IP_LEN);
self_memcpy(ch[31], mid_max, IP_LEN);
self_memcpy(ch[32], mid_int, IP_LEN);


bu = 0;
if(IP_LEN > strlen(chA)){
   for(count=0; count < 33; count++){
      if(0 == self_memcmp(chA, ch[count])){
         bu=count;
         }
      }
   }
else{
   fprintf(stderr,"big size mess err. %s\n", chA);
   } 
return(bu);
}




