X11workbench Toolkit  1.0
refactor.h
1 // __ _ _ //
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-2018 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 
21  BSD-like license:
22 
23  There is no restriction as to what you can do with this software, so long
24  as you include the above copyright notice and DISCLAIMER for any distributed
25  work that is linked with, equivalent to, or derived from any portion of this
26  software, along with this paragraph that explains the terms of the license if
27  the source is also being made available. "Linked with" includes the use of a
28  portion of any of the source and/or header files, or their compiled binary
29  output, as a part of your application or library. A "derived work"
30  describes a work that uses a significant portion of the source files or the
31  algorithms that are included with this software.
32 
33  EXCLUSIONS
34 
35  Specifically excluded from this requirement are files that were generated by
36  the software, or anything that is included with the software that is part of
37  another package (such as files that were created or added during the
38  'configure' process).
39 
40  DISTRIBUTION
41 
42  The license also covers the use of part or all of any of the X11 workbench
43  toolkit source or header files in your distributed application, in source or
44  binary form. If you do not ship the source, the above copyright statement
45  and DISCLAIMER is still required to be placed in a reasonably prominent
46  place, such as documentation, splash screens, and/or 'about the application'
47  dialog boxes.
48 
49  Use and distribution are in accordance with GPL, LGPL, and/or the above
50  BSD-like license. See COPYING and README.md files for more information.
51 
52  Additionally, this software, in source or binary form, and in whole or in
53  part, may be used by explicit permission from the author, without the need
54  of a license.
55 
56  Additional information at http://sourceforge.net/projects/X11workbench
57  and http://bombasticbob.github.io/X11workbench/
58 
59 ******************************************************************************/
60 
61 
62 #ifndef _REFACTOR_H_INCLUDED_
63 #define _REFACTOR_H_INCLUDED_
64 
65 #ifdef __cplusplus
66 extern "C" {
67 #endif // __cplusplus
68 
69 
70 enum
71 {
72  refactor_symbol_functions = 1,
73  refactor_symbol_variables = 2,
74  refactor_symbol_macros = 4,
75  refactor_symbol_classes = 8,
76  refactor_symbol_members = 0x10,
77 
78  refactor_symbol_all = 0x7fffffff,
79  refactor_symbol_nocase = 0x80000000
80 };
81 
82 enum
83 {
84  refactor_indent_width_mask = 0xf,
85  refactor_indent_split_ll = 0x10, // split long lines (lineup with '(' or soft tab depending on flags)
86  refactor_indent_hard_tab = 0x20,
87  refactor_indent_split_str = 0x40, // split long strings as well as long lines of code
88  refactor_indent_soft_tab_line_cont = 0x80, // 'soft tab' line continuations (or '{}' depending on other flags)
89  refactor_indent_KandR = 0x100,
90  refactor_indent_1TBS = 0x200, // K&R with } else {
91  refactor_indent_Allman = 0x400,
92  refactor_indent_BSD = 0x400, // alias for 'Allman'
93  refactor_indent_BSD_KNF = 0x4a8, // BSD kernel normal format, ITBS with 8 char hard tab, 4 char soft tab for line continuations
94  // (don't include this with any other flags)
95  refactor_indent_Whitesmith = 0x800, // BSD with tabbed '{}' for control/scope, function and struct body '{}' not tabbed over
96  refactor_indent_GNU = 0x880, // half-indent '{}'
97 
98  refactor_reserved = 0xf000, // reserved flags
99 
100  refactor_lang_MASK = 0xf0000,
101  refactor_lang_C = 0x10000,
102  refactor_lang_CPP = 0x20000,
103  refactor_lang_Pascal = 0x30000,
104  refactor_lang_Java = 0x40000,
105 
106  // other languages reserved
107 
108 
109 };
110 
111 // workbench refactor tools - RESERVED
112 
113 int refactor_symbol(const char *szSymbol, const char *szFile, int iFlags);
114 int refactor_indent(const char *szFile, int iFlags); // TODO: calls 'indent' application?
115 
116 #ifdef __cplusplus
117 };
118 #endif // __cplusplus
119 
120 
121 #endif // _REFACTOR_H_INCLUDED_
122