diff -rNu indent-2.2.9.org/src/args.c indent-2.2.9/src/args.c --- indent-2.2.9.org/src/args.c 2002-11-10 22:02:48.000000000 +0100 +++ indent-2.2.9/src/args.c 2007-05-17 10:08:17.000000000 +0200 @@ -62,6 +62,11 @@ "-ce\0-ci4\0-cli0\0-cp33\0-di16\0-fc1\0-fca\0-i4\0-l75\0-lp\0-npcs\0-nprs\0" \ "-psl\0-sc\0-sai\0-saf\0-saw\0-nsob\0-nss\0-ts8\0" +#define LINUX_SETTINGS_STRING (int *) \ + "-nbad\0-bap\0-nbc\0-bbo\0-hnl\0-br\0-brs\0-c33\0-cd33\0" \ + "-ncdb\0-ce\0-ci4\0-cli0\0-d0\0-di1\0-nfc1\0-i8\0-ip0\0-l80\0-lp\0" \ + "-npcs\0-nprs\0-npsl\0-sai\0-saf\0-saw\0-ncs\0-nsc\0-sob\0-nfca\0-cp33\0-ss\0" \ + "-ts8\0-il1\0" /* profile types */ typedef enum profile @@ -121,9 +126,11 @@ static int exp_gnu = 0; static int exp_hnl = 0; static int exp_i = 0; +static int exp_il = 0; static int exp_ip = 0; static int exp_kr = 0; static int exp_l = 0; +static int exp_linux = 0; static int exp_lc = 0; static int exp_lp = 0; static int exp_lps = 0; @@ -250,11 +257,13 @@ {"nbadp", PRO_BOOL, false, OFF, &settings.blanklines_after_declarations_at_proctop, &exp_badp}, {"nbad", PRO_BOOL, false, OFF, &settings.blanklines_after_declarations, &exp_bad}, {"nbacc", PRO_BOOL, false, OFF, &settings.blanklines_around_conditional_compilation, &exp_bacc}, + {"linux", PRO_SETTINGS, 0, ONOFF_NA, LINUX_SETTINGS_STRING, &exp_linux}, {"lps", PRO_BOOL, false, ON, &settings.leave_preproc_space, &exp_lps}, {"lp", PRO_BOOL, true, ON, &settings.lineup_to_parens, &exp_lp}, {"lc", PRO_INT, DEFAULT_RIGHT_COMMENT_MARGIN, ONOFF_NA, &settings.comment_max_col, &exp_lc}, {"l", PRO_INT, DEFAULT_RIGHT_MARGIN, ONOFF_NA, &settings.max_col, &exp_l}, {"kr", PRO_SETTINGS, 0, ONOFF_NA, KR_SETTINGS_STRING, &exp_kr}, + {"il", PRO_INT, 0, ONOFF_NA, &settings.label_offset, &exp_il}, {"ip", PRO_INT, 4, ONOFF_NA, &settings.indent_parameters, &exp_ip}, {"i", PRO_INT, 4, ONOFF_NA, &settings.ind_size, &exp_i}, {"hnl", PRO_BOOL, true, ON, &settings.honour_newlines, &exp_hnl}, @@ -363,11 +372,13 @@ {"nbadp", PRO_BOOL, false, OFF, &settings.blanklines_after_declarations_at_proctop, &exp_badp}, {"nbad", PRO_BOOL, false, OFF, &settings.blanklines_after_declarations, &exp_bad}, {"nbacc", PRO_BOOL, false, OFF, &settings.blanklines_around_conditional_compilation, &exp_bacc}, + {"linux", PRO_SETTINGS, 0, ONOFF_NA, LINUX_SETTINGS_STRING, &exp_linux}, {"lps", PRO_BOOL, false, ON, &settings.leave_preproc_space, &exp_lps}, {"lp", PRO_BOOL, true, ON, &settings.lineup_to_parens, &exp_lp}, {"lc", PRO_INT, DEFAULT_RIGHT_COMMENT_MARGIN, ONOFF_NA, &settings.comment_max_col, &exp_lc}, {"l", PRO_INT, DEFAULT_RIGHT_MARGIN, ONOFF_NA, &settings.max_col, &exp_l}, {"kr", PRO_SETTINGS, 0, ONOFF_NA, KR_SETTINGS_STRING, &exp_kr}, + {"il", PRO_INT, 0, ONOFF_NA, &settings.label_offset, &exp_il}, {"ip", PRO_INT, 5, ONOFF_NA, &settings.indent_parameters, &exp_ip}, {"i", PRO_INT, 2, ONOFF_NA, &settings.ind_size, &exp_i}, {"hnl", PRO_BOOL, true, ON, &settings.honour_newlines, &exp_hnl}, @@ -470,14 +481,17 @@ {"no-blank-lines-after-commas", "nbc"}, {"no-blank-before-sizeof", "nbs"}, {"no-Bill-Shannon", "nbs"}, + {"label-offset", "il"}, {"line-length", "l"}, {"line-comments-indentation", "d"}, + {"linux-style", "linux"}, {"left-justify-declarations", "dj"}, {"leave-preprocessor-space", "lps"}, {"leave-optional-blank-lines", "nsob"}, {"kernighan-and-ritchie-style", "kr"}, {"kernighan-and-ritchie", "kr"}, {"k-and-r-style", "kr"}, + {"indent-label", "il"}, {"indentation-level", "i"}, {"indent-level", "i"}, {"ignore-profile", "npro"}, diff -rNu indent-2.2.9.org/src/indent.h indent-2.2.9/src/indent.h --- indent-2.2.9.org/src/indent.h 2007-05-16 21:16:17.000000000 +0200 +++ indent-2.2.9/src/indent.h 2007-05-17 10:08:15.000000000 +0200 @@ -229,6 +229,7 @@ int blanklines_around_conditional_compilation; int comment_max_col; int max_col; /* the maximum allowable line length */ + int label_offset; /* offset of labels */ int ind_size; /* The size of one indentation level in spaces. */ int indent_parameters; /* Number of spaces to indent parameters. */ int decl_indent; /* column to indent declared identifiers to */ diff -rNu indent-2.2.9.org/src/io.c indent-2.2.9/src/io.c --- indent-2.2.9.org/src/io.c 2002-08-04 19:08:41.000000000 +0200 +++ indent-2.2.9/src/io.c 2007-05-17 10:08:16.000000000 +0200 @@ -312,6 +312,10 @@ /* FIXME: does this belong here at all? */ return 1; } + else if (settings.label_offset) + { + return settings.label_offset; + } else { return parser_state_tos->ind_level - LABEL_OFFSET + 1;