/*
 * ===========================
 * VDK Builder
 * Version 0.1
 * Revision 0.0
 * January 1999
 * ===========================
 *
 * Copyright (C) 1998,1999 Mario Motta
 * Developed by Mario Motta <mmotta@guest.net>
 *
 * Based on VDK Library 
 * Copyright (C) 1998, Mario Motta
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 */
#ifndef _vdkb_prj_opt_h
#define _vdkb_prj_opt_h

#if HAVE_CONFIG_H
#include <config.h>
#endif

#if USE_XDB
#include <vdkxdb/vdkxdb.h>
#include <vdkxdb/vdkxtable.h>
#endif

#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <vdk/vdk.h>
#include <vdkb/vdkb_types.h>

// sections
#define END_SECTION "}"
#define COMPILERS_SECTION "compilers{"
#define LINK_SECTION "link{"
#define C_FLAGS_SECTION "compile_flags{"
#define DEFINES_SECTION "defines{"
#define INCLUDES_SECTION "includes{"
#define LIBS_SECTION "shared_libs{"
#define DEBUGGER_SECTION "debugger{"
#define PROGRAM_SECTION "program{"
#define PACKAGE_SECTION "package{"

#if USE_XDB
#include <vdkxdb/vdkxdb.h>
#include <vdkxdb/vdkxtable.h>
#define XDB_SECTION "xdb_section{"
#endif

// keys
#define END_KEY ";"
#define C_COMPILER "c_compiler:"
#define CC_COMPILER "cc_compiler:"
#define LINK "lnk:"
#define C_FLAGS "c_flags:"
#define DEFINES "def:"
#define INCLUDES "include:"
#define LIBS "so_libs:"
#define DEBUGGER "use_db:"
#define RUNARGS  "args:"
#define PKG_VERSION "version:"

#if USE_XDB
#define XDB_MAX_OPENTABLE 16
#define XDB_TABLE_OPEN "table:"
#define XDB_INDEX_OPEN "index:"
#endif

class VDKBProjectOptions
{
  int type;
 public:
  
  VDKString c_compiler,cc_compiler,link,c_flags,
    defines,includes,libs,debugger,runargs,version;
  VDKString filename;
  VDKBProjectOptions(int type = vdk_project);
  ~VDKBProjectOptions();
  bool Save();
  bool Load();
};

#if USE_XDB
extern bool SaveXdbOptions(VDKXDatabase* db, char* filename);
#endif

#endif
