# Uncrustify: Where do the options work?

## New lines

    ^
    ^
    void bar_0();  // function definition
              ^^
    void bar_0()   // function declaration
              ^^
    void A::bar_1(int a);
            ^    ^     ^
    void bar_2(int a) ^
        ^     ^     ^
              ^     ^
    {^
    }
    ^
    void bar_3(int x,
               int y)
              ^    ^
    {
        int a = 5; ^
        int b = 7;
            ^
        a = 135;
        list_for_each(item, list) {
                                 ^
        }
        ^
        /* c1
         * c2
         */
        ^
        int x2;
        ^
        /* single comment */
        ^
        // cpp comment
        std::for_each(a, b, [] (int& b) -> foo {
                                                ^
            b+=3; return(b);
        }
    ^

    class foo : public my_Class ^
             ^
    {
        void bar_c(int t, int u) ^
            ^            ^
            : t(222)
            , u(88)
            ^
        {
            ^
            typedef char CHAR;
            ^ ^
            CHAR c;
            int a;
            int b;
            ^
            c = 'a';
            ^
            switch (a) {
                      ^
            case 0:
                b = 1;
                break;
            ^
            case 1: b = 5; break;
                   ^
            case 13: {
                    ^
                b = 15;
                break;
            }
            }
            ^ ^
            do { ^
               do_something();
            } while (!d.isEmpty());
            ^^ ^
            if (a) { ^
                b = 1;
            } else if (c) {
             ^    ^      ^
                b ;
            } else {
                  ^
                b = 3;
            }
            ^ ^
            for (a = 1; a < 5; a++) {
                                  ^
                b = b + a;
            }
            ^
            for (int a = 1; a < 5;
                 a++) {
                     ^
                b = a + 4;
            }
            try {
            ^
                b = 1;
                if (err) {
                    ^
                    throw std::runtime_error(std::string("nextKey: ") + err.asString());
                }
            } catch (const std::exception &exc) {
             ^                                 ^
                b = 3;
            }
            ^
            while (c) {
                 ^
                b ;
            }
            ^
        }
        enum CaseOfOne {
                      ^
            a1,
            b1,
            ^
            // comment
            c1,
            ^
        };
        struct indent_ptr_t ^
       {
            chunk_t *ref;
            ^
            // comment
            int delta;
            ^
        } ipt;
         ^
        ^
        union UnionOfOne {
                        ^
            a1,
            b1,
            ^
            // comment
            c1,
            ^
        };
        ^ ^
        private: // same for protected:, signal: or slots: label
        ^
            int ap;
    };
    ^

    namespace foo {
                 ^
    int foo()
    {
        if (foo) a++; return;
            ^          ^
        if (a)
            return;
        ^
    l123: ^
        int a = 5;
        ^
        if (a > b) {
            c = 7;
        ^
            return a + b;
        }
        std::for_each(a, b, [] (int& b)->foo{ b+=3; return(b); });
                                                                ^
        QUrl dxOffEagle("http://something/newpage.html?[{\"foo: bar\"}]", QUrl::TolerantMode);
                                                                      ^
        ^
        return 0;
        ^

    /* c1
     *
     */
    ^
    void b();
    ^
    void d();
    #define LOG_CONTTEXT() \
                          ^
        LOG_FMT(LCONTTEXT  \
                ,"%s:%d set cont_text to '%s'\n"  \
                ,__func__, __LINE__, cmt.cont_text.c_str())
    template <class T>
    ^
    ItemJob::ItemJob(PlatformDependent *internals, const QNetworkRequest &request)
        : GetJob(internals, request)
    typedef int ia;
    typedef int ib;
    ^
    typedef int ic;
    typedef int id;

# Register

nl_after_access_spec | nl_after_case
nl_after_class | nl_after_do
nl_after_for | nl_after_func_body
nl_after_func_body_class | nl_after_func_proto
nl_after_if | nl_after_label_colon
nl_after_return | nl_after_semicolon
nl_after_struct | nl_after_switch
nl_after_vbrace_close | nl_after_vbrace_open
nl_after_while | nl_before_access_spec
nl_before_block_comment | nl_before_c_comment
nl_before_case | nl_before_cpp_comment
nl_before_do | nl_before_for
nl_before_if | nl_before_return
nl_before_return | nl_before_switch
nl_before_throw | nl_before_while
nl_brace_catch | nl_brace_else
nl_brace_fparen | nl_brace_square
nl_brace_struct_var | nl_brace_while
nl_case_colon_brace | nl_catch_brace
nl_class_brace | nl_class_colon
nl_collapse_empty_body | nl_comment_func_def
nl_constr_colon | nl_constr_init_args
nl_cpp_ldef_brace | nl_do_brace
nl_ds_struct_enum_close_brace | nl_ds_struct_enum_close_brace
nl_ds_struct_enum_close_brace | nl_ds_struct_enum_cmt
nl_ds_struct_enum_cmt | nl_ds_struct_enum_cmt
nl_else_brace | nl_else_if
nl_elseif_brace | nl_end_of_file
nl_enum_brace | nl_fcall_brace
nl_fdef_brace | nl_for_brace
nl_func_decl_args | nl_func_decl_empty
nl_func_decl_end | nl_func_decl_end
nl_func_decl_end_single | nl_func_decl_start
nl_func_decl_start_single | nl_func_def_args
nl_func_def_empty | nl_func_def_end_single
nl_func_def_paren | nl_func_def_start
nl_func_paren | nl_func_scope_name
nl_func_type_name | nl_func_type_name_class
nl_func_var_def_blk | nl_if_brace
nl_max | nl_multi_line_cond
nl_multi_line_define | nl_namespace_brace
nl_remove_extra_newlines | nl_return_expr
nl_start_of_file | nl_struct_brace
nl_switch_brace | nl_template_class
nl_try_brace | nl_typedef_blk_end
nl_typedef_blk_in | nl_typedef_blk_start
nl_union_brace | nl_var_def_blk_end
nl_var_def_blk_in | nl_var_def_blk_start
nl_while_brace |

## only for Java

nl_after_annotation
nl_between_annotation
nl_paren_dbrace_open

## only for D

nl_after_square_assign
nl_assign_square
nl_scope_brace
nl_unittest_brace
nl_version_brace

## only for oc

nl_oc_msg_args
nl_oc_msg_leave_one_liner

## only for C#

nl_around_cs_property
nl_between_get_set
nl_after_try_catch_finally
nl_brace_finally
nl_finally_brace
nl_getset_brace
nl_property_brace

## not yet shown

nl_after_brace_close
nl_after_brace_open
template class X { /* a */ }; template class Y { /* ... */ }; nl_after_brace_open_cmt
nl_after_func_body_one_liner
nl_after_func_proto_group
nl_after_multiline_comment
nl_after_vbrace_open_empty
nl_brace_brace
nl_class_init_args
nl_class_leave_one_liners
nl_cpp_lambda_leave_one_liners
nl_create_for_one_liner
nl_create_if_one_liner
nl_create_while_one_liner
nl_define_macro
nl_enum_leave_one_liners
nl_func_leave_one_liners
nl_getset_leave_one_liners
nl_if_leave_one_liners
nl_squeeze_ifdef
nl_using_brace