/usr/share/stx2any/common/common.m4 is in stx2any 1.56-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | divert(-1)
undefine(`format')
define(`w_stdin_p', `ifelse(__file__,stdin,t,__file__,-,t)')
define(`w_current_location',
`ifelse(w_stdin_p,t,w_real_file,__file__):'dnl
`ifelse(w_stdin_p,t,`eval(__line__ - w_line_base)',__line__)')
define(`w_warning',
`errprint(ifelse(`$2',,`w_current_location',``$2'')`: stx2any: $1'w_nl)')
define(`w_error', `w_warning($@)m4exit(1)')
define(`w_nl',`
')
define(`w_void',)
define(`w_bq',
changequote([[,]])dnl
[[changequote(.,.)`changequote(`,')]]dnl
changequote(`,'))
define(`w_combine', ``$@'')
define(`w_gather', ``$*'')
define(`w_dequote', `$1')
define(`w_pickn',
`ifelse(`$1',1,`$2',`w_pickn(decr(`$1'),shift(shift($@)))')')
define(`w_listlen',
`ifelse(`$*',,0,`incr(w_listlen(shift($@)))')')
define(`w_newcounter',
`pushdef(`@w_counter_$1',0)'dnl
`pushdef(`@w_refcounter_$1',`$2')')
define(`w_delcounter',
`popdef(`@w_counter_$1')popdef(`@w_refcounter_$1')')
define(`w_setcounter',
`define(`@w_counter_$1',`$2')'dnl
`ifelse(defn(`@w_refcounter_$1'),,,
`w_setcounter(defn(`@w_refcounter_$1'),0)')')
define(`w_getcounter', `defn(`@w_counter_$1')')
define(`w_stepcounter',
`w_setcounter(`$1',ifelse(`$2',,`incr(',`eval($2+')w_getcounter(`$1')))')
define(`w_counter_arabic', `w_getcounter(`$1')')
define(`w_counter_alpha',
`substr(_abcdefghijklmnopqrstuvwxyz,w_getcounter(`$1'),1)')
define(`w_counter_Alpha',
`substr(_ABCDEFGHIJKLMNOPQRSTUVWXYZ,w_getcounter(`$1'),1)')
define(`w_begdiv',
`ifdef(`@w_div_$1',,`w_error(`unknown diversion "$1"')')'dnl
`pushdef(`@w_divlocstack', w_current_location)'dnl
`pushdef(`@w_divstack',$1)divert(defn(`@w_div_$1'))')
define(`w_enddiv',
`ifdef(`@w_divstack',,`w_error(`diversion stack empty')')'dnl
`ifelse(`$1',,,`$1',defn(`@w_divstack'),,
`w_warning("defn(`@w_divstack')`" begins here...', defn(`@w_divlocstack'))'
`w_error(`diversion "'defn(`@w_divstack')`" closed by "$1"')')'dnl
`popdef(`@w_divlocstack')popdef(`@w_divstack')'dnl
`ifdef(`@w_divstack',`divert(defn(`@w_div_'defn(`@w_divstack')))')')
define(`w_check_div', `ifdef(`@w_divstack',
`w_error(`unclosed diversion "'defn(`@w_divstack')", defn(`@w_divlocstack'))')')
define(`w_dumpdiv', `undivert(defn(`@w_div_$1'))')
w_newcounter(`w_n_avail_div')
define(`w_define_div',
`w_stepcounter(`w_n_avail_div')'dnl
`define(`@w_div_$1', w_getcounter(`w_n_avail_div'))')
define(`w_define_trashcan',
`define(`@w_div_$1', -1)')
w_newcounter(`w_layer')
define(`w_layervar', ``w_layer_'w_getcounter(`w_layer')`_$1'')
define(`w_sublayer',
`w_stepcounter(`w_layer')$1`'w_stepcounter(`w_layer',-1)')
define(`w_define_env',
`define(`@w_begin_$1', `$2')define(`@w_end_$1', `$3')')
define(`w_ifdef_env', `ifdef(`@w_begin_$1', `$2', `$3')')
define(`w_beg',
`w_ifdef_env(`$1',, `w_error(`unknown environment "$1"')')'dnl
`pushdef(w_layervar(env), `$1')'dnl
`pushdef(w_layervar(params), w_combine(shift($@)))'dnl
`pushdef(w_layervar(loc), w_current_location)'dnl
`w_sublayer(`indir(`@w_begin_$1',shift($@))')')
define(`w_end',
`ifdef(w_layervar(env),,`w_error(`environment stack empty')')'dnl
`ifelse(`$1',,,`$1',defn(w_layervar(env)),,
`w_warning("defn(w_layervar(env))`" begins here...', defn(w_layervar(loc)))'
`w_error(`environment "'defn(w_layervar(env))`" closed by "$1" in layer 'w_counter_arabic(`w_layer'))')'dnl
`w_sublayer(`indir(`@w_end_''defn(w_layervar(env))`,'
defn(w_layervar(params))`)')'dnl
`popdef(w_layervar(loc))popdef(w_layervar(env))popdef(w_layervar(params))')
define(`w_check_env1', `ifdef(w_layervar(env),
`w_error(`unclosed environment "'defn(w_layervar(env))`" in layer 'w_counter_arabic(`w_layer'), defn(w_layervar(loc)))')')
define(`w_check_env',
`w_sublayer(`w_sublayer(`w_check_env1')w_check_env1')w_check_env1')
define(`w_push_env', `pushdef(`@w_begin_$1',)pushdef(`@w_end_$1',)')
define(`w_pop_env', `popdef(`@w_begin_$1')popdef(`@w_end_$1')')
define(`w_make_param_shifter',
`ifelse(`$1',0,``$'@',``shift('w_make_param_shifter(decr(`$1'))`)'')')
define(`w_derive_env', `w_define_env(`$1',
`$4`'w_beg(`$2','w_make_param_shifter(`$3')`)`'$5',
`$6`'w_end(`$2','w_make_param_shifter(`$3')`)`'$7')')
define(`w_newindent',
`ifelse(`$2',,`w_new_indents(`$1',0)',
`w_new_indents(`$1',`$2')')')
define(`w_new_indents',
`w_compare_indent(`$1', `$2', w_dequote(defn(`@w_indstack')),
`pushdef(`@w_indstack',`$1,$2')w_indent`'',
`popdef(`@w_indstack')w_dedent`'w_new_indents(`$1',`$2')',)')
define(`w_compare_indent',
`ifelse(eval(`$1>$3'),1,`$5',eval(`$1<$3'),1,`$6',
eval(`$2>$4'),1,`$5',eval(`$2<$4'),1,`$6',`$7')')
define(`@w_indstack',`0,0')
define(`w_setup_list',
`pushdef(`@w_list_len_$1', w_listlen(shift($@)))'dnl
`pushdef(`@w_list_save_$1', w_combine(shift($@)))'dnl
`pushdef(`@w_list_$1', defn(`@w_list_save_$1'))')
define(`w_unsetup_list',
`popdef(`@w_list_$1')popdef(`@w_list_save_$1')popdef(`@w_list_len_$1')')
define(`w_reinit_list', `define(`@w_list_$1', defn(`@w_list_save_$1'))')
define(`w_next_in_list',
`w_pickn(1,w_dequote(defn(`@w_list_$1')))`''dnl
`define(`@w_list_$1',w_combine(shift(w_dequote(defn(`@w_list_$1')))))')
define(`w_length_list', `defn(`@w_list_len_$1')')
define(`w_set_or_get',
`ifelse(`$2',,`defn(`$1')',`define(`$1', `$2')')')
define(`w_doc_id',)
define(`w_documentclass',)
define(`w_title', `w_set_or_get(`@w_title', `$1')')
define(`w_gettitle', `w_title')
define(`w_author', `w_set_or_get(`@w_author', `$1')')
define(`w_date', `w_set_or_get(`@w_date', `$1')')
define(`w_getdate', `w_date')
define(`w_language',
`define(`@w_language', `$1')'dnl
`define(`@w_iso_language',
ifelse(`$2',,`substr(`$1',0,2)',`$2'))')
define(`w_char_coding',
`define(`@w_char_coding', `$1')'dnl
`define(`w_long_charset_name',
ifelse(`$2',,`w_long_charset_name_for(`$1')',`$2'))')
define(`w_long_charset_name_for',
`ifelse(`$1',latin9,ISO-8859-15,
`$1',ascii,US-ASCII,
`$1',utf8,utf-8,ISO-8859-1)')
|