2 * Copyright (C) 2002-2015 The DOSBox Team
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef DOSBOX_PROGRAMS_H
21 #define DOSBOX_PROGRAMS_H
23 #ifndef DOSBOX_DOSBOX_H
26 #ifndef DOSBOX_DOS_INC_H
42 CommandLine(int argc,char const * const argv[]);
43 CommandLine(char const * const name,char const * const cmdline);
44 const char * GetFileName(){ return file_name.c_str();}
46 bool FindExist(char const * const name,bool remove=false);
47 bool FindHex(char const * const name,int & value,bool remove=false);
48 bool FindInt(char const * const name,int & value,bool remove=false);
49 bool FindString(char const * const name,std::string & value,bool remove=false);
50 bool FindCommand(unsigned int which,std::string & value);
51 bool FindStringBegin(char const * const begin,std::string & value, bool remove=false);
52 bool FindStringRemain(char const * const name,std::string & value);
53 bool FindStringRemainBegin(char const * const name,std::string & value);
54 bool GetStringRemain(std::string & value);
55 int GetParameterFromList(const char* const params[], std::vector<std::string> & output);
56 void FillVector(std::vector<std::string> & vector);
57 unsigned int GetCount(void);
58 void Shift(unsigned int amount=1);
59 Bit16u Get_arglength();
62 typedef std::list<std::string>::iterator cmd_it;
63 std::list<std::string> cmds;
64 std::string file_name;
65 bool FindEntry(char const * const name,cmd_it & it,bool neednext=false);
75 std::string temp_line;
78 virtual void Run(void)=0;
79 bool GetEnvStr(const char * entry,std::string & result);
80 bool GetEnvNum(Bitu num,std::string & result);
81 Bitu GetEnvCount(void);
82 bool SetEnv(const char * entry,const char * new_string);
83 void WriteOut(const char * format,...); /* Write to standard output */
84 void WriteOut_NoParsing(const char * format); /* Write to standard output, no parsing */
85 void ChangeToLongCmd();
89 typedef void (PROGRAMS_Main)(Program * * make);
90 void PROGRAMS_MakeFile(char const * const name,PROGRAMS_Main * main);