/[dtapublic]/projs/trunk/shared_source/c_datd/cu_msgs.h
ViewVC logotype

Diff of /projs/trunk/shared_source/c_datd/cu_msgs.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 70 by dashley, Sat Oct 29 01:53:01 2016 UTC revision 71 by dashley, Sat Nov 5 11:07:06 2016 UTC
# Line 1  Line 1 
1  //$Header$  //$Header$
2  //-------------------------------------------------------------------------------------------------  //-------------------------------------------------------------------------------------------------
3  //This file is part of "David T. Ashley's Shared Source Code", a set of shared components  //This file is part of "David T. Ashley's Shared Source Code", a set of shared components
4  //integrated into many of David T. Ashley's projects.  //integrated into many of David T. Ashley's projects.
5  //-------------------------------------------------------------------------------------------------  //-------------------------------------------------------------------------------------------------
6  //This source code and any program in which it is compiled/used is provided under the MIT License,  //This source code and any program in which it is compiled/used is provided under the MIT License,
7  //reproduced below.  //reproduced below.
8  //-------------------------------------------------------------------------------------------------  //-------------------------------------------------------------------------------------------------
9  //Permission is hereby granted, free of charge, to any person obtaining a copy of  //Permission is hereby granted, free of charge, to any person obtaining a copy of
10  //this software and associated documentation files(the "Software"), to deal in the  //this software and associated documentation files(the "Software"), to deal in the
11  //Software without restriction, including without limitation the rights to use,  //Software without restriction, including without limitation the rights to use,
12  //copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the  //copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the
13  //Software, and to permit persons to whom the Software is furnished to do so,  //Software, and to permit persons to whom the Software is furnished to do so,
14  //subject to the following conditions :  //subject to the following conditions :
15  //  //
16  //The above copyright notice and this permission notice shall be included in all  //The above copyright notice and this permission notice shall be included in all
17  //copies or substantial portions of the Software.  //copies or substantial portions of the Software.
18  //  //
19  //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE  //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
22  //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23  //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24  //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  //SOFTWARE.  //SOFTWARE.
26  //-------------------------------------------------------------------------------------------------  //-------------------------------------------------------------------------------------------------
27  /* Messages common to command-line utilities.  They are collected  /* Messages common to command-line utilities.  They are collected
28  ** in one place to avoided redundancy.  ** in one place to avoided redundancy.
29  */  */
30    
31  #ifndef CU_MSGS_H_INCLUDED  #ifndef CU_MSGS_H_INCLUDED
32     #define CU_MSGS_H_INCLUDED     #define CU_MSGS_H_INCLUDED
33    
34     #ifdef MODULE_CU_MSGS     #ifdef MODULE_CU_MSGS
35        #define DECMOD_CU_MSGS        #define DECMOD_CU_MSGS
36     #else     #else
37        #define DECMOD_CU_MSGS extern        #define DECMOD_CU_MSGS extern
38     #endif     #endif
39    
40     //This is the structure type used to pass back to a caller     //This is the structure type used to pass back to a caller
41     //the results of looking at his command-line parameter(s).     //the results of looking at his command-line parameter(s).
42     typedef struct     typedef struct
43        {        {
44        int debug;        int debug;
45           //True if -debug flag was used.           //True if -debug flag was used.
46        int noformat;        int noformat;
47           //True if -noformat flag was used.           //True if -noformat flag was used.
48        int help;        int help;
49           //True if -help flag was used.           //True if -help flag was used.
50        int verbose;        int verbose;
51           //True if the -verbose option was used.           //True if the -verbose option was used.
52        } CU_MSGS_std_cmd_line_par_results_struct;        } CU_MSGS_std_cmd_line_par_results_struct;
53    
54     //Prints out the message which should occur when too few     //Prints out the message which should occur when too few
55     //arguments are used on the command-line.     //arguments are used on the command-line.
56     DECMOD_CU_MSGS     DECMOD_CU_MSGS
57     void CU_MSGS_too_few_args_msg(FILE *s, const char *pname);     void CU_MSGS_too_few_args_msg(FILE *s, const char *pname);
58    
59     //Prints out the message which supplies download     //Prints out the message which supplies download
60     //and license information.     //and license information.
61     DECMOD_CU_MSGS     DECMOD_CU_MSGS
62     void CU_MSGS_toolset_info_msg(FILE *s, const char *pname);     void CU_MSGS_toolset_info_msg(FILE *s, const char *pname);
63    
64     //Prints standard options, indented by 3 and 6 spaces.     //Prints standard options, indented by 3 and 6 spaces.
65     DECMOD_CU_MSGS     DECMOD_CU_MSGS
66     void CU_MSGS_std_options(FILE *s, const char *pname);     void CU_MSGS_std_options(FILE *s, const char *pname);
67    
68     //Initializes the common parameter block structure,     //Initializes the common parameter block structure,
69     //including any dynamic allocation (at this time, none).     //including any dynamic allocation (at this time, none).
70     DECMOD_CU_MSGS     DECMOD_CU_MSGS
71     void CU_MSGS_cmd_line_par_results_struct_create(     void CU_MSGS_cmd_line_par_results_struct_create(
72                  CU_MSGS_std_cmd_line_par_results_struct *arg);                  CU_MSGS_std_cmd_line_par_results_struct *arg);
73    
74     //Processes the passed command-line argument into the     //Processes the passed command-line argument into the
75     //structure.     //structure.
76     DECMOD_CU_MSGS     DECMOD_CU_MSGS
77     void CU_MSGS_cmd_line_par_results_struct_process_arg(     void CU_MSGS_cmd_line_par_results_struct_process_arg(
78             CU_MSGS_std_cmd_line_par_results_struct *argblock,             CU_MSGS_std_cmd_line_par_results_struct *argblock,
79             const char *arg, int *recognized);             const char *arg, int *recognized);
80    
81     //Finalizes the results, such as taking care of conflicting     //Finalizes the results, such as taking care of conflicting
82     //switches, etc.     //switches, etc.
83     void CU_MSGS_cmd_line_par_results_struct_finalize(     void CU_MSGS_cmd_line_par_results_struct_finalize(
84             CU_MSGS_std_cmd_line_par_results_struct *arg);             CU_MSGS_std_cmd_line_par_results_struct *arg);
85    
86     //Destroys the command-line argument.  This is left as a     //Destroys the command-line argument.  This is left as a
87     //hook in case dynamic allocation is ever required.     //hook in case dynamic allocation is ever required.
88     DECMOD_CU_MSGS     DECMOD_CU_MSGS
89     void CU_MSGS_cmd_line_par_results_struct_destroy(     void CU_MSGS_cmd_line_par_results_struct_destroy(
90             CU_MSGS_std_cmd_line_par_results_struct *arg);             CU_MSGS_std_cmd_line_par_results_struct *arg);
91    
92     //Passed a pointer to a table of function pointers, each of which     //Passed a pointer to a table of function pointers, each of which
93     //returns a character string, emit version control information     //returns a character string, emit version control information
94     //to the passed stream.  Should supply program name in all upper     //to the passed stream.  Should supply program name in all upper
95     //case.     //case.
96     DECMOD_CU_MSGS     DECMOD_CU_MSGS
97     void CU_MSGS_emit_vcinfo_from_ptr_table(FILE *s,     void CU_MSGS_emit_vcinfo_from_ptr_table(FILE *s,
98                                             const char *(**ptrs)(void),                                             const char *(**ptrs)(void),
99                                             const char *pname);                                             const char *pname);
100    
101     DECMOD_CU_MSGS const char *CU_MSGS_cvcinfo(void);     DECMOD_CU_MSGS const char *CU_MSGS_cvcinfo(void);
102     DECMOD_CU_MSGS const char *CU_MSGS_hvcinfo(void);     DECMOD_CU_MSGS const char *CU_MSGS_hvcinfo(void);
103     #define CU_MSGS_H_VERSION ("$Header$")     #define CU_MSGS_H_VERSION ("$Header$")
104  #endif  #endif
105    
106  //End of cu_msgs.h.  //End of cu_msgs.h.

Legend:
Removed from v.70  
changed lines
  Added in v.71

dashley@gmail.com
ViewVC Help
Powered by ViewVC 1.1.25