siliconBrainOption.h
#ifndef siliconBrainOption_alreadyIncluded
#define siliconBrainOption_alreadyIncluded
/******************************************** -*-c-*- ***********************************************/
/*                                                                                                  */
/* siliconBrainOption.h:                                                                            */
/*                                                                                                  */
/****************************************************************************************************/

/****************************************************************************************************/
/*                                                                                                  */
/*     Copyright (C) 2004 Joerg Kunze                                                               */
/*                                                                                                  */
/*     This file is part of siliconBrain.                                                           */
/*                                                                                                  */
/*     siliconBrain 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.                                                          */
/*                                                                                                  */
/*     siliconBrain 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                    */
/*                                                                                                  */
/****************************************************************************************************/
#include <stdbool.h>
#include "siliconBrainSpecification"
#include "siliconBrainLib"

// char *siliconBrainRelease       = "$siliconBrainRelease: 0.2.3 $";
// char *siliconBrainRcsIdentifier = "$Id: siliconBrainOption.h,v 1.10 2004/12/14 23:31:26 joerg Exp $";
// char *siliconBrainSaveStamp     = "$siliconBrainSaveStamp: 2004/12/14 22:16:32, Joerg Kunze$";

/****************************************************************************************************/
/*                                                                                                  */
/* typedef:                                                                                         */
/*                                                                                                  */
/****************************************************************************************************/
typedef struct {
   const char *name;
   bool        alreadyConfigured;
   void       *value;
   OptionType  optionType;
} OptionProcessed;

typedef enum {
   commandOk = 0,
   commandStop = 1,
   commandError = -1
} CommandReturnCode;

typedef CommandReturnCode (*UserCommand)( void *options, void *commandData, String source );

typedef struct {
   UserCommand userCommand;

   CommandReturnCode *(*openCommand )( const void *options );
   CommandReturnCode  (*openFile    )( const void *options, void *data, String fileName );
   CommandReturnCode  (*closeFile   )( const void *options, void *data, String fileName );
   CommandReturnCode  (*closeCommand)( const void *options, void *data );

} FileReaderContext;

/****************************************************************************************************/
/*                                                                                                  */
/* prototype:                                                                                       */
/*                                                                                                  */
/****************************************************************************************************/
void optionReadOptions( OptionProcessed options[], Obstack *obstack, const char * const packageName );

extern CommandReturnCode fileReader( FileReaderContext *context, void *options, int argc, char *argv[] );
extern CommandReturnCode pipeReader( FileReaderContext *context, void *options, int fileDescriptor     );

#endif

/*
$Log: siliconBrainOption.h,v $
Revision 1.10  2004/12/14 23:31:26  joerg
published for new release 0.2.3

Revision 1.9  2004/12/14 23:17:05  joerg
published for new release 0.2.2

Revision 1.8  2004/12/14 22:20:09  joerg
pipe output of make command into stringSearch c-function
without creating a process for stringSearch. The later is used as a C-function command, not as a main.

*/