#ifndef VOLGIT_SYSTEM_PART_C #define VOLGIT_SYSTEM_PART_C VOLGIT_SYSTEM_PART_C #include const char *const default_header="GIT"; const char *const default_footer=""; struct Volgit_Options options = { .input_path=NULL, .output_path=NULL, .header=default_header, .footer=default_footer, .output_dir_fd=-1, .tree_cutoff=NO_TREE_CUTOFF, .output_is_tree_like=0, }; const char *usage= "Options: \n" " --input \n" " --output \n" " --header \n" " --footer \n" " --tree \n" " Use 'tree' like output for directory index\n" " --tree-cutoff \n" " The tree output can get too bulky\n" " so you can set a depth at which the output\n" " is seperated into a different file\n" " -h --help\n" " Print this message\n"; static inline int get_next_option_or_die(int i,int argc,const char *error_message) { if(i+1>=argc) die(error_message); return i+1; } void parse_options(int argc,char **argv) { #define if_option(option) if(!strncmp(argv[i],option,sizeof(option))) int i; if(argc==1) die(usage); for(i=1;i%s\n",oid,filename); } void push_html_link_for_tree(FILE *out,const char *filename,const char *oid) { fprintf(out,"%s\n",oid,filename); } #endif