wd
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cmdln.h
Go to the documentation of this file.
1 /*
2  Copyright 2013 John Bailey
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
17 #if !defined CMDLN_H
18 #define CMDLN_H
19 
20 #include <sys/param.h>
21 
22 typedef enum {
30 } wd_oper_t;
31 
32 typedef enum {
38 } wd_entity_t;
39 
40 typedef enum {
45 
46 typedef struct {
53  char* list_fn;
56  char wd_oper_dir[ MAXPATHLEN ];
61  int wd_prompt;
68  time_t wd_now_time;
75 
80 void init_cmdln( config_container_t* const p_config );
81 int process_cmdln( config_container_t* const p_config, const int argc, char* const argv[] );
82 int process_env( config_container_t* const p_config );
83 
84 #define _DEBUG
85 #if defined _DEBUG
86 #define DEBUG_OUT( ... ) do { fprintf(stdout,"wd: " __VA_ARGS__ ); fprintf(stdout,"\n"); fflush(stdout); } while( 0 )
87 #else
88 #define DEBUG_OUT( ... )
89 #endif
90 
91 #endif
char * wd_bookmark_name
Name of a bookmark read from the command line on which operations should be performed.
Definition: cmdln.h:59
int wd_output_all
Control whether or not all items should be output regardless of whether or not they seem to point to ...
Definition: cmdln.h:73
time_t wd_now_time
Time to use as the current time when manipulating datestamps.
Definition: cmdln.h:68
wd_oper_t wd_oper
Type of operation which the command line has instructed should be performed.
Definition: cmdln.h:49
void init_cmdln(config_container_t *const p_config)
Initialise the specified config with default values.
Definition: cmdln.c:86
wd_entity_t
Definition: cmdln.h:32
char * list_fn
Directory containing list of bookmarks.
Definition: cmdln.h:53
int process_cmdln(config_container_t *const p_config, const int argc, char *const argv[])
Definition: cmdln.c:378
int wd_store_access
Indicate whether or not access times should be stored in the bookmarks.
Definition: cmdln.h:64
int wd_prompt
Indicate whether or not to run in &quot;interactive&quot; mode.
Definition: cmdln.h:61
wd_dir_format_t wd_dir_form
Format in which file paths should be output.
Definition: cmdln.h:51
wd_dir_format_t
Definition: cmdln.h:40
wd_oper_t
Definition: cmdln.h:22
wd_entity_t wd_entity_type
Control which types of entity should be included in the output.
Definition: cmdln.h:70
int process_env(config_container_t *const p_config)
Definition: cmdln.c:297