X11 Work Bench Toolkit  1.0
refactor.h
1 
2 // __ _ _ //
3 // _ __ ___ / _| __ _ ___ | |_ ___ _ __ | |__ //
4 // | '__|/ _ \| |_ / _` | / __|| __|/ _ \ | '__|| '_ \ //
5 // | | | __/| _|| (_| || (__ | |_| (_) || | _ | | | | //
6 // |_| \___||_| \__,_| \___| \__|\___/ |_|(_)|_| |_| //
7 // //
8 // Code 're-factor' utility - stand-alone or utility API //
9 // //
11 
12 /*****************************************************************************
13 
14  X11workbench - X11 programmer's 'work bench' application and toolkit
15  Copyright (c) 2010-2016 by Bob Frazier (aka 'Big Bad Bombastic Bob')
16  all rights reserved
17 
18  DISCLAIMER: The X11workbench application and toolkit software are supplied
19  'as-is', with no warranties, either implied or explicit.
20  Any claims to alleged functionality or features should be
21  considered 'preliminary', and might not function as advertised.
22 
23  BSD-like license:
24 
25  There is no restriction as to what you can do with this software, so long
26  as you include the above copyright notice and DISCLAIMER for any distributed
27  work that is equal to or derived from this one, along with this paragraph
28  that explains the terms of the license if the source is also being made
29  available. A "derived work" describes a work that uses a significant portion
30  of the source files or algorithms that are included with this one.
31  Specifically excluded from this are files that were generated by the software,
32  or anything that is included with the software that is part of another package
33  (such as files that were created or added during the 'configure' process).
34  Specifically included is the use of part or all of any of the X11 workbench
35  toolkit source or header files in your distributed application. If you do not
36  ship the source, the above copyright statement is still required to be placed
37  in a reasonably prominent place, such as documentation, splash screens, and/or
38  'about the application' dialog boxes.
39 
40  Use and distribution are in accordance with GPL, LGPL, and/or the above
41  BSD-like license. See COPYING and README files for more information.
42 
43 
44  Additional information at http://sourceforge.net/projects/X11workbench
45 
46 ******************************************************************************/
47 
48 
49 #ifndef _REFACTOR_H_INCLUDED_
50 #define _REFACTOR_H_INCLUDED_
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif // __cplusplus
55 
56 
57 enum
58 {
59  refactor_symbol_functions = 1,
60  refactor_symbol_variables = 2,
61  refactor_symbol_macros = 4,
62  refactor_symbol_classes = 8,
63  refactor_symbol_members = 0x10,
64 
65  refactor_symbol_all = 0x7fffffff,
66  refactor_symbol_nocase = 0x80000000
67 };
68 
69 enum
70 {
71  refactor_indent_width_mask = 0xf,
72  refactor_indent_split_ll = 0x10, // split long lines (lineup with '(' or soft tab depending on flags)
73  refactor_indent_hard_tab = 0x20,
74  refactor_indent_split_str = 0x40, // split long strings as well as long lines of code
75  refactor_indent_soft_tab_line_cont = 0x80, // 'soft tab' line continuations (or '{}' depending on other flags)
76  refactor_indent_KandR = 0x100,
77  refactor_indent_1TBS = 0x200, // K&R with } else {
78  refactor_indent_Allman = 0x400,
79  refactor_indent_BSD = 0x400, // alias for 'Allman'
80  refactor_indent_BSD_KNF = 0x4a8, // BSD kernel normal format, ITBS with 8 char hard tab, 4 char soft tab for line continuations
81  // (don't include this with any other flags)
82  refactor_indent_Whitesmith = 0x800, // BSD with tabbed '{}' for control/scope, function and struct body '{}' not tabbed over
83  refactor_indent_GNU = 0x880, // half-indent '{}'
84 
85  refactor_reserved = 0xf000, // reserved flags
86 
87  refactor_lang_MASK = 0xf0000,
88  refactor_lang_C = 0x10000,
89  refactor_lang_CPP = 0x20000,
90  refactor_lang_Pascal = 0x30000,
91  refactor_lang_Java = 0x40000,
92 
93  // other languages reserved
94 
95 
96 };
97 
98 // workbench refactor tools - RESERVED
99 
100 int refactor_symbol(const char *szSymbol, const char *szFile, int iFlags);
101 int refactor_indent(const char *szFile, int iFlags); // TODO: calls 'indent' application?
102 
103 #ifdef __cplusplus
104 };
105 #endif // __cplusplus
106 
107 
108 #endif // _REFACTOR_H_INCLUDED_
109