working on the C version
This commit is contained in:
parent
6995967283
commit
e5f80ed5d9
|
@ -0,0 +1,60 @@
|
||||||
|
#include "cmdlineoptions.h"
|
||||||
|
|
||||||
|
|
||||||
|
CmdOptions cmdoptions;
|
||||||
|
|
||||||
|
void CmdOptions_Init(){
|
||||||
|
if (cmdoptions.init == 0) {
|
||||||
|
cmdoptions.init = 1;
|
||||||
|
// do we have to init something?
|
||||||
|
// add the help option
|
||||||
|
CmdOptions_Add("help","--help");
|
||||||
|
CmdOptions_Add("help","-h");
|
||||||
|
CmdOptions_Add("help","-?");
|
||||||
|
CmdOptions_AddDescription("help","Display the help text.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int CmdOptions_Parse(int argc, char** argv){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int CmdOptions_Add(char* name, char* option){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int CmdOptions_AddDefaultParameter(char* name, char* defaultparameter){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int CmdOptions_AddPossibleParameter(char* name, char* possibleParameter){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int CmdOptions_AddDescription(char* name, char* description) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CmdOptions_IsSet(char* name) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
char* CmdOptions_Get(char* name) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int CmdOptions_GetInt(char* name) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
long CmdOptions_GetLong(char* name){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
double CmdOptions_GetDouble(char* name) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int CmdOptions_GetAll(char* name, char** values, unsigned int* count) {
|
||||||
|
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef CMDLINEOPTIONS_H
|
#ifndef CMDLINEOPTIONS_H
|
||||||
#define CMDLINEOPTIONS_H
|
#define CMDLINEOPTIONS_H
|
||||||
|
|
||||||
|
|
||||||
struct Option {
|
struct Option {
|
||||||
char* name; // the name of this option
|
char* name; // the name of this option
|
||||||
char** options; //dashed option name and alternatives
|
char** options; //dashed option name and alternatives
|
||||||
|
@ -17,11 +16,22 @@ struct Option {
|
||||||
bool set; // boolean if this option has been set
|
bool set; // boolean if this option has been set
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct CONode {
|
||||||
|
CONode* prev;
|
||||||
|
CONode* next;
|
||||||
|
Option* option;
|
||||||
|
};
|
||||||
|
|
||||||
struct CmdOptions {
|
struct CmdOptions {
|
||||||
bool init;
|
bool init;
|
||||||
Option** options;
|
CONode* options;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Main structure
|
||||||
|
*/
|
||||||
|
extern CmdOptions cmdoptions;
|
||||||
|
|
||||||
/** Init function dummy.
|
/** Init function dummy.
|
||||||
*/
|
*/
|
||||||
void CmdOptions_Init();
|
void CmdOptions_Init();
|
||||||
|
|
Loading…
Reference in New Issue