File: arguments.h

package info (click to toggle)
xfireworks 1.3-16
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,036 kB
  • sloc: ansic: 6,896; makefile: 383; sh: 40
file content (34 lines) | stat: -rw-r--r-- 1,067 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*****************************************************************************/
/* 実行時のコマンドラインオプションの読み込み用のライブラリ                  */
/*****************************************************************************/

#ifndef _Arguments_h_INCLUDED_
#define _Arguments_h_INCLUDED_

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

#define ARGUMENTS_NONE     0
#define ARGUMENTS_FLAG     1
#define ARGUMENTS_FLAG_ON  2
#define ARGUMENTS_FLAG_OFF 3
#define ARGUMENTS_INTEGER  4
#define ARGUMENTS_STRING   5
#define ARGUMENTS_FUNCTION 6

#define ARGUMENTS_TRUE  1
#define ARGUMENTS_FALSE 0

typedef struct _Argument {
  char * name;
  short int flag;
  void * value;
} Argument;

/*===========================================================================*/
/* コマンドラインオプションの読み込み(戻り値は処理したオプションの数)        */
/*===========================================================================*/

int Arguments_Read(int * argc, char ** argv, Argument arguments[]);

#endif