HOME   ·Î±×ÀΠ  ȸ¿ø°¡ÀÔ
    
ȸ¿ø°¡ÀÔ
ºñ¹Ð¹øÈ£ ã±â ÀÚµ¿·Î±ä
ÀÌÀü°Ô½ÃÆÇ
   free_board
   °Ç°­°Ô½ÃÆÇ
   ¿À¶óŬDB
   Linux
   HTML/javascript
   Áú¹®°ú ´ä
È£¼­±â
   À̹ÌÁö°Ô½ÃÆÇ  
   °Ç°­°Ô½ÃÆÇ  
   À½¾ÇÀÚ·á  
   ¼ºÁØÀÌ °Ô½ÃÆÇ  
  c ¿¡¼­ ini Àбâ 2008-05-28 13:44:44  
  À̸§ : È£¼®  (121.¢½.39.7)  Á¶È¸: 308    
#################
c ¿¡¼­ ini Àбâ
ÇÔ¼ö±¸Çö
>>> daemon.ini
[POSMAST]
port_no=33001
maxfork=40
logpath=/home/rh3drim/poscomm/log
[POSSALER]
port_no=33002
maxfork=40
datapath=/home/rh3drim/poscomm/data
backpath=/home/rh3drim/poscomm/data/sale
logpath=/home/rh3drim/poscomm/log
[POSSALEU]
datapath=/home/rh3drim/poscomm/data
backpath=/home/rh3drim/poscomm/data/sale
logpath=/home/rh3drim/poscomm/log
runcycle=3

>>> Çì´õÆÄÀÏ

#define INIFILE     "daemon.ini"        /* ȯ°æ ¼³Á¤ INI                      */
#define NPHOME      getenv("NPHOME")    /* HOME µð·ºÅ丮                      */
#define DAEMON_NAME             "POSMAST"
>>> ¼Ò½º
>>>>
    /*------------------------------------------------------------------------*/
    /*----- INIÈ­ÀÏ READ */
    /*------------------------------------------------------------------------*/
    /*-INI ÆÄÀÏ °æ·Î ¼³Á¤-*/
    snprintf(ini_path, sizeof(ini_path), "%s/bin/%s", NPHOME, INIFILE);
    memset(port_no,0x00,sizeof(port_no));
    if (get_inifile(ini_path, DAEMON_NAME, "port_no", port_no, sizeof(port_no)) == FALSE){
        printf("ȯ°æÆÄÀÏ[%s] ¿À·ù => [%s]ÀÇ  port_no¸¦ È®ÀÎÇϽʽÿä.\n", ini_path, DAEMON_NAME);
        exit(1);
    }
   

/******************************************************************************/
/* INI FILE READ                                                              */
/******************************************************************************/
int get_inifile(cFileName, cSetionName, cKeyName, cReturned, size)
char*   cFileName;
char*   cSetionName;
char*   cKeyName;
char*   cReturned;
int     size;
{
     char  cprobuff[BUFF_SIZE];
     FILE  *fp_file;
    /*** ȯ°æÈ­ÀÏ ¿­±â ***/
    if((fp_file = fopen(cFileName, "r")) == NULL){
        fclose(fp_file);
        return FALSE;
    }
    while(1) {
        memset(cprobuff, 0x00, sizeof (cprobuff));
            if(fgets(cprobuff,BUFF_SIZE, fp_file) == NULL) {/* File Á¤º¸ Àбâ */
                fclose(fp_file);
            return FALSE;
            }
            else{
                cprobuff[strlen(cprobuff)] = '\0';
                /* Section¸í °Ë»ç*/
                if (cprobuff[0] == '[' && memcmp(&cprobuff[1], cSetionName, strlen(cSetionName)) == 0
                               && cprobuff[strlen(cSetionName)+1] == ']') {
                    while(1) {/* File Á¤º¸ Àбâ*/
                        memset (cprobuff, '\0', sizeof (cprobuff));
                            if(fgets(cprobuff, BUFF_SIZE, fp_file) == NULL) {
                            fclose(fp_file);
                                return FALSE;
                            }
                            else {
                                cprobuff[strlen(cprobuff)] = '\0';
                                    /* ´Ù¸¥ Section*/
                                    if (cprobuff[0] == '[') {
                                fclose(fp_file);
                                    return FALSE;
                                    }
                                    /* Key °Ë»ç */
                                    if (memcmp(cprobuff, cKeyName, strlen(cKeyName)) == 0
                                            && cprobuff[strlen(cKeyName)] == '=') {
                                        memset (cReturned, '\0', size);
                                        memcpy (&cReturned[0],   &cprobuff[strlen(cKeyName)+1],
                                                     (int)(strlen(cprobuff) - strlen(cKeyName) - 2));
                                        cReturned[(int)(strlen(cprobuff) - strlen(cKeyName) - 2)]= 0x00;
                                fclose(fp_file);
                                return TRUE;
                                    }
                            }
                        }/* End of while(1) */
                }
            }
    }/* End of while(1) {  */
    fclose(fp_file);
    return FALSE;
}   

¸ñ·Ï
°Ô½Ã¹° 12°Ç
No Title Name Date Hits
75   xml ttt È£¼® 10-12-08 32
74   111 È£¼® 10-10-28 14
73   ³óÃÌ ¼Ò¼È³×Æ®¿öÅ© ¤Ð¤Ð È£¼® 10-03-28 113
72   Ä¿¼­ Ȱ¿ë È£¼® 10-03-26 114
71   22222222 È£¼® 10-03-09 159
70   111 È£¼® 10-03-08 187
69   Standby Database ±¸Ãà [DB] ¿À¶óŬ È£¼® 10-01-31 121
68   Àû¼öº¸µå¿¡¼­ ·Î±×Àνà ¹®Á¦´Â ÄíŰ¹®Á¦ È£¼® 09-01-19 289
66   ¼Ò½º¼öÁ¤½Ã echo 󸮽à ÀÚ½ÅÀÇ ¾ÆÀÌÇǸ¸ Àû¿ëÇϱâ È£¼® 08-11-03 242
64   rh2 ³¯Â¥ Á¶°ÇÀÌ ¾ø´Â Äõ¸® È£¼® 08-10-01 236
  c ¿¡¼­ ini Àбâ È£¼® 08-05-28 309
48   sga_max_size º¯°æ ÀýÂ÷ (1) È£¼® 07-10-01 1110
 
Copyright © zenos.pe.kr. All rights reserved.