/*************************************************************************
 * Ralink Tech Inc.                                                      *
 * 4F, No. 2 Technology 5th Rd.                                          *
 * Science-based Industrial Park                                         *
 * Hsin-chu, Taiwan, R.O.C.                                              *
 *                                                                       *
 * (c) Copyright 2002, Ralink Technology, Inc.                           *
 *                                                                       *
 * 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; either version 2 of the License, or     * 
 * (at your option) any later version.                                   * 
 *                                                                       * 
 * 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     * 
 * along with this program; if not, write to the                         * 
 * Free Software Foundation, Inc.,                                       * 
 * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             * 
 *                                                                       * 
 *************************************************************************

    Module Name:
    configapi.h

    Abstract:
        Implement getkeystring / writekeystring like windows API.

    Revision History:
    Who            When          What
    --------    ----------      ----------------------------------------------
    Paul Wu     01-22-2003      created

*/

#ifndef _CONFIGAPI_H
#define _CONFIGAPI_H

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#define MAX_CHARS 256          // Maximum characters/line in Configuration File.
#define NEWLINE   "\n"

#ifndef TRUE
#define TRUE 1
#endif

#ifndef FALSE
#define FALSE 0
#endif

int isfound(char *ptr, char *ini_buffer);
char *find_header(char *ini_buffer, char *header_name);
int get_parameter(char *str, int strsize, char *key, char *offset);
char *find_parameter(char *key, char *offset, int *length);
int writekeystring(char *section, char *key, char *str, char *path, char *filename);
int getkeystring(char *section, char *key, char *dest, int strsize, char *path, char *filename);

#endif //_CONFIGAPI_H
