#! /bin/sh # # This is patch #2 to gawk 4.1. cd to gawk-4.1.1 and sh this file. # Then remove all the .orig files and rename the directory gawk-4.1.2 # Changes to files that are automatically recreated have been omitted. # They will be recreated the first time you run make. # This includes all the extracted example files in awklib. # First, slight rearranging, create some binary files chmod 644 ABOUT-NLS chmod 755 test/next.sh chmod 664 test/charasbytes.awk chmod 664 test/ofs1.awk chmod 664 test/gensub2.ok chmod 664 test/range1.awk chmod 755 mkinstalldirs chmod 664 m4/isc-posix.m4 chmod 664 po/Makevars chmod 664 missing_d/getaddrinfo.h chmod 664 missing_d/getaddrinfo.c rm -fr extension/m4/iconv.m4 rm -fr extension/m4/lib-ld.m4 rm -fr extension/m4/lib-prefix.m4 rm -fr extension/m4/progtest.m4 rm -fr extension/m4/intlmacosx.m4 rm -fr extension/m4/lib-link.m4 rm -fr extension/m4/nls.m4 rm -fr extension/m4/gettext.m4 rm -fr extension/m4/po.m4 rm -fr doc/array-elements.png rm -fr doc/array-elements.pdf awk ' { for (i = 1; i <= NF; i++) { printf("%c", $i) } } ' << \EOF > doc/array-elements.png 137 80 78 71 13 10 26 10 0 0 0 13 73 72 68 82 0 0 1 165 0 0 0 84 8 2 0 0 0 173 9 191 241 0 0 9 54 105 67 67 80 100 101 102 97 117 108 116 95 114 103 98 46 105 99 99 0 0 120 156 149 145 103 80 148 135 22 134 207 247 125 219 11 11 236 178 116 88 122 147 42 101 1 233 189 73 175 162 2 75 239 44 75 17 177 33 98 4 34 138 136 52 69 144 160 128 1 163 82 36 86 68 177 16 20 20 177 160 89 36 8 40 49 24 69 84 80 242 195 59 19 231 222 241 199 125 126 61 243 206 59 231 156 153 3 64 17 5 0 64 69 1 82 82 5 124 63 23 123 78 72 104 24 7 190 33 146 151 153 110 231 227 227 9 223 229 253 40 32 0 0 247 86 125 191 243 93 40 209 49 153 60 0 88 6 128 124 94 58 95 0 128 228 2 128 102 142 32 93 0 128 28 5 0 86 84 82 186 0 0 57 11 0 44 126 72 104 24 0 114 3 0 88 113 95 125 28 0 88 81 95 125 30 0 88 252 0 63 7 0 20 7 64 162 197 125 227 81 223 248 127 246 2 0 40 219 241 5 9 177 49 185 28 255 180 88 65 78 36 63 134 147 233 231 98 207 113 115 112 224 248 240 211 98 19 146 99 190 57 248 255 42 127 7 65 76 174 0 0 192 33 45 125 19 63 33 46 94 192 249 159 161 70 6 134 134 240 239 47 222 250 2 2 0 8 123 240 191 255 3 0 223 244 210 26 1 184 11 0 216 190 127 179 168 106 128 238 93 0 82 143 255 205 84 143 2 48 10 1 186 238 240 178 248 217 95 51 28 0 0 30 40 192 0 22 72 131 2 168 128 38 232 130 17 152 129 37 216 130 19 184 131 55 4 64 40 108 0 30 196 67 10 240 33 7 242 97 7 20 65 9 236 131 131 80 3 245 208 4 45 208 14 167 161 27 206 195 21 184 14 183 225 46 140 194 19 16 194 20 188 130 121 120 15 75 8 130 16 17 58 194 68 164 17 69 68 13 209 65 140 16 46 98 141 56 33 158 136 31 18 138 68 32 113 72 42 146 133 228 35 59 145 18 164 28 169 65 26 144 22 228 23 228 28 114 5 185 137 12 35 143 144 9 100 22 249 27 249 132 98 40 13 101 161 242 168 58 170 143 114 81 59 212 3 13 64 215 163 113 104 6 154 135 22 162 123 209 42 180 17 61 137 118 161 87 208 219 232 40 42 68 95 161 11 24 96 84 140 141 41 97 186 24 23 115 192 188 177 48 44 22 227 99 91 177 98 172 18 107 196 218 177 94 108 0 187 135 9 177 57 236 35 142 128 99 226 56 56 93 156 37 206 21 23 136 227 225 50 112 91 113 165 184 26 220 9 92 23 174 31 119 15 55 129 155 199 125 193 211 241 114 120 29 188 5 222 13 31 130 143 195 231 224 139 240 149 248 102 124 39 254 26 126 20 63 133 127 79 32 16 216 4 13 130 25 193 149 16 74 72 36 108 38 148 18 14 19 58 8 151 9 195 132 73 194 2 145 72 148 38 234 16 173 136 222 196 72 162 128 88 68 172 38 158 36 94 34 142 16 167 136 31 72 84 146 34 201 136 228 76 10 35 165 146 10 72 149 164 86 210 69 210 8 105 154 180 68 22 37 171 145 45 200 222 228 104 242 38 114 25 185 137 220 75 190 67 158 34 47 81 196 40 26 20 43 74 0 37 145 178 131 82 69 105 167 92 163 140 83 222 82 169 84 101 170 57 213 151 154 64 221 78 173 162 158 162 222 160 78 80 63 210 196 105 218 52 7 90 56 45 139 182 151 118 156 118 153 246 136 246 150 78 167 171 211 109 233 97 116 1 125 47 189 133 126 149 254 140 254 65 132 41 162 39 226 38 18 45 178 77 164 86 164 75 100 68 228 53 131 204 80 99 216 49 54 48 242 24 149 140 51 140 59 140 57 81 178 168 186 168 131 104 164 232 86 209 90 209 115 162 99 162 11 98 76 49 67 49 111 177 20 177 82 177 86 177 155 98 51 226 68 113 117 113 39 241 104 241 66 241 99 226 87 197 39 153 24 83 133 233 192 228 49 119 50 155 152 215 152 83 44 2 75 131 229 198 74 100 149 176 126 102 13 177 230 37 196 37 140 37 130 36 114 37 106 37 46 72 8 217 24 91 157 237 198 78 102 151 177 79 179 31 176 63 73 202 75 218 73 198 72 238 145 108 151 28 145 92 148 146 149 178 149 138 145 42 150 234 144 26 149 250 36 205 145 118 146 78 146 222 47 221 45 253 84 6 39 163 45 227 43 147 35 115 68 230 154 204 156 44 75 214 82 150 39 91 44 123 90 246 177 28 42 167 45 231 39 183 89 238 152 220 160 220 130 188 130 188 139 124 186 124 181 252 85 249 57 5 182 130 173 66 162 66 133 194 69 133 89 69 166 162 181 98 130 98 133 226 37 197 151 28 9 142 29 39 153 83 197 233 231 204 43 201 41 185 42 101 41 53 40 13 41 45 41 107 40 7 42 23 40 119 40 63 85 161 168 112 85 98 85 42 84 250 84 230 85 21 85 189 84 243 85 219 84 31 171 145 213 184 106 241 106 135 212 6 212 22 213 53 212 131 213 119 171 119 171 207 104 72 105 184 105 228 105 180 105 140 107 210 53 109 52 51 52 27 53 239 107 17 180 184 90 73 90 135 181 238 106 163 218 38 218 241 218 181 218 119 116 80 29 83 157 4 157 195 58 195 171 240 171 204 87 165 174 106 92 53 166 75 211 181 211 205 214 109 211 157 208 99 235 121 234 21 232 117 235 189 214 87 213 15 211 223 175 63 160 255 197 192 196 32 217 160 201 224 137 161 184 161 187 97 129 97 175 225 223 70 218 70 60 163 90 163 251 171 233 171 157 87 111 91 221 179 250 141 177 142 113 140 241 17 227 135 38 76 19 47 147 221 38 125 38 159 77 205 76 249 166 237 166 179 102 170 102 17 102 117 102 99 92 22 215 135 91 202 189 97 142 55 183 55 223 102 126 222 252 163 133 169 133 192 226 180 197 95 150 186 150 73 150 173 150 51 107 52 214 196 172 105 90 51 105 165 108 21 105 213 96 37 180 230 88 71 88 31 181 22 218 40 217 68 218 52 218 60 183 85 177 141 182 109 182 157 182 211 178 75 180 59 105 247 218 222 192 158 111 223 105 191 232 96 225 176 197 225 178 35 230 232 226 88 236 56 228 36 238 20 232 84 227 244 204 89 217 57 206 185 205 121 222 197 196 101 179 203 101 87 188 171 135 235 126 215 49 55 121 55 158 91 139 219 188 187 153 251 22 247 126 15 154 135 191 71 141 199 115 79 109 79 190 103 175 23 234 229 238 117 192 107 124 173 218 218 212 181 221 222 224 237 230 125 192 251 169 143 134 79 134 207 175 190 4 95 31 223 90 223 23 126 134 126 249 126 3 254 76 255 141 254 173 254 239 3 236 3 202 2 158 4 106 6 102 5 246 5 49 130 194 131 90 130 22 131 29 131 203 131 133 33 250 33 91 66 110 135 202 132 38 132 246 132 17 195 130 194 154 195 22 214 57 173 59 184 110 42 220 36 188 40 252 193 122 141 245 185 235 111 110 144 217 144 188 225 194 70 198 198 200 141 103 34 240 17 193 17 173 17 203 145 222 145 141 145 11 81 110 81 117 81 243 60 7 222 33 222 171 104 219 232 138 232 217 24 171 152 242 152 233 88 171 216 242 216 153 56 171 184 3 113 179 241 54 241 149 241 115 9 14 9 53 9 111 18 93 19 235 19 23 147 188 147 142 39 173 36 7 39 119 164 144 82 34 82 206 165 138 167 38 165 246 167 41 164 229 166 13 167 235 164 23 165 11 51 44 50 14 102 204 243 61 248 205 153 72 230 250 204 30 1 75 144 46 24 204 210 204 218 149 53 145 109 157 93 155 253 33 39 40 231 76 174 88 110 106 238 224 38 237 77 123 54 77 231 57 231 253 180 25 183 153 183 185 47 95 41 127 71 254 196 22 187 45 13 91 145 173 81 91 251 182 169 108 43 220 54 181 221 101 251 137 29 148 29 73 59 126 43 48 40 40 47 120 183 51 120 103 111 161 124 225 246 194 201 93 46 187 218 138 68 138 248 69 99 187 45 119 215 255 128 251 33 225 135 161 61 171 247 84 239 249 82 28 93 124 171 196 160 164 178 100 185 148 87 122 235 71 195 31 171 126 92 217 27 187 119 168 204 180 236 200 62 194 190 212 125 15 246 219 236 63 81 46 86 158 87 62 121 192 235 64 87 5 167 162 184 226 221 193 141 7 111 86 26 87 214 31 162 28 202 58 36 172 242 172 234 169 86 173 222 87 189 92 19 95 51 90 107 95 219 81 39 87 183 167 110 241 112 244 225 145 35 182 71 218 235 229 235 75 234 63 29 77 56 250 176 193 165 161 171 81 189 177 242 24 225 88 246 177 23 77 65 77 3 63 113 127 106 105 150 105 46 105 254 124 60 245 184 240 132 223 137 254 22 179 150 150 86 185 214 178 54 180 45 171 109 246 100 248 201 187 63 59 254 220 211 174 219 222 208 193 238 40 57 5 167 178 78 189 252 37 226 151 7 167 61 78 247 157 225 158 105 63 171 118 182 174 147 217 89 220 133 116 109 234 154 239 142 239 22 246 132 246 12 159 115 63 215 215 107 217 219 249 171 222 175 199 207 43 157 175 189 32 113 161 236 34 229 98 225 197 149 75 121 151 22 46 167 95 158 187 18 119 101 178 111 99 223 147 171 33 87 239 247 251 246 15 93 243 184 118 227 186 243 245 171 3 118 3 151 110 88 221 56 127 211 226 230 185 91 220 91 221 183 77 111 119 13 154 12 118 254 102 242 91 231 144 233 80 215 29 179 59 61 119 205 239 246 14 175 25 190 56 98 51 114 229 158 227 189 235 247 221 238 223 30 93 59 58 252 32 240 193 195 177 240 49 225 195 232 135 51 143 146 31 189 121 156 253 120 233 201 246 113 252 120 241 83 209 167 149 207 228 158 53 254 174 245 123 135 208 84 120 97 194 113 98 240 185 255 243 39 147 188 201 87 127 100 254 177 60 85 248 130 254 162 114 90 113 186 101 198 104 230 252 172 243 236 221 151 235 94 78 189 74 127 181 52 87 244 167 216 159 117 175 53 95 159 253 203 246 175 193 249 144 249 169 55 252 55 43 127 151 190 149 126 123 252 157 241 187 190 5 159 133 103 239 83 222 47 45 22 127 144 254 112 226 35 247 227 192 167 224 79 211 75 57 203 196 229 170 207 90 159 123 191 120 124 25 95 73 89 89 249 7 46 162 144 188 82 23 95 253 0 0 0 9 112 72 89 115 0 0 12 78 0 0 12 78 1 127 119 140 35 0 0 0 29 116 69 88 116 83 111 102 116 119 97 114 101 0 71 80 76 32 71 104 111 115 116 115 99 114 105 112 116 32 57 46 48 53 243 175 93 143 0 0 3 43 73 68 65 84 120 156 237 221 219 142 155 48 0 5 64 92 237 255 255 50 125 64 165 20 3 201 150 13 96 159 153 167 21 160 196 215 19 27 212 82 198 113 28 0 2 148 187 11 0 180 173 161 53 211 215 208 84 113 127 92 41 37 185 250 31 162 85 247 244 215 50 165 180 180 102 250 117 119 1 0 46 34 239 128 20 242 14 72 33 239 128 20 242 14 72 33 239 128 20 242 14 72 33 239 128 20 242 14 72 33 239 128 20 242 14 72 33 239 128 20 242 14 72 33 239 128 20 242 14 72 113 67 222 149 63 174 255 234 230 76 173 180 217 92 101 225 199 63 188 111 155 21 239 169 53 246 6 198 99 167 94 93 170 131 66 158 41 255 213 121 55 149 117 28 199 113 28 31 216 238 109 153 154 241 238 82 240 44 123 83 236 201 83 111 53 140 63 247 191 162 126 125 226 67 143 153 162 231 45 199 235 178 61 231 49 189 121 189 150 79 112 208 203 141 14 128 205 209 59 31 172 207 30 140 246 171 215 119 83 249 158 185 168 126 178 186 59 135 127 119 1 171 191 151 23 111 30 223 251 240 40 155 21 239 163 53 94 78 177 167 77 192 189 85 231 180 214 171 207 206 221 180 154 26 123 215 79 110 88 223 241 190 169 47 87 51 112 243 55 109 168 58 126 111 64 172 142 247 49 189 191 101 175 85 235 131 237 122 224 166 245 77 171 205 236 244 247 183 234 114 112 241 213 121 183 172 76 163 253 1 77 152 247 82 13 45 99 55 159 177 12 223 137 239 227 122 221 243 124 246 250 47 141 178 215 194 90 62 220 195 7 64 189 196 254 143 251 206 199 117 188 122 125 55 255 230 92 252 189 61 89 221 143 155 71 201 230 67 140 189 227 244 234 224 62 87 115 83 111 85 230 122 173 186 58 181 186 126 227 193 221 230 209 28 159 123 242 157 76 171 238 233 175 101 218 170 145 127 95 1 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 138 150 94 54 14 60 77 67 47 219 30 134 161 165 119 131 3 156 97 63 11 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 10 121 7 164 144 119 64 138 175 139 191 175 148 191 111 188 245 42 200 151 166 230 210 80 63 168 251 17 216 98 5 223 31 231 165 156 122 133 236 213 121 55 44 106 117 178 232 9 198 113 92 14 95 206 91 14 191 123 75 242 33 221 87 240 140 75 243 78 7 192 53 218 93 76 76 37 175 87 124 117 122 204 215 172 78 29 84 220 253 59 232 205 52 255 219 93 94 212 97 61 29 89 46 93 231 35 171 83 199 41 127 195 126 22 110 215 238 242 231 29 83 213 218 205 187 205 176 171 47 171 43 248 178 79 47 205 59 119 163 120 130 190 195 46 196 94 2 30 247 236 109 251 89 99 142 91 24 120 205 217 92 39 173 142 204 221 122 188 162 186 97 63 107 137 247 62 109 245 9 115 171 118 25 124 189 214 110 174 215 252 64 163 174 233 203 29 164 223 58 32 197 111 107 229 126 25 53 162 251 193 0 0 0 0 73 69 78 68 174 66 96 130 137 80 78 71 13 10 26 10 0 0 0 13 73 72 68 82 0 0 1 165 0 0 0 84 8 2 0 0 0 173 9 191 241 0 0 9 54 105 67 67 80 100 101 102 97 117 108 116 95 114 103 98 46 105 99 99 0 0 120 156 149 145 103 80 148 135 22 134 207 247 125 219 11 11 236 178 116 88 122 147 42 101 1 233 189 73 175 162 2 75 239 44 75 17 177 33 98 4 34 138 136 52 69 144 160 128 1 163 82 36 86 68 177 16 20 20 177 160 89 36 8 40 49 24 69 84 80 242 195 59 19 231 222 241 199 125 126 61 243 206 59 231 156 153 3 64 17 5 0 64 69 1 82 82 5 124 63 23 123 78 72 104 24 7 190 33 146 151 153 110 231 227 227 9 223 229 253 40 32 0 0 247 86 125 191 243 93 40 209 49 153 60 0 88 6 128 124 94 58 95 0 128 228 2 128 102 142 32 93 0 128 28 5 0 86 84 82 186 0 0 57 11 0 44 126 72 104 24 0 114 3 0 88 113 95 125 28 0 88 81 95 125 30 0 88 252 0 63 7 0 20 7 64 162 197 125 227 81 223 248 127 246 2 0 40 219 241 5 9 177 49 185 28 255 180 88 65 78 36 63 134 147 233 231 98 207 113 115 112 224 248 240 211 98 19 146 99 190 57 248 255 42 127 7 65 76 174 0 0 192 33 45 125 19 63 33 46 94 192 249 159 161 70 6 134 134 240 239 47 222 250 2 2 0 8 123 240 191 255 3 0 223 244 210 26 1 184 11 0 216 190 127 179 168 106 128 238 93 0 82 143 255 205 84 143 2 48 10 1 186 238 240 178 248 217 95 51 28 0 0 30 40 192 0 22 72 131 2 168 128 38 232 130 17 152 129 37 216 130 19 184 131 55 4 64 40 108 0 30 196 67 10 240 33 7 242 97 7 20 65 9 236 131 131 80 3 245 208 4 45 208 14 167 161 27 206 195 21 184 14 183 225 46 140 194 19 16 194 20 188 130 121 120 15 75 8 130 16 17 58 194 68 164 17 69 68 13 209 65 140 16 46 98 141 56 33 158 136 31 18 138 68 32 113 72 42 146 133 228 35 59 145 18 164 28 169 65 26 144 22 228 23 228 28 114 5 185 137 12 35 143 144 9 100 22 249 27 249 132 98 40 13 101 161 242 168 58 170 143 114 81 59 212 3 13 64 215 163 113 104 6 154 135 22 162 123 209 42 180 17 61 137 118 161 87 208 219 232 40 42 68 95 161 11 24 96 84 140 141 41 97 186 24 23 115 192 188 177 48 44 22 227 99 91 177 98 172 18 107 196 218 177 94 108 0 187 135 9 177 57 236 35 142 128 99 226 56 56 93 156 37 206 21 23 136 227 225 50 112 91 113 165 184 26 220 9 92 23 174 31 119 15 55 129 155 199 125 193 211 241 114 120 29 188 5 222 13 31 130 143 195 231 224 139 240 149 248 102 124 39 254 26 126 20 63 133 127 79 32 16 216 4 13 130 25 193 149 16 74 72 36 108 38 148 18 14 19 58 8 151 9 195 132 73 194 2 145 72 148 38 234 16 173 136 222 196 72 162 128 88 68 172 38 158 36 94 34 142 16 167 136 31 72 84 146 34 201 136 228 76 10 35 165 146 10 72 149 164 86 210 69 210 8 105 154 180 68 22 37 171 145 45 200 222 228 104 242 38 114 25 185 137 220 75 190 67 158 34 47 81 196 40 26 20 43 74 0 37 145 178 131 82 69 105 167 92 163 140 83 222 82 169 84 101 170 57 213 151 154 64 221 78 173 162 158 162 222 160 78 80 63 210 196 105 218 52 7 90 56 45 139 182 151 118 156 118 153 246 136 246 150 78 167 171 211 109 233 97 116 1 125 47 189 133 126 149 254 140 254 65 132 41 162 39 226 38 18 45 178 77 164 86 164 75 100 68 228 53 131 204 80 99 216 49 54 48 242 24 149 140 51 140 59 140 57 81 178 168 186 168 131 104 164 232 86 209 90 209 115 162 99 162 11 98 76 49 67 49 111 177 20 177 82 177 86 177 155 98 51 226 68 113 117 113 39 241 104 241 66 241 99 226 87 197 39 153 24 83 133 233 192 228 49 119 50 155 152 215 152 83 44 2 75 131 229 198 74 100 149 176 126 102 13 177 230 37 196 37 140 37 130 36 114 37 106 37 46 72 8 217 24 91 157 237 198 78 102 151 177 79 179 31 176 63 73 202 75 218 73 198 72 238 145 108 151 28 145 92 148 146 149 178 149 138 145 42 150 234 144 26 149 250 36 205 145 118 146 78 146 222 47 221 45 253 84 6 39 163 45 227 43 147 35 115 68 230 154 204 156 44 75 214 82 150 39 91 44 123 90 246 177 28 42 167 45 231 39 183 89 238 152 220 160 220 130 188 130 188 139 124 186 124 181 252 85 249 57 5 182 130 173 66 162 66 133 194 69 133 89 69 166 162 181 98 130 98 133 226 37 197 151 28 9 142 29 39 153 83 197 233 231 204 43 201 41 185 42 101 41 53 40 13 41 45 41 107 40 7 42 23 40 119 40 63 85 161 168 112 85 98 85 42 84 250 84 230 85 21 85 189 84 243 85 219 84 31 171 145 213 184 106 241 106 135 212 6 212 22 213 53 212 131 213 119 171 119 171 207 104 72 105 184 105 228 105 180 105 140 107 210 53 109 52 51 52 27 53 239 107 17 180 184 90 73 90 135 181 238 106 163 218 38 218 241 218 181 218 119 116 80 29 83 157 4 157 195 58 195 171 240 171 204 87 165 174 106 92 53 166 75 211 181 211 205 214 109 211 157 208 99 235 121 234 21 232 117 235 189 214 87 213 15 211 223 175 63 160 255 197 192 196 32 217 160 201 224 137 161 184 161 187 97 129 97 175 225 223 70 218 70 60 163 90 163 251 171 233 171 157 87 111 91 221 179 250 141 177 142 113 140 241 17 227 135 38 76 19 47 147 221 38 125 38 159 77 205 76 249 166 237 166 179 102 170 102 17 102 117 102 99 92 22 215 135 91 202 189 97 142 55 183 55 223 102 126 222 252 163 133 169 133 192 226 180 197 95 150 186 150 73 150 173 150 51 107 52 214 196 172 105 90 51 105 165 108 21 105 213 96 37 180 230 88 71 88 31 181 22 218 40 217 68 218 52 218 60 183 85 177 141 182 109 182 157 182 211 178 75 180 59 105 247 218 222 192 158 111 223 105 191 232 96 225 176 197 225 178 35 230 232 226 88 236 56 228 36 238 20 232 84 227 244 204 89 217 57 206 185 205 121 222 197 196 101 179 203 101 87 188 171 135 235 126 215 49 55 121 55 158 91 139 219 188 187 153 251 22 247 126 15 154 135 191 71 141 199 115 79 109 79 190 103 175 23 234 229 238 117 192 107 124 173 218 218 212 181 221 222 224 237 230 125 192 251 169 143 134 79 134 207 175 190 4 95 31 223 90 223 23 126 134 126 249 126 3 254 76 255 141 254 173 254 239 3 236 3 202 2 158 4 106 6 102 5 246 5 49 130 194 131 90 130 22 131 29 131 203 131 133 33 250 33 91 66 110 135 202 132 38 132 246 132 17 195 130 194 154 195 22 214 57 173 59 184 110 42 220 36 188 40 252 193 122 141 245 185 235 111 110 144 217 144 188 225 194 70 198 198 200 141 103 34 240 17 193 17 173 17 203 145 222 145 141 145 11 81 110 81 117 81 243 60 7 222 33 222 171 104 219 232 138 232 217 24 171 152 242 152 233 88 171 216 242 216 153 56 171 184 3 113 179 241 54 241 149 241 115 9 14 9 53 9 111 18 93 19 235 19 23 147 188 147 142 39 173 36 7 39 119 164 144 82 34 82 206 165 138 167 38 165 246 167 41 164 229 166 13 167 235 164 23 165 11 51 44 50 14 102 204 243 61 248 205 153 72 230 250 204 30 1 75 144 46 24 204 210 204 218 149 53 145 109 157 93 155 253 33 39 40 231 76 174 88 110 106 238 224 38 237 77 123 54 77 231 57 231 253 180 25 183 153 183 185 47 95 41 127 71 254 196 22 187 45 13 91 145 173 81 91 251 182 169 108 43 220 54 181 221 101 251 137 29 148 29 73 59 126 43 48 40 40 47 120 183 51 120 103 111 161 124 225 246 194 201 93 46 187 218 138 68 138 248 69 99 187 45 119 215 255 128 251 33 225 135 161 61 171 247 84 239 249 82 28 93 124 171 196 160 164 178 100 185 148 87 122 235 71 195 31 171 126 92 217 27 187 119 168 204 180 236 200 62 194 190 212 125 15 246 219 236 63 81 46 86 158 87 62 121 192 235 64 87 5 167 162 184 226 221 193 141 7 111 86 26 87 214 31 162 28 202 58 36 172 242 172 234 169 86 173 222 87 189 92 19 95 51 90 107 95 219 81 39 87 183 167 110 241 112 244 225 145 35 182 71 218 235 229 235 75 234 63 29 77 56 250 176 193 165 161 171 81 189 177 242 24 225 88 246 177 23 77 65 77 3 63 113 127 106 105 150 105 46 105 254 124 60 245 184 240 132 223 137 254 22 179 150 150 86 185 214 178 54 180 45 171 109 246 100 248 201 187 63 59 254 220 211 174 219 222 208 193 238 40 57 5 167 178 78 189 252 37 226 151 7 167 61 78 247 157 225 158 105 63 171 118 182 174 147 217 89 220 133 116 109 234 154 239 142 239 22 246 132 246 12 159 115 63 215 215 107 217 219 249 171 222 175 199 207 43 157 175 189 32 113 161 236 34 229 98 225 197 149 75 121 151 22 46 167 95 158 187 18 119 101 178 111 99 223 147 171 33 87 239 247 251 246 15 93 243 184 118 227 186 243 245 171 3 118 3 151 110 88 221 56 127 211 226 230 185 91 220 91 221 183 77 111 119 13 154 12 118 254 102 242 91 231 144 233 80 215 29 179 59 61 119 205 239 246 14 175 25 190 56 98 51 114 229 158 227 189 235 247 221 238 223 30 93 59 58 252 32 240 193 195 177 240 49 225 195 232 135 51 143 146 31 189 121 156 253 120 233 201 246 113 252 120 241 83 209 167 149 207 228 158 53 254 174 245 123 135 208 84 120 97 194 113 98 240 185 255 243 39 147 188 201 87 127 100 254 177 60 85 248 130 254 162 114 90 113 186 101 198 104 230 252 172 243 236 221 151 235 94 78 189 74 127 181 52 87 244 167 216 159 117 175 53 95 159 253 203 246 175 193 249 144 249 169 55 252 55 43 127 151 190 149 126 123 252 157 241 187 190 5 159 133 103 239 83 222 47 45 22 127 144 254 112 226 35 247 227 192 167 224 79 211 75 57 203 196 229 170 207 90 159 123 191 120 124 25 95 73 89 89 249 7 46 162 144 188 82 23 95 253 0 0 0 9 112 72 89 115 0 0 12 78 0 0 12 78 1 127 119 140 35 0 0 0 29 116 69 88 116 83 111 102 116 119 97 114 101 0 71 80 76 32 71 104 111 115 116 115 99 114 105 112 116 32 57 46 48 53 243 175 93 143 0 0 1 46 73 68 65 84 120 156 237 212 49 1 0 32 12 192 48 192 191 231 225 2 142 38 10 122 117 207 204 2 8 56 191 3 0 30 241 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 10 191 3 42 252 14 168 240 59 160 194 239 128 138 11 100 53 3 165 196 129 155 160 0 0 0 0 73 69 78 68 174 66 96 130 EOF awk ' { for (i = 1; i <= NF; i++) { printf("%c", $i) } } ' << \EOF > doc/array-elements.pdf 37 80 68 70 45 49 46 52 10 37 199 236 143 162 10 53 32 48 32 111 98 106 10 60 60 47 76 101 110 103 116 104 32 54 32 48 32 82 47 70 105 108 116 101 114 32 47 70 108 97 116 101 68 101 99 111 100 101 62 62 10 115 116 114 101 97 109 10 120 156 77 144 77 75 3 49 16 134 239 243 43 134 94 76 132 29 103 242 53 187 87 65 68 241 210 26 188 20 15 210 110 11 210 181 180 34 250 243 77 187 31 44 57 204 155 55 239 60 201 228 132 76 130 124 89 67 221 116 112 183 82 220 127 67 32 117 193 69 252 133 235 57 174 30 65 213 147 99 143 26 18 105 163 216 77 142 107 74 85 60 76 134 119 66 73 230 206 20 121 5 209 162 83 152 113 70 103 22 114 41 4 98 153 133 70 103 22 234 159 118 222 195 9 164 215 67 217 116 120 159 203 40 53 138 144 247 181 195 188 131 126 68 65 47 212 36 77 24 29 49 251 136 185 131 181 169 109 165 129 153 216 153 197 238 120 92 216 42 49 179 89 20 17 234 139 47 198 179 125 207 207 133 90 46 153 97 163 148 38 105 48 191 64 190 93 27 46 160 216 131 196 86 117 145 198 217 42 198 129 113 69 120 9 148 202 205 83 235 22 204 219 199 225 167 181 249 19 204 211 215 182 253 179 55 240 144 97 9 74 181 198 113 102 239 98 67 234 49 68 79 177 236 207 109 249 132 37 252 3 208 140 92 42 101 110 100 115 116 114 101 97 109 10 101 110 100 111 98 106 10 54 32 48 32 111 98 106 10 50 54 53 10 101 110 100 111 98 106 10 52 32 48 32 111 98 106 10 60 60 47 84 121 112 101 47 80 97 103 101 47 77 101 100 105 97 66 111 120 32 91 48 32 48 32 51 55 57 32 55 54 93 10 47 80 97 114 101 110 116 32 51 32 48 32 82 10 47 82 101 115 111 117 114 99 101 115 60 60 47 80 114 111 99 83 101 116 91 47 80 68 70 32 47 84 101 120 116 93 10 47 69 120 116 71 83 116 97 116 101 32 49 50 32 48 32 82 10 47 70 111 110 116 32 49 51 32 48 32 82 10 62 62 10 47 67 111 110 116 101 110 116 115 32 53 32 48 32 82 10 62 62 10 101 110 100 111 98 106 10 51 32 48 32 111 98 106 10 60 60 32 47 84 121 112 101 32 47 80 97 103 101 115 32 47 75 105 100 115 32 91 10 52 32 48 32 82 10 93 32 47 67 111 117 110 116 32 49 10 62 62 10 101 110 100 111 98 106 10 49 32 48 32 111 98 106 10 60 60 47 84 121 112 101 32 47 67 97 116 97 108 111 103 32 47 80 97 103 101 115 32 51 32 48 32 82 10 47 77 101 116 97 100 97 116 97 32 49 54 32 48 32 82 10 62 62 10 101 110 100 111 98 106 10 55 32 48 32 111 98 106 10 60 60 47 84 121 112 101 47 69 120 116 71 83 116 97 116 101 10 47 79 80 77 32 49 62 62 101 110 100 111 98 106 10 49 50 32 48 32 111 98 106 10 60 60 47 82 55 10 55 32 48 32 82 62 62 10 101 110 100 111 98 106 10 49 51 32 48 32 111 98 106 10 60 60 47 82 56 10 56 32 48 32 82 47 82 49 48 10 49 48 32 48 32 82 62 62 10 101 110 100 111 98 106 10 56 32 48 32 111 98 106 10 60 60 47 66 97 115 101 70 111 110 116 47 73 76 78 89 82 81 43 67 111 117 114 105 101 114 45 66 111 108 100 47 70 111 110 116 68 101 115 99 114 105 112 116 111 114 32 57 32 48 32 82 47 84 121 112 101 47 70 111 110 116 10 47 70 105 114 115 116 67 104 97 114 32 51 52 47 76 97 115 116 67 104 97 114 32 49 49 49 47 87 105 100 116 104 115 91 32 54 48 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 10 54 48 48 32 48 32 48 32 54 48 48 32 48 32 48 32 48 32 48 32 54 48 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 10 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 10 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 10 48 32 48 32 48 32 48 32 48 32 48 32 54 48 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 54 48 48 93 10 47 69 110 99 111 100 105 110 103 47 87 105 110 65 110 115 105 69 110 99 111 100 105 110 103 47 83 117 98 116 121 112 101 47 84 121 112 101 49 62 62 10 101 110 100 111 98 106 10 49 48 32 48 32 111 98 106 10 60 60 47 66 97 115 101 70 111 110 116 47 67 71 68 72 89 75 43 84 105 109 101 115 45 82 111 109 97 110 47 70 111 110 116 68 101 115 99 114 105 112 116 111 114 32 49 49 32 48 32 82 47 84 121 112 101 47 70 111 110 116 10 47 70 105 114 115 116 67 104 97 114 32 52 56 47 76 97 115 116 67 104 97 114 32 49 50 48 47 87 105 100 116 104 115 91 10 53 48 48 32 53 48 48 32 53 48 48 32 53 48 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 10 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 51 51 51 32 48 32 48 32 48 32 48 32 48 32 48 10 48 32 48 32 48 32 48 32 48 32 48 32 55 50 50 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 32 48 10 48 32 52 52 52 32 48 32 48 32 53 48 48 32 52 52 52 32 48 32 48 32 48 32 48 32 48 32 48 32 50 55 56 32 48 32 53 48 48 32 48 10 48 32 48 32 48 32 48 32 48 32 53 48 48 32 48 32 48 32 53 48 48 93 10 47 69 110 99 111 100 105 110 103 47 87 105 110 65 110 115 105 69 110 99 111 100 105 110 103 47 83 117 98 116 121 112 101 47 84 121 112 101 49 62 62 10 101 110 100 111 98 106 10 57 32 48 32 111 98 106 10 60 60 47 84 121 112 101 47 70 111 110 116 68 101 115 99 114 105 112 116 111 114 47 70 111 110 116 78 97 109 101 47 73 76 78 89 82 81 43 67 111 117 114 105 101 114 45 66 111 108 100 47 70 111 110 116 66 66 111 120 91 48 32 45 49 54 32 53 55 49 32 54 51 56 93 47 70 108 97 103 115 32 49 51 49 49 48 53 10 47 65 115 99 101 110 116 32 54 51 56 10 47 67 97 112 72 101 105 103 104 116 32 54 51 56 10 47 68 101 115 99 101 110 116 32 45 49 54 10 47 73 116 97 108 105 99 65 110 103 108 101 32 48 10 47 83 116 101 109 86 32 56 53 10 47 65 118 103 87 105 100 116 104 32 54 48 48 10 47 77 97 120 87 105 100 116 104 32 54 48 48 10 47 77 105 115 115 105 110 103 87 105 100 116 104 32 54 48 48 10 47 88 72 101 105 103 104 116 32 52 53 48 10 47 67 104 97 114 83 101 116 40 47 101 105 103 104 116 47 102 47 111 47 113 117 111 116 101 100 98 108 47 116 104 114 101 101 47 122 101 114 111 41 47 70 111 110 116 70 105 108 101 51 32 49 52 32 48 32 82 62 62 10 101 110 100 111 98 106 10 49 52 32 48 32 111 98 106 10 60 60 47 70 105 108 116 101 114 47 70 108 97 116 101 68 101 99 111 100 101 10 47 83 117 98 116 121 112 101 47 84 121 112 101 49 67 47 76 101 110 103 116 104 32 57 49 51 62 62 115 116 114 101 97 109 10 120 156 109 144 125 76 27 117 24 199 239 40 187 94 92 217 164 221 225 54 183 222 233 116 178 116 184 14 99 50 48 70 7 216 134 208 45 131 68 186 130 44 118 208 150 27 165 119 43 20 233 75 54 91 54 181 252 132 141 190 88 222 214 142 25 86 130 96 155 161 16 70 10 11 99 89 12 26 154 205 104 98 112 81 22 137 127 16 15 33 241 119 122 137 241 186 100 153 38 230 73 158 60 249 62 111 159 231 65 145 236 44 4 69 209 156 82 198 97 167 77 246 130 18 198 218 144 17 10 248 103 81 126 79 22 191 87 2 220 252 210 159 242 45 123 17 221 21 121 206 199 50 20 200 36 64 150 61 244 215 91 114 216 157 11 189 219 161 243 105 68 130 162 237 157 145 82 134 117 218 105 75 99 43 149 255 118 149 254 128 74 117 240 137 114 184 168 168 136 58 237 124 156 161 202 76 45 180 197 70 237 23 131 54 147 149 97 155 77 182 214 215 168 82 177 218 106 165 235 41 139 213 201 54 182 80 198 134 6 83 67 166 173 218 104 53 53 81 26 218 74 179 44 211 70 229 151 30 160 10 213 234 195 5 162 123 245 56 221 124 218 209 66 29 99 108 12 165 163 50 7 252 71 65 16 4 99 204 71 158 87 191 130 32 39 16 45 178 11 145 32 185 200 14 68 42 30 142 100 35 229 200 223 168 11 77 102 229 102 13 243 107 219 248 53 55 7 163 28 250 37 7 211 156 4 222 230 171 9 33 95 216 178 95 216 41 228 65 236 5 152 49 108 3 230 65 66 192 54 133 231 200 206 151 136 149 244 137 163 111 106 42 11 11 53 119 190 251 62 189 176 74 138 67 0 7 189 220 207 28 10 107 197 33 115 240 23 2 170 176 33 16 233 10 94 238 15 135 6 192 32 24 232 232 63 23 246 6 58 186 88 128 11 170 36 54 118 125 96 97 116 230 131 139 227 202 136 63 220 217 3 240 225 171 67 35 215 60 131 108 128 108 10 233 2 70 177 106 235 209 170 67 164 185 78 202 130 11 157 190 139 30 159 207 5 92 192 29 244 244 250 66 29 17 255 167 0 191 41 120 43 177 179 255 206 122 130 238 136 47 116 161 239 163 107 0 135 41 44 6 250 187 3 151 158 16 156 23 9 124 143 8 72 76 132 246 112 80 179 14 75 56 249 3 78 205 65 171 232 158 81 172 241 71 224 125 226 238 68 124 18 204 227 220 203 203 130 84 192 15 21 191 88 29 127 247 110 189 82 177 81 81 127 70 127 108 55 245 176 4 238 128 121 15 191 253 67 169 88 3 95 157 153 171 152 192 5 25 100 136 197 41 139 222 112 202 162 211 157 74 204 206 78 37 22 73 197 134 16 207 254 102 182 254 164 161 198 172 213 214 36 103 83 183 38 22 51 15 227 127 136 161 112 15 255 27 49 46 4 187 237 33 111 20 236 138 129 96 248 210 240 40 12 236 188 159 247 127 234 35 98 222 192 161 15 56 120 142 147 240 125 80 32 192 42 179 108 152 163 19 181 209 42 80 5 106 219 105 139 65 207 20 3 53 126 80 10 212 241 226 148 126 220 50 211 190 0 22 192 76 116 60 145 154 139 47 131 85 92 88 249 157 216 156 94 186 119 111 90 187 79 41 160 210 125 117 218 178 178 186 165 77 229 227 5 114 94 197 189 46 254 34 13 71 120 5 209 236 104 179 177 81 215 152 159 156 244 247 250 175 250 110 182 143 52 2 51 104 125 223 238 114 179 45 102 175 6 84 128 230 158 179 131 238 240 135 93 231 1 206 56 28 204 201 31 105 184 125 229 86 223 216 20 57 157 136 223 6 119 192 162 57 245 70 18 87 252 244 245 141 225 228 252 110 240 133 115 170 105 212 116 67 31 45 7 56 149 95 93 201 14 181 94 239 235 237 9 133 200 207 62 143 127 50 15 240 244 164 237 29 163 209 92 67 110 123 47 198 151 199 160 60 22 139 97 235 79 173 111 253 53 40 147 173 203 114 16 228 31 49 50 192 53 10 101 110 100 115 116 114 101 97 109 10 101 110 100 111 98 106 10 49 49 32 48 32 111 98 106 10 60 60 47 84 121 112 101 47 70 111 110 116 68 101 115 99 114 105 112 116 111 114 47 70 111 110 116 78 97 109 101 47 67 71 68 72 89 75 43 84 105 109 101 115 45 82 111 109 97 110 47 70 111 110 116 66 66 111 120 91 48 32 45 49 52 32 54 57 55 32 54 56 51 93 47 70 108 97 103 115 32 49 51 49 49 48 52 10 47 65 115 99 101 110 116 32 54 56 51 10 47 67 97 112 72 101 105 103 104 116 32 54 54 50 10 47 68 101 115 99 101 110 116 32 45 49 52 10 47 73 116 97 108 105 99 65 110 103 108 101 32 48 10 47 83 116 101 109 86 32 49 48 52 10 47 77 105 115 115 105 110 103 87 105 100 116 104 32 53 48 48 10 47 88 72 101 105 103 104 116 32 52 54 48 10 47 67 104 97 114 83 101 116 40 47 73 47 86 47 97 47 100 47 101 47 108 47 110 47 111 110 101 47 116 104 114 101 101 47 116 119 111 47 117 47 120 47 122 101 114 111 41 47 70 111 110 116 70 105 108 101 51 32 49 53 32 48 32 82 62 62 10 101 110 100 111 98 106 10 49 53 32 48 32 111 98 106 10 60 60 47 70 105 108 116 101 114 47 70 108 97 116 101 68 101 99 111 100 101 10 47 83 117 98 116 121 112 101 47 84 121 112 101 49 67 47 76 101 110 103 116 104 32 49 54 49 55 62 62 115 116 114 101 97 109 10 120 156 101 84 125 84 147 231 21 127 95 2 121 158 118 128 43 49 147 216 154 100 174 31 182 126 20 105 61 72 231 78 103 101 116 29 145 218 20 249 176 48 12 18 32 144 47 129 16 18 242 18 2 33 6 110 48 24 33 33 1 18 148 74 69 160 65 139 64 1 181 21 113 116 107 119 92 165 181 210 30 35 231 236 184 57 219 179 179 127 246 188 156 215 63 150 108 103 103 127 236 159 231 60 207 253 221 231 222 223 185 191 123 47 77 197 199 81 52 77 39 230 169 52 202 186 157 114 157 70 161 141 189 183 179 79 211 236 51 113 236 22 30 48 235 7 215 95 79 216 66 201 6 121 73 144 200 131 196 248 161 103 248 246 20 50 241 20 241 108 32 109 63 166 120 52 221 232 121 255 128 78 111 170 85 85 86 213 75 183 29 150 23 188 184 125 251 142 255 89 118 103 102 102 74 203 76 255 69 164 89 202 58 85 165 86 250 124 244 210 160 84 235 244 26 165 182 254 231 210 3 81 111 181 90 117 76 90 169 54 233 171 234 164 138 242 114 101 121 236 91 190 66 173 172 145 102 171 212 42 189 94 215 32 221 118 224 69 105 122 90 218 238 157 209 99 79 174 74 83 102 168 147 254 155 184 52 87 151 41 149 73 229 202 74 131 90 81 251 255 8 69 81 73 90 195 91 138 198 114 165 58 63 109 119 250 43 20 245 54 149 79 189 68 189 65 21 81 191 162 178 169 131 84 6 245 20 149 66 9 168 141 84 114 180 46 84 60 213 64 253 133 222 74 223 136 203 141 251 130 183 131 167 226 125 26 191 53 94 19 191 152 144 195 58 147 89 39 4 216 205 215 233 111 35 36 43 194 235 103 183 10 79 157 236 117 121 1 127 208 99 57 34 225 92 8 228 45 76 225 9 108 33 85 1 84 232 182 248 32 140 201 4 154 159 61 227 27 7 188 48 172 126 75 194 41 17 200 154 205 69 49 167 242 0 58 210 109 245 193 2 38 38 244 176 116 113 127 137 218 156 243 166 120 21 217 187 142 152 84 45 121 77 162 104 70 219 146 60 196 190 54 192 248 83 190 140 144 236 200 38 193 0 91 119 69 232 224 151 180 120 63 150 144 71 92 58 18 140 155 209 103 78 159 13 138 48 103 69 160 115 48 76 139 222 160 182 106 0 151 215 76 92 150 8 6 200 42 247 60 131 230 157 126 11 148 96 174 27 237 155 47 92 153 188 212 63 50 34 158 158 78 216 139 4 50 119 199 149 80 216 123 213 47 74 38 107 16 92 143 15 210 4 253 131 71 16 161 133 240 203 102 107 134 19 55 146 43 65 148 121 178 201 15 43 152 61 132 96 197 223 23 113 227 32 119 165 17 221 119 248 90 96 63 78 102 15 217 110 200 151 216 212 225 148 197 123 100 219 119 155 4 179 108 238 23 66 51 99 117 88 0 215 219 253 51 18 82 128 224 154 227 188 101 216 16 62 26 60 4 120 231 254 35 178 250 144 241 236 240 80 232 140 187 179 187 211 35 233 232 233 60 13 30 60 50 118 230 163 133 17 237 97 113 46 226 118 29 52 183 29 85 26 140 140 10 170 177 160 80 54 83 186 60 51 53 116 109 89 44 232 43 232 30 108 152 122 122 2 134 124 31 94 140 66 220 203 247 132 160 118 180 54 88 235 24 93 107 3 224 42 221 196 180 196 141 224 230 84 152 36 205 224 152 126 33 246 149 0 77 46 252 132 148 4 248 106 48 246 171 103 184 141 164 48 245 30 73 12 142 140 246 143 185 68 1 46 221 130 70 59 122 219 129 1 171 213 80 171 118 180 91 77 205 70 38 148 170 187 108 154 128 62 240 247 121 70 93 56 192 29 179 244 160 81 232 111 190 80 252 144 123 54 149 227 115 153 154 50 155 189 218 41 178 144 231 2 72 103 237 238 59 229 9 244 133 36 171 100 195 3 78 234 110 239 106 135 118 17 152 236 39 170 59 98 76 108 215 160 159 125 242 3 122 100 141 24 35 60 242 189 77 72 94 184 150 208 143 76 157 29 224 4 92 217 22 149 151 253 3 114 116 189 103 174 178 229 152 69 77 232 180 235 20 156 6 60 217 99 43 147 112 105 72 57 166 247 30 3 204 161 93 92 2 183 149 219 248 245 171 36 110 241 98 104 110 66 146 19 213 45 30 236 118 171 173 197 100 172 181 105 1 239 205 251 150 108 32 9 11 95 221 249 100 161 56 95 18 147 234 22 209 142 17 20 166 217 29 100 175 240 189 215 143 106 115 64 14 71 207 107 111 152 46 218 199 59 150 49 89 230 183 125 110 59 95 59 166 9 151 12 21 64 17 20 155 148 170 226 50 125 22 100 98 78 124 123 15 65 127 251 250 38 161 46 139 185 187 100 135 208 123 119 98 114 25 150 97 88 215 247 42 78 38 23 32 64 255 16 225 5 215 121 194 83 124 175 203 231 138 242 30 235 101 138 37 143 143 35 56 204 52 203 28 209 246 111 9 32 153 219 218 11 215 49 251 16 157 232 42 48 43 109 217 102 81 242 122 69 75 104 61 41 68 71 183 208 75 66 78 209 200 191 238 28 108 1 29 52 217 245 86 13 247 194 99 94 42 183 157 60 168 94 105 59 11 1 17 4 253 189 99 93 110 240 186 252 174 104 55 6 27 209 66 135 159 153 78 39 157 143 63 78 13 240 73 45 187 52 190 234 245 206 159 140 141 18 115 110 61 229 28 61 252 136 244 61 226 17 207 250 94 97 30 40 204 21 85 239 188 171 228 16 112 79 0 71 143 115 79 204 189 59 89 122 181 110 9 174 194 244 64 248 195 165 235 23 9 6 146 132 137 34 141 252 148 219 36 118 30 23 70 102 163 5 87 114 202 82 233 158 61 165 255 36 229 164 106 150 240 214 36 255 217 14 159 248 191 12 209 68 181 198 35 51 209 4 220 175 211 18 24 228 235 246 186 221 93 131 158 1 119 47 224 161 30 75 141 228 113 17 130 234 182 250 166 86 75 43 227 84 116 70 139 113 62 128 246 185 154 122 97 30 179 223 163 88 168 59 236 217 175 104 242 96 141 199 234 200 22 97 115 119 133 188 185 245 183 32 226 218 248 100 31 201 250 243 95 47 221 129 187 162 191 191 246 205 207 242 10 12 199 42 196 53 42 75 141 57 107 200 145 250 209 15 225 177 91 128 35 55 228 25 191 40 217 149 145 46 225 178 185 119 18 172 236 230 88 84 38 204 62 248 93 10 185 189 170 188 189 73 112 139 236 36 247 132 55 225 108 199 112 235 103 134 75 114 200 198 25 242 223 236 215 27 61 195 21 98 205 160 217 99 142 142 173 133 105 168 154 54 252 233 155 213 115 83 115 146 185 169 115 75 240 71 184 218 52 167 189 96 60 211 232 43 13 98 193 253 91 115 239 79 126 186 249 187 156 197 151 139 74 205 53 149 98 141 222 114 220 240 118 224 68 234 212 202 236 248 239 1 127 62 91 42 171 180 84 214 214 74 52 26 157 229 205 58 156 108 12 177 249 33 146 23 226 143 62 121 255 71 163 167 19 19 239 15 38 38 81 212 191 0 224 197 6 77 10 101 110 100 115 116 114 101 97 109 10 101 110 100 111 98 106 10 49 54 32 48 32 111 98 106 10 60 60 47 84 121 112 101 47 77 101 116 97 100 97 116 97 10 47 83 117 98 116 121 112 101 47 88 77 76 47 76 101 110 103 116 104 32 49 51 54 57 62 62 115 116 114 101 97 109 10 60 63 120 112 97 99 107 101 116 32 98 101 103 105 110 61 39 239 187 191 39 32 105 100 61 39 87 53 77 48 77 112 67 101 104 105 72 122 114 101 83 122 78 84 99 122 107 99 57 100 39 63 62 10 60 63 97 100 111 98 101 45 120 97 112 45 102 105 108 116 101 114 115 32 101 115 99 61 34 67 82 76 70 34 63 62 10 60 120 58 120 109 112 109 101 116 97 32 120 109 108 110 115 58 120 61 39 97 100 111 98 101 58 110 115 58 109 101 116 97 47 39 32 120 58 120 109 112 116 107 61 39 88 77 80 32 116 111 111 108 107 105 116 32 50 46 57 46 49 45 49 51 44 32 102 114 97 109 101 119 111 114 107 32 49 46 54 39 62 10 60 114 100 102 58 82 68 70 32 120 109 108 110 115 58 114 100 102 61 39 104 116 116 112 58 47 47 119 119 119 46 119 51 46 111 114 103 47 49 57 57 57 47 48 50 47 50 50 45 114 100 102 45 115 121 110 116 97 120 45 110 115 35 39 32 120 109 108 110 115 58 105 88 61 39 104 116 116 112 58 47 47 110 115 46 97 100 111 98 101 46 99 111 109 47 105 88 47 49 46 48 47 39 62 10 60 114 100 102 58 68 101 115 99 114 105 112 116 105 111 110 32 114 100 102 58 97 98 111 117 116 61 39 117 117 105 100 58 53 52 55 48 97 100 48 55 45 48 98 101 49 45 49 49 101 102 45 48 48 48 48 45 48 57 56 52 52 54 54 99 98 98 52 102 39 32 120 109 108 110 115 58 112 100 102 61 39 104 116 116 112 58 47 47 110 115 46 97 100 111 98 101 46 99 111 109 47 112 100 102 47 49 46 51 47 39 32 112 100 102 58 80 114 111 100 117 99 101 114 61 39 71 80 76 32 71 104 111 115 116 115 99 114 105 112 116 32 57 46 48 53 39 47 62 10 60 114 100 102 58 68 101 115 99 114 105 112 116 105 111 110 32 114 100 102 58 97 98 111 117 116 61 39 117 117 105 100 58 53 52 55 48 97 100 48 55 45 48 98 101 49 45 49 49 101 102 45 48 48 48 48 45 48 57 56 52 52 54 54 99 98 98 52 102 39 32 120 109 108 110 115 58 120 109 112 61 39 104 116 116 112 58 47 47 110 115 46 97 100 111 98 101 46 99 111 109 47 120 97 112 47 49 46 48 47 39 62 60 120 109 112 58 77 111 100 105 102 121 68 97 116 101 62 50 48 49 52 45 48 53 45 48 52 84 50 50 58 52 54 58 50 55 43 48 51 58 48 48 60 47 120 109 112 58 77 111 100 105 102 121 68 97 116 101 62 10 60 120 109 112 58 67 114 101 97 116 101 68 97 116 101 62 50 48 49 52 45 48 53 45 48 52 84 50 50 58 52 54 58 50 55 43 48 51 58 48 48 60 47 120 109 112 58 67 114 101 97 116 101 68 97 116 101 62 10 60 120 109 112 58 67 114 101 97 116 111 114 84 111 111 108 62 102 105 103 50 100 101 118 32 86 101 114 115 105 111 110 32 51 46 50 32 80 97 116 99 104 108 101 118 101 108 32 53 100 60 47 120 109 112 58 67 114 101 97 116 111 114 84 111 111 108 62 60 47 114 100 102 58 68 101 115 99 114 105 112 116 105 111 110 62 10 60 114 100 102 58 68 101 115 99 114 105 112 116 105 111 110 32 114 100 102 58 97 98 111 117 116 61 39 117 117 105 100 58 53 52 55 48 97 100 48 55 45 48 98 101 49 45 49 49 101 102 45 48 48 48 48 45 48 57 56 52 52 54 54 99 98 98 52 102 39 32 120 109 108 110 115 58 120 97 112 77 77 61 39 104 116 116 112 58 47 47 110 115 46 97 100 111 98 101 46 99 111 109 47 120 97 112 47 49 46 48 47 109 109 47 39 32 120 97 112 77 77 58 68 111 99 117 109 101 110 116 73 68 61 39 117 117 105 100 58 53 52 55 48 97 100 48 55 45 48 98 101 49 45 49 49 101 102 45 48 48 48 48 45 48 57 56 52 52 54 54 99 98 98 52 102 39 47 62 10 60 114 100 102 58 68 101 115 99 114 105 112 116 105 111 110 32 114 100 102 58 97 98 111 117 116 61 39 117 117 105 100 58 53 52 55 48 97 100 48 55 45 48 98 101 49 45 49 49 101 102 45 48 48 48 48 45 48 57 56 52 52 54 54 99 98 98 52 102 39 32 120 109 108 110 115 58 100 99 61 39 104 116 116 112 58 47 47 112 117 114 108 46 111 114 103 47 100 99 47 101 108 101 109 101 110 116 115 47 49 46 49 47 39 32 100 99 58 102 111 114 109 97 116 61 39 97 112 112 108 105 99 97 116 105 111 110 47 112 100 102 39 62 60 100 99 58 116 105 116 108 101 62 60 114 100 102 58 65 108 116 62 60 114 100 102 58 108 105 32 120 109 108 58 108 97 110 103 61 39 120 45 100 101 102 97 117 108 116 39 62 97 114 114 97 121 45 101 108 101 109 101 110 116 115 46 102 105 103 60 47 114 100 102 58 108 105 62 60 47 114 100 102 58 65 108 116 62 60 47 100 99 58 116 105 116 108 101 62 60 47 114 100 102 58 68 101 115 99 114 105 112 116 105 111 110 62 10 60 47 114 100 102 58 82 68 70 62 10 60 47 120 58 120 109 112 109 101 116 97 62 10 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 10 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 10 60 63 120 112 97 99 107 101 116 32 101 110 100 61 39 119 39 63 62 10 101 110 100 115 116 114 101 97 109 10 101 110 100 111 98 106 10 50 32 48 32 111 98 106 10 60 60 47 80 114 111 100 117 99 101 114 40 71 80 76 32 71 104 111 115 116 115 99 114 105 112 116 32 57 46 48 53 41 10 47 67 114 101 97 116 105 111 110 68 97 116 101 40 68 58 50 48 49 52 48 53 48 52 50 50 52 54 50 55 43 48 51 39 48 48 39 41 10 47 77 111 100 68 97 116 101 40 68 58 50 48 49 52 48 53 48 52 50 50 52 54 50 55 43 48 51 39 48 48 39 41 10 47 84 105 116 108 101 40 97 114 114 97 121 45 101 108 101 109 101 110 116 115 46 102 105 103 41 10 47 67 114 101 97 116 111 114 40 102 105 103 50 100 101 118 32 86 101 114 115 105 111 110 32 51 46 50 32 80 97 116 99 104 108 101 118 101 108 32 53 100 41 62 62 101 110 100 111 98 106 10 120 114 101 102 10 48 32 49 55 10 48 48 48 48 48 48 48 48 48 48 32 54 53 53 51 53 32 102 32 10 48 48 48 48 48 48 48 53 55 56 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 54 49 48 57 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 48 53 49 57 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 48 51 54 57 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 48 48 49 53 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 48 51 53 48 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 48 54 52 51 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 48 55 53 53 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 49 52 48 56 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 49 48 55 57 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 50 54 57 51 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 48 54 56 52 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 48 55 49 52 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 49 54 57 54 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 50 57 54 49 32 48 48 48 48 48 32 110 32 10 48 48 48 48 48 48 52 54 54 51 32 48 48 48 48 48 32 110 32 10 116 114 97 105 108 101 114 10 60 60 32 47 83 105 122 101 32 49 55 32 47 82 111 111 116 32 49 32 48 32 82 32 47 73 110 102 111 32 50 32 48 32 82 10 47 73 68 32 91 60 54 69 49 50 69 54 54 67 48 65 50 55 49 65 52 53 56 68 66 49 69 52 50 68 53 68 66 70 66 55 50 51 62 60 54 69 49 50 69 54 54 67 48 65 50 55 49 65 52 53 56 68 66 49 69 52 50 68 53 68 66 70 66 55 50 51 62 93 10 62 62 10 115 116 97 114 116 120 114 101 102 10 54 51 48 51 10 37 37 69 79 70 10 EOF # Now, apply the patch patch -p1 << \EOF diff -urN gawk-4.1.1/ChangeLog gawk-4.1.2/ChangeLog --- gawk-4.1.1/ChangeLog 2014-04-08 20:33:55.000000000 +0300 +++ gawk-4.1.2/ChangeLog 2015-04-29 08:52:53.000000000 +0300 @@ -1,3 +1,899 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + +2015-04-28 Arnold D. Robbins + + * awkgram.y (yylex): Rework the bracket handling from zero. + Thanks to Michal Jaegermann for yet another test case. + + Unrelated: + + * eval.c (setup_frame): Restore call-by-value for $0. This was + necessitated by the changes on 2014-11-11 for conserving + memory use. Thanks to Andrew Schorr for the report and isolating + the cause of the problem. + +2015-04-27 Arnold D. Robbins + + * awkgram.y (yylex): Make change of Jan 7 for parsing regexps + work better. Thanks to Nelson Beebe. + +2015-04-26 Arnold D. Robbins + + * dfa.c: Sync with grep. + +2015-04-16 Arnold D. Robbins + + * builtin.c (do_strftime): For bad time_t values, return "". + +2015-04-16 Andrew J. Schorr + + * node.c (r_force_number): If strtod sets errno, then force the + numeric value in node->numbr to zero. For subnormal values, strtod + sets errno but does not return zero, and we don't want to retain + those subnormal values. + +2015-04-16 Arnold D. Robbins + + * builtin.c (do_strftime): Use a double for the timestamp and + check that the value is within range for a time_t. + + Unrelated: + + * regex_internal.h (test_malloc, test_realloc): Use %lu in printf + format for error messages. Thanks to Michal Jaegermann for + pointing this out. + + Unrelated: + + * NEWS: Updated. + +2015-04-14 Arnold D. Robbins + + * builtin.c (do_strftime): Restore checking for negative result and + add check that time_t is > 0 --- means we're assigning a negative value + to an unsigned time_t. Thanks again to Glaudiston Gomes da Silva + . + + If localtime() or gmtime() return NULL, return a null string. + Thanks to Andrew Schorr. + + Unrelated: + * builtin.c (call_sub): Fix for indirect gensub, 3 args now works. + +2015-04-13 Arnold D. Robbins + + * regcomp.c (analyze): Prevent malloc(0). + * regex_internal.h (test_malloc, test_realloc): New functions + that check for zero count. + (re_malloc, re_realloc): Adjust to call the new functions for gawk. + * regexec.c (buid_trtable, match_ctx_clean): Replace malloc/free + with re_malloc/re_free. + + Unrelated: + + * builtin.c (do_strftime): Disable checking timestamp value for less + than zero. Allows times before the epoch to work with strftime. + Thanks to Glaudiston Gomes da Silva + for raising the issue. + +2015-04-12 Arnold D. Robbins + + * Makefile.am (efence): Make this link again. + Thanks to Michal Jaegermann for pointing out the problem. + +2015-04-08 John E. Malmberg + + * custom.h: VMS shares some code paths with ZOS_USS in + building gawkfts extension. + +2015-04-08 Arnold D. Robbins + + Factor out opening of /dev/XXX files from /inet. + Enable interpretation of special filenames for profiling output. + + * awk.h (devopen_simple): Add declaration. + * io.c (devopen_simple): New routine. + (devopen): Call devopen_simple as appropriate. + * profile.c (set_prof_file): Call devopen_simple as appropriate, + some additonal logic to hande fd to fp conversion. + + Unrelated: + + * main.c (usage): Add a comment for translators. + +2015-04-08 Eli Zaretskii + + * profile.c (set_prof_file): Interpret a file name of "-" to mean + standard output. + +2015-04-06 Arnold D. Robbins + + * awk.h (force_number): Add `!= 0' check to bitwise operation. + * awkgram.y: Same, many places. + (check_special): Simplify code for checking extension flags. + +2015-04-05 Arnold D. Robbins + + * awkgram.y (install_builtins): If do_traditional is true, do not + install gawk extensions flagged with GAWKX. Similarly, if do_posix + is true, do not install functions flagged with NOT_POSIX. + This fixes a problem with spurious lint complaints about shadowing + a global variable that is not valid in traditional or posix mode. + Thanks to Andrew Schorr for finding the problem and supplying + initial code; I did it slightly differently. + +2015-03-31 Arnold D. Robbins + + * awk.h (call_sub): Renamed from call_sub_func. + (call_match, call_split_func): Declare. + * builtin.c (call_sub): Renamed from call_sub_func. + (call_match, call_split_func): New functions. + * interpret.h (r_interpret): Call new functions as appropriate. + * node.c (r_unref): Revert change to handle Node_regex, not needed. + +2015-03-31 Arnold D. Robbins + + * awk.h (r_get_field): Declare. + * builtin.c (call_sub_func): Rearrange the stack to be what + the buitin function expects. + * eval.c (r_get_field): Make extern. + +2015-03-24 Arnold D. Robbins + + * awkgram.y (make_regnode): Make extern. + * awk.h (make_regnode): Declare. + * builtin.c (call_sub_func): Start on reworking the stack to + be what do_sub() expects. Still needs work. + * interpret.h (r_interpret): Add a cast in comparison with do_sub(). + * node.c (r_unref): Handle Node_regex nodes. + +2015-03-24 Andrew J. Schorr + + * interpret.h (r_interpret): When Op_K_exit has an argument of + Nnull_string, do not update exit_val, since no value was supplied. + +2015-03-20 Arnold D. Robbins + + Start on fixing indirect calls of builtins. + + * awk.h (call_sub_func): Add declaration. + * awkgram.y (lookup_builtin): Handle length, sub functions. + (install_builtin): Handle length function. + * builtin.c (call_sub_func): New function. + * interpret.h (r_interpret): If calling do_sub, do it through + call_sub_func(). + +2015-03-18 Arnold D. Robbins + + * config.guess, config.sub: Updated, from libtool 2.4.6. + +2015-03-17 Arnold D. Robbins + + * profile.c (pp_number): Allocate enough room to print the number + in all cases. Was a problem mixing -M with profiling with a really + big number. Thanks to Hermann Peifer for the bug report. + +2015-03-08 Arnold D. Robbins + + * re.c (regexflags2str): Removed. It was redundant. + +2015-02-27 Arnold D. Robbins + + * symbol.c (check_param_names): Fix argument order in memset() call. + * configure.ac: Use AC_SEARCH_LIBS instead of AC_CHECK_LIB. This fixes + a long-standing problem where `-lm' was used twice in the final + compilation line. + +2015-02-24 Arnold D. Robbins + + * POSIX.STD: Update copyright year. + * awkgram.y (yylex): Allow \r after \\ line continuation everywhere. + Thanks to Scott Rush for the report. + +2015-02-13 Arnold D. Robbins + + * awkgram.y (yylex): Be more careful about passing true to + nextc() when collecting a regexp. Some systems' iscntrl() + are not as forgiving as GLIBC's. E.g., Solaris. + Thanks to Dagobert Michelsen for + the bug report and access to systems to check the fix. + +2015-02-12 Arnold D. Robbins + + * POSIX.STD: Update with info about function parameters. + * configure.ac: Remove test for / use of dbug library. + +2015-02-11 Arnold D. Robbins + + * gawkapi.h: Fix spelling error in comment. + +2015-02-07 Arnold D. Robbins + + * regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h, + regexec.c: Sync with GLIBC. Mostly copyright date updates. + +2015-02-05 Andrew J. Schorr + + * eval.c (set_IGNORECASE): If IGNORECASE has a numeric value, try + using that before treating it as a string. This fixes a problem + where setting -v IGNORECASE=0 on the command line was not working + properly. + +2015-02-01 Arnold D. Robbins + + Move POSIX requirement for disallowing paramater names with the + same name as a function into --posix. + + * NEWS: Document it. + * awkgram.y (parse_program): Check do_posix before calling + check_param_names(). + * symbol.c (check_param_names): Set up a fake node and call + in_array() for function parameter names instead of linear + searching the function list a second time. Thanks to Andrew + Schorr for the motivation. + +2015-01-30 Arnold D. Robbins + + Don't allow function parameter names to be the same as function + names - required by POSIX. Bug first reported in comp.lang.awk. + + In addition, don't allow use of a parameter as a function name + in a call (but it's ok in indirect calls). + + * NEWS: Updated. + * awk.h (check_param_names): Add declaration. + * awkgram.y (at_seen): New variable. Communicates between + yylex() and the parser. + (FUNC_CALL production): Check at_seen and check that the identifier + is a function name. + (parse_program): Call check_param_names() and set errcount. + (yylex): Set at_seen after seeing an at-sign. + * symbol.c (check_param_names): New function. + +2015-01-24 Arnold D. Robbins + + Infrastructure updates. + + Bison 3.0.4. Automake 1.15. Gettext 0.19.4. + +2015-01-20 Arnold D. Robbins + + * gawkapi.c (api_set_array_element): Remove useless call to + make_aname. + * symbol.c (load_symbols): Ditto. + Thanks to Andrew Schorr for pointing out the problem. + +2015-01-19 Arnold D. Robbins + + * awkgram.c: Update to bison 3.0.3. + * command.c: Ditto. + * NEWS: Note same. + +2015-01-15 Arnold D. Robbins + + * dfa.h, dfa.c: Sync with grep. Mainly copyright updates. + * getopt.c, getopt.h, getopt1.c getopt_int.h: Sync with GLIBC. + Mainly copyright updates, one minor code fix. + +2015-01-14 Arnold D. Robbins + + Remove deferred variables. + + * awk.h (register_deferred_variable): Remove declaration. + * awkgram.y (is_deferred_variable, process_deferred, + symtab_used, extensions_used, deferred_variables, + process_deferred): Remove declarations, bodies, and uses. + * builtin.c (do_length): Update comment. + * main.c (init_vars): Just call load_procinfo() and `load_environ()'. + +2015-01-07 Arnold D. Robbins + + * configure.ac: Update debug flags if developing. + * awkgram.y (yylex): Regex parsing bug fix for bracket expressions. + Thanks to Mike Brennan for the report. + * builtin.c (format_tree): Catch non-use of count$ for dynamic + field width or precision. + + Unrelated: + + Load deferred variables if extensions are used; they might + want to access PROCINFO and/or ENVIRON. Thanks to Andrew Schorr + for pointing out the issue. + + * awkgram.y (extensions_used): New variable. Set it on @load. + (do_add_scrfile): Set it on -l. + (process_deferred): Check it also. + +2014-12-10 Arnold D. Robbins + + * dfa.c: Sync with GNU grep. + +2014-11-26 Arnold D. Robbins + + * builtin.c (do_sub): Improve wording of gensub warnings. + +2014-11-25 Arnold D. Robbins + + * builtin.c (do_sub): For gensub, add more warnings for invalid + third argument. + +2014-11-23 Arnold D. Robbins + + * awk.h: Move all inline functions to the bottom of the file. + Keeps modern GCC happier. + +2014-11-22 Arnold D. Robbins + + * awk.h (emalloc, realloc): Redefine in terms of ... + (emalloc_real, eralloc_real): New static inline functions. + (fatal): Move definition up. + * gawkmisc.c (xmalloc): If count is zero, make it one for older + mallocs that require size > 0 (such as z/OS). + +2014-11-21 Arnold D. Robbins + + * main.c: Remove a debugging // comment. + * NOTES: Removed. + + Unrelated: + + Revert changes of 2014-11-20 from Paul Eggert. Causes failures + on z/OS. + + Unrelated: Avoid unnecessary copying of $0. + + * interpret.h (UNFIELD): New macro. + (r_interpret): Use it where *lhs is assigned to. + +2014-11-20 Paul Eggert + + Port to systems where malloc (0) and/or realloc(P, 0) returns NULL. + * gawkmisc.c (xmalloc): + * xalloc.h (realloc): + Do not fail if malloc(0) or realloc(P, 0) returns NULL. + Fail only when the allocator returns null when attempting to + allocate a nonzero number of bytes. + +2014-11-19 Arnold D. Robbins + + Infrastructure upgrades: + + * Automake 1.14.1, Gettext 0.19.3, Libtool 2.4.3. + * compile, extension/build-aux/compile: New files. + +2014-11-19 gettextize + + * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.3. + +2014-11-16 Arnold D. Robbins + + * interpret.h: Revert change of 2014-11-11 since it breaks + certain uses. + + Unrelated: + + * dfa.c: Sync with GNU grep. + +2014-11-15 Arnold D. Robbins + + * array.c, awk.h, awkgram.y, builtin.c, dfa.c, eval.c, field.c, + interpret.h, io.c, main.c, mpfr.c, node.c, re.c, regex_internal.h, + replace.c: Remove all uses of MBS_SUPPORT. + * regex_internal.h: Disable wide characters on DJGPP. + * mbsupport.h: Rework to be needed only for DJGPP. + +2014-11-11 Arnold D. Robbins + + Don't let memory used increase linearly in the size of + the input. Problem reported by dragan legic + . + + * field.c (set_record): NUL-terminate the buffer. + * interpret.h (r_interpret): Op_field_spec: if it's $0, increment + the valref. Op_store_var: if we got $0, handle it appropriately. + +2014-11-10 Arnold D. Robbins + + Reorder main.c activities so that we can set a locale on the + command line with the new, for now undocumented, -Z option. + + * main.c (parse_args, set_locale_stuff): New functions. + (stopped_early): Made file level static. + (optlist, optab): Add new argument. + (main): Adjust ordering and move inline code into new functions. + +2014-11-09 Andrew J. Schorr + + * gawkapi.c (node_to_awk_value): When the type wanted is AWK_UNDEFINED + and a it's a Node_val set to Nnull_string, return AWK_UNDEFINED instead + of AWK_NUMBER 0. + +2014-11-03 Norihiro Tanaka + + * re.c (research): Use dfa superset to improve matching speed. + +2014-11-02 Arnold D. Robbins + + * profile.c (div_on_left_mul_on_right): New function. + (parenthesize): Call it. + +2014-10-30 Arnold D. Robbins + + * configure: Regenerated after fix to m4/readline.m4. + + Unrelated; fixes to profiling. Thanks to Hermann Peifer and + Manuel Collado for pointing out problems: + + * profile.c (pprint): For Op_unary_minus, parenthesize -(-x) + correctly. + (prec_level): Get the levels right (checked the grammar). + (is_unary_minus): New function. + (pp_concat): Add checks for unary minus; needs to be parenthesized. + +2014-10-29 Arnold D. Robbins + + * dfa.c: Sync with GNU grep. Again, again. + +2014-10-28 Arnold D. Robbins + + * dfa.c: Sync with GNU grep. Again. + +2014-10-25 Arnold D. Robbins + + * dfa.c: Sync with GNU grep. + +2014-10-17 John E. Malmberg + + * ext.c (close_extensions): Test for null pointer since + since this can be called by signal handler before the + pointers are initialized. + +2014-10-15 Arnold D. Robbins + + Make sane the handling of AWKPATH and AWKLIBPATH: + + 1. Don't explicitly search "."; it must be in the path either + physically or as null element a la the shell's $PATH + 2. If environment's value was empty, use built-in default value. + 3. Set ENVIRON["AWK*PATH"] to the path used. + + * io.c (path_info): Remove try_cwd member. + (get_cwd): Removed, not needed anymore. + (do_find_source): Don't do explicit check in current directory. + It must come from the AWKPATH or AWKLIBPATH variable. + * main.c (path_environ): If value from environment was empty, + set it to the default. This is how gawk has behaved since 2.10. + +2014-10-13 Arnold D. Robbins + + * regcomp.c (__re_error_msgid): Make error message for REG_EBRACK + more helpful - also used for unmatched [:, [., [=. + Thanks to Davide Brini for raising the issue. + +2014-10-12 KO Myung-Hun + + Fixes for OS/2: + + * Makefile.am (install-exec-hook, uninstall-links): Use $(EXEEXT). + * getopt.h: Redefinitions if using KLIBC. + * io.c (_S_IFDIR, _S_IRWXU): Define if the more standard versions + are available. + +2014-10-12 Arnold D. Robbins + + * README: Remove Pat Rankin from VMS duties, per his request. + +2014-10-08 Arnold D. Robbins + + * dfa.c: Sync with GNU grep. + +2014-10-05 Arnold D. Robbins + + * profile.c (pprint): Fix typo in header. Sheesh. + +2014-10-04 Arnold D. Robbins + + * profile.c (pp_string_fp): Fix breaklines case to actually + output the current letter. This broke at gawk 4.0.0. Sigh. + Thanks to Bert Bos (bert@w3.org) for the report. + +2014-09-29 Andrew J. Schorr + + * main.c (main): In optlist, it should say "h", not "h:", since there + is no argument for the help option. Thanks to Joep van Delft for + the bug report. + +2014-09-29 Arnold D. Robbins + + * gawkapi.h: Minor edits to sync with documentation. Does not + influence the behavior of the API. + +2014-09-28 Arnold D. Robbins + + * command.y (cmdtab): Add "where" as an alias for "backtrace". + Finally! + + Unrelated: + + * dfa.c: Sync with GNU grep. + +2014-09-27 Arnold D. Robbins + + * awkgram.y (check_for_bad): Bitwise-and the bad character with 0xFF + to avoid sign extension into a large integer. + + Unrelated: + + * configure.ac: Add an option to enable locale letters in identifiers. + Undocumented and subject to being rescinded at any time in the future. + * NEWS: Mention to look at configure --help. + + Unrelated: + + * profile.c (pprint): Use "rule(s)" instead of "block(s)" in the + header. + +2014-09-23 Arnold D. Robbins + + * awkgram.y (yylex): Don't check for junk characters inside + quoted strings. Caused issues on DJGPP and Solaris. + + Unrelated: + + * io.c (devopen): Straighten things out with respect to + compatibility with BWK awk. + +2014-09-19 Arnold D. Robbins + + * awkgram.y: Further commentary as to the treacherousness + of isalnum and isalpha. + +2014-09-15 Arnold D. Robbins + + Finish removing use of isalpha and isalnum. + + * awk.h (is_alpha, is_alnum, is_identchar): Add declarations. + * awkgram.y (yylex): Use is_alpha. + (is_alpha, is_alnum): New functions. + (is_identchar): Use is_alnum. + * builtin.c (r_format_tree): Use is_alpha, is_alnum. + * command.y (yylex): Use is_alpha, is_identchar. + * ext.c (is_letter): Use is_alpha. + (is_identifier_char): Removed; replaced uses with is_identchar. + * main.c (arg_assign): Use is_alpha, is_alnum. + * node.c (r_force_number): Use is_alpha. + +2014-09-14 Arnold D. Robbins + + * awkgram.y (is_identchar): Change from simple macro to function + since use of isalnum() let non-ASCII letters slip through into + identifiers. + +2014-09-07 Arnold D. Robbins + + * awk.h: Move libsigsegv stuff to ... + * main.c: here. Thanks to Yehezkel Bernat for motivating + the cleanup. + * symbol.c (make_symbol, install, install_symbol): Add const to + first parameter. Adjust decls and fix up uses. + +2014-09-05 Arnold D. Robbins + + Add builtin functions to FUNCTAB for consistency. + + * awk.h (Node_builtin_func): New node type. + (install_builtins): Declare new function. + * awkgram.y [DEBUG_USE]: New flag value for debug functions; they + don't go into FUNCTAB. + (install_builtins): New function. + * eval.c (nodetypes): Add Node_builtin_func. + * interpret.h (r_interpret): Rework indirect calls of built-ins + since they're now in the symbol table. + * main.c (main): Call `install_builtins'. + * symbol.c (install): Adjust for Node_builtin_func. + (load_symbols): Ditto. + +2014-09-04 Arnold D. Robbins + + * profile.c (pprint): Case Op_K_for: Improve printing of + empty for loop header. + + Unrelated: Make indirect function calls work for built-in and + extension functions. + + * awkgram.y (lookup_builtin): New function. + * awk.h (builtin_func_t): New typedef. + (lookup_builtin): Declare it. + * interpret.h (r_interpret): For indirect calls, add code to + find and call builtin functions, and call extension functions. + +2014-09-01 Arnold D. Robbins + + * builtin.c (do_substr): Return "" instead of null string in case + result is passed to length() with --lint. Based on discussions in + comp.lang.awk. + + Unrelated: + + * interpret.h (r_interpret): For indirect function call, separate + error message if lookup returned NULL. Otherwise got a core dump. + Thanks to "Kenny McKormack" for the report in comp.lang.awk. + +2014-08-27 Arnold D. Robbins + + * configure.ac: Add test for strcasecmp. + * regcomp.c: Remove special case code around use of strcasecmp(). + * replace.c: Include missing/strncasecmp.c if either strcasecmp() + or strncasecmp() aren't available. + +2014-08-26 Arnold D. Robbins + + * regcomp.c, regex_internal.c: Sync with GBLIC. Why not. + +2014-08-18 Arnold D. Robbins + + * symbol.c: General formatting cleanup. + +2014-08-15 Arnold D. Robbins + + * main.c (usage): Adjust whitespace for -L and add "invalid" + as a possible value for it. Report from Robert P. J. Day + . + +2014-08-14 Arnold D. Robbins + + * Makefile.am (SUBDIRS): Put awklib after doc so that examples + get extracted when the doc changes. + +2014-08-13 Arnold D. Robbins + + * builtin.c (do_sub): Move initial allocation of the replacement + string down towards code to do the replacement, with a (we hope) + better guesstimate of how much to initially allocate. The idea + is to avoid unnecessary realloc() calls by making a better guess + at how much to allocate. This came up in an email discussion + with Tom Dickey about mawk's gsub(). + +2014-08-12 Arnold D. Robbins + + OFS being set should rebuild $0 using previous OFS if $0 + needs to be rebuilt. Thanks to Mike Brennan for pointing this out. + + * awk.h (rebuild_record): Declare. + * eval.c (set_OFS): If not being called from var_init(), check + if $0 needs rebuilding. If so, parse the record fully and rebuild it. + Make OFS point to a separate copy of the new OFS for next time, since + OFS_node->var_value->stptr was already updated at this point. + * field.c (rebuild_record): Is now extern instead of static. + Use OFS and OFSlen instead of the value of OFS_node. + + Unrelated: + + * Makefile.am (RM): Define for makes that don't have it, + such as on OpenBSD. Thanks to Jeremie Courreges-Anglas + for the report. + +2014-08-05 Arnold D. Robbins + + Bug fix: For MPFR sqrt(), need to set precision of result to be + the same as that of the argument. Doesn't hurt other functions. + See test/mpfrsqrt.awk. Thank to Katie Wasserman + for the bug report. + + * mpfr.c (do_mpfr_func): New function. Runs code for MPFR functions + while still enabling debugging. Add call here to mpfr_set_prec(). + Original code from SPEC_MATH macro. + (SPEC_MATH): Change macro to call do_mpfr_func(). + + Next MPFR bug fix: The % operator gave strange results for negative + numerator. Thanks again to Katie Wasserman for the bug report. + + * mpfr.c (mpg_mod): Use mpz_tdiv_qr() instead of mpz_mod(). From + the GMP doc, mpz_mod() should have worked; it's not clear why + it doesn't. + +2014-08-03 Arnold D. Robbins + + * builtin.c (format_tree): Don't need to check return value of + wctombr for -2. Thanks to Eli Zaretskii for pointing this out. + + Unrelated: + + * gawkapi.h: Fix doc for API get_record - errcode needs to + be greater than zero. + * interpret.h (r_interpret): Move setting of ERRNO to here, from ... + * io.c (inrec): ... here. Makes the code cleaner. + +2014-08-03 Andrew J. Schorr + + * awkgram.y (getfname): Match on either ptr or ptr2 so --profile + will work in -M (MPFR bignum) mode. + +2014-07-31 Arnold D. Robbins + + * builtin.c (format_tree): Make %c handling more sane on Windows. + Rework the lint messages. + + Unrelated: + + * dfa.c: Sync with GNU grep. Mainly white space differences. + + Unrelated: + + * mpfr.c (cleanup_mpfr): New function to deallocate _mpf_t1 + and _mpf_t2; removes some valgrind warnings. + * awk.h (cleanup_mpfr): Add declaration. + * main.c (main): Add call to `cleanup_mpfr'. + +2014-07-25 Arnold D. Robbins + + * main.c (main): Add a warning message if -M is used and gawk was + compiled without MPFR/GMP. + +2014-07-24 Arnold D. Robbins + + * main.c (usage): Put text for `-n' *after* text for `-m'. + Report from Robert P. J. Day . + + Fix problems with I/O errors reported by Assaf Gordon + : + + * io.c (inrec): Change type to bool to make calling easier. Add + check in non-EOF case for error, and if so, return false. + Update ERRNO in case there is an ENDFILE block. + * awk.h (inrec): Change type in declaration. + * interpret.h (r_interpret): Change call of inrec() to boolean + notation. + +2014-07-10 Arnold D. Robbins + + * awkgram.y (check_for_bad): New routine to do the fatal message, + with smarter checking. + (nextc): Call it as appropriate. + + * builtin.c (format_tree): Add check for bad returns from mbrlen + to avoid trying to malloc (size_t) -1 bytes. Thanks to + mail.green.fox@gmail.com for the bug report. + +2014-07-03 Arnold D. Robbins + + * awkgram.y (nextc): Add bool check_for_bad parameter to check + for bad characters in the source program. + (yylex): Adjust calls. + +2014-06-22 Paul Eggert + + Bring in from GNULIB: + + regex: fix memory leak in compiler + Fix by Andreas Schwab in: + https://sourceware.org/ml/libc-alpha/2014-06/msg00462.html + * lib/regcomp.c (parse_expression): Deallocate partially + constructed tree before returning error. + +2014-06-19 Arnold D. Robbins + + * builtin.c (do_sub): Add more info to leading comment. + Add some whitespace in the code. + +2014-06-08 Arnold D. Robbins + + * dfa.c: Sync with GNU grep. + +2014-06-03 Arnold D. Robbins + + * dfa.c (mbs_to_wchar): Define a macro if not MBS. + +2014-05-29 Arnold D. Robbins + + * dfa.c: Sync with GNU grep. + +2014-05-26 Arnold D. Robbins + + * io.c (inetfile): Change return type to bool. Wrap code + with ifdef HAVE_SOCKETS so that it'll compile on DJGPP. + +2014-05-22 Andrew J. Schorr + + Allow any redirected getline inside BEGINFILE/ENDFILE. + + * awkgram.y (LEX_GETLINE): Only require a redirection and not also + a variable if getline is in a BEGINFILE or ENDFILE rule. + * interpret.h (Op_K_getline_redir): Remove check and fatal error. + +2014-05-20 Arnold D. Robbins + + * dfa.c (dfaexec): Minor sync with GNU grep. + +2014-05-14 Arnold D. Robbins + + * custom.h (_GL_PURE): Move definition to here. Sigh. + * dfa.h, dfa.c: Sync with GNU grep. Sigh. + + Unrelated: + + * custom.h: Remove stuff for Ultrix 4.3. No one has such + systems anymore; this just got missed earlier. + +2014-05-11 Arnold D. Robbins + + * debug.c (do_eval): Repair fix of 2014-05-09 and use + assoc_remove to take @eval out of the function table. + * symbol.c: Fix a comment. This file needs some work. + +2014-05-10 Arnold D. Robbins + + * io.c (get_a_record): Finish TERMNEAREND handling in case + we don't have a regular file but aren't going to get more data. + Added some additional comments. + +2014-05-09 Arnold D. Robbins + + * debug.c (do_eval): Don't free `f' which points into the context + that was previously freed. Bug reported by Jan Chaloupka + . Apparently introduced with move to + SYMTAB and FUNCTAB, but only showed up on Fedora 20 and Ubuntu 14.04, + which have a newer glibc. + (do_eval): Fix a memory leak seen by valgrind on Fedora 20 and + Ubuntu 14.04: the new SRCFILE that is added wasn't released. + + Unrelated: + + * io.c (get_a_record): Handle return of TERMNEAREND when the + entire file has been read into the buffer and we're using a + regex for RS. Bug report by Grail Dane . + +2014-05-04 Arnold D. Robbins + + * debug.c (debug_prog): Change check for GAWK_RESTART so that it + actually works. Bug fix: run command in debugger would start + over again but not actually start running the program. + +2014-04-25 Andrew J. Schorr + + * io.c (two_way_open): In forked child, reset SIGPIPE to SIG_DFL. + Fixes problems with "broken pipe" errors from child processes, + restoring 4.1.0 and earlier behavior. Thanks to Daryl F + for the report. + (gawk_popen): Ditto. + +2014-04-25 Arnold D. Robbins + + * dfa.h, dfa.c: Merge with GNU grep; lots of forward motion. + +2014-04-24 Arnold D. Robbins + + Update xalloc.h for pending merge with dfa. + + * xalloc.h (xstrdup): Implement this. + (x2nrealloc): Incorporate changed logic from GNULIB. + +2014-04-20 Andrew J. Schorr + + * io.c (struct inet_socket_info): Define new structure + for use in parsing special socket filenames. + (inetfile): Parse all components of the special socket filename + into the struct inet_socket_info. Returns true only if it is a + valid socket fliename, unlike the previous version which checked + for the '/inet[46]?/' prefix only. + (redirect): Patch to use updated inetfile() function. + (devopen): Remove logic to parse socket filenames, since this has + been moved into the inetfile() function. + (two_way_open): Update args to inetfile(). + +2014-04-18 Arnold D. Robbins + + * configure.ac: Change adding of -export-dynamic for GCC to be + -Wl,-export-dynamic, which then works for PCC also. + +2014-04-11 Arnold D. Robbins + + * io.c (closemabyesocket): Define if not defined, e.g. building + without socket code. Thanks to dave.gma@googlemail.com (Dave Sines) + for the report. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. @@ -956,7 +1852,7 @@ 2012-12-25 Arnold D. Robbins Remove sym-constant from API after discussions with John - Haque and Andy Schorr. + Haque and Andrew Schorr. * gawkapi.h (api_sym_constant): Removed field in API struct. (sym_constant): Remove macro. diff -urN gawk-4.1.1/INSTALL gawk-4.1.2/INSTALL --- gawk-4.1.1/INSTALL 2014-01-20 21:52:59.000000000 +0200 +++ gawk-4.1.2/INSTALL 2015-04-27 18:09:07.000000000 +0300 @@ -1,7 +1,7 @@ Installation Instructions ************************* -Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation, +Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, @@ -12,8 +12,8 @@ Basic Installation ================== - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following + Briefly, the shell command `./configure && make && make install' +should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented diff -urN gawk-4.1.1/Makefile.am gawk-4.1.2/Makefile.am --- gawk-4.1.1/Makefile.am 2014-03-31 22:17:46.000000000 +0300 +++ gawk-4.1.2/Makefile.am 2015-04-28 16:49:46.000000000 +0300 @@ -61,10 +61,12 @@ # The order to do things in. # Build explicitly in "." in order to build gawk first, so # that `make check' without a prior `make' works. +# Build in awklib after in doc, since we want to extract +# sample files if doc/gawk.texi changed. SUBDIRS = \ . \ - awklib \ doc \ + awklib \ po \ extension \ test @@ -144,6 +146,9 @@ # We want hard links for install-exec-hook, below LN= ln +# For some make's, e.g. OpenBSD, that don't define this +RM = rm -f + # First, add a link from gawk to gawk-X.Y.Z. # # For GNU systems where gawk is awk, add a link to awk. @@ -152,14 +157,14 @@ install-exec-hook: (cd $(DESTDIR)$(bindir); \ $(LN) gawk$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \ - if [ ! -f awk ]; \ - then $(LN_S) gawk$(EXEEXT) awk; \ + if [ ! -f awk$(EXEEXT) ]; \ + then $(LN_S) gawk$(EXEEXT) awk$(EXEEXT); \ fi; exit 0) # Undo the above when uninstalling uninstall-links: (cd $(DESTDIR)$(bindir); \ - if [ -f awk ] && cmp awk gawk$(EXEEXT) > /dev/null; then rm -f awk; fi ; \ + if [ -f awk$(EXEEXT) ] && cmp awk$(EXEEXT) gawk$(EXEEXT) > /dev/null; then rm -f awk$(EXEEXT); fi ; \ rm -f gawk-$(VERSION)$(EXEEXT); exit 0) uninstall-recursive: uninstall-links @@ -198,7 +203,7 @@ # This is for my development & testing. efence: gawk - $(CC) $(LDFLAGS) -o gawk $$(ls *.o | grep -v '_p.o$$') $(LIBS) -lefence + $(CC) $(LDFLAGS) -o gawk $$(ls *.o | grep -v '_p.o$$') $(LDADD) $(LIBS) -lefence diffout valgrind-scan: @cd test && $(MAKE) $(AM_MAKEFLAGS) $@ diff -urN gawk-4.1.1/Makefile.in gawk-4.1.2/Makefile.in --- gawk-4.1.1/Makefile.in 2014-04-08 19:12:38.000000000 +0300 +++ gawk-4.1.2/Makefile.in 2015-04-29 08:35:51.000000000 +0300 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -39,7 +39,17 @@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -103,12 +113,6 @@ host_triplet = @host@ bin_PROGRAMS = gawk$(EXEEXT) subdir = . -DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ - $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/configh.in mkinstalldirs ABOUT-NLS awkgram.c \ - command.c depcomp ylwrap $(include_HEADERS) COPYING \ - config.guess config.rpath config.sub install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \ @@ -123,6 +127,8 @@ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(include_HEADERS) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -256,6 +262,10 @@ CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/configh.in ABOUT-NLS \ + AUTHORS COPYING ChangeLog INSTALL NEWS README awkgram.c \ + command.c compile config.guess config.rpath config.sub depcomp \ + install-sh missing mkinstalldirs ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -363,6 +373,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOCKET_LIBS = @SOCKET_LIBS@ @@ -467,10 +478,12 @@ # The order to do things in. # Build explicitly in "." in order to build gawk first, so # that `make check' without a prior `make' works. +# Build in awklib after in doc, since we want to extract +# sample files if doc/gawk.texi changed. SUBDIRS = \ . \ - awklib \ doc \ + awklib \ po \ extension \ test @@ -542,6 +555,9 @@ # We want hard links for install-exec-hook, below LN = ln + +# For some make's, e.g. OpenBSD, that don't define this +RM = rm -f all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -562,7 +578,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -583,8 +598,8 @@ $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/configh.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -684,14 +699,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .y.c: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) @@ -905,10 +920,16 @@ $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -943,16 +964,17 @@ esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -1142,6 +1164,8 @@ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-includeHEADERS +.PRECIOUS: Makefile + # First, add a link from gawk to gawk-X.Y.Z. # @@ -1151,14 +1175,14 @@ install-exec-hook: (cd $(DESTDIR)$(bindir); \ $(LN) gawk$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \ - if [ ! -f awk ]; \ - then $(LN_S) gawk$(EXEEXT) awk; \ + if [ ! -f awk$(EXEEXT) ]; \ + then $(LN_S) gawk$(EXEEXT) awk$(EXEEXT); \ fi; exit 0) # Undo the above when uninstalling uninstall-links: (cd $(DESTDIR)$(bindir); \ - if [ -f awk ] && cmp awk gawk$(EXEEXT) > /dev/null; then rm -f awk; fi ; \ + if [ -f awk$(EXEEXT) ] && cmp awk$(EXEEXT) gawk$(EXEEXT) > /dev/null; then rm -f awk$(EXEEXT); fi ; \ rm -f gawk-$(VERSION)$(EXEEXT); exit 0) uninstall-recursive: uninstall-links @@ -1197,7 +1221,7 @@ # This is for my development & testing. efence: gawk - $(CC) $(LDFLAGS) -o gawk $$(ls *.o | grep -v '_p.o$$') $(LIBS) -lefence + $(CC) $(LDFLAGS) -o gawk $$(ls *.o | grep -v '_p.o$$') $(LDADD) $(LIBS) -lefence diffout valgrind-scan: @cd test && $(MAKE) $(AM_MAKEFLAGS) $@ diff -urN gawk-4.1.1/NEWS gawk-4.1.2/NEWS --- gawk-4.1.1/NEWS 2014-04-03 21:55:27.000000000 +0300 +++ gawk-4.1.2/NEWS 2015-04-29 08:49:40.000000000 +0300 @@ -1,9 +1,69 @@ - Copyright (C) 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. + Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, + Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. +Changes from 4.1.1 to 4.1.2 +--------------------------- + +1. The manual has been considerably improved. + - Thoroughly reviewed and updated. + - Out-of-date examples replaced. + - Chapter 15 on MPFR reworked. + - Summary sections added to all chapters. + - Exercises added in several chapters. + - Heavily proof-read and copyedited. + +2. The debugger's "restart" command now works again. + +3. Redirected getline is now allowed inside BEGINFILE/ENDFILE. + +4. A number of bugs have been fixed in the MPFR code. + +5. Indirect function calls now work for both built-in and extension functions. + +6. Built-in functions are now included in FUNCTAB. + +7. POSIX and historical practice require the exclusive use of the English + alphabet in identifiers. In non-English locales, it was accidentally + possible to use "letters" beside those of the English alphabet. This + has been fixed. (isalpha and isalnum are NOT our friends.) + + If you feel that you must have this misfeature, use `configure --help' + to see what option to use when configuring gawk to reenable it. + +8. The "where" command has been added to the debugger as an alias + for "backtrace". This will make life easier for long-time GDB users. + +9. Gawk no longer explicitly checks the current directory after doing + a path search of AWKPATH. The default value continues to have "." at + the front, so most people should not be affected. If you have your own + AWKPATH setting, be sure to put "." in it somewhere. The documentation + has been updated and clarified. + +10. Infrastructure upgrades: Automake 1.15, Gettext 0.19.4, Libtool 2.4.6, + Bison 3.0.4. + +11. If a user-defined function has a parameter with the same name as another + user-defined function, it is no longer possible to call the second + function from inside the first. + +12. POSIX requires that the names of function parameters not be the + same as any of the special built-in variables and also not conflict + with the names of any functions. Gawk has checked for the former + since 3.1.7. With --posix, it now also checks for the latter. + +13. The test suite should check for necessary locales and skip the tests + where it matters if support isn't what it should be. + +14. Gawk now expects to be compiled on a system with multibyte character + support. Systems without such support, at least at the C language + level, are so obsolete as to not be worth supporting anymore. + +15. A number of bugs have been fixed. See the ChangeLog. + Changes from 4.1.0 to 4.1.1 --------------------------- diff -urN gawk-4.1.1/POSIX.STD gawk-4.1.2/POSIX.STD --- gawk-4.1.1/POSIX.STD 2014-01-20 21:52:59.000000000 +0200 +++ gawk-4.1.2/POSIX.STD 2015-04-27 18:09:07.000000000 +0300 @@ -1,11 +1,11 @@ - Copyright (C) 1992, 1995, 1998, 2001, 2006, 2007, 2010, 2011 + Copyright (C) 1992, 1995, 1998, 2001, 2006, 2007, 2010, 2011, 2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. -------------------------------------------------------------------------- -Thu Mar 31 22:31:57 IST 2011 +Thu Feb 12 08:51:22 IST 2015 ============================ This file documents several things related to the 2008 POSIX standard that I noted after reviewing it. @@ -30,6 +30,19 @@ sequence into account. By default gawk doesn't do this. Rather, gawk will do this only if --posix is in effect. +4. According to POSIX, the function parameters of one function may not have + the same name as another function, making this invalid: + + function foo() { ... } + function bar(foo) { ...} + + Or even: + + function bar(foo) { ...} + function foo() { ... } + + Gawk enforces this only with --posix. + The following things aren't described by POSIX but ought to be: 1. The value of $0 in an END rule diff -urN gawk-4.1.1/README gawk-4.1.2/README --- gawk-4.1.1/README 2014-04-08 19:11:59.000000000 +0300 +++ gawk-4.1.2/README 2015-04-27 18:09:07.000000000 +0300 @@ -1,4 +1,4 @@ - Copyright (C) 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013, 2014 + Copyright (C) 2005, 2006, 2007, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, @@ -7,7 +7,7 @@ README: -This is GNU Awk 4.1.1. It is upwardly compatible with Brian Kernighan's +This is GNU Awk 4.1.2. It is upwardly compatible with Brian Kernighan's version of Unix awk. It is almost completely compliant with the 2008 POSIX 1003.1 standard for awk. (See the note below about POSIX.) @@ -91,9 +91,6 @@ andreas.buening@nexgo.de VMS: - Pat Rankin - r.pat.rankin@gmail.com - John Malmberg wb8tyw@qsl.net diff -urN gawk-4.1.1/README_d/ChangeLog gawk-4.1.2/README_d/ChangeLog --- gawk-4.1.1/README_d/ChangeLog 2014-04-08 20:34:02.000000000 +0300 +++ gawk-4.1.2/README_d/ChangeLog 2015-04-29 08:53:44.000000000 +0300 @@ -1,3 +1,15 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + +2015-04-13 Arnold D. Robbins + + * README.macosx: Updated. + +2015-04-09 Arnold D. Robbins + + * README.macosx: New file. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff -urN gawk-4.1.1/README_d/README.macosx gawk-4.1.2/README_d/README.macosx --- gawk-4.1.1/README_d/README.macosx 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/README_d/README.macosx 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,21 @@ +Mon Apr 13 09:49:40 IDT 2015 +============================ + +I have reports of success on this compiler: + +$ gcc --version +Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr +--with-gxx-include-dir=/usr/include/c++/4.2.1 +Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) +Target: x86_64-apple-darwin14.1.0 +Thread model: posix + +Thu Apr 9 10:39:26 IDT 2015 +============================ + +There are reports of compilation issues on Mac OS X 10.10 (Yosemite). +The only compiler reported to have produced a complete pass of +"make check" is the MacPorts compiler, /opt/local/bin/clang-mp-3.5. + +Arnold Robbins +arnold@skeeve.com diff -urN gawk-4.1.1/aclocal.m4 gawk-4.1.2/aclocal.m4 --- gawk-4.1.1/aclocal.m4 2014-04-08 19:12:37.000000000 +0300 +++ gawk-4.1.2/aclocal.m4 2015-04-29 08:35:50.000000000 +0300 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.13.4 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.13' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.13.4], [], +m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.13.4])dnl +[AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -103,15 +103,14 @@ # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -142,7 +141,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -333,7 +332,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -409,7 +408,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -418,6 +417,12 @@ # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -493,8 +498,8 @@ # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -526,6 +531,51 @@ AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -534,7 +584,6 @@ m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -556,7 +605,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -567,7 +616,7 @@ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -577,7 +626,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -598,7 +647,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -648,7 +697,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -687,7 +736,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -716,9 +765,73 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -799,7 +912,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -859,7 +972,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -887,7 +1000,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -906,7 +1019,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff -urN gawk-4.1.1/array.c gawk-4.1.2/array.c --- gawk-4.1.1/array.c 2014-03-31 22:17:46.000000000 +0300 +++ gawk-4.1.2/array.c 2015-04-28 16:49:46.000000000 +0300 @@ -978,14 +978,13 @@ const unsigned char *cp1 = (const unsigned char *) s1; const unsigned char *cp2 = (const unsigned char *) s2; -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { ret = strncasecmpmbs((const unsigned char *) cp1, (const unsigned char *) cp2, lmin); - } else -#endif - for (ret = 0; lmin-- > 0 && ret == 0; cp1++, cp2++) - ret = casetable[*cp1] - casetable[*cp2]; + } else { + for (ret = 0; lmin-- > 0 && ret == 0; cp1++, cp2++) + ret = casetable[*cp1] - casetable[*cp2]; + } if (ret != 0) return ret; /* diff -urN gawk-4.1.1/awk.h gawk-4.1.2/awk.h --- gawk-4.1.1/awk.h 2014-04-03 21:55:27.000000000 +0300 +++ gawk-4.1.2/awk.h 2015-04-28 16:49:46.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2014 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -95,13 +95,11 @@ #include "missing_d/gawkbool.h" #endif -#include "mbsupport.h" /* defines MBS_SUPPORT */ - -#if MBS_SUPPORT /* We can handle multibyte strings. */ #include #include -#endif + +#include "mbsupport.h" /* defines stuff for DJGPP to fake MBS */ #ifdef STDC_HEADERS #include @@ -193,15 +191,6 @@ #define memset memset_ulong #endif -#ifdef HAVE_LIBSIGSEGV -#include -#else -typedef void *stackoverflow_context_t; -#define sigsegv_install_handler(catchsegv) signal(SIGSEGV, catchsig) -/* define as 0 rather than empty so that (void) cast on it works */ -#define stackoverflow_install_handler(catchstackoverflow, extra_stack, STACK_SIZE) 0 -#endif - #if defined(__EMX__) || defined(__MINGW32__) #include "nonposix.h" #endif /* defined(__EMX__) || defined(__MINGW32__) */ @@ -297,6 +286,7 @@ Node_func, /* lnode is param. list, rnode is body */ Node_ext_func, /* extension function, code_ptr is builtin code */ Node_old_ext_func, /* extension function, code_ptr is builtin code */ + Node_builtin_func, /* built-in function, main use is for FUNCTAB */ Node_array_ref, /* array passed by ref as parameter */ Node_array_tree, /* Hashed array tree (HAT) */ @@ -403,10 +393,8 @@ size_t slen; long sref; int idx; -#if MBS_SUPPORT wchar_t *wsp; size_t wslen; -#endif } val; } sub; NODETYPE type; @@ -1112,11 +1100,7 @@ #define do_lint (do_flags & (DO_LINT_INVALID|DO_LINT_ALL)) #define do_lint_old (do_flags & DO_LINT_OLD) #endif -#if MBS_SUPPORT extern int gawk_mb_cur_max; -#else -#define gawk_mb_cur_max (1) -#endif #if defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0 extern GETGROUPS_T *groupset; @@ -1261,46 +1245,11 @@ #define cant_happen() r_fatal("internal error line %d, file: %s", \ __LINE__, __FILE__) -#define emalloc(var,ty,x,str) (void)((var=(ty)malloc((size_t)(x))) ||\ - (fatal(_("%s: %s: can't allocate %ld bytes of memory (%s)"),\ - (str), #var, (long) (x), strerror(errno)),0)) -#define erealloc(var,ty,x,str) (void)((var = (ty)realloc((char *)var, (size_t)(x))) \ - ||\ - (fatal(_("%s: %s: can't allocate %ld bytes of memory (%s)"),\ - (str), #var, (long) (x), strerror(errno)),0)) +#define emalloc(var,ty,x,str) (void) (var = (ty) emalloc_real((size_t)(x), str, #var, __FILE__, __LINE__)) +#define erealloc(var,ty,x,str) (void) (var = (ty) erealloc_real((void *) var, (size_t)(x), str, #var, __FILE__, __LINE__)) #define efree(p) free(p) -static inline NODE * -force_string(NODE *s) -{ - if ((s->flags & STRCUR) != 0 - && (s->stfmt == -1 || s->stfmt == CONVFMTidx) - ) - return s; - return format_val(CONVFMT, CONVFMTidx, s); -} - -#ifdef GAWKDEBUG -#define unref r_unref -#define force_number str2number -#else /* not GAWKDEBUG */ - -static inline void -unref(NODE *r) -{ - if (r != NULL && --r->valref <= 0) - r_unref(r); -} - -static inline NODE * -force_number(NODE *n) -{ - return (n->flags & NUMCUR) ? n : str2number(n); -} - -#endif /* GAWKDEBUG */ - #define fatal set_loc(__FILE__, __LINE__), r_fatal extern jmp_buf fatal_tag; @@ -1372,10 +1321,17 @@ extern void shadow_funcs(void); extern int check_special(const char *name); extern SRCFILE *add_srcfile(enum srctype stype, char *src, SRCFILE *curr, bool *already_included, int *errcode); -extern void register_deferred_variable(const char *name, NODE *(*load_func)(void)); +extern void free_srcfile(SRCFILE *thisfile); extern int files_are_same(char *path, SRCFILE *src); extern void valinfo(NODE *n, Func_print print_func, FILE *fp); extern void negate_num(NODE *n); +typedef NODE *(*builtin_func_t)(int); /* function that implements a built-in */ +extern builtin_func_t lookup_builtin(const char *name); +extern void install_builtins(void); +extern bool is_alpha(int c); +extern bool is_alnum(int c); +extern bool is_identchar(int c); +extern NODE *make_regnode(int type, NODE *exp); /* builtin.c */ extern double double_to_int(double d); extern NODE *do_exp(int nargs); @@ -1405,6 +1361,9 @@ extern NODE *do_srand(int nargs); extern NODE *do_match(int nargs); extern NODE *do_sub(int nargs, unsigned int flags); +extern NODE *call_sub(const char *name, int nargs); +extern NODE *call_match(int nargs); +extern NODE *call_split_func(const char *name, int nargs); extern NODE *format_tree(const char *, size_t, NODE **, long); extern NODE *do_lshift(int nargs); extern NODE *do_rshift(int nargs); @@ -1417,10 +1376,8 @@ extern NODE *do_dcgettext(int nargs); extern NODE *do_dcngettext(int nargs); extern NODE *do_bindtextdomain(int nargs); -#if MBS_SUPPORT extern int strncasecmpmbs(const unsigned char *, const unsigned char *, size_t); -#endif /* eval.c */ extern void PUSH_CODE(INSTRUCTION *cp); extern INSTRUCTION *POP_CODE(void); @@ -1453,6 +1410,7 @@ extern STACK_ITEM *grow_stack(void); extern void dump_fcall_stack(FILE *fp); extern int register_exec_hook(Func_pre_exec preh, Func_post_exec posth); +extern NODE **r_get_field(NODE *n, Func_ptr *assign, bool reference); /* ext.c */ extern NODE *do_ext(int nargs); void load_ext(const char *lib_name); /* temporary */ @@ -1470,6 +1428,7 @@ extern void init_fields(void); extern void set_record(const char *buf, int cnt); extern void reset_record(void); +extern void rebuild_record(void); extern void set_NF(void); extern NODE **get_field(long num, Func_ptr *assign); extern NODE *do_split(int nargs); @@ -1524,13 +1483,14 @@ extern NODE *do_close(int nargs); extern int flush_io(void); extern int close_io(bool *stdio_problem); +extern int devopen_simple(const char *name, const char *mode, bool try_real_open); extern int devopen(const char *name, const char *mode); extern int srcopen(SRCFILE *s); extern char *find_source(const char *src, struct stat *stb, int *errcode, int is_extlib); extern NODE *do_getline_redir(int intovar, enum redirval redirtype); extern NODE *do_getline(int intovar, IOBUF *iop); extern struct redirect *getredirect(const char *str, int len); -extern int inrec(IOBUF *iop, int *errcode); +extern bool inrec(IOBUF *iop, int *errcode); extern int nextfile(IOBUF **curfile, bool skipping); /* main.c */ extern int arg_assign(char *arg, bool initing); @@ -1566,6 +1526,7 @@ extern NODE *do_mpfr_strtonum(int); extern NODE *do_mpfr_xor(int); extern void init_mpfr(mpfr_prec_t, const char *); +extern void cleanup_mpfr(void); extern NODE *mpg_node(unsigned int); extern const char *mpg_fmt(const char *, ...); extern int mpg_strtoui(mpz_ptr, char *, size_t, char **, int); @@ -1601,7 +1562,6 @@ extern NODE *make_str_node(const char *s, size_t len, int flags); extern void *more_blocks(int id); extern int parse_escape(const char **string_ptr); -#if MBS_SUPPORT extern NODE *str2wstr(NODE *n, size_t **ptr); extern NODE *wstr2str(NODE *n); #define force_wstring(n) str2wstr(n, NULL) @@ -1615,9 +1575,6 @@ #define btowc_cache(x) btowc_cache[(x)&0xFF] extern void init_btowc_cache(); #define is_valid_character(b) (btowc_cache[(b)&0xFF] != WEOF) -#else -#define free_wstr(NODE) /* empty */ -#endif /* re.c */ extern Regexp *make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal); extern int research(Regexp *rp, char *str, int start, size_t len, int flags); @@ -1635,7 +1592,7 @@ extern void init_symbol_table(); extern NODE *symbol_table; extern NODE *func_table; -extern NODE *install_symbol(char *name, NODETYPE type); +extern NODE *install_symbol(const char *name, NODETYPE type); extern NODE *remove_symbol(NODE *r); extern void destroy_symbol(NODE *r); extern void release_symbols(NODE *symlist, int keep_globals); @@ -1656,6 +1613,7 @@ extern NODE **variable_list(); extern NODE **function_list(bool sort); extern void print_vars(NODE **table, Func_print print_func, FILE *fp); +extern bool check_param_names(void); /* floatcomp.c */ #ifdef HAVE_UINTMAX_T @@ -1786,3 +1744,65 @@ return r_dupnode(n); } #endif + +static inline NODE * +force_string(NODE *s) +{ + if ((s->flags & STRCUR) != 0 + && (s->stfmt == -1 || s->stfmt == CONVFMTidx) + ) + return s; + return format_val(CONVFMT, CONVFMTidx, s); +} + +#ifdef GAWKDEBUG +#define unref r_unref +#define force_number str2number +#else /* not GAWKDEBUG */ + +static inline void +unref(NODE *r) +{ + if (r != NULL && --r->valref <= 0) + r_unref(r); +} + +static inline NODE * +force_number(NODE *n) +{ + return (n->flags & NUMCUR) != 0 ? n : str2number(n); +} + +#endif /* GAWKDEBUG */ + +static inline void * +emalloc_real(size_t count, const char *where, const char *var, const char *file, int line) +{ + void *ret; + + if (count == 0) + fatal("%s:%d: emalloc called with zero bytes", file, line); + + ret = (void *) malloc(count); + if (ret == NULL) + fatal(_("%s:%d:%s: %s: can't allocate %ld bytes of memory (%s)"), + file, line, where, var, (long) count, strerror(errno)); + + return ret; +} + +static inline void * +erealloc_real(void *ptr, size_t count, const char *where, const char *var, const char *file, int line) +{ + void *ret; + + if (count == 0) + fatal("%s:%d: erealloc called with zero bytes", file, line); + + ret = (void *) realloc(ptr, count); + if (ret == NULL) + fatal(_("%s:%d:%s: %s: can't reallocate %ld bytes of memory (%s)"), + file, line, where, var, (long) count, strerror(errno)); + + return ret; +} diff -urN gawk-4.1.1/awkgram.y gawk-4.1.2/awkgram.y --- gawk-4.1.1/awkgram.y 2014-03-05 06:00:36.000000000 +0200 +++ gawk-4.1.2/awkgram.y 2015-04-28 16:49:46.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2014 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -57,7 +57,6 @@ static int load_library(INSTRUCTION *file); static void next_sourcefile(void); static char *tokexpand(void); -static bool is_deferred_variable(const char *name); #define instruction(t) bcalloc(t, 1, 0) @@ -74,13 +73,10 @@ static INSTRUCTION *mk_boolean(INSTRUCTION *left, INSTRUCTION *right, INSTRUCTION *op); static INSTRUCTION *mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op); static INSTRUCTION *mk_getline(INSTRUCTION *op, INSTRUCTION *opt_var, INSTRUCTION *redir, int redirtype); -static NODE *make_regnode(int type, NODE *exp); static int count_expressions(INSTRUCTION **list, bool isarg); static INSTRUCTION *optimize_assignment(INSTRUCTION *exp); static void add_lint(INSTRUCTION *list, LINTTYPE linttype); -static void process_deferred(); - enum defref { FUNC_DEFINE, FUNC_USE, FUNC_EXT }; static void func_use(const char *name, enum defref how); static void check_funcs(void); @@ -88,10 +84,10 @@ static ssize_t read_one_line(int fd, void *buffer, size_t count); static int one_line_close(int fd); +static bool at_seen = false; static bool want_source = false; static bool want_regexp = false; /* lexical scanning kludge */ static char *in_function; /* parsing kludge */ -static bool symtab_used = false; /* program used SYMTAB */ static int rule = 0; const char *const ruletab[] = { @@ -154,8 +150,6 @@ extern double fmod(double x, double y); #define YYSTYPE INSTRUCTION * - -#define is_identchar(c) (isalnum(c) || (c) == '_') %} %token FUNC_CALL NAME REGEXP FILENAME @@ -208,8 +202,6 @@ | program LEX_EOF { next_sourcefile(); - if (sourcefile == srcfiles) - process_deferred(); } | program error { @@ -247,11 +239,13 @@ | '@' LEX_INCLUDE source statement_term { want_source = false; + at_seen = false; yyerrok; } | '@' LEX_LOAD library statement_term { want_source = false; + at_seen = false; yyerrok; } ; @@ -375,7 +369,10 @@ YYABORT; } | '@' LEX_EVAL - { $$ = $2; } + { + $$ = $2; + at_seen = false; + } ; lex_builtin @@ -1345,7 +1342,7 @@ if ($1->lasti->opcode == Op_concat) { /* multiple (> 2) adjacent strings optimization */ - is_simple_var = ($1->lasti->concat_flag & CSVAR); + is_simple_var = ($1->lasti->concat_flag & CSVAR) != 0; count = $1->lasti->expr_count + 1; $1->lasti->opcode = Op_no_op; } else { @@ -1405,21 +1402,12 @@ | LEX_GETLINE opt_variable input_redir { /* - * In BEGINFILE/ENDFILE, allow `getline var < file' + * In BEGINFILE/ENDFILE, allow `getline [var] < file' */ - if (rule == BEGINFILE || rule == ENDFILE) { - if ($2 != NULL && $3 != NULL) - ; /* all ok */ - else { - if ($2 != NULL) - error_ln($1->source_line, - _("`getline var' invalid inside `%s' rule"), ruletab[rule]); - else - error_ln($1->source_line, - _("`getline' invalid inside `%s' rule"), ruletab[rule]); - } - } + if ((rule == BEGINFILE || rule == ENDFILE) && $3 == NULL) + error_ln($1->source_line, + _("non-redirected `getline' invalid inside `%s' rule"), ruletab[rule]); if (do_lint && rule == END && $3 == NULL) lintwarn_ln($1->source_line, _("non-redirected `getline' undefined inside END action")); @@ -1629,12 +1617,24 @@ */ $$ = list_prepend($2, t); + at_seen = false; } ; direct_func_call : FUNC_CALL '(' opt_expression_list r_paren { + NODE *n; + + if (! at_seen) { + n = lookup($1->func_name); + if (n != NULL && n->type != Node_func + && n->type != Node_ext_func && n->type != Node_old_ext_func) { + error_ln($1->source_line, + _("attempt to use non-function `%s' in function call"), + $1->func_name); + } + } param_sanity($3); $1->opcode = Op_func_call; $1->func_body = NULL; @@ -1814,6 +1814,7 @@ # define GAWKX 0x0400 /* gawk extension */ # define BREAK 0x0800 /* break allowed inside */ # define CONTINUE 0x1000 /* continue allowed inside */ +# define DEBUG_USE 0x2000 /* for use by developers */ NODE *(*ptr)(int); /* function that implements this keyword */ NODE *(*ptr2)(int); /* alternate arbitrary-precision function */ @@ -1852,7 +1853,7 @@ {"END", Op_rule, LEX_END, 0, 0, 0}, {"ENDFILE", Op_rule, LEX_ENDFILE, GAWKX, 0, 0}, #ifdef ARRAYDEBUG -{"adump", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_adump, 0}, +{"adump", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|DEBUG_USE, do_adump, 0}, #endif {"and", Op_builtin, LEX_BUILTIN, GAWKX, do_and, MPF(and)}, {"asort", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_asort, 0}, @@ -1911,7 +1912,7 @@ {"sqrt", Op_builtin, LEX_BUILTIN, A(1), do_sqrt, MPF(sqrt)}, {"srand", Op_builtin, LEX_BUILTIN, NOT_OLD|A(0)|A(1), do_srand, MPF(srand)}, #if defined(GAWKDEBUG) || defined(ARRAYDEBUG) /* || ... */ -{"stopme", Op_builtin, LEX_BUILTIN, GAWKX|A(0), stopme, 0}, +{"stopme", Op_builtin, LEX_BUILTIN, GAWKX|A(0)|DEBUG_USE, stopme, 0}, #endif {"strftime", Op_builtin, LEX_BUILTIN, GAWKX|A(0)|A(1)|A(2)|A(3), do_strftime, 0}, {"strtonum", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_strtonum, MPF(strtonum)}, @@ -1926,7 +1927,6 @@ {"xor", Op_builtin, LEX_BUILTIN, GAWKX, do_xor, MPF(xor)}, }; -#if MBS_SUPPORT /* Variable containing the current shift state. */ static mbstate_t cur_mbstate; /* Ring buffer containing current characters. */ @@ -1938,10 +1938,6 @@ /* This macro means that last nextc() return a singlebyte character or 1st byte of a multibyte character. */ #define nextc_is_1stbyte (cur_char_ring[cur_ring_idx] == 1) -#else /* MBS_SUPPORT */ -/* a dummy */ -#define nextc_is_1stbyte 1 -#endif /* MBS_SUPPORT */ /* getfname --- return name of a builtin function (for pretty printing) */ @@ -1953,7 +1949,7 @@ j = sizeof(tokentab) / sizeof(tokentab[0]); /* linear search, no other way to do it */ for (i = 0; i < j; i++) - if (tokentab[i].ptr == fptr) + if (tokentab[i].ptr == fptr || tokentab[i].ptr2 == fptr) return tokentab[i].operator; return NULL; @@ -2325,6 +2321,9 @@ if (ret == 0) /* avoid spurious warning if parser aborted with YYABORT */ check_funcs(); + if (do_posix && ! check_param_names()) + errcount++; + if (args_array == NULL) emalloc(args_array, NODE **, (max_args + 2) * sizeof(NODE *), "parse_program"); else @@ -2333,6 +2332,15 @@ return (ret || errcount); } +/* free_srcfile --- free a SRCFILE struct */ + +void +free_srcfile(SRCFILE *thisfile) +{ + efree(thisfile->src); + efree(thisfile); +} + /* do_add_srcfile --- add one item to srcfiles */ static SRCFILE * @@ -2372,7 +2380,7 @@ if (stype == SRC_CMDLINE || stype == SRC_STDIN) return do_add_srcfile(stype, src, NULL, thisfile); - path = find_source(src, & sbuf, &errno_val, stype == SRC_EXTLIB); + path = find_source(src, & sbuf, & errno_val, stype == SRC_EXTLIB); if (path == NULL) { if (errcode) { *errcode = errno_val; @@ -2791,12 +2799,38 @@ return tok; } -/* nextc --- get the next input character */ +/* check_bad_char --- fatal if c isn't allowed in gawk source code */ -#if MBS_SUPPORT +/* + * The error message was inspired by someone who decided to put + * a physical \0 byte into the source code to see what would + * happen and then filed a bug report about it. Sigh. + */ + +static void +check_bad_char(int c) +{ + /* allow escapes. needed for autoconf. bleah. */ + switch (c) { + case '\a': + case '\b': + case '\f': + case '\n': + case '\r': + case '\t': + return; + default: + break; + } + + if (iscntrl(c) && ! isspace(c)) + fatal(_("PEBKAC error: invalid character '\\%03o' in source code"), c & 0xFF); +} + +/* nextc --- get the next input character */ static int -nextc(void) +nextc(bool check_for_bad) { if (gawk_mb_cur_max > 1) { again: @@ -2847,45 +2881,32 @@ 0 : work_ring_idx + 1; cur_char_ring[work_ring_idx] = 0; } + if (check_for_bad) + check_bad_char(*lexptr); return (int) (unsigned char) *lexptr++; } else { do { if (lexeof) return END_FILE; - if (lexptr && lexptr < lexend) - return ((int) (unsigned char) *lexptr++); + if (lexptr && lexptr < lexend) { + if (check_for_bad) + check_bad_char(*lexptr); + return ((int) (unsigned char) *lexptr++); + } } while (get_src_buf()); return END_SRC; } } -#else /* MBS_SUPPORT */ - -int -nextc() -{ - do { - if (lexeof) - return END_FILE; - if (lexptr && lexptr < lexend) - return ((int) (unsigned char) *lexptr++); - } while (get_src_buf()); - return END_SRC; -} - -#endif /* MBS_SUPPORT */ - /* pushback --- push a character back on the input */ static inline void pushback(void) { -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) cur_ring_idx = (cur_ring_idx == 0)? RING_BUFFER_SIZE - 1 : cur_ring_idx - 1; -#endif (! lexeof && lexptr && lexptr > lexptr_begin ? lexptr-- : lexptr); } @@ -2898,13 +2919,13 @@ int c; for (;;) { - c = nextc(); + c = nextc(true); if (c == END_FILE) { pushback(); break; } if (c == '#') { - while ((c = nextc()) != '\n' && c != END_FILE) + while ((c = nextc(false)) != '\n' && c != END_FILE) continue; if (c == END_FILE) { pushback(); @@ -2976,7 +2997,7 @@ if (lasttok == LEX_EOF) /* error earlier in current source, must give up !! */ return 0; - c = nextc(); + c = nextc(! want_regexp); if (c == END_SRC) return 0; if (c == END_FILE) @@ -2998,50 +3019,58 @@ thisline = NULL; if (want_regexp) { int in_brack = 0; /* count brackets, [[:alnum:]] allowed */ + int b_index = -1; + int cur_index = 0; + /* - * Counting brackets is non-trivial. [[] is ok, - * and so is [\]], with a point being that /[/]/ as a regexp - * constant has to work. + * Here is what's ok with brackets: * - * Do not count [ or ] if either one is preceded by a \. - * A `[' should be counted if - * a) it is the first one so far (in_brack == 0) - * b) it is the `[' in `[:' - * A ']' should be counted if not preceded by a \, since - * it is either closing `:]' or just a plain list. - * According to POSIX, []] is how you put a ] into a set. - * Try to handle that too. + * [[] [^[] []] [^]] [.../...] + * [...\[...] [...\]...] [...\/...] + * + * (Remember that all of the above are inside /.../) * - * The code for \ handles \[ and \]. + * The code for \ handles \[, \] and \/. + * + * Otherwise, track the first open [ position, and if + * an embedded [ or ] occurs, allow it to pass through + * if it's right after the first [ or after [^. + * + * Whew! */ want_regexp = false; tok = tokstart; for (;;) { - c = nextc(); + c = nextc(false); if (gawk_mb_cur_max == 1 || nextc_is_1stbyte) switch (c) { case '[': - /* one day check for `.' and `=' too */ - if (nextc() == ':' || in_brack == 0) - in_brack++; - pushback(); - break; case ']': - if (tokstart[0] == '[' - && (tok == tokstart + 1 - || (tok == tokstart + 2 - && tokstart[1] == '^'))) - /* do nothing */; - else + cur_index = tok - tokstart; + if (in_brack > 0 + && (cur_index == b_index + 1 + || (cur_index == b_index + 2 && tok[-1] == '^'))) + ; /* do nothing */ + else if (c == '[') { + in_brack++; + if (in_brack == 1) + b_index = tok - tokstart; + } else { in_brack--; + if (in_brack == 0) + b_index = -1; + } break; case '\\': - if ((c = nextc()) == END_FILE) { + if ((c = nextc(false)) == END_FILE) { pushback(); yyerror(_("unterminated regexp ends with `\\' at end of file")); goto end_regexp; /* kludge */ - } else if (c == '\n') { + } + if (c == '\r') /* allow MS-DOS files. bleah */ + c = nextc(true); + if (c == '\n') { sourceline++; continue; } else { @@ -3057,7 +3086,7 @@ yylval = GET_INSTRUCTION(Op_token); yylval->lextok = estrdup(tokstart, tok - tokstart); if (do_lint) { - int peek = nextc(); + int peek = nextc(true); pushback(); if (peek == 'i' || peek == 's') { @@ -3087,16 +3116,14 @@ retry: /* skipping \r is a hack, but windows is just too pervasive. sigh. */ - while ((c = nextc()) == ' ' || c == '\t' || c == '\r') + while ((c = nextc(true)) == ' ' || c == '\t' || c == '\r') continue; lexeme = lexptr ? lexptr - 1 : lexptr; thisline = NULL; tok = tokstart; -#if MBS_SUPPORT if (gawk_mb_cur_max == 1 || nextc_is_1stbyte) -#endif switch (c) { case END_SRC: return 0; @@ -3109,7 +3136,7 @@ return lasttok = NEWLINE; case '#': /* it's a comment */ - while ((c = nextc()) != '\n') { + while ((c = nextc(false)) != '\n') { if (c == END_FILE) return lasttok = NEWLINE_EOF; } @@ -3117,6 +3144,7 @@ return lasttok = NEWLINE; case '@': + at_seen = true; return lasttok = '@'; case '\\': @@ -3129,7 +3157,7 @@ */ if (! do_traditional) { /* strip trailing white-space and/or comment */ - while ((c = nextc()) == ' ' || c == '\t' || c == '\r') + while ((c = nextc(true)) == ' ' || c == '\t' || c == '\r') continue; if (c == '#') { static bool warned = false; @@ -3139,16 +3167,16 @@ lintwarn( _("use of `\\ #...' line continuation is not portable")); } - while ((c = nextc()) != '\n') + while ((c = nextc(false)) != '\n') if (c == END_FILE) break; } pushback(); } #endif /* RELAXED_CONTINUATION */ - c = nextc(); + c = nextc(true); if (c == '\r') /* allow MS-DOS files. bleah */ - c = nextc(); + c = nextc(true); if (c == '\n') { sourceline++; goto retry; @@ -3187,7 +3215,7 @@ case '[': return lasttok = c; case ']': - c = nextc(); + c = nextc(true); pushback(); if (c == '[') { yylval = GET_INSTRUCTION(Op_sub_array); @@ -3199,7 +3227,7 @@ return ']'; case '*': - if ((c = nextc()) == '=') { + if ((c = nextc(true)) == '=') { yylval = GET_INSTRUCTION(Op_assign_times); return lasttok = ASSIGNOP; } else if (do_posix) { @@ -3210,7 +3238,7 @@ /* make ** and **= aliases for ^ and ^= */ static bool did_warn_op = false, did_warn_assgn = false; - if (nextc() == '=') { + if (nextc(true) == '=') { if (! did_warn_assgn) { did_warn_assgn = true; if (do_lint) @@ -3238,7 +3266,7 @@ return lasttok = '*'; case '/': - if (nextc() == '=') { + if (nextc(false) == '=') { pushback(); return lasttok = SLASH_BEFORE_EQUAL; } @@ -3247,7 +3275,7 @@ return lasttok = '/'; case '%': - if (nextc() == '=') { + if (nextc(true) == '=') { yylval = GET_INSTRUCTION(Op_assign_mod); return lasttok = ASSIGNOP; } @@ -3259,7 +3287,7 @@ { static bool did_warn_op = false, did_warn_assgn = false; - if (nextc() == '=') { + if (nextc(true) == '=') { if (do_lint_old && ! did_warn_assgn) { did_warn_assgn = true; warning(_("operator `^=' is not supported in old awk")); @@ -3277,7 +3305,7 @@ } case '+': - if ((c = nextc()) == '=') { + if ((c = nextc(true)) == '=') { yylval = GET_INSTRUCTION(Op_assign_plus); return lasttok = ASSIGNOP; } @@ -3290,7 +3318,7 @@ return lasttok = '+'; case '!': - if ((c = nextc()) == '=') { + if ((c = nextc(true)) == '=') { yylval = GET_INSTRUCTION(Op_notequal); return lasttok = RELOP; } @@ -3303,7 +3331,7 @@ return lasttok = '!'; case '<': - if (nextc() == '=') { + if (nextc(true) == '=') { yylval = GET_INSTRUCTION(Op_leq); return lasttok = RELOP; } @@ -3312,7 +3340,7 @@ return lasttok = '<'; case '=': - if (nextc() == '=') { + if (nextc(true) == '=') { yylval = GET_INSTRUCTION(Op_equal); return lasttok = RELOP; } @@ -3321,7 +3349,7 @@ return lasttok = ASSIGN; case '>': - if ((c = nextc()) == '=') { + if ((c = nextc(true)) == '=') { yylval = GET_INSTRUCTION(Op_geq); return lasttok = RELOP; } else if (c == '>') { @@ -3360,7 +3388,11 @@ case '"': string: esc_seen = false; - while ((c = nextc()) != '"') { + /* + * Allow any kind of junk in quoted string, + * so pass false to nextc(). + */ + while ((c = nextc(false)) != '"') { if (c == '\n') { pushback(); yyerror(_("unterminated string")); @@ -3368,7 +3400,9 @@ } if ((gawk_mb_cur_max == 1 || nextc_is_1stbyte) && c == '\\') { - c = nextc(); + c = nextc(true); + if (c == '\r') /* allow MS-DOS files. bleah */ + c = nextc(true); if (c == '\n') { sourceline++; continue; @@ -3402,7 +3436,7 @@ return lasttok = YSTRING; case '-': - if ((c = nextc()) == '=') { + if ((c = nextc(true)) == '=') { yylval = GET_INSTRUCTION(Op_assign_minus); return lasttok = ASSIGNOP; } @@ -3415,7 +3449,7 @@ return lasttok = '-'; case '.': - c = nextc(); + c = nextc(true); pushback(); if (! isdigit(c)) return lasttok = '.'; @@ -3443,7 +3477,7 @@ if (do_traditional) goto done; if (tok == tokstart + 2) { - int peek = nextc(); + int peek = nextc(true); if (isxdigit(peek)) { inhex = true; @@ -3471,8 +3505,8 @@ break; } seen_e = true; - if ((c = nextc()) == '-' || c == '+') { - int c2 = nextc(); + if ((c = nextc(true)) == '-' || c == '+') { + int c2 = nextc(true); if (isdigit(c2)) { tokadd(c); @@ -3519,7 +3553,7 @@ } if (gotnumber) break; - c = nextc(); + c = nextc(true); } pushback(); @@ -3568,7 +3602,7 @@ return lasttok = YNUMBER; case '&': - if ((c = nextc()) == '&') { + if ((c = nextc(true)) == '&') { yylval = GET_INSTRUCTION(Op_and); allow_newline(); return lasttok = LEX_AND; @@ -3578,7 +3612,7 @@ return lasttok = '&'; case '|': - if ((c = nextc()) == '|') { + if ((c = nextc(true)) == '|') { yylval = GET_INSTRUCTION(Op_or); allow_newline(); return lasttok = LEX_OR; @@ -3599,7 +3633,7 @@ } } - if (c != '_' && ! isalpha(c)) { + if (c != '_' && ! is_alpha(c)) { yyerror(_("invalid char '%c' in expression"), c); return lasttok = LEX_EOF; } @@ -3619,7 +3653,7 @@ * occasions where the interactions are funny. */ if (! do_traditional && c == '_' && lasttok != '$') { - if ((c = nextc()) == '"') { + if ((c = nextc(true)) == '"') { intlstr = true; goto string; } @@ -3631,7 +3665,7 @@ tok = tokstart; while (c != END_FILE && is_identchar(c)) { tokadd(c); - c = nextc(); + c = nextc(true); } tokadd('\0'); pushback(); @@ -4083,10 +4117,10 @@ { if (n == Nnull_string) print_func(fp, "uninitialized scalar\n"); - else if (n->flags & STRING) { + else if ((n->flags & STRING) != 0) { pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', false); print_func(fp, "\n"); - } else if (n->flags & NUMBER) { + } else if ((n->flags & NUMBER) != 0) { #ifdef HAVE_MPFR if (is_mpg_float(n)) print_func(fp, "%s\n", mpg_fmt("%.17R*g", ROUND_MODE, n->mpg_numbr)); @@ -4095,10 +4129,10 @@ else #endif print_func(fp, "%.17g\n", n->numbr); - } else if (n->flags & STRCUR) { + } else if ((n->flags & STRCUR) != 0) { pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', false); print_func(fp, "\n"); - } else if (n->flags & NUMCUR) { + } else if ((n->flags & NUMCUR) != 0) { #ifdef HAVE_MPFR if (is_mpg_float(n)) print_func(fp, "%s\n", mpg_fmt("%.17R*g", ROUND_MODE, n->mpg_numbr)); @@ -4235,7 +4269,7 @@ int pcount = 0; r = lookup(fname); - if (r != NULL || is_deferred_variable(fname)) { + if (r != NULL) { error_ln(fi->source_line, _("function name `%s' previously defined"), fname); return -1; } @@ -4428,50 +4462,6 @@ } } -/* deferred variables --- those that are only defined if needed. */ - -/* - * Is there any reason to use a hash table for deferred variables? At the - * moment, there are only 1 to 3 such variables, so it may not be worth - * the overhead. If more modules start using this facility, it should - * probably be converted into a hash table. - */ - -static struct deferred_variable { - NODE *(*load_func)(void); - struct deferred_variable *next; - char name[1]; /* variable-length array */ -} *deferred_variables; - -/* register_deferred_variable --- add a var name and loading function to the list */ - -void -register_deferred_variable(const char *name, NODE *(*load_func)(void)) -{ - struct deferred_variable *dv; - size_t sl = strlen(name); - - emalloc(dv, struct deferred_variable *, sizeof(*dv)+sl, - "register_deferred_variable"); - dv->load_func = load_func; - dv->next = deferred_variables; - memcpy(dv->name, name, sl+1); - deferred_variables = dv; -} - -/* is_deferred_variable --- check if NAME is a deferred variable */ - -static bool -is_deferred_variable(const char *name) -{ - struct deferred_variable *dv; - for (dv = deferred_variables; dv != NULL; dv = dv->next) - if (strcmp(name, dv->name) == 0) - return true; - return false; -} - - /* variable --- make sure NAME is in the symbol table */ NODE * @@ -4483,47 +4473,17 @@ if (r->type == Node_func || r->type == Node_ext_func ) error_ln(location, _("function `%s' called with space between name and `(',\nor used as a variable or an array"), r->vname); - if (r == symbol_table) - symtab_used = true; } else { /* not found */ - struct deferred_variable *dv; - - for (dv = deferred_variables; true; dv = dv->next) { - if (dv == NULL) { - /* - * This is the only case in which we may not free the string. - */ - return install_symbol(name, type); - } - if (strcmp(name, dv->name) == 0) { - r = (*dv->load_func)(); - break; - } - } + return install_symbol(name, type); } efree(name); return r; } -/* process_deferred --- if the program uses SYMTAB, load deferred variables */ - -static void -process_deferred() -{ - struct deferred_variable *dv; - - if (! symtab_used) - return; - - for (dv = deferred_variables; dv != NULL; dv = dv->next) { - (void) dv->load_func(); - } -} - /* make_regnode --- make a regular expression node */ -static NODE * +NODE * make_regnode(int type, NODE *exp) { NODE *n; @@ -5129,7 +5089,7 @@ switch (i2->opcode) { case Op_concat: if (i2->nexti->opcode == Op_push_lhs /* l.h.s is a simple variable */ - && (i2->concat_flag & CSVAR) /* 1st exp in r.h.s is a simple variable; + && (i2->concat_flag & CSVAR) != 0 /* 1st exp in r.h.s is a simple variable; * see Op_concat in the grammer above. */ && i2->nexti->memory == exp->nexti->memory /* and the same as in l.h.s */ @@ -5589,6 +5549,7 @@ { int low, high, mid; int i; + int non_standard_flags = 0; #if 'a' == 0x81 /* it's EBCDIC */ static bool did_sort = false; @@ -5600,6 +5561,11 @@ } #endif + if (do_traditional) + non_standard_flags |= GAWKX; + if (do_posix) + non_standard_flags |= NOT_POSIX; + low = 0; high = (sizeof(tokentab) / sizeof(tokentab[0])) - 1; while (low <= high) { @@ -5613,8 +5579,7 @@ else if (i > 0) /* token > mid */ low = mid + 1; else { - if ((do_traditional && (tokentab[mid].flags & GAWKX)) - || (do_posix && (tokentab[mid].flags & NOT_POSIX))) + if ((tokentab[mid].flags & non_standard_flags) != 0) return -1; return mid; } @@ -5669,3 +5634,116 @@ } +/* lookup_builtin --- find a builtin function or return NULL */ + +builtin_func_t +lookup_builtin(const char *name) +{ + int mid = check_special(name); + + if (mid == -1) + return NULL; + + switch (tokentab[mid].class) { + case LEX_BUILTIN: + case LEX_LENGTH: + break; + default: + return NULL; + } + +#ifdef HAVE_MPFR + if (do_mpfr) + return tokentab[mid].ptr2; +#endif + + /* And another special case... */ + if (tokentab[mid].value == Op_sub_builtin) + return (builtin_func_t) do_sub; + + return tokentab[mid].ptr; +} + +/* install_builtins --- add built-in functions to FUNCTAB */ + +void +install_builtins(void) +{ + int i, j; + int flags_that_must_be_clear = DEBUG_USE; + + if (do_traditional) + flags_that_must_be_clear |= GAWKX; + + if (do_posix) + flags_that_must_be_clear |= NOT_POSIX; + + + j = sizeof(tokentab) / sizeof(tokentab[0]); + for (i = 0; i < j; i++) { + if ( (tokentab[i].class == LEX_BUILTIN + || tokentab[i].class == LEX_LENGTH) + && (tokentab[i].flags & flags_that_must_be_clear) == 0) { + (void) install_symbol(tokentab[i].operator, Node_builtin_func); + } + } +} + +/* + * 9/2014: Gawk cannot use isalpha or isalnum when + * parsing the program since that can let through non-English + * letters. So, we supply our own. !@#$%^&*()-ing locales! + */ + +/* is_alpha --- return true if c is an English letter */ + +/* + * The scene of the murder was grisly to look upon. When the inspector + * arrived, the sergeant turned to him and said, "Another programmer stabbed + * in the back. He never knew what happened." + * + * The inspector replied, "Looks like the MO of isalpha, and his even meaner + * big brother, isalnum. The Locale brothers." The sergeant merely + * shuddered in horror. + */ + +bool +is_alpha(int c) +{ +#ifdef I_DONT_KNOW_WHAT_IM_DOING + return isalpha(c); +#else /* ! I_DONT_KNOW_WHAT_IM_DOING */ + switch (c) { + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': + case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': + case 's': case 't': case 'u': case 'v': case 'w': case 'x': + case 'y': case 'z': + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': + case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': + case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': + case 'Y': case 'Z': + return true; + } + return false; +#endif /* ! I_DONT_KNOW_WHAT_IM_DOING */ +} + +/* is_alnum --- return true for alphanumeric, English only letters */ + +bool +is_alnum(int c) +{ + /* digit test is good for EBCDIC too. so there. */ + return (is_alpha(c) || ('0' <= c && c <= '9')); +} + + +/* is_identchar --- return true if c can be in an identifier */ + +bool +is_identchar(int c) +{ + return (is_alnum(c) || c == '_'); +} diff -urN gawk-4.1.1/awklib/ChangeLog gawk-4.1.2/awklib/ChangeLog --- gawk-4.1.1/awklib/ChangeLog 2014-04-08 20:34:08.000000000 +0300 +++ gawk-4.1.2/awklib/ChangeLog 2015-04-29 08:54:20.000000000 +0300 @@ -1,3 +1,17 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + +2014-11-05 Juergen Kahrs + + * Makefile.am (AWKPROG): Add quotes around the name in case the + build dir has spaces in it. + +2014-10-17 Andrew J. Schorr + + * Makefile.am (stamp-eg): Use explicit ./extract.awk to avoid + assumptions about AWKPATH in the environment. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff -urN gawk-4.1.1/awklib/Makefile.am gawk-4.1.2/awklib/Makefile.am --- gawk-4.1.1/awklib/Makefile.am 2014-04-03 21:51:30.000000000 +0300 +++ gawk-4.1.2/awklib/Makefile.am 2015-04-28 16:49:46.000000000 +0300 @@ -30,7 +30,7 @@ if TEST_CROSS_COMPILE AWKPROG = LC_ALL=C LANG=C awk$(EXEEXT) else -AWKPROG = LC_ALL=C LANG=C $(abs_top_builddir)/gawk$(EXEEXT) +AWKPROG = LC_ALL=C LANG=C "$(abs_top_builddir)/gawk$(EXEEXT)" endif # Get config.h from the build directory and custom.h from the source directory. @@ -68,7 +68,7 @@ cd $(srcdir) && \ rm -fr eg && \ rm -fr stamp-eg && \ - $(AWKPROG) -f extract.awk ../doc/gawk.texi ../doc/gawkinet.texi + $(AWKPROG) -f ./extract.awk ../doc/gawk.texi ../doc/gawkinet.texi @echo 'some makes are stupid and will not check a directory' > $(srcdir)/stamp-eg @echo 'against a file, so this file is a place holder. gack.' >> $(srcdir)/stamp-eg diff -urN gawk-4.1.1/awklib/Makefile.in gawk-4.1.2/awklib/Makefile.in --- gawk-4.1.1/awklib/Makefile.in 2014-04-08 19:12:38.000000000 +0300 +++ gawk-4.1.2/awklib/Makefile.in 2015-04-29 08:35:51.000000000 +0300 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -39,7 +39,17 @@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -102,8 +112,6 @@ host_triplet = @host@ pkglibexec_PROGRAMS = pwcat$(EXEEXT) grcat$(EXEEXT) subdir = awklib -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \ @@ -118,6 +126,7 @@ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -212,6 +221,8 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ + $(top_srcdir)/mkinstalldirs ChangeLog DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkgdatadir = $(datadir)/awk pkglibexecdir = $(libexecdir)/awk @@ -277,6 +288,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOCKET_LIBS = @SOCKET_LIBS@ @@ -342,7 +354,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = ChangeLog ChangeLog.0 extract.awk eg $(srcdir)/stamp-eg -@TEST_CROSS_COMPILE_FALSE@AWKPROG = LC_ALL=C LANG=C $(abs_top_builddir)/gawk$(EXEEXT) +@TEST_CROSS_COMPILE_FALSE@AWKPROG = LC_ALL=C LANG=C "$(abs_top_builddir)/gawk$(EXEEXT)" # With some locales, the script extract.awk fails. # So we fix the locale to some sensible value. @TEST_CROSS_COMPILE_TRUE@AWKPROG = LC_ALL=C LANG=C awk$(EXEEXT) @@ -369,7 +381,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu awklib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu awklib/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -479,14 +490,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -697,6 +708,8 @@ uninstall-binSCRIPTS uninstall-local \ uninstall-pkglibexecPROGRAMS +.PRECIOUS: Makefile + all: $(srcdir)/stamp-eg $(AUXPROGS) igawk $(AUXAWK) @@ -721,7 +734,7 @@ cd $(srcdir) && \ rm -fr eg && \ rm -fr stamp-eg && \ - $(AWKPROG) -f extract.awk ../doc/gawk.texi ../doc/gawkinet.texi + $(AWKPROG) -f ./extract.awk ../doc/gawk.texi ../doc/gawkinet.texi @echo 'some makes are stupid and will not check a directory' > $(srcdir)/stamp-eg @echo 'against a file, so this file is a place holder. gack.' >> $(srcdir)/stamp-eg diff -urN gawk-4.1.1/builtin.c gawk-4.1.2/builtin.c --- gawk-4.1.1/builtin.c 2014-04-03 21:55:27.000000000 +0300 +++ gawk-4.1.2/builtin.c 2015-04-28 16:49:46.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2014 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -247,7 +247,6 @@ return make_number((AWKNUM) status); } -#if MBS_SUPPORT /* strncasecmpmbs --- like strncasecmp (multibyte string version) */ int @@ -327,14 +326,6 @@ dest[idx] = mbclen; } } -#else -/* a dummy function */ -static void -index_multibyte_buffer(char* src ATTRIBUTE_UNUSED, char* dest ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUSED) -{ - cant_happen(); -} -#endif /* do_index --- find index of a string */ @@ -345,7 +336,6 @@ const char *p1, *p2; size_t l1, l2; long ret; -#if MBS_SUPPORT bool do_single_byte = false; mbstate_t mbs1, mbs2; @@ -353,7 +343,6 @@ memset(& mbs1, 0, sizeof(mbstate_t)); memset(& mbs2, 0, sizeof(mbstate_t)); } -#endif POP_TWO_SCALARS(s1, s2); @@ -383,7 +372,6 @@ goto out; } -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { s1 = force_wstring(s1); s2 = force_wstring(s2); @@ -394,14 +382,12 @@ do_single_byte = ((s1->wstlen == 0 && s1->stlen > 0) || (s2->wstlen == 0 && s2->stlen > 0)); } -#endif /* IGNORECASE will already be false if posix */ if (IGNORECASE) { while (l1 > 0) { if (l2 > l1) break; -#if MBS_SUPPORT if (! do_single_byte && gawk_mb_cur_max > 1) { const wchar_t *pos; @@ -412,21 +398,18 @@ ret = pos - s1->wstptr + 1; /* 1-based */ goto out; } else { -#endif - /* - * Could use tolower(*p1) == tolower(*p2) here. - * See discussion in eval.c as to why not. - */ - if (casetable[(unsigned char)*p1] == casetable[(unsigned char)*p2] - && (l2 == 1 || strncasecmp(p1, p2, l2) == 0)) { - ret = 1 + s1->stlen - l1; - break; - } - l1--; - p1++; -#if MBS_SUPPORT + /* + * Could use tolower(*p1) == tolower(*p2) here. + * See discussion in eval.c as to why not. + */ + if (casetable[(unsigned char)*p1] == casetable[(unsigned char)*p2] + && (l2 == 1 || strncasecmp(p1, p2, l2) == 0)) { + ret = 1 + s1->stlen - l1; + break; + } + l1--; + p1++; } -#endif } } else { while (l1 > 0) { @@ -437,7 +420,6 @@ ret = 1 + s1->stlen - l1; break; } -#if MBS_SUPPORT if (! do_single_byte && gawk_mb_cur_max > 1) { const wchar_t *pos; @@ -451,10 +433,6 @@ l1--; p1++; } -#else - l1--; - p1++; -#endif } } out: @@ -532,6 +510,9 @@ * Support for deferred loading of array elements requires that * we use the array length interface even though it isn't * necessary for the built-in array types. + * + * 1/2015: The deferred arrays are gone, but this is probably + * still a good idea. */ size = assoc_length(tmp); @@ -544,7 +525,6 @@ lintwarn(_("length: received non-string argument")); tmp = force_string(tmp); -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { tmp = force_wstring(tmp); len = tmp->wstlen; @@ -555,7 +535,6 @@ if (len == 0 && tmp->stlen > 0) len = tmp->stlen; } else -#endif len = tmp->stlen; DEREF(tmp); @@ -928,7 +907,10 @@ case '*': if (cur == NULL) break; - if (! do_traditional && isdigit((unsigned char) *s1)) { + if (! do_traditional && used_dollar && ! isdigit((unsigned char) *s1)) { + fatal(_("fatal: must use `count$' on all formats or none")); + break; /* silence warnings */ + } else if (! do_traditional && isdigit((unsigned char) *s1)) { int val = 0; for (; n0 > 0 && *s1 && isdigit((unsigned char) *s1); s1++, n0--) { @@ -1058,7 +1040,6 @@ (void) force_number(arg); if ((arg->flags & NUMBER) != 0) { uval = get_number_uj(arg); -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { char buf[100]; wchar_t wc; @@ -1066,13 +1047,29 @@ size_t count; memset(& mbs, 0, sizeof(mbs)); + + /* handle systems with too small wchar_t */ + if (sizeof(wchar_t) < 4 && uval > 0xffff) { + if (do_lint) + lintwarn( + _("[s]printf: value %g is too big for %%c format"), + arg->numbr); + + goto out0; + } + wc = uval; count = wcrtomb(buf, wc, & mbs); if (count == 0 - || count == (size_t)-1 - || count == (size_t)-2) + || count == (size_t) -1) { + if (do_lint) + lintwarn( + _("[s]printf: value %g is not a valid wide character"), + arg->numbr); + goto out0; + } memcpy(cpbuf, buf, count); prec = count; @@ -1083,11 +1080,7 @@ ; /* else, fall through */ -#endif - if (do_lint && uval > 255) { - lintwarn("[s]printf: value %g is too big for %%c format", - arg->numbr); - } + cpbuf[0] = uval; prec = 1; cp = cpbuf; @@ -1101,7 +1094,6 @@ */ cp = arg->stptr; prec = 1; -#if MBS_SUPPORT /* * First character can be multiple bytes if * it's a multibyte character. Grr. @@ -1112,14 +1104,13 @@ memset(& state, 0, sizeof(state)); count = mbrlen(cp, arg->stlen, & state); - if (count > 0) { + if (count != (size_t) -1 && count != (size_t) -2 && count > 0) { prec = count; /* may need to increase fw so that padding happens, see pr_tail code */ if (fw > 0) fw += count - 1; } } -#endif goto pr_tail; case 's': need_format = false; @@ -1557,7 +1548,7 @@ s0 = s1; break; default: - if (do_lint && isalpha(cs1)) + if (do_lint && is_alpha(cs1)) lintwarn(_("ignoring unknown format specifier character `%c': no argument converted"), cs1); break; } @@ -1747,7 +1738,14 @@ else if (do_lint == DO_LINT_INVALID && ! (d_length >= 0)) lintwarn(_("substr: length %g is not >= 0"), d_length); DEREF(t1); - return dupnode(Nnull_string); + /* + * Return explicit null string instead of doing + * dupnode(Nnull_string) so that if the result + * is checked with the combination of length() + * and lint, no error is reported about using + * an uninitialized value. Same thing later, too. + */ + return make_string("", 0); } if (do_lint) { if (double_to_int(d_length) != d_length) @@ -1786,13 +1784,11 @@ if (nargs == 2) { /* third arg. missing */ /* use remainder of string */ length = t1->stlen - indx; /* default to bytes */ -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { t1 = force_wstring(t1); if (t1->wstlen > 0) /* use length of wide char string if we have one */ length = t1->wstlen - indx; } -#endif d_length = length; /* set here in case used in diagnostics, below */ } @@ -1801,16 +1797,14 @@ if (do_lint && (do_lint == DO_LINT_ALL || ((indx | length) != 0))) lintwarn(_("substr: source string is zero length")); DEREF(t1); - return dupnode(Nnull_string); + return make_string("", 0); } /* get total len of input string, for following checks */ -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { t1 = force_wstring(t1); src_len = t1->wstlen; } else -#endif src_len = t1->stlen; if (indx >= src_len) { @@ -1818,7 +1812,7 @@ lintwarn(_("substr: start index %g is past end of string"), d_index); DEREF(t1); - return dupnode(Nnull_string); + return make_string("", 0); } if (length > src_len - indx) { if (do_lint) @@ -1828,7 +1822,6 @@ length = src_len - indx; } -#if MBS_SUPPORT /* force_wstring() already called */ if (gawk_mb_cur_max == 1 || t1->wstlen == t1->stlen) /* single byte case */ @@ -1858,9 +1851,6 @@ *cp = '\0'; r = make_str_node(substr, cp - substr, ALREADY_MALLOCED); } -#else - r = make_string(t1->stptr + indx, length); -#endif DEREF(t1); return r; @@ -1874,7 +1864,7 @@ NODE *t1, *t2, *t3, *ret; struct tm *tm; time_t fclock; - long clock_val; + double clock_val; char *bufp; size_t buflen, bufsize; char buf[BUFSIZ]; @@ -1883,6 +1873,8 @@ int do_gmt; NODE *val = NULL; NODE *sub = NULL; + static const time_t time_t_min = TYPE_MINIMUM(time_t); + static const time_t time_t_max = TYPE_MAXIMUM(time_t); /* set defaults first */ format = def_strftime_format; /* traditional date format */ @@ -1922,10 +1914,25 @@ if (do_lint && (t2->flags & (NUMCUR|NUMBER)) == 0) lintwarn(_("strftime: received non-numeric second argument")); (void) force_number(t2); - clock_val = get_number_si(t2); - if (clock_val < 0) - fatal(_("strftime: second argument less than 0 or too big for time_t")); + clock_val = get_number_d(t2); fclock = (time_t) clock_val; + /* + * Protect against negative value being assigned + * to unsigned time_t. + */ + if (clock_val < 0 && fclock > 0) { + if (do_lint) + lintwarn(_("strftime: second argument less than 0 or too big for time_t")); + return make_string("", 0); + } + + /* And check that the value is in range */ + if (clock_val < time_t_min || clock_val > time_t_max) { + if (do_lint) + lintwarn(_("strftime: second argument out of range for time_t")); + return make_string("", 0); + } + DEREF(t2); } @@ -1949,6 +1956,9 @@ else tm = localtime(& fclock); + if (tm == NULL) + return make_string("", 0); + bufp = buf; bufsize = sizeof(buf); for (;;) { @@ -2192,7 +2202,6 @@ rp->output.gawk_fflush(rp->output.fp, rp->output.opaque); } -#if MBS_SUPPORT /* is_wupper --- function version of iswupper for passing function pointers */ @@ -2257,7 +2266,6 @@ { wide_change_case(wstr, wlen, is_wupper, to_wlower); } -#endif /* do_tolower --- lower case a string */ @@ -2280,14 +2288,11 @@ cp < cp2; cp++) if (isupper(*cp)) *cp = tolower(*cp); - } -#if MBS_SUPPORT - else { + } else { force_wstring(t2); wide_tolower(t2->wstptr, t2->wstlen); wstr2str(t2); } -#endif DEREF(t1); return t2; @@ -2314,14 +2319,11 @@ cp < cp2; cp++) if (islower(*cp)) *cp = toupper(*cp); - } -#if MBS_SUPPORT - else { + } else { force_wstring(t2); wide_toupper(t2->wstptr, t2->wstlen); wstr2str(t2); } -#endif DEREF(t1); return t2; @@ -2471,13 +2473,12 @@ size_t *wc_indices = NULL; rlength = REEND(rp, t1->stptr) - RESTART(rp, t1->stptr); /* byte length */ -#if MBS_SUPPORT if (rlength > 0 && gawk_mb_cur_max > 1) { t1 = str2wstr(t1, & wc_indices); rlength = wc_indices[rstart + rlength - 1] - wc_indices[rstart] + 1; rstart = wc_indices[rstart]; } -#endif + rstart++; /* now it's 1-based indexing */ /* Build the array only if the caller wants the optional subpatterns */ @@ -2499,12 +2500,10 @@ start = t1->stptr + s; subpat_start = s; subpat_len = len = SUBPATEND(rp, t1->stptr, ii) - s; -#if MBS_SUPPORT if (len > 0 && gawk_mb_cur_max > 1) { subpat_start = wc_indices[s]; subpat_len = wc_indices[s + len - 1] - subpat_start + 1; } -#endif it = make_string(start, len); it->flags |= MAYBE_NUM; /* user input */ @@ -2647,23 +2646,28 @@ * 2001 standard: * * sub(ere, repl[, in ]) - * Substitute the string repl in place of the first instance of the extended regular - * expression ERE in string in and return the number of substitutions. An ampersand - * ('&') appearing in the string repl shall be replaced by the string from in that - * matches the ERE. An ampersand preceded with a backslash ('\') shall be - * interpreted as the literal ampersand character. An occurrence of two consecutive - * backslashes shall be interpreted as just a single literal backslash character. Any - * other occurrence of a backslash (for example, preceding any other character) shall - * be treated as a literal backslash character. Note that if repl is a string literal (the - * lexical token STRING; see Grammar (on page 170)), the handling of the - * ampersand character occurs after any lexical processing, including any lexical - * backslash escape sequence processing. If in is specified and it is not an lvalue (see - * Expressions in awk (on page 156)), the behavior is undefined. If in is omitted, awk - * shall use the current record ($0) in its place. + * Substitute the string repl in place of the first instance of the + * extended regular expression ERE in string in and return the number of + * substitutions. An ampersand ('&') appearing in the string repl shall + * be replaced by the string from in that matches the ERE. An ampersand + * preceded with a backslash ('\') shall be interpreted as the literal + * ampersand character. An occurrence of two consecutive backslashes shall + * be interpreted as just a single literal backslash character. Any other + * occurrence of a backslash (for example, preceding any other character) + * shall be treated as a literal backslash character. Note that if repl is a + * string literal (the lexical token STRING; see Grammar (on page 170)), the + * handling of the ampersand character occurs after any lexical processing, + * including any lexical backslash escape sequence processing. If in is + * specified and it is not an lvalue (see Expressions in awk (on page 156)), + * the behavior is undefined. If in is omitted, awk shall use the current + * record ($0) in its place. * - * 11/2010: The text in the 2008 standard is the same as just quoted. However, POSIX behavior - * is now the default. This can change the behavior of awk programs. The old behavior - * is not available. + * 11/2010: The text in the 2008 standard is the same as just quoted. + * However, POSIX behavior is now the default. This can change the behavior + * of awk programs. The old behavior is not available. + * + * 7/2011: Reverted backslash handling to what it used to be. It was in + * gawk for too long. Should have known better. */ /* @@ -2718,6 +2722,8 @@ if ((t1->flags & NUMCUR) != 0) goto set_how_many; + warning(_("gensub: third argument `%.*s' treated as 1"), + (int) t1->stlen, t1->stptr); how_many = 1; } } else { @@ -2730,8 +2736,8 @@ how_many = d; else how_many = LONG_MAX; - if (d == 0) - warning(_("gensub: third argument of 0 treated as 1")); + if (d <= 0) + warning(_("gensub: third argument %g treated as 1"), d); } DEREF(t1); @@ -2769,14 +2775,11 @@ text = t->stptr; textlen = t->stlen; - buflen = textlen + 2; repl = s->stptr; replend = repl + s->stlen; repllen = replend - repl; - emalloc(buf, char *, buflen + 2, "do_sub"); - buf[buflen] = '\0'; - buf[buflen + 1] = '\0'; + ampersands = 0; /* @@ -2835,6 +2838,13 @@ } lastmatchnonzero = false; + + /* guesstimate how much room to allocate; +2 forces > 0 */ + buflen = textlen + (ampersands + 1) * repllen + 2; + emalloc(buf, char *, buflen + 2, "do_sub"); + buf[buflen] = '\0'; + buf[buflen + 1] = '\0'; + bp = buf; for (current = 1;; current++) { matches++; @@ -3004,6 +3014,146 @@ return make_number((AWKNUM) matches); } +/* call_sub --- call do_sub indirectly */ + +NODE * +call_sub(const char *name, int nargs) +{ + unsigned int flags = 0; + NODE *regex, *replace, *glob_flag; + NODE **lhs, *rhs; + NODE *zero = make_number(0.0); + NODE *result; + + if (name[0] == 'g') { + if (name[1] == 'e') + flags = GENSUB; + else + flags = GSUB; + } + + if (flags == 0 || flags == GSUB) { + /* sub or gsub */ + if (nargs != 2) + fatal(_("%s: can be called indirectly only with two arguments"), name); + + replace = POP_STRING(); + regex = POP(); /* the regex */ + /* + * push regex + * push replace + * push $0 + */ + regex = make_regnode(Node_regex, regex); + PUSH(regex); + PUSH(replace); + lhs = r_get_field(zero, (Func_ptr *) 0, true); + nargs++; + PUSH_ADDRESS(lhs); + } else { + /* gensub */ + if (nargs == 4) + rhs = POP(); + else + rhs = NULL; + glob_flag = POP_STRING(); + replace = POP_STRING(); + regex = POP(); /* the regex */ + /* + * push regex + * push replace + * push glob_flag + * if (nargs = 3) { + * push $0 + * nargs++ + * } + */ + regex = make_regnode(Node_regex, regex); + PUSH(regex); + PUSH(replace); + PUSH(glob_flag); + if (rhs == NULL) { + lhs = r_get_field(zero, (Func_ptr *) 0, true); + rhs = *lhs; + UPREF(rhs); + PUSH(rhs); + nargs++; + } + else + PUSH(rhs); + } + + unref(zero); + result = do_sub(nargs, flags); + if (flags != GENSUB) + reset_record(); + return result; +} + +/* call_match --- call do_match indirectly */ + +NODE * +call_match(int nargs) +{ + NODE *regex, *text, *array; + NODE *result; + + regex = text = array = NULL; + if (nargs == 3) + array = POP(); + regex = POP(); + + /* Don't need to pop the string just to push it back ... */ + + regex = make_regnode(Node_regex, regex); + PUSH(regex); + + if (array) + PUSH(array); + + result = do_match(nargs); + return result; +} + +/* call_split_func --- call do_split or do_pat_split indirectly */ + +NODE * +call_split_func(const char *name, int nargs) +{ + NODE *regex, *seps; + NODE *result; + + regex = seps = NULL; + if (nargs < 2) + fatal(_("indirect call to %s requires at least two arguments"), + name); + + if (nargs == 4) + seps = POP(); + + if (nargs >= 3) { + regex = POP_STRING(); + regex = make_regnode(Node_regex, regex); + } else { + if (name[0] == 's') { + regex = make_regnode(Node_regex, FS_node->var_value); + regex->re_flags |= FS_DFLT; + } else + regex = make_regnode(Node_regex, FPAT_node->var_value); + nargs++; + } + + /* Don't need to pop the string or the data array */ + + PUSH(regex); + + if (seps) + PUSH(seps); + + result = (name[0] == 's') ? do_split(nargs) : do_patsplit(nargs); + + return result; +} /* make_integer - Convert an integer to a number node. */ @@ -3550,7 +3700,6 @@ static size_t mbc_byte_count(const char *ptr, size_t numchars) { -#if MBS_SUPPORT mbstate_t cur_state; size_t sum = 0; int mb_len; @@ -3571,9 +3720,6 @@ } return sum; -#else - return numchars; -#endif } /* mbc_char_count --- return number of m.b. chars in string, up to numbytes bytes */ @@ -3581,7 +3727,6 @@ static size_t mbc_char_count(const char *ptr, size_t numbytes) { -#if MBS_SUPPORT mbstate_t cur_state; size_t sum = 0; int mb_len; @@ -3604,7 +3749,4 @@ } return sum; -#else - return numbytes; -#endif } diff -urN gawk-4.1.1/command.y gawk-4.1.2/command.y --- gawk-4.1.1/command.y 2014-03-05 06:00:36.000000000 +0200 +++ gawk-4.1.2/command.y 2015-04-28 16:49:46.000000000 +0300 @@ -897,6 +897,8 @@ gettext_noop("up [N] - move N frames up the stack.") }, { "watch", "w", D_watch, D_WATCH, do_watch, gettext_noop("watch var - set a watchpoint for a variable.") }, +{ "where", "", D_backtrace, D_BACKTRACE, do_backtrace, + gettext_noop("where [N] - (same as backtrace) print trace of all or N innermost (outermost if N < 0) frames.") }, { NULL, NULL, D_illegal, 0, (Func_cmd) 0, NULL }, }; @@ -1112,7 +1114,7 @@ } while (c != '\0' && c != ' ' && c != '\t') { - if (! isalpha(c) && ! in_eval) { + if (! is_alpha(c) && ! in_eval) { yyerror(_("invalid character in command")); return '\n'; } @@ -1280,12 +1282,12 @@ || c == ',' || c == '=') return *lexptr++; - if (c != '_' && ! isalpha(c)) { + if (c != '_' && ! is_alpha(c)) { yyerror(_("invalid character")); return '\n'; } - while (isalnum(c) || c == '_') + while (is_identchar(c)) c = *++lexptr; toklen = lexptr - tokstart; diff -urN gawk-4.1.1/compile gawk-4.1.2/compile --- gawk-4.1.1/compile 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/compile 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -urN gawk-4.1.1/config.guess gawk-4.1.2/config.guess --- gawk-4.1.1/config.guess 2014-01-20 21:52:59.000000000 +0200 +++ gawk-4.1.2/config.guess 2015-04-27 18:09:07.000000000 +0300 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2014-01-01' +timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +149,7 @@ LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac @@ -579,8 +579,9 @@ else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -826,7 +827,7 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -969,10 +970,10 @@ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) @@ -1371,154 +1372,6 @@ exit ;; esac -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -68,7 +68,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -260,7 +260,7 @@ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ - | fido | fr30 | frv \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ @@ -283,8 +283,10 @@ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -296,11 +298,11 @@ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -311,6 +313,7 @@ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -325,6 +328,9 @@ c6x) basic_machine=tic6x-unknown ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none @@ -402,8 +408,10 @@ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -415,6 +423,7 @@ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ @@ -432,6 +441,7 @@ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -769,6 +779,9 @@ basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -824,6 +837,10 @@ basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -1369,14 +1386,14 @@ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1594,9 +1611,6 @@ mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; diff -urN gawk-4.1.1/configh.in gawk-4.1.2/configh.in --- gawk-4.1.1/configh.in 2014-04-08 19:12:48.000000000 +0300 +++ gawk-4.1.2/configh.in 2015-04-29 08:36:01.000000000 +0300 @@ -96,9 +96,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H -/* Define to 1 if you have the `m' library (-lm). */ -#undef HAVE_LIBM - /* Define to 1 if you have a fully functional readline library. */ #undef HAVE_LIBREADLINE @@ -195,6 +192,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR @@ -317,6 +317,9 @@ /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL +/* enable severe portability problems */ +#undef I_DONT_KNOW_WHAT_IM_DOING + /* libc is broken for regex handling */ #undef LIBC_IS_BORKED diff -urN gawk-4.1.1/configure gawk-4.1.2/configure --- gawk-4.1.1/configure 2014-04-08 19:12:38.000000000 +0300 +++ gawk-4.1.2/configure 2015-04-29 08:35:51.000000000 +0300 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for GNU Awk 4.1.1. +# Generated by GNU Autoconf 2.69 for GNU Awk 4.1.2. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='GNU Awk' PACKAGE_TARNAME='gawk' -PACKAGE_VERSION='4.1.1' -PACKAGE_STRING='GNU Awk 4.1.1' +PACKAGE_VERSION='4.1.2' +PACKAGE_STRING='GNU Awk 4.1.2' PACKAGE_BUGREPORT='bug-gawk@gnu.org' PACKAGE_URL='http://www.gnu.org/software/gawk/' @@ -657,6 +657,7 @@ MSGFMT GETTEXT_MACRO_VERSION USE_NLS +SED pkgextensiondir acl_shlibext LN_S @@ -761,6 +762,7 @@ enable_silent_rules with_whiny_user_strftime enable_lint +enable_severe_portability_problems enable_dependency_tracking enable_largefile enable_nls @@ -1324,7 +1326,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU Awk 4.1.1 to adapt to many kinds of systems. +\`configure' configures GNU Awk 4.1.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1394,7 +1396,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU Awk 4.1.1:";; + short | recursive ) echo "Configuration of GNU Awk 4.1.2:";; esac cat <<\_ACEOF @@ -1405,6 +1407,7 @@ --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --disable-lint Disable gawk lint checking + --enable-severe-portability-problems Enable really nasty portability problems --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking @@ -1418,7 +1421,7 @@ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-whiny-user-strftime Force use of included version of strftime for deficient systems - --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib @@ -1512,7 +1515,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU Awk configure 4.1.1 +GNU Awk configure 4.1.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2221,7 +2224,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNU Awk $as_me 4.1.1, which was +It was created by GNU Awk $as_me 4.1.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2589,7 +2592,7 @@ fi -am__api_version='1.13' +am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2790,8 +2793,8 @@ ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -2810,7 +2813,7 @@ $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -3104,7 +3107,7 @@ # Define the identity of the package. PACKAGE='gawk' - VERSION='4.1.1' + VERSION='4.1.2' cat >>confdefs.h <<_ACEOF @@ -3138,8 +3141,8 @@ # mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -3155,6 +3158,48 @@ +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + @@ -3181,6 +3226,17 @@ fi +# Check whether --enable-severe-portability-problems was given. +if test "${enable_severe_portability_problems+set}" = set; then : + enableval=$enable_severe_portability_problems; if test "$enableval" = yes + then + +$as_echo "#define I_DONT_KNOW_WHAT_IM_DOING 1" >>confdefs.h + + fi + +fi + # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || @@ -4105,6 +4161,65 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -5353,6 +5468,65 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -5662,17 +5836,13 @@ if test -f $srcdir/.developing then # add other debug flags as appropriate, save GAWKDEBUG for emergencies - CFLAGS="$CFLAGS -DARRAYDEBUG -DYYDEBUG" - if grep dbug $srcdir/.developing - then - CFLAGS="$CFLAGS -DDBUG" - LIBS="$LIBS dbug/libdbug.a" - fi + CFLAGS="$CFLAGS -DARRAYDEBUG -DYYDEBUG -DLOCALEDEBUG" + # turn on compiler warnings if we're doing development # enable debugging using macros also if test "$GCC" = yes then - CFLAGS="$CFLAGS -Wall -fno-builtin -g3 -gdwarf-2" + CFLAGS="$CFLAGS -Wall -fno-builtin -g3" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -6014,6 +6184,75 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } @@ -6030,7 +6269,7 @@ - GETTEXT_MACRO_VERSION=0.18 + GETTEXT_MACRO_VERSION=0.19 @@ -6038,15 +6277,14 @@ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi # Find out how to test for executable files. Don't use a zero-byte file, @@ -6161,15 +6399,14 @@ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi # Find out how to test for executable files. Don't use a zero-byte file, @@ -6239,15 +6476,14 @@ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi # Find out how to test for executable files. Don't use a zero-byte file, @@ -6331,6 +6567,7 @@ prefix="$acl_save_prefix" + # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes @@ -6341,21 +6578,21 @@ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi + ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 -$as_echo_n "checking for ld used by GCC... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -6365,11 +6602,11 @@ esac case $ac_prog in # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) + [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + # Canonicalize the pathname of ld + ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` + while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" @@ -6394,23 +6631,26 @@ $as_echo_n "(cached) " >&6 else if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do + IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. + # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + case `"$acl_cv_path_LD" -v 2>&1 &6 else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. + # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 @@ -6618,7 +6860,7 @@ done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then @@ -7147,15 +7389,19 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; + int main () { + bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + ; return 0; } @@ -7213,14 +7459,16 @@ am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include #include + int main () { iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); ; return 0; } @@ -7235,14 +7483,16 @@ LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include #include + int main () { iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); ; return 0; } @@ -7266,40 +7516,50 @@ $as_echo_n "(cached) " >&6 else - am_save_LIBS="$LIBS" + am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi - if test "$cross_compiling" = yes; then : + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes; then : case "$host_os" in - aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; - *) am_cv_func_iconv_works="guessing yes" ;; - esac + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -int main () + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main () { +int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\342\202\254"; /* EURO SIGN */ + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 1; + iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from @@ -7308,17 +7568,37 @@ iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\263"; + static ICONV_CONST char input[] = "\263"; char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ @@ -7327,17 +7607,18 @@ iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { - static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) - return 1; + result |= 8; + iconv_close (cd_88591_to_utf8); } } #endif @@ -7351,19 +7632,22 @@ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - return 1; + result |= 16; + return result; + + ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : am_cv_func_iconv_works=yes -else - am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + test "$am_cv_func_iconv_works" = no || break + done LIBS="$am_save_LIBS" fi @@ -7469,7 +7753,7 @@ done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then @@ -7867,6 +8151,7 @@ LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include $gt_revision_test_code extern int _nl_msg_cat_cntr; @@ -7875,11 +8160,14 @@ "C" #endif const char *_nl_expand_alias (const char *); + int main () { + bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ; return 0; } @@ -7895,6 +8183,7 @@ LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include $gt_revision_test_code extern int _nl_msg_cat_cntr; @@ -7903,19 +8192,22 @@ "C" #endif const char *_nl_expand_alias (const char *); + int main () { + bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" - eval "$gt_func_gnugettext_libintl=yes" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" fi rm -f core conftest.err conftest.$ac_objext \ @@ -9308,13 +9600,12 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fmod in -lm" >&5 -$as_echo_n "checking for fmod in -lm... " >&6; } -if ${ac_cv_lib_m_fmod+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing fmod" >&5 +$as_echo_n "checking for library containing fmod... " >&6; } +if ${ac_cv_search_fmod+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" + ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9333,33 +9624,44 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_fmod=yes -else - ac_cv_lib_m_fmod=no +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_fmod=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + conftest$ac_exeext + if ${ac_cv_search_fmod+:} false; then : + break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fmod" >&5 -$as_echo "$ac_cv_lib_m_fmod" >&6; } -if test "x$ac_cv_lib_m_fmod" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF +done +if ${ac_cv_search_fmod+:} false; then : - LIBS="-lm $LIBS" +else + ac_cv_search_fmod=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fmod" >&5 +$as_echo "$ac_cv_search_fmod" >&6; } +ac_res=$ac_cv_search_fmod +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf in -lm" >&5 -$as_echo_n "checking for isinf in -lm... " >&6; } -if ${ac_cv_lib_m_isinf+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing isinf" >&5 +$as_echo_n "checking for library containing isinf... " >&6; } +if ${ac_cv_search_isinf+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" + ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9378,33 +9680,44 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_isinf=yes -else - ac_cv_lib_m_isinf=no +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_isinf=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + conftest$ac_exeext + if ${ac_cv_search_isinf+:} false; then : + break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_isinf" >&5 -$as_echo "$ac_cv_lib_m_isinf" >&6; } -if test "x$ac_cv_lib_m_isinf" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF +done +if ${ac_cv_search_isinf+:} false; then : - LIBS="-lm $LIBS" +else + ac_cv_search_isinf=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_isinf" >&5 +$as_echo "$ac_cv_search_isinf" >&6; } +ac_res=$ac_cv_search_isinf +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ismod in -lm" >&5 -$as_echo_n "checking for ismod in -lm... " >&6; } -if ${ac_cv_lib_m_ismod+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ismod" >&5 +$as_echo_n "checking for library containing ismod... " >&6; } +if ${ac_cv_search_ismod+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" + ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9423,23 +9736,35 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_ismod=yes -else - ac_cv_lib_m_ismod=no +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_ismod=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + conftest$ac_exeext + if ${ac_cv_search_ismod+:} false; then : + break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ismod" >&5 -$as_echo "$ac_cv_lib_m_ismod" >&6; } -if test "x$ac_cv_lib_m_ismod" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF +done +if ${ac_cv_search_ismod+:} false; then : - LIBS="-lm $LIBS" +else + ac_cv_search_ismod=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ismod" >&5 +$as_echo "$ac_cv_search_ismod" >&6; } +ac_res=$ac_cv_search_ismod +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -9527,7 +9852,7 @@ done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then @@ -10007,7 +10332,7 @@ isascii iswctype iswlower iswupper mbrlen \ memcmp memcpy memcpy_ulong memmove memset \ memset_ulong mkstemp posix_openpt setenv setlocale setsid snprintf strchr \ - strerror strftime strncasecmp strcoll strtod strtoul \ + strerror strftime strcasecmp strncasecmp strcoll strtod strtoul \ system tmpfile towlower towupper tzset usleep wcrtomb \ wcscoll wctype do : @@ -10151,7 +10476,7 @@ if test "$GCC" = yes; then case $host_os in linux*|freebsd*) - LDFLAGS="$LDFLAGS -export-dynamic" + LDFLAGS="$LDFLAGS -Wl,-export-dynamic" ;; esac fi @@ -10426,7 +10751,39 @@ $as_echo_n "checking whether readline via \"$_combo\" is present and sane... " >&6; } if test "$cross_compiling" = yes; then : - _found_readline=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +int +main () +{ + + int fd; + char *line; + + close(0); + close(1); + fd = open("/dev/null", 2); /* should get fd 0 */ + dup(fd); + line = readline("giveittome> "); + + /* some printfs don't handle NULL for %s */ + printf("got <%s>\n", line ? line : "(NULL)"); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + _found_readline=yes +else + _found_readline=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -11506,7 +11863,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GNU Awk $as_me 4.1.1, which was +This file was extended by GNU Awk $as_me 4.1.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11574,7 +11931,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -GNU Awk config.status 4.1.1 +GNU Awk config.status 4.1.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -12416,7 +12773,7 @@ case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. @@ -12432,7 +12789,8 @@ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration @@ -12443,12 +12801,12 @@ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assigment from automake < 1.5. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assigment from automake < 1.5. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES diff -urN gawk-4.1.1/configure.ac gawk-4.1.2/configure.ac --- gawk-4.1.1/configure.ac 2014-04-08 19:12:00.000000000 +0300 +++ gawk-4.1.2/configure.ac 2015-04-29 08:35:39.000000000 +0300 @@ -1,7 +1,7 @@ dnl dnl configure.ac --- autoconf input file for gawk dnl -dnl Copyright (C) 1995-2014 the Free Software Foundation, Inc. +dnl Copyright (C) 1995-2015 the Free Software Foundation, Inc. dnl dnl This file is part of GAWK, the GNU implementation of the dnl AWK Programming Language. @@ -23,7 +23,7 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([GNU Awk], 4.1.1, bug-gawk@gnu.org, gawk) +AC_INIT([GNU Awk], 4.1.2, bug-gawk@gnu.org, gawk) # This is a hack. Different versions of install on different systems # are just too different. Chuck it and use install-sh. @@ -40,7 +40,7 @@ fi AC_PREREQ(2.69) -AM_INIT_AUTOMAKE([1.13 dist-xz dist-lzip]) +AM_INIT_AUTOMAKE([1.15 dist-xz dist-lzip]) AC_CONFIG_MACRO_DIR([m4]) @@ -58,6 +58,12 @@ AC_DEFINE(NO_LINT, 1, [disable lint checks]) fi ) +AC_ARG_ENABLE([severe-portability-problems], [ --enable-severe-portability-problems Enable really nasty portability problems], + if test "$enableval" = yes + then + AC_DEFINE(I_DONT_KNOW_WHAT_IM_DOING, 1, [enable severe portability problems]) + fi +) AC_CANONICAL_HOST AC_USE_SYSTEM_EXTENSIONS @@ -81,17 +87,13 @@ if test -f $srcdir/.developing then # add other debug flags as appropriate, save GAWKDEBUG for emergencies - CFLAGS="$CFLAGS -DARRAYDEBUG -DYYDEBUG" - if grep dbug $srcdir/.developing - then - CFLAGS="$CFLAGS -DDBUG" - LIBS="$LIBS dbug/libdbug.a" - fi + CFLAGS="$CFLAGS -DARRAYDEBUG -DYYDEBUG -DLOCALEDEBUG" + # turn on compiler warnings if we're doing development # enable debugging using macros also if test "$GCC" = yes then - CFLAGS="$CFLAGS -Wall -fno-builtin -g3 -gdwarf-2" + CFLAGS="$CFLAGS -Wall -fno-builtin -g3" fi AC_MSG_RESULT([yes]) else @@ -132,7 +134,7 @@ dnl initialize GNU gettext AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION([0.18.1]) +AM_GNU_GETTEXT_VERSION([0.19.4]) AM_LANGINFO_CODESET gt_LC_MESSAGES @@ -259,9 +261,9 @@ [AC_DEFINE(HAVE_GETADDRINFO, 1, [have getaddrinfo])])]) -AC_CHECK_LIB(m, fmod) -AC_CHECK_LIB(m, isinf) -AC_CHECK_LIB(m, ismod) +AC_SEARCH_LIBS(fmod, m) +AC_SEARCH_LIBS(isinf, m) +AC_SEARCH_LIBS(ismod, m) dnl Don't look for libsigsegv on OSF/1, gives us severe headaches case $host_os in osf1) : ;; @@ -275,7 +277,7 @@ isascii iswctype iswlower iswupper mbrlen \ memcmp memcpy memcpy_ulong memmove memset \ memset_ulong mkstemp posix_openpt setenv setlocale setsid snprintf strchr \ - strerror strftime strncasecmp strcoll strtod strtoul \ + strerror strftime strcasecmp strncasecmp strcoll strtod strtoul \ system tmpfile towlower towupper tzset usleep wcrtomb \ wcscoll wctype) dnl this check is for both mbrtowc and the mbstate_t type, which is good @@ -313,7 +315,7 @@ if test "$GCC" = yes; then case $host_os in linux*|freebsd*) - LDFLAGS="$LDFLAGS -export-dynamic" + LDFLAGS="$LDFLAGS -Wl,-export-dynamic" ;; esac fi diff -urN gawk-4.1.1/custom.h gawk-4.1.2/custom.h --- gawk-4.1.1/custom.h 2014-01-20 21:52:59.000000000 +0200 +++ gawk-4.1.2/custom.h 2015-04-27 18:09:07.000000000 +0300 @@ -47,12 +47,6 @@ #define HAVE_MKTIME 1 #endif -/* For ULTRIX 4.3 */ -#ifdef ultrix -#define HAVE_MKTIME 1 -#define GETGROUPS_NOT_STANDARD 1 -#endif - /* For whiny users */ #ifdef USE_INCLUDED_STRFTIME #undef HAVE_STRFTIME @@ -65,8 +59,8 @@ #define _TZSET 1 #endif -/* For z/OS, from Dave Pitts */ -#ifdef ZOS_USS +/* For z/OS, from Dave Pitts - VMS using some ZOS_USS code paths */ +#if defined(ZOS_USS) && !defined(__VMS) #undef HAVE_DLFCN_H #undef HAVE_SYS_PARAM_H #undef HAVE_MCHECK_H @@ -76,3 +70,11 @@ extern int setenv(const char *name, const char *value, int rewrite); extern int unsetenv(const char *name); #endif + +/* Junk for dfa.[ch] */ +/* The __pure__ attribute was added in gcc 2.96. */ +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE /* empty */ +#endif diff -urN gawk-4.1.1/debug.c gawk-4.1.2/debug.c --- gawk-4.1.1/debug.c 2014-03-05 06:31:02.000000000 +0200 +++ gawk-4.1.2/debug.c 2015-04-28 16:49:46.000000000 +0300 @@ -2801,7 +2801,7 @@ unserialize(OPTION); unsetenv("DGAWK_RESTART"); fprintf(out_fp, "Restarting ...\n"); - if (run[0] == 'T') + if (strcasecmp(run, "true") == 0) (void) do_run(NULL, 0); } else if (command_file != NULL) { @@ -5448,6 +5448,7 @@ int ecount = 0, pcount = 0; int ret; int save_flags = do_flags; + SRCFILE *the_source; if (prog_running) { this_frame = find_frame(0); @@ -5458,7 +5459,7 @@ ctxt = new_context(); ctxt->install_func = append_symbol; /* keep track of newly installed globals */ push_context(ctxt); - (void) add_srcfile(SRC_CMDLINE, arg->a_string, srcfiles, NULL, NULL); + the_source = add_srcfile(SRC_CMDLINE, arg->a_string, srcfiles, NULL, NULL); do_flags = false; ret = parse_program(&code); do_flags = save_flags; @@ -5559,14 +5560,27 @@ this_func->param_cnt -= ecount; } - /* always destroy symbol "@eval", however destroy all newly installed + /* + * Always destroy symbol "@eval", however destroy all newly installed * globals only if fatal error (execute_code() returing NULL). */ pop_context(); /* switch to prev context */ free_context(ctxt, (ret_val != NULL)); /* free all instructions and optionally symbols */ - if (ret_val != NULL) - destroy_symbol(f); /* destroy "@eval" */ + + if (ret_val != NULL) { + /* + * Remove @eval from FUNCTAB, so that above code + * will work the next time around. + */ + NODE *s = make_string("@eval", 5); + + (void) assoc_remove(func_table, s); + unref(s); + } + + free_srcfile(the_source); + return false; } diff -urN gawk-4.1.1/depcomp gawk-4.1.2/depcomp --- gawk-4.1.1/depcomp 2014-01-20 21:52:59.000000000 +0200 +++ gawk-4.1.2/depcomp 2015-04-27 18:09:07.000000000 +0300 @@ -3,7 +3,7 @@ scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -251,6 +251,41 @@ exit 1 ;; +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, diff -urN gawk-4.1.1/dfa.c gawk-4.1.2/dfa.c --- gawk-4.1.1/dfa.c 2014-03-30 21:27:30.000000000 +0300 +++ gawk-4.1.2/dfa.c 2015-04-28 16:49:46.000000000 +0300 @@ -1,5 +1,5 @@ /* dfa.c - deterministic extended regexp routines for GNU - Copyright (C) 1988, 1998, 2000, 2002, 2004-2005, 2007-2014 Free Software + Copyright (C) 1988, 1998, 2000, 2002, 2004-2005, 2007-2015 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -37,21 +37,11 @@ #if HAVE_SETLOCALE #include #endif -#ifdef HAVE_STDBOOL_H -#include -#else -#include "missing_d/gawkbool.h" -#endif /* HAVE_STDBOOL_H */ -/* Gawk doesn't use Gnulib, so don't assume that setlocale and - static_assert are present. */ +/* Gawk doesn't use Gnulib, so don't assume that setlocale is present. */ #ifndef LC_ALL # define setlocale(category, locale) NULL #endif -#ifndef static_assert -# define static_assert(cond, diagnostic) \ - extern int (*foo (void)) [!!sizeof (struct { int foo: (cond) ? 8 : -1; })] -#endif #define STREQ(a, b) (strcmp (a, b) == 0) @@ -65,32 +55,18 @@ host does not conform to Posix. */ #define ISASCIIDIGIT(c) ((unsigned) (c) - '0' <= 9) -/* gettext.h ensures that we don't use gettext if ENABLE_NLS is not defined */ #include "gettext.h" #define _(str) gettext (str) -#include "mbsupport.h" /* Define MBS_SUPPORT to 1 or 0, as appropriate. */ -#if MBS_SUPPORT -/* We can handle multibyte strings. */ -# include -# include -#endif +#include +#include -#ifdef GAWK -/* The __pure__ attribute was added in gcc 2.96. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) -#else -# define _GL_ATTRIBUTE_PURE /* empty */ -#endif -#endif /* GAWK */ +#include "xalloc.h" -#if HAVE_LANGINFO_CODESET -# include +#if defined(__DJGPP__) +#include "mbsupport.h" #endif -#include "xalloc.h" - #include "dfa.h" #ifdef GAWK @@ -117,24 +93,29 @@ # undef clrbit #endif -/* Number of bits in an unsigned char. */ -#ifndef CHARBITS -# define CHARBITS 8 -#endif - /* First integer value that is greater than any character code. */ -#define NOTCHAR (1 << CHARBITS) +enum { NOTCHAR = 1 << CHAR_BIT }; -/* INTBITS need not be exact, just a lower bound. */ -#ifndef INTBITS -# define INTBITS (CHARBITS * sizeof (int)) -#endif +/* This represents part of a character class. It must be unsigned and + at least CHARCLASS_WORD_BITS wide. Any excess bits are zero. */ +typedef unsigned int charclass_word; + +/* The number of bits used in a charclass word. utf8_classes assumes + this is exactly 32. */ +enum { CHARCLASS_WORD_BITS = 32 }; -/* Number of ints required to hold a bit for every character. */ -#define CHARCLASS_INTS ((NOTCHAR + INTBITS - 1) / INTBITS) +/* The maximum useful value of a charclass_word; all used bits are 1. */ +#define CHARCLASS_WORD_MASK \ + (((charclass_word) 1 << (CHARCLASS_WORD_BITS - 1) << 1) - 1) + +/* Number of words required to hold a bit for every character. */ +enum +{ + CHARCLASS_WORDS = (NOTCHAR + CHARCLASS_WORD_BITS - 1) / CHARCLASS_WORD_BITS +}; /* Sets of unsigned characters are stored as bit vectors in arrays of ints. */ -typedef unsigned int charclass[CHARCLASS_INTS]; +typedef charclass_word charclass[CHARCLASS_WORDS]; /* Convert a possibly-signed character to an unsigned character. This is a bit safer than casting to unsigned char, since it catches some type @@ -237,27 +218,25 @@ a backtracking matcher. */ BEGLINE, /* BEGLINE is a terminal symbol that matches - the empty string if it is at the beginning - of a line. */ + the empty string at the beginning of a + line. */ ENDLINE, /* ENDLINE is a terminal symbol that matches - the empty string if it is at the end of - a line. */ + the empty string at the end of a line. */ BEGWORD, /* BEGWORD is a terminal symbol that matches - the empty string if it is at the beginning - of a word. */ + the empty string at the beginning of a + word. */ ENDWORD, /* ENDWORD is a terminal symbol that matches - the empty string if it is at the end of - a word. */ + the empty string at the end of a word. */ LIMWORD, /* LIMWORD is a terminal symbol that matches - the empty string if it is at the beginning - or the end of a word. */ + the empty string at the beginning or the + end of a word. */ NOTLIMWORD, /* NOTLIMWORD is a terminal symbol that - matches the empty string if it is not at + matches the empty string not at the beginning or end of a word. */ QMARK, /* QMARK is an operator of one argument that @@ -338,7 +317,8 @@ size_t hash; /* Hash of the positions of this state. */ position_set elems; /* Positions this state could match. */ unsigned char context; /* Context from previous state. */ - char backref; /* True if this state matches a \. */ + bool has_backref; /* This state matches a \. */ + bool has_mbcset; /* This state matches a MBCSET. */ unsigned short constraint; /* Constraint for this state to accept. */ token first_end; /* Token value of the first END in elems. */ position_set mbps; /* Positions which can match multibyte @@ -355,13 +335,16 @@ struct mb_char_classes { ptrdiff_t cset; - int invert; + bool invert; wchar_t *chars; /* Normal characters. */ size_t nchars; wctype_t *ch_classes; /* Character classes. */ size_t nch_classes; - wchar_t *range_sts; /* Range characters (start of the range). */ - wchar_t *range_ends; /* Range characters (end of the range). */ + struct /* Range characters. */ + { + wchar_t beg; /* Range start. */ + wchar_t end; /* Range end. */ + } *ranges; size_t nranges; char **equivs; /* Equivalence classes. */ size_t nequivs; @@ -387,10 +370,15 @@ size_t nleaves; /* Number of leaves on the parse tree. */ size_t nregexps; /* Count of parallel regexps being built with dfaparse. */ - unsigned int mb_cur_max; /* Cached value of MB_CUR_MAX. */ + bool fast; /* The DFA is fast. */ + bool multibyte; /* MB_CUR_MAX > 1. */ token utf8_anychar_classes[5]; /* To lower ANYCHAR in UTF-8 locales. */ + mbstate_t mbs; /* Multibyte conversion state. */ + + /* dfaexec implementation. */ + char *(*dfaexec) (struct dfa *, char const *, char *, int, size_t *, int *); - /* The following are used only if MB_CUR_MAX > 1. */ + /* The following are valid only if MB_CUR_MAX > 1. */ /* The value of multibyte_prop[i] is defined by following rule. if tokens[i] < NOTCHAR @@ -409,26 +397,25 @@ multibyte_prop = 3 , 1 , 0 , 2 , 3 */ - size_t nmultibyte_prop; int *multibyte_prop; -#if MBS_SUPPORT /* A table indexed by byte values that contains the corresponding wide - character (if any) for that byte. WEOF means the byte is the - leading byte of a multibyte character. Invalid and null bytes are - mapped to themselves. */ + character (if any) for that byte. WEOF means the byte is not a + valid single-byte character. */ wint_t mbrtowc_cache[NOTCHAR]; -#endif /* Array of the bracket expression in the DFA. */ struct mb_char_classes *mbcsets; size_t nmbcsets; size_t mbcsets_alloc; + /* Fields filled by the superset. */ + struct dfa *superset; /* Hint of the dfa. */ + /* Fields filled by the state builder. */ dfa_state *states; /* States of the dfa. */ state_num sindex; /* Index for adding new states. */ - state_num salloc; /* Number of states currently allocated. */ + size_t salloc; /* Number of states currently allocated. */ /* Fields filled by the parse tree->NFA conversion. */ position_set *follows; /* Array of follow sets, indexed by position @@ -438,7 +425,7 @@ matching the given position in a string matching the regexp. Allocated to the maximum possible position index. */ - int searchflag; /* True if we are supposed to build a searching + bool searchflag; /* We are supposed to build a searching as opposed to an exact matcher. A searching matcher finds the first and shortest string matching a regexp anywhere in the buffer, @@ -448,16 +435,20 @@ /* Fields filled by dfaexec. */ state_num tralloc; /* Number of transition tables that have - slots so far. */ + slots so far, not counting trans[-1]. */ int trcount; /* Number of transition tables that have actually been built. */ + int min_trcount; /* Minimum of number of transition tables. + Always keep the number, even after freeing + the transition tables. It is also the + number of initial states. */ state_num **trans; /* Transition tables for states that can never accept. If the transitions for a state have not yet been computed, or the state could possibly accept, its entry in - this table is NULL. */ - state_num **realtrans; /* Trans always points to realtrans + 1; this - is so trans[-1] can contain NULL. */ + this table is NULL. This points to one + past the start of the allocated array, + and trans[-1] is always NULL. */ state_num **fails; /* Transition tables after failing to accept on a state that potentially could do so. */ int *success; /* Table of acceptance conditions used in @@ -469,63 +460,33 @@ newline is stored separately and handled as a special case. Newline is also used as a sentinel at the end of the buffer. */ + state_num initstate_letter; /* Initial state for letter context. */ + state_num initstate_others; /* Initial state for other contexts. */ struct dfamust *musts; /* List of strings, at least one of which is known to appear in any r.e. matching the dfa. */ + position_set mb_follows; /* Follow set added by ANYCHAR and/or MBCSET + on demand. */ + int *mb_match_lens; /* Array of length reduced by ANYCHAR and/or + MBCSET. Null if mb_follows.elems has not + been allocated. */ }; /* Some macros for user access to dfa internals. */ -/* ACCEPTING returns true if s could possibly be an accepting state of r. */ +/* S could possibly be an accepting state of R. */ #define ACCEPTING(s, r) ((r).states[s].constraint) -/* ACCEPTS_IN_CONTEXT returns true if the given state accepts in the - specified context. */ +/* STATE accepts in the specified context. */ #define ACCEPTS_IN_CONTEXT(prev, curr, state, dfa) \ SUCCEEDS_IN_CONTEXT ((dfa).states[state].constraint, prev, curr) static void dfamust (struct dfa *dfa); static void regexp (void); -/* These two macros are identical to the ones in gnulib's xalloc.h, - except that they do not cast the result to "(t *)", and thus may - be used via type-free CALLOC and MALLOC macros. */ -#undef XNMALLOC -#undef XCALLOC - -/* Allocate memory for N elements of type T, with error checking. */ -/* extern t *XNMALLOC (size_t n, typename t); */ -# define XNMALLOC(n, t) \ - (sizeof (t) == 1 ? xmalloc (n) : xnmalloc (n, sizeof (t))) - -/* Allocate memory for N elements of type T, with error checking, - and zero it. */ -/* extern t *XCALLOC (size_t n, typename t); */ -# define XCALLOC(n, t) \ - (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t))) - -#define CALLOC(p, n) do { (p) = XCALLOC (n, *(p)); } while (0) -#undef MALLOC /* Irix defines this */ -#define MALLOC(p, n) do { (p) = XNMALLOC (n, *(p)); } while (0) -#define REALLOC(p, n) do {(p) = xnrealloc (p, n, sizeof (*(p))); } while (0) - -/* Reallocate an array of type *P if N_ALLOC is <= N_REQUIRED. */ -#define REALLOC_IF_NECESSARY(p, n_alloc, n_required) \ - do \ - { \ - if ((n_alloc) <= (n_required)) \ - { \ - size_t new_n_alloc = (n_required) + !(p); \ - (p) = x2nrealloc (p, &new_n_alloc, sizeof (*(p))); \ - (n_alloc) = new_n_alloc; \ - } \ - } \ - while (false) - static void dfambcache (struct dfa *d) { -#if MBS_SUPPORT int i; for (i = CHAR_MIN; i <= CHAR_MAX; ++i) { @@ -533,53 +494,48 @@ unsigned char uc = i; mbstate_t s = { 0 }; wchar_t wc; - wint_t wi; - switch (mbrtowc (&wc, &c, 1, &s)) - { - default: wi = wc; break; - case (size_t) -2: wi = WEOF; break; - case (size_t) -1: wi = uc; break; - } - d->mbrtowc_cache[uc] = wi; + d->mbrtowc_cache[uc] = mbrtowc (&wc, &c, 1, &s) <= 1 ? wc : WEOF; } -#endif } -#if MBS_SUPPORT -/* Given the dfa D, store into *PWC the result of converting the - leading bytes of the multibyte buffer S of length N bytes, updating - the conversion state in *MBS. On conversion error, convert just a - single byte as-is. Return the number of bytes converted. +/* Store into *PWC the result of converting the leading bytes of the + multibyte buffer S of length N bytes, using the mbrtowc_cache in *D + and updating the conversion state in *D. On conversion error, + convert just a single byte, to WEOF. Return the number of bytes + converted. - This differs from mbrtowc (PWC, S, N, MBS) as follows: + This differs from mbrtowc (PWC, S, N, &D->mbs) as follows: - * Extra arg D, containing an mbrtowc_cache for speed. + * PWC points to wint_t, not to wchar_t. + * The last arg is a dfa *D instead of merely a multibyte conversion + state D->mbs. D also contains an mbrtowc_cache for speed. * N must be at least 1. * S[N - 1] must be a sentinel byte. * Shift encodings are not supported. * The return value is always in the range 1..N. - * *MBS is always valid afterwards. + * D->mbs is always valid afterwards. * *PWC is always set to something. */ static size_t -mbs_to_wchar (struct dfa *d, wchar_t *pwc, char const *s, size_t n, - mbstate_t *mbs) +mbs_to_wchar (wint_t *pwc, char const *s, size_t n, struct dfa *d) { unsigned char uc = s[0]; wint_t wc = d->mbrtowc_cache[uc]; if (wc == WEOF) { - size_t nbytes = mbrtowc (pwc, s, n, mbs); + wchar_t wch; + size_t nbytes = mbrtowc (&wch, s, n, &d->mbs); if (0 < nbytes && nbytes < (size_t) -2) - return nbytes; - memset (mbs, 0, sizeof *mbs); - wc = uc; + { + *pwc = wch; + return nbytes; + } + memset (&d->mbs, 0, sizeof d->mbs); } *pwc = wc; return 1; } -#endif #ifdef DEBUG @@ -664,19 +620,20 @@ static bool tstbit (unsigned int b, charclass const c) { - return c[b / INTBITS] >> b % INTBITS & 1; + return c[b / CHARCLASS_WORD_BITS] >> b % CHARCLASS_WORD_BITS & 1; } static void setbit (unsigned int b, charclass c) { - c[b / INTBITS] |= 1U << b % INTBITS; + c[b / CHARCLASS_WORD_BITS] |= (charclass_word) 1 << b % CHARCLASS_WORD_BITS; } static void clrbit (unsigned int b, charclass c) { - c[b / INTBITS] &= ~(1U << b % INTBITS); + c[b / CHARCLASS_WORD_BITS] &= ~((charclass_word) 1 + << b % CHARCLASS_WORD_BITS); } static void @@ -696,40 +653,64 @@ { int i; - for (i = 0; i < CHARCLASS_INTS; ++i) - s[i] = ~s[i]; + for (i = 0; i < CHARCLASS_WORDS; ++i) + s[i] = CHARCLASS_WORD_MASK & ~s[i]; } -static int +static bool equal (charclass const s1, charclass const s2) { return memcmp (s1, s2, sizeof (charclass)) == 0; } -/* A pointer to the current dfa is kept here during parsing. */ -static struct dfa *dfa; +/* Ensure that the array addressed by PTR holds at least NITEMS + + (PTR || !NITEMS) items. Either return PTR, or reallocate the array + and return its new address. Although PTR may be null, the returned + value is never null. + + The array holds *NALLOC items; *NALLOC is updated on reallocation. + ITEMSIZE is the size of one item. Avoid O(N**2) behavior on arrays + growing linearly. */ +static void * +maybe_realloc (void *ptr, size_t nitems, size_t *nalloc, size_t itemsize) +{ + if (nitems < *nalloc) + return ptr; + *nalloc = nitems; + return x2nrealloc (ptr, nalloc, itemsize); +} -/* Find the index of charclass s in dfa->charclasses, or allocate a - new charclass. */ +/* In DFA D, find the index of charclass S, or allocate a new one. */ static size_t -charclass_index (charclass const s) +dfa_charclass_index (struct dfa *d, charclass const s) { size_t i; - for (i = 0; i < dfa->cindex; ++i) - if (equal (s, dfa->charclasses[i])) + for (i = 0; i < d->cindex; ++i) + if (equal (s, d->charclasses[i])) return i; - REALLOC_IF_NECESSARY (dfa->charclasses, dfa->calloc, dfa->cindex + 1); - ++dfa->cindex; - copyset (s, dfa->charclasses[i]); + d->charclasses = maybe_realloc (d->charclasses, d->cindex, &d->calloc, + sizeof *d->charclasses); + ++d->cindex; + copyset (s, d->charclasses[i]); return i; } +/* A pointer to the current dfa is kept here during parsing. */ +static struct dfa *dfa; + +/* Find the index of charclass S in the current DFA, or allocate a new one. */ +static size_t +charclass_index (charclass const s) +{ + return dfa_charclass_index (dfa, s); +} + /* Syntax bits controlling the behavior of the lexical analyzer. */ static reg_syntax_t syntax_bits, syntax_bits_set; /* Flag for case-folding letters into sets. */ -static int case_fold; +static bool case_fold; /* End-of-line byte in data. */ static unsigned char eolbyte; @@ -749,17 +730,17 @@ #ifdef __GLIBC__ # define is_valid_unibyte_character(c) 1 #else -# define is_valid_unibyte_character(c) (! (MBS_SUPPORT && btowc (c) == WEOF)) +# define is_valid_unibyte_character(c) (btowc (c) != WEOF) #endif -/* Return non-zero if C is a "word-constituent" byte; zero otherwise. */ +/* C is a "word-constituent" byte. */ #define IS_WORD_CONSTITUENT(C) \ (is_valid_unibyte_character (C) && (isalnum (C) || (C) == '_')) static int char_context (unsigned char c) { - if (c == eolbyte || c == 0) + if (c == eolbyte) return CTX_NEWLINE; if (IS_WORD_CONSTITUENT (c)) return CTX_LETTER; @@ -784,7 +765,7 @@ syntax_bits_set = 1; syntax_bits = bits; - case_fold = fold; + case_fold = fold != 0; eolbyte = eol; for (i = 0; i < NOTCHAR; ++i) @@ -810,17 +791,12 @@ static bool setbit_wc (wint_t wc, charclass c) { -#if MBS_SUPPORT int b = wctob (wc); if (b == EOF) return false; setbit (b, c); return true; -#else - abort (); - /*NOTREACHED*/ return false; -#endif } /* Set a bit for B and its case variants in the charclass C. @@ -843,23 +819,20 @@ using_utf8 (void) { static int utf8 = -1; - if (utf8 == -1) + if (utf8 < 0) { -#if defined HAVE_LANGINFO_CODESET && MBS_SUPPORT - utf8 = (STREQ (nl_langinfo (CODESET), "UTF-8")); -#else - utf8 = 0; -#endif + wchar_t wc; + mbstate_t mbs = { 0 }; + utf8 = mbrtowc (&wc, "\xc4\x80", 2, &mbs) == 2 && wc == 0x100; #ifdef LIBC_IS_BORKED if (gawk_mb_cur_max == 1) utf8 = 0; #endif } - return utf8; } -/* Return true if the current locale is known to be a unibyte locale +/* The current locale is known to be a unibyte locale without multicharacter collating sequences and where range comparisons simply use the native encoding. These locales can be processed more efficiently. */ @@ -867,7 +840,7 @@ static bool using_simple_locale (void) { - /* True if the native character set is known to be compatible with + /* The native character set is known to be compatible with the C locale. The following test isn't perfect, but it's good enough in practice, as only ASCII and EBCDIC are in common use and this test correctly accepts ASCII and rejects EBCDIC. */ @@ -883,7 +856,7 @@ && '}' == 125 && '~' == 126) }; - if (! native_c_charset || MB_CUR_MAX > 1) + if (! native_c_charset || dfa->multibyte) return false; else { @@ -907,39 +880,27 @@ static char const *lexptr; /* Pointer to next input character. */ static size_t lexleft; /* Number of characters remaining. */ static token lasttok; /* Previous token returned; initially END. */ -static int laststart; /* True if we're separated from beginning or (, +static bool laststart; /* We're separated from beginning or (, | only by zero-width characters. */ static size_t parens; /* Count of outstanding left parens. */ static int minrep, maxrep; /* Repeat counts for {m,n}. */ static int cur_mb_len = 1; /* Length of the multibyte representation of wctok. */ -/* These variables are used only if (MB_CUR_MAX > 1). */ -static mbstate_t mbs; /* mbstate for mbrtowc. */ -static wchar_t wctok; /* Wide character representation of the current - multibyte character. */ -static unsigned char *mblen_buf;/* Correspond to the input buffer in dfaexec. - Each element stores the number of remaining - bytes of the corresponding multibyte - character in the input string. A element's - value is 0 if the corresponding character is - single-byte. - e.g., input : 'a', , , - mblen_buf : 0, 3, 2, 1 - */ -static wchar_t *inputwcs; /* Wide character representation of the input - string in dfaexec. - The length of this array is the same as - the length of input string (char array). - inputstring[i] is a single-byte char, - or the first byte of a multibyte char; - inputwcs[i] is the codepoint. */ -static unsigned char const *buf_begin; /* reference to begin in dfaexec. */ -static unsigned char const *buf_end; /* reference to end in dfaexec. */ +static wint_t wctok; /* Wide character representation of the current + multibyte character, or WEOF if there was + an encoding error. Used only if + MB_CUR_MAX > 1. */ -#if MBS_SUPPORT -/* Note that characters become unsigned here. */ + +/* Fetch the next lexical input character. Set C (of type int) to the + next input byte, except set C to EOF if the input is a multibyte + character of length greater than 1. Set WC (of type wint_t) to the + value of the input if it is a valid multibyte character (possibly + of length 1); otherwise set WC to WEOF. If there is no more input, + report EOFERR if EOFERR is not null, and return lasttok = END + otherwise. */ # define FETCH_WC(c, wc, eoferr) \ do { \ if (! lexleft) \ @@ -951,8 +912,8 @@ } \ else \ { \ - wchar_t _wc; \ - size_t nbytes = mbs_to_wchar (dfa, &_wc, lexptr, lexleft, &mbs); \ + wint_t _wc; \ + size_t nbytes = mbs_to_wchar (&_wc, lexptr, lexleft, dfa); \ cur_mb_len = nbytes; \ (wc) = _wc; \ (c) = nbytes == 1 ? to_uchar (*lexptr) : EOF; \ @@ -961,23 +922,6 @@ } \ } while (0) -#else -/* Note that characters become unsigned here. */ -# define FETCH_WC(c, unused, eoferr) \ - do { \ - if (! lexleft) \ - { \ - if ((eoferr) != 0) \ - dfaerror (eoferr); \ - else \ - return lasttok = END; \ - } \ - (c) = to_uchar (*lexptr++); \ - --lexleft; \ - } while (0) - -#endif /* MBS_SUPPORT */ - #ifndef MIN # define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif @@ -999,14 +943,17 @@ 0x03F5, 0x1E9B, 0x1FBE, }; -static_assert ((sizeof lonesome_lower / sizeof *lonesome_lower + 2 - == CASE_FOLDED_BUFSIZE), - "CASE_FOLDED_BUFSIZE is wrong"); +/* Maximum number of characters that can be the case-folded + counterparts of a single character, not counting the character + itself. This is 1 for towupper, 1 for towlower, and 1 for each + entry in LONESOME_LOWER. */ +enum +{ CASE_FOLDED_BUFSIZE = 2 + sizeof lonesome_lower / sizeof *lonesome_lower }; /* Find the characters equal to C after case-folding, other than C itself, and store them into FOLDED. Return the number of characters stored. */ -int +static int case_folded_counterparts (wchar_t c, wchar_t folded[CASE_FOLDED_BUFSIZE]) { int i; @@ -1061,9 +1008,8 @@ unsigned int i; for (i = 0; prednames[i].name; ++i) if (STREQ (str, prednames[i].name)) - break; - - return &prednames[i]; + return &prednames[i]; + return NULL; } /* Multibyte character handling sub-routine for lex. @@ -1071,11 +1017,11 @@ static token parse_bracket_exp (void) { - int invert; + bool invert; int c, c1, c2; charclass ccl; - /* True if this is a bracket expression that dfaexec is known to + /* This is a bracket expression that dfaexec is known to process correctly. */ bool known_bracket_exp = true; @@ -1092,16 +1038,14 @@ /* Work area to build a mb_char_classes. */ struct mb_char_classes *work_mbc; - size_t chars_al, range_sts_al, range_ends_al, ch_classes_al, - equivs_al, coll_elems_al; + size_t chars_al, ranges_al, ch_classes_al, equivs_al, coll_elems_al; - chars_al = 0; - range_sts_al = range_ends_al = 0; - ch_classes_al = equivs_al = coll_elems_al = 0; - if (MB_CUR_MAX > 1) + chars_al = ranges_al = ch_classes_al = equivs_al = coll_elems_al = 0; + if (dfa->multibyte) { - REALLOC_IF_NECESSARY (dfa->mbcsets, dfa->mbcsets_alloc, - dfa->nmbcsets + 1); + dfa->mbcsets = maybe_realloc (dfa->mbcsets, dfa->nmbcsets, + &dfa->mbcsets_alloc, + sizeof *dfa->mbcsets); /* dfa->multibyte_prop[] hold the index of dfa->mbcsets. We will update dfa->multibyte_prop[] in addtok, because we can't @@ -1119,16 +1063,16 @@ if (c == '^') { FETCH_WC (c, wc, _("unbalanced [")); - invert = 1; + invert = true; known_bracket_exp = using_simple_locale (); } else - invert = 0; + invert = false; colon_warning_state = (c == ':'); do { - c1 = EOF; /* mark c1 is not initialized". */ + c1 = NOTCHAR; /* Mark c1 as not initialized. */ colon_warning_state &= ~2; /* Note that if we're looking at some other [:...:] construct, @@ -1137,13 +1081,13 @@ dfa is ever called. */ if (c == '[') { -#define MAX_BRACKET_STRING_LEN 32 - char str[MAX_BRACKET_STRING_LEN + 1]; FETCH_WC (c1, wc1, _("unbalanced [")); if ((c1 == ':' && (syntax_bits & RE_CHAR_CLASSES)) || c1 == '.' || c1 == '=') { + enum { MAX_BRACKET_STRING_LEN = 32 }; + char str[MAX_BRACKET_STRING_LEN + 1]; size_t len = 0; for (;;) { @@ -1173,14 +1117,15 @@ if (!pred) dfaerror (_("invalid character class")); - if (MB_CUR_MAX > 1 && !pred->single_byte_only) + if (dfa->multibyte && !pred->single_byte_only) { /* Store the character class as wctype_t. */ wctype_t wt = (wctype_t) wctype (class); - REALLOC_IF_NECESSARY (work_mbc->ch_classes, - ch_classes_al, - work_mbc->nch_classes + 1); + work_mbc->ch_classes + = maybe_realloc (work_mbc->ch_classes, + work_mbc->nch_classes, &ch_classes_al, + sizeof *work_mbc->ch_classes); work_mbc->ch_classes[work_mbc->nch_classes++] = wt; } @@ -1205,7 +1150,7 @@ if (c == '\\' && (syntax_bits & RE_BACKSLASH_ESCAPE_IN_LISTS)) FETCH_WC (c, wc, _("unbalanced [")); - if (c1 == EOF) + if (c1 == NOTCHAR) FETCH_WC (c1, wc1, _("unbalanced [")); if (c1 == '-') @@ -1227,29 +1172,30 @@ if (c2 == '\\' && (syntax_bits & RE_BACKSLASH_ESCAPE_IN_LISTS)) FETCH_WC (c2, wc2, _("unbalanced [")); - if (MB_CUR_MAX > 1) + if (dfa->multibyte) { /* When case folding map a range, say [m-z] (or even [M-z]) to the pair of ranges, [m-z] [M-Z]. Although this code is wrong in multiple ways, it's never used in practice. FIXME: Remove this (and related) unused code. */ - REALLOC_IF_NECESSARY (work_mbc->range_sts, - range_sts_al, work_mbc->nranges + 1); - REALLOC_IF_NECESSARY (work_mbc->range_ends, - range_ends_al, work_mbc->nranges + 1); - work_mbc->range_sts[work_mbc->nranges] = - case_fold ? towlower (wc) : (wchar_t) wc; - work_mbc->range_ends[work_mbc->nranges++] = - case_fold ? towlower (wc2) : (wchar_t) wc2; - - if (case_fold && (iswalpha (wc) || iswalpha (wc2))) + if (wc != WEOF && wc2 != WEOF) { - REALLOC_IF_NECESSARY (work_mbc->range_sts, - range_sts_al, work_mbc->nranges + 1); - work_mbc->range_sts[work_mbc->nranges] = towupper (wc); - REALLOC_IF_NECESSARY (work_mbc->range_ends, - range_ends_al, work_mbc->nranges + 1); - work_mbc->range_ends[work_mbc->nranges++] = towupper (wc2); + work_mbc->ranges + = maybe_realloc (work_mbc->ranges, + work_mbc->nranges + 2, + &ranges_al, sizeof *work_mbc->ranges); + work_mbc->ranges[work_mbc->nranges].beg + = case_fold ? towlower (wc) : wc; + work_mbc->ranges[work_mbc->nranges++].end + = case_fold ? towlower (wc2) : wc2; + + if (case_fold && (iswalpha (wc) || iswalpha (wc2))) + { + work_mbc->ranges[work_mbc->nranges].beg + = towupper (wc); + work_mbc->ranges[work_mbc->nranges++].end + = towupper (wc2); + } } } else if (using_simple_locale ()) @@ -1284,7 +1230,7 @@ colon_warning_state |= (c == ':') ? 2 : 4; - if (MB_CUR_MAX == 1) + if (!dfa->multibyte) { if (case_fold) setbit_case_fold_c (c, ccl); @@ -1293,21 +1239,23 @@ continue; } - if (case_fold) + if (wc == WEOF) + known_bracket_exp = false; + else { - wchar_t folded[CASE_FOLDED_BUFSIZE]; - int i, n = case_folded_counterparts (wc, folded); - REALLOC_IF_NECESSARY (work_mbc->chars, chars_al, - work_mbc->nchars + n); + wchar_t folded[CASE_FOLDED_BUFSIZE + 1]; + int i; + int n = (case_fold ? case_folded_counterparts (wc, folded + 1) + 1 + : 1); + folded[0] = wc; for (i = 0; i < n; i++) if (!setbit_wc (folded[i], ccl)) - work_mbc->chars[work_mbc->nchars++] = folded[i]; - } - if (!setbit_wc (wc, ccl)) - { - REALLOC_IF_NECESSARY (work_mbc->chars, chars_al, - work_mbc->nchars + 1); - work_mbc->chars[work_mbc->nchars++] = wc; + { + work_mbc->chars + = maybe_realloc (work_mbc->chars, work_mbc->nchars, + &chars_al, sizeof *work_mbc->chars); + work_mbc->chars[work_mbc->nchars++] = folded[i]; + } } } while ((wc = wc1, (c = c1) != ']')); @@ -1318,7 +1266,7 @@ if (! known_bracket_exp) return BACKREF; - if (MB_CUR_MAX > 1) + if (dfa->multibyte) { static charclass zeroclass; work_mbc->invert = invert; @@ -1328,7 +1276,7 @@ if (invert) { - assert (MB_CUR_MAX == 1); + assert (!dfa->multibyte); notset (ccl); if (syntax_bits & RE_HAT_LISTS_NOT_NEWLINE) clrbit (eolbyte, ccl); @@ -1337,11 +1285,25 @@ return CSET + charclass_index (ccl); } +#define PUSH_LEX_STATE(s) \ + do \ + { \ + char const *lexptr_saved = lexptr; \ + size_t lexleft_saved = lexleft; \ + lexptr = (s); \ + lexleft = strlen (lexptr) + +#define POP_LEX_STATE() \ + lexptr = lexptr_saved; \ + lexleft = lexleft_saved; \ + } \ + while (0) + static token lex (void) { - unsigned int c, c2; - int backslash = 0; + int c, c2; + bool backslash = false; charclass ccl; int i; @@ -1354,8 +1316,6 @@ for (i = 0; i < 2; ++i) { FETCH_WC (c, wctok, NULL); - if (c == (unsigned int) EOF) - goto normal_char; switch (c) { @@ -1364,7 +1324,7 @@ goto normal_char; if (lexleft == 0) dfaerror (_("unfinished \\ escape")); - backslash = 1; + backslash = true; break; case '^': @@ -1402,7 +1362,7 @@ case '9': if (backslash && !(syntax_bits & RE_NO_BK_REFS)) { - laststart = 0; + laststart = false; return lasttok = BACKREF; } goto normal_char; @@ -1510,14 +1470,14 @@ { if (syntax_bits & RE_INVALID_INTERVAL_ORD) goto normal_char; - dfaerror (_("Invalid content of \\{\\}")); + dfaerror (_("invalid content of \\{\\}")); } if (RE_DUP_MAX < maxrep) - dfaerror (_("Regular expression too big")); + dfaerror (_("regular expression too big")); lexptr = p; lexleft = lim - p; } - laststart = 0; + laststart = false; return lasttok = REPMN; case '|': @@ -1525,21 +1485,21 @@ goto normal_char; if (backslash != ((syntax_bits & RE_NO_BK_VBAR) == 0)) goto normal_char; - laststart = 1; + laststart = true; return lasttok = OR; case '\n': if (syntax_bits & RE_LIMITED_OPS || backslash || !(syntax_bits & RE_NEWLINE_ALT)) goto normal_char; - laststart = 1; + laststart = true; return lasttok = OR; case '(': if (backslash != ((syntax_bits & RE_NO_BK_PARENS) == 0)) goto normal_char; ++parens; - laststart = 1; + laststart = true; return lasttok = LPAREN; case ')': @@ -1548,17 +1508,17 @@ if (parens == 0 && syntax_bits & RE_UNMATCHED_RIGHT_PAREN_ORD) goto normal_char; --parens; - laststart = 0; + laststart = false; return lasttok = RPAREN; case '.': if (backslash) goto normal_char; - if (MB_CUR_MAX > 1) + if (dfa->multibyte) { /* In multibyte environment period must match with a single character not a byte. So we use ANYCHAR. */ - laststart = 0; + laststart = false; return lasttok = ANYCHAR; } zeroset (ccl); @@ -1567,14 +1527,14 @@ clrbit (eolbyte, ccl); if (syntax_bits & RE_DOT_NOT_NULL) clrbit ('\0', ccl); - laststart = 0; + laststart = false; return lasttok = CSET + charclass_index (ccl); case 's': case 'S': if (!backslash || (syntax_bits & RE_NO_GNU_OPS)) goto normal_char; - if (MB_CUR_MAX == 1) + if (!dfa->multibyte) { zeroset (ccl); for (c2 = 0; c2 < NOTCHAR; ++c2) @@ -1582,24 +1542,10 @@ setbit (c2, ccl); if (c == 'S') notset (ccl); - laststart = 0; + laststart = false; return lasttok = CSET + charclass_index (ccl); } -#define PUSH_LEX_STATE(s) \ - do \ - { \ - char const *lexptr_saved = lexptr; \ - size_t lexleft_saved = lexleft; \ - lexptr = (s); \ - lexleft = strlen (lexptr) - -#define POP_LEX_STATE() \ - lexptr = lexptr_saved; \ - lexleft = lexleft_saved; \ - } \ - while (0) - /* FIXME: see if optimizing this, as is done with ANYCHAR and add_utf8_anychar, makes sense. */ @@ -1612,34 +1558,53 @@ POP_LEX_STATE (); - laststart = 0; + laststart = false; return lasttok; case 'w': case 'W': if (!backslash || (syntax_bits & RE_NO_GNU_OPS)) goto normal_char; - zeroset (ccl); - for (c2 = 0; c2 < NOTCHAR; ++c2) - if (IS_WORD_CONSTITUENT (c2)) - setbit (c2, ccl); - if (c == 'W') - notset (ccl); - laststart = 0; - return lasttok = CSET + charclass_index (ccl); + + if (!dfa->multibyte) + { + zeroset (ccl); + for (c2 = 0; c2 < NOTCHAR; ++c2) + if (IS_WORD_CONSTITUENT (c2)) + setbit (c2, ccl); + if (c == 'W') + notset (ccl); + laststart = false; + return lasttok = CSET + charclass_index (ccl); + } + + /* FIXME: see if optimizing this, as is done with ANYCHAR and + add_utf8_anychar, makes sense. */ + + /* \w and \W are documented to be equivalent to [_[:alnum:]] and + [^_[:alnum:]] respectively, so tell the lexer to process those + strings, each minus its "already processed" '['. */ + PUSH_LEX_STATE (c == 'w' ? "_[:alnum:]]" : "^_[:alnum:]]"); + + lasttok = parse_bracket_exp (); + + POP_LEX_STATE (); + + laststart = false; + return lasttok; case '[': if (backslash) goto normal_char; - laststart = 0; + laststart = false; return lasttok = parse_bracket_exp (); default: normal_char: - laststart = 0; + laststart = false; /* For multibyte character sets, folding is done in atom. Always return WCHAR. */ - if (MB_CUR_MAX > 1) + if (dfa->multibyte) return lasttok = WCHAR; if (case_fold && isalpha (c)) @@ -1671,14 +1636,16 @@ static void addtok_mb (token t, int mbprop) { - if (MB_CUR_MAX > 1) + if (dfa->talloc == dfa->tindex) { - REALLOC_IF_NECESSARY (dfa->multibyte_prop, dfa->nmultibyte_prop, - dfa->tindex + 1); - dfa->multibyte_prop[dfa->tindex] = mbprop; + dfa->tokens = x2nrealloc (dfa->tokens, &dfa->talloc, + sizeof *dfa->tokens); + if (dfa->multibyte) + dfa->multibyte_prop = xnrealloc (dfa->multibyte_prop, dfa->talloc, + sizeof *dfa->multibyte_prop); } - - REALLOC_IF_NECESSARY (dfa->tokens, dfa->talloc, dfa->tindex + 1); + if (dfa->multibyte) + dfa->multibyte_prop[dfa->tindex] = mbprop; dfa->tokens[dfa->tindex++] = t; switch (t) @@ -1693,8 +1660,12 @@ --depth; break; + case BACKREF: + dfa->fast = false; + /* fallthrough */ default: ++dfa->nleaves; + /* fallthrough */ case EMPTY: ++depth; break; @@ -1710,7 +1681,7 @@ static void addtok (token t) { - if (MB_CUR_MAX > 1 && t == MBCSET) + if (dfa->multibyte && t == MBCSET) { bool need_or = false; struct mb_char_classes *work_mbc = &dfa->mbcsets[dfa->nmbcsets - 1]; @@ -1761,7 +1732,6 @@ } } -#if MBS_SUPPORT /* We treat a multibyte character as a single atom, so that DFA can treat a multibyte character as a single expression. @@ -1793,23 +1763,26 @@ addtok (CAT); } } -#else -static void -addtok_wc (wint_t wc) -{ -} -#endif static void add_utf8_anychar (void) { -#if MBS_SUPPORT static const charclass utf8_classes[5] = { - {0, 0, 0, 0, ~0, ~0, 0, 0}, /* 80-bf: non-leading bytes */ - {~0, ~0, ~0, ~0, 0, 0, 0, 0}, /* 00-7f: 1-byte sequence */ - {0, 0, 0, 0, 0, 0, ~3, 0}, /* c2-df: 2-byte sequence */ - {0, 0, 0, 0, 0, 0, 0, 0xffff}, /* e0-ef: 3-byte sequence */ - {0, 0, 0, 0, 0, 0, 0, 0xff0000} /* f0-f7: 4-byte sequence */ + /* 80-bf: non-leading bytes. */ + {0, 0, 0, 0, CHARCLASS_WORD_MASK, CHARCLASS_WORD_MASK, 0, 0}, + + /* 00-7f: 1-byte sequence. */ + {CHARCLASS_WORD_MASK, CHARCLASS_WORD_MASK, CHARCLASS_WORD_MASK, + CHARCLASS_WORD_MASK, 0, 0, 0, 0}, + + /* c2-df: 2-byte sequence. */ + {0, 0, 0, 0, 0, 0, ~3 & CHARCLASS_WORD_MASK, 0}, + + /* e0-ef: 3-byte sequence. */ + {0, 0, 0, 0, 0, 0, 0, 0xffff}, + + /* f0-f7: 4-byte sequence. */ + {0, 0, 0, 0, 0, 0, 0, 0xff0000} }; const unsigned int n = sizeof (utf8_classes) / sizeof (utf8_classes[0]); unsigned int i; @@ -1848,7 +1821,6 @@ addtok (CAT); addtok (OR); } -#endif } /* The grammar understood by the parser is as follows. @@ -1889,24 +1861,29 @@ static void atom (void) { - if (MBS_SUPPORT && tok == WCHAR) + if (tok == WCHAR) { - addtok_wc (wctok); - - if (case_fold) + if (wctok == WEOF) + addtok (BACKREF); + else { - wchar_t folded[CASE_FOLDED_BUFSIZE]; - int i, n = case_folded_counterparts (wctok, folded); - for (i = 0; i < n; i++) + addtok_wc (wctok); + + if (case_fold) { - addtok_wc (folded[i]); - addtok (OR); + wchar_t folded[CASE_FOLDED_BUFSIZE]; + int i, n = case_folded_counterparts (wctok, folded); + for (i = 0; i < n; i++) + { + addtok_wc (folded[i]); + addtok (OR); + } } } tok = lex (); } - else if (MBS_SUPPORT && tok == ANYCHAR && using_utf8 ()) + else if (tok == ANYCHAR && using_utf8 ()) { /* For UTF-8 expand the period to a series of CSETs that define a valid UTF-8 character. This avoids using the slow multibyte path. I'm @@ -1920,9 +1897,7 @@ } else if ((tok >= 0 && tok < NOTCHAR) || tok >= CSET || tok == BACKREF || tok == BEGLINE || tok == ENDLINE || tok == BEGWORD -#if MBS_SUPPORT || tok == ANYCHAR || tok == MBCSET -#endif /* MBS_SUPPORT */ || tok == ENDWORD || tok == LIMWORD || tok == NOTLIMWORD) { addtok (tok); @@ -1967,7 +1942,7 @@ { size_t i; - if (MB_CUR_MAX > 1) + if (dfa->multibyte) for (i = 0; i < ntokens; ++i) addtok_mb (dfa->tokens[tindex + i], dfa->multibyte_prop[tindex + i]); else @@ -2050,12 +2025,12 @@ lexptr = s; lexleft = len; lasttok = END; - laststart = 1; + laststart = true; parens = 0; - if (MB_CUR_MAX > 1) + if (dfa->multibyte) { cur_mb_len = 0; - memset (&mbs, 0, sizeof mbs); + memset (&d->mbs, 0, sizeof d->mbs); } if (!syntax_bits_set) @@ -2080,19 +2055,24 @@ /* Some primitives for operating on sets of positions. */ -/* Copy one set to another; the destination must be large enough. */ +/* Copy one set to another. */ static void copy (position_set const *src, position_set * dst) { - REALLOC_IF_NECESSARY (dst->elems, dst->alloc, src->nelem); - memcpy (dst->elems, src->elems, sizeof (dst->elems[0]) * src->nelem); + if (dst->alloc < src->nelem) + { + free (dst->elems); + dst->alloc = src->nelem; + dst->elems = x2nrealloc (NULL, &dst->alloc, sizeof *dst->elems); + } + memcpy (dst->elems, src->elems, src->nelem * sizeof *dst->elems); dst->nelem = src->nelem; } static void alloc_position_set (position_set * s, size_t size) { - MALLOC (s->elems, size); + s->elems = xnmalloc (size, sizeof *s->elems); s->alloc = size; s->nelem = 0; } @@ -2122,7 +2102,7 @@ return; } - REALLOC_IF_NECESSARY (s->elems, s->alloc, count + 1); + s->elems = maybe_realloc (s->elems, count, &s->alloc, sizeof *s->elems); for (i = count; i > lo; i--) s->elems[i] = s->elems[i - 1]; s->elems[lo] = p; @@ -2136,7 +2116,12 @@ { size_t i = 0, j = 0; - REALLOC_IF_NECESSARY (m->elems, m->alloc, s1->nelem + s2->nelem); + if (m->alloc < s1->nelem + s2->nelem) + { + free (m->elems); + m->elems = maybe_realloc (NULL, s1->nelem + s2->nelem, &m->alloc, + sizeof *m->elems); + } m->nelem = 0; while (i < s1->nelem && j < s2->nelem) if (s1->elems[i].index > s2->elems[j].index) @@ -2197,19 +2182,19 @@ } /* We'll have to create a new state. */ - REALLOC_IF_NECESSARY (d->states, d->salloc, d->sindex + 1); + d->states = maybe_realloc (d->states, d->sindex, &d->salloc, + sizeof *d->states); d->states[i].hash = hash; alloc_position_set (&d->states[i].elems, s->nelem); copy (s, &d->states[i].elems); d->states[i].context = context; - d->states[i].backref = 0; + d->states[i].has_backref = false; + d->states[i].has_mbcset = false; d->states[i].constraint = 0; d->states[i].first_end = 0; - if (MBS_SUPPORT) - { - d->states[i].mbps.nelem = 0; - d->states[i].mbps.elems = NULL; - } + d->states[i].mbps.nelem = 0; + d->states[i].mbps.elems = NULL; + for (j = 0; j < s->nelem; ++j) if (d->tokens[s->elems[j].index] < 0) { @@ -2222,7 +2207,7 @@ else if (d->tokens[s->elems[j].index] == BACKREF) { d->states[i].constraint = NO_CONSTRAINT; - d->states[i].backref = 1; + d->states[i].has_backref = true; } ++d->sindex; @@ -2236,23 +2221,24 @@ constraint. Repeat exhaustively until no funny positions are left. S->elems must be large enough to hold the result. */ static void -epsclosure (position_set * s, struct dfa const *d) +epsclosure (position_set *s, struct dfa const *d, char *visited) { size_t i, j; - char *visited; /* Array of booleans, enough to use char, not int. */ position p, old; - - CALLOC (visited, d->tindex); + bool initialized = false; for (i = 0; i < s->nelem; ++i) if (d->tokens[s->elems[i].index] >= NOTCHAR && d->tokens[s->elems[i].index] != BACKREF -#if MBS_SUPPORT && d->tokens[s->elems[i].index] != ANYCHAR && d->tokens[s->elems[i].index] != MBCSET -#endif && d->tokens[s->elems[i].index] < CSET) { + if (!initialized) + { + memset (visited, 0, d->tindex * sizeof (*visited)); + initialized = true; + } old = s->elems[i]; p.constraint = old.constraint; delete (s->elems[i], s); @@ -2293,8 +2279,6 @@ /* Force rescan to start at the beginning. */ i = -1; } - - free (visited); } /* Returns the set of contexts for which there is at least one @@ -2309,7 +2293,7 @@ if (tstbit (eolbyte, c)) context |= CTX_NEWLINE; - for (j = 0; j < CHARCLASS_INTS; ++j) + for (j = 0; j < CHARCLASS_WORDS; ++j) { if (c[j] & letters[j]) context |= CTX_LETTER; @@ -2399,19 +2383,29 @@ void dfaanalyze (struct dfa *d, int searchflag) { - int *nullable; /* Nullable stack. */ - size_t *nfirstpos; /* Element count stack for firstpos sets. */ - position *firstpos; /* Array where firstpos elements are stored. */ - size_t *nlastpos; /* Element count stack for lastpos sets. */ - position *lastpos; /* Array where lastpos elements are stored. */ + /* Array allocated to hold position sets. */ + position *posalloc = xnmalloc (d->nleaves, 2 * sizeof *posalloc); + /* Firstpos and lastpos elements. */ + position *firstpos = posalloc + d->nleaves; + position *lastpos = firstpos + d->nleaves; + + /* Stack for element counts and nullable flags. */ + struct + { + /* Whether the entry is nullable. */ + bool nullable; + + /* Counts of firstpos and lastpos sets. */ + size_t nfirstpos; + size_t nlastpos; + } *stkalloc = xnmalloc (d->depth, sizeof *stkalloc), *stk = stkalloc; + position_set tmp; /* Temporary set for merging sets. */ position_set merged; /* Result of merging sets. */ int separate_contexts; /* Context wanted by some position. */ - int *o_nullable; - size_t *o_nfirst, *o_nlast; - position *o_firstpos, *o_lastpos; size_t i, j; position *pos; + char *visited = xnmalloc (d->tindex, sizeof *visited); #ifdef DEBUG fprintf (stderr, "dfaanalyze:\n"); @@ -2423,21 +2417,9 @@ putc ('\n', stderr); #endif - d->searchflag = searchflag; - - MALLOC (nullable, d->depth); - o_nullable = nullable; - MALLOC (nfirstpos, d->depth); - o_nfirst = nfirstpos; - MALLOC (firstpos, d->nleaves); - o_firstpos = firstpos, firstpos += d->nleaves; - MALLOC (nlastpos, d->depth); - o_nlast = nlastpos; - MALLOC (lastpos, d->nleaves); - o_lastpos = lastpos, lastpos += d->nleaves; + d->searchflag = searchflag != 0; alloc_position_set (&merged, d->nleaves); - - CALLOC (d->follows, d->tindex); + d->follows = xcalloc (d->tindex, sizeof *d->follows); for (i = 0; i < d->tindex; ++i) { @@ -2445,38 +2427,40 @@ { case EMPTY: /* The empty set is nullable. */ - *nullable++ = 1; + stk->nullable = true; /* The firstpos and lastpos of the empty leaf are both empty. */ - *nfirstpos++ = *nlastpos++ = 0; + stk->nfirstpos = stk->nlastpos = 0; + stk++; break; case STAR: case PLUS: /* Every element in the firstpos of the argument is in the follow of every element in the lastpos. */ - tmp.nelem = nfirstpos[-1]; + tmp.nelem = stk[-1].nfirstpos; tmp.elems = firstpos; pos = lastpos; - for (j = 0; j < nlastpos[-1]; ++j) + for (j = 0; j < stk[-1].nlastpos; ++j) { merge (&tmp, &d->follows[pos[j].index], &merged); copy (&merged, &d->follows[pos[j].index]); } + /* fallthrough */ case QMARK: /* A QMARK or STAR node is automatically nullable. */ if (d->tokens[i] != PLUS) - nullable[-1] = 1; + stk[-1].nullable = true; break; case CAT: /* Every element in the firstpos of the second argument is in the follow of every element in the lastpos of the first argument. */ - tmp.nelem = nfirstpos[-1]; + tmp.nelem = stk[-1].nfirstpos; tmp.elems = firstpos; - pos = lastpos + nlastpos[-1]; - for (j = 0; j < nlastpos[-2]; ++j) + pos = lastpos + stk[-1].nlastpos; + for (j = 0; j < stk[-2].nlastpos; ++j) { merge (&tmp, &d->follows[pos[j].index], &merged); copy (&merged, &d->follows[pos[j].index]); @@ -2484,43 +2468,39 @@ /* The firstpos of a CAT node is the firstpos of the first argument, union that of the second argument if the first is nullable. */ - if (nullable[-2]) - nfirstpos[-2] += nfirstpos[-1]; + if (stk[-2].nullable) + stk[-2].nfirstpos += stk[-1].nfirstpos; else - firstpos += nfirstpos[-1]; - --nfirstpos; + firstpos += stk[-1].nfirstpos; /* The lastpos of a CAT node is the lastpos of the second argument, union that of the first argument if the second is nullable. */ - if (nullable[-1]) - nlastpos[-2] += nlastpos[-1]; + if (stk[-1].nullable) + stk[-2].nlastpos += stk[-1].nlastpos; else { - pos = lastpos + nlastpos[-2]; - for (j = nlastpos[-1]; j-- > 0;) + pos = lastpos + stk[-2].nlastpos; + for (j = stk[-1].nlastpos; j-- > 0;) pos[j] = lastpos[j]; - lastpos += nlastpos[-2]; - nlastpos[-2] = nlastpos[-1]; + lastpos += stk[-2].nlastpos; + stk[-2].nlastpos = stk[-1].nlastpos; } - --nlastpos; /* A CAT node is nullable if both arguments are nullable. */ - nullable[-2] = nullable[-1] && nullable[-2]; - --nullable; + stk[-2].nullable &= stk[-1].nullable; + stk--; break; case OR: /* The firstpos is the union of the firstpos of each argument. */ - nfirstpos[-2] += nfirstpos[-1]; - --nfirstpos; + stk[-2].nfirstpos += stk[-1].nfirstpos; /* The lastpos is the union of the lastpos of each argument. */ - nlastpos[-2] += nlastpos[-1]; - --nlastpos; + stk[-2].nlastpos += stk[-1].nlastpos; /* An OR node is nullable if either argument is nullable. */ - nullable[-2] = nullable[-1] || nullable[-2]; - --nullable; + stk[-2].nullable |= stk[-1].nullable; + stk--; break; default: @@ -2529,10 +2509,12 @@ an "epsilon closure" effectively makes them nullable later. Backreferences have to get a real position so we can detect transitions on them later. But they are nullable. */ - *nullable++ = d->tokens[i] == BACKREF; + stk->nullable = d->tokens[i] == BACKREF; /* This position is in its own firstpos and lastpos. */ - *nfirstpos++ = *nlastpos++ = 1; + stk->nfirstpos = stk->nlastpos = 1; + stk++; + --firstpos, --lastpos; firstpos->index = lastpos->index = i; firstpos->constraint = lastpos->constraint = NO_CONSTRAINT; @@ -2546,15 +2528,16 @@ fprintf (stderr, "node %zd:", i); prtok (d->tokens[i]); putc ('\n', stderr); - fprintf (stderr, nullable[-1] ? " nullable: yes\n" : " nullable: no\n"); + fprintf (stderr, + stk[-1].nullable ? " nullable: yes\n" : " nullable: no\n"); fprintf (stderr, " firstpos:"); - for (j = nfirstpos[-1]; j-- > 0;) + for (j = stk[-1].nfirstpos; j-- > 0;) { fprintf (stderr, " %zd:", firstpos[j].index); prtok (d->tokens[firstpos[j].index]); } fprintf (stderr, "\n lastpos:"); - for (j = nlastpos[-1]; j-- > 0;) + for (j = stk[-1].nlastpos; j-- > 0;) { fprintf (stderr, " %zd:", lastpos[j].index); prtok (d->tokens[lastpos[j].index]); @@ -2567,9 +2550,7 @@ it with its epsilon closure. */ for (i = 0; i < d->tindex; ++i) if (d->tokens[i] < NOTCHAR || d->tokens[i] == BACKREF -#if MBS_SUPPORT || d->tokens[i] == ANYCHAR || d->tokens[i] == MBCSET -#endif || d->tokens[i] >= CSET) { #ifdef DEBUG @@ -2584,33 +2565,34 @@ putc ('\n', stderr); #endif copy (&d->follows[i], &merged); - epsclosure (&merged, d); + epsclosure (&merged, d, visited); copy (&merged, &d->follows[i]); } /* Get the epsilon closure of the firstpos of the regexp. The result will be the set of positions of state 0. */ merged.nelem = 0; - for (i = 0; i < nfirstpos[-1]; ++i) + for (i = 0; i < stk[-1].nfirstpos; ++i) insert (firstpos[i], &merged); - epsclosure (&merged, d); + epsclosure (&merged, d, visited); /* Build the initial state. */ - d->salloc = 1; - d->sindex = 0; - MALLOC (d->states, d->salloc); - separate_contexts = state_separate_contexts (&merged); - state_index (d, &merged, - (separate_contexts & CTX_NEWLINE - ? CTX_NEWLINE : separate_contexts ^ CTX_ANY)); - - free (o_nullable); - free (o_nfirst); - free (o_firstpos); - free (o_nlast); - free (o_lastpos); + if (separate_contexts & CTX_NEWLINE) + state_index (d, &merged, CTX_NEWLINE); + d->initstate_others = d->min_trcount + = state_index (d, &merged, separate_contexts ^ CTX_ANY); + if (separate_contexts & CTX_LETTER) + d->initstate_letter = d->min_trcount + = state_index (d, &merged, CTX_LETTER); + else + d->initstate_letter = d->initstate_others; + d->min_trcount++; + + free (posalloc); + free (stkalloc); free (merged.elems); + free (visited); } @@ -2647,16 +2629,16 @@ void dfastate (state_num s, struct dfa *d, state_num trans[]) { - leaf_set *grps; /* As many as will ever be needed. */ - charclass *labels; /* Labels corresponding to the groups. */ + leaf_set grps[NOTCHAR]; /* As many as will ever be needed. */ + charclass labels[NOTCHAR]; /* Labels corresponding to the groups. */ size_t ngrps = 0; /* Number of groups actually used. */ position pos; /* Current position being considered. */ charclass matches; /* Set of matching characters. */ - int matchesf; /* True if matches is nonempty. */ + charclass_word matchesf; /* Nonzero if matches is nonempty. */ charclass intersect; /* Intersection with some label set. */ - int intersectf; /* True if intersect is nonempty. */ + charclass_word intersectf; /* Nonzero if intersect is nonempty. */ charclass leftovers; /* Stuff in the label that didn't match. */ - int leftoversf; /* True if leftovers is nonempty. */ + charclass_word leftoversf; /* Nonzero if leftovers is nonempty. */ position_set follows; /* Union of the follows of some group. */ position_set tmp; /* Temporary space for merging sets. */ int possible_contexts; /* Contexts that this group can match. */ @@ -2664,12 +2646,9 @@ state_num state; /* New state. */ state_num state_newline; /* New state on a newline transition. */ state_num state_letter; /* New state on a letter transition. */ - int next_isnt_1st_byte = 0; /* Flag if we can't add state0. */ + bool next_isnt_1st_byte = false; /* We can't add state0. */ size_t i, j, k; - MALLOC (grps, NOTCHAR); - MALLOC (labels, NOTCHAR); - zeroset (matches); for (i = 0; i < d->states[s].elems.nelem; ++i) @@ -2679,21 +2658,23 @@ setbit (d->tokens[pos.index], matches); else if (d->tokens[pos.index] >= CSET) copyset (d->charclasses[d->tokens[pos.index] - CSET], matches); - else if (MBS_SUPPORT - && (d->tokens[pos.index] == ANYCHAR - || d->tokens[pos.index] == MBCSET)) - /* MB_CUR_MAX > 1 */ - { - /* ANYCHAR and MBCSET must match with a single character, so we - must put it to d->states[s].mbps, which contains the positions - which can match with a single character not a byte. */ - if (d->states[s].mbps.nelem == 0) - alloc_position_set (&d->states[s].mbps, 1); - insert (pos, &(d->states[s].mbps)); + else + { + if (d->tokens[pos.index] == MBCSET + || d->tokens[pos.index] == ANYCHAR) + { + /* MB_CUR_MAX > 1 */ + if (d->tokens[pos.index] == MBCSET) + d->states[s].has_mbcset = true; + /* ANYCHAR and MBCSET must match with a single character, so we + must put it to d->states[s].mbps, which contains the positions + which can match with a single character not a byte. */ + if (d->states[s].mbps.nelem == 0) + alloc_position_set (&d->states[s].mbps, 1); + insert (pos, &(d->states[s].mbps)); + } continue; } - else - continue; /* Some characters may need to be eliminated from matches because they fail in the current context. */ @@ -2701,21 +2682,21 @@ { if (!SUCCEEDS_IN_CONTEXT (pos.constraint, d->states[s].context, CTX_NEWLINE)) - for (j = 0; j < CHARCLASS_INTS; ++j) + for (j = 0; j < CHARCLASS_WORDS; ++j) matches[j] &= ~newline[j]; if (!SUCCEEDS_IN_CONTEXT (pos.constraint, d->states[s].context, CTX_LETTER)) - for (j = 0; j < CHARCLASS_INTS; ++j) + for (j = 0; j < CHARCLASS_WORDS; ++j) matches[j] &= ~letters[j]; if (!SUCCEEDS_IN_CONTEXT (pos.constraint, d->states[s].context, CTX_NONE)) - for (j = 0; j < CHARCLASS_INTS; ++j) + for (j = 0; j < CHARCLASS_WORDS; ++j) matches[j] &= letters[j] | newline[j]; /* If there are no characters left, there's no point in going on. */ - for (j = 0; j < CHARCLASS_INTS && !matches[j]; ++j) + for (j = 0; j < CHARCLASS_WORDS && !matches[j]; ++j) continue; - if (j == CHARCLASS_INTS) + if (j == CHARCLASS_WORDS) continue; } @@ -2731,20 +2712,20 @@ /* Check if this group's label has a nonempty intersection with matches. */ intersectf = 0; - for (k = 0; k < CHARCLASS_INTS; ++k) - (intersect[k] = matches[k] & labels[j][k]) ? (intersectf = 1) : 0; + for (k = 0; k < CHARCLASS_WORDS; ++k) + intersectf |= intersect[k] = matches[k] & labels[j][k]; if (!intersectf) continue; /* It does; now find the set differences both ways. */ leftoversf = matchesf = 0; - for (k = 0; k < CHARCLASS_INTS; ++k) + for (k = 0; k < CHARCLASS_WORDS; ++k) { /* Even an optimizing compiler can't know this for sure. */ - int match = matches[k], label = labels[j][k]; + charclass_word match = matches[k], label = labels[j][k]; - (leftovers[k] = ~match & label) ? (leftoversf = 1) : 0; - (matches[k] = match & ~label) ? (matchesf = 1) : 0; + leftoversf |= leftovers[k] = ~match & label; + matchesf |= matches[k] = match & ~label; } /* If there were leftovers, create a new group labeled with them. */ @@ -2752,7 +2733,8 @@ { copyset (leftovers, labels[ngrps]); copyset (intersect, labels[j]); - MALLOC (grps[ngrps].elems, d->nleaves); + grps[ngrps].elems = xnmalloc (d->nleaves, + sizeof *grps[ngrps].elems); memcpy (grps[ngrps].elems, grps[j].elems, sizeof (grps[j].elems[0]) * grps[j].nelem); grps[ngrps].nelem = grps[j].nelem; @@ -2775,7 +2757,7 @@ { copyset (matches, labels[ngrps]); zeroset (matches); - MALLOC (grps[ngrps].elems, d->nleaves); + grps[ngrps].elems = xnmalloc (d->nleaves, sizeof *grps[ngrps].elems); grps[ngrps].nelem = 1; grps[ngrps].elems[0] = pos.index; ++ngrps; @@ -2821,7 +2803,7 @@ for (k = 0; k < d->follows[grps[i].elems[j]].nelem; ++k) insert (d->follows[grps[i].elems[j]].elems[k], &follows); - if (d->mb_cur_max > 1) + if (d->multibyte) { /* If a token in follows.elems is not 1st byte of a multibyte character, or the states of follows must accept the bytes @@ -2841,12 +2823,12 @@ codepoint of , it must not be but 2nd byte of , so we cannot add state[0]. */ - next_isnt_1st_byte = 0; + next_isnt_1st_byte = false; for (j = 0; j < follows.nelem; ++j) { if (!(d->multibyte_prop[follows.elems[j].index] & 1)) { - next_isnt_1st_byte = 1; + next_isnt_1st_byte = true; break; } } @@ -2854,10 +2836,11 @@ /* If we are building a searching matcher, throw in the positions of state 0 as well. */ - if (d->searchflag - && (!MBS_SUPPORT || (d->mb_cur_max == 1 || !next_isnt_1st_byte))) - for (j = 0; j < d->states[0].elems.nelem; ++j) - insert (d->states[0].elems.elems[j], &follows); + if (d->searchflag && (!d->multibyte || !next_isnt_1st_byte)) + { + merge (&d->states[0].elems, &follows, &tmp); + copy (&tmp, &follows); + } /* Find out if the new state will want any context information. */ possible_contexts = charclass_context (labels[i]); @@ -2878,11 +2861,11 @@ state_letter = state; /* Set the transitions for each character in the current label. */ - for (j = 0; j < CHARCLASS_INTS; ++j) - for (k = 0; k < INTBITS; ++k) - if (labels[i][j] & 1U << k) + for (j = 0; j < CHARCLASS_WORDS; ++j) + for (k = 0; k < CHARCLASS_WORD_BITS; ++k) + if (labels[i][j] >> k & 1) { - int c = j * INTBITS + k; + int c = j * CHARCLASS_WORD_BITS + k; if (c == eolbyte) trans[c] = state_newline; @@ -2897,8 +2880,31 @@ free (grps[i].elems); free (follows.elems); free (tmp.elems); - free (grps); - free (labels); +} + +/* Make sure D's state arrays are large enough to hold NEW_STATE. */ +static void +realloc_trans_if_necessary (struct dfa *d, state_num new_state) +{ + state_num oldalloc = d->tralloc; + if (oldalloc <= new_state) + { + state_num **realtrans = d->trans ? d->trans - 1 : NULL; + size_t newalloc, newalloc1; + newalloc1 = new_state + 1; + realtrans = x2nrealloc (realtrans, &newalloc1, sizeof *realtrans); + realtrans[0] = NULL; + d->trans = realtrans + 1; + d->tralloc = newalloc = newalloc1 - 1; + d->fails = xnrealloc (d->fails, newalloc, sizeof *d->fails); + d->success = xnrealloc (d->success, newalloc, sizeof *d->success); + d->newlines = xnrealloc (d->newlines, newalloc, sizeof *d->newlines); + for (; oldalloc < newalloc; oldalloc++) + { + d->trans[oldalloc] = NULL; + d->fails[oldalloc] = NULL; + } + } } /* Some routines for manipulating a compiled dfa's transition tables. @@ -2912,21 +2918,22 @@ build_state (state_num s, struct dfa *d) { state_num *trans; /* The new transition table. */ - state_num i; + state_num i, maxstate; /* Set an upper limit on the number of transition tables that will ever exist at once. 1024 is arbitrary. The idea is that the frequently used transition tables will be quickly rebuilt, whereas the ones that - were only needed once or twice will be cleared away. */ + were only needed once or twice will be cleared away. However, do not + clear the initial D->min_trcount states, since they are always used. */ if (d->trcount >= 1024) { - for (i = 0; i < d->tralloc; ++i) + for (i = d->min_trcount; i < d->tralloc; ++i) { free (d->trans[i]); free (d->fails[i]); d->trans[i] = d->fails[i] = NULL; } - d->trcount = 0; + d->trcount = d->min_trcount; } ++d->trcount; @@ -2940,30 +2947,17 @@ if (ACCEPTS_IN_CONTEXT (d->states[s].context, CTX_NONE, s, *d)) d->success[s] |= CTX_NONE; - MALLOC (trans, NOTCHAR); + trans = xmalloc (NOTCHAR * sizeof *trans); dfastate (s, d, trans); /* Now go through the new transition table, and make sure that the trans and fail arrays are allocated large enough to hold a pointer for the largest state mentioned in the table. */ + maxstate = -1; for (i = 0; i < NOTCHAR; ++i) - if (trans[i] >= d->tralloc) - { - state_num oldalloc = d->tralloc; - - while (trans[i] >= d->tralloc) - d->tralloc *= 2; - REALLOC (d->realtrans, d->tralloc + 1); - d->trans = d->realtrans + 1; - REALLOC (d->fails, d->tralloc); - REALLOC (d->success, d->tralloc); - REALLOC (d->newlines, d->tralloc); - while (oldalloc < d->tralloc) - { - d->trans[oldalloc] = NULL; - d->fails[oldalloc++] = NULL; - } - } + if (maxstate < trans[i]) + maxstate = trans[i]; + realloc_trans_if_necessary (d, maxstate); /* Keep the newline transition in a special place so we can use it as a sentinel. */ @@ -2976,68 +2970,8 @@ d->trans[s] = trans; } -static void -build_state_zero (struct dfa *d) -{ - d->tralloc = 1; - d->trcount = 0; - CALLOC (d->realtrans, d->tralloc + 1); - d->trans = d->realtrans + 1; - CALLOC (d->fails, d->tralloc); - MALLOC (d->success, d->tralloc); - MALLOC (d->newlines, d->tralloc); - build_state (0, d); -} - /* Multibyte character handling sub-routines for dfaexec. */ -/* The initial state may encounter a byte which is not a single byte character - nor the first byte of a multibyte character. But it is incorrect for the - initial state to accept such a byte. For example, in Shift JIS the regular - expression "\\" accepts the codepoint 0x5c, but should not accept the second - byte of the codepoint 0x815c. Then the initial state must skip the bytes - that are not a single byte character nor the first byte of a multibyte - character. */ -#define SKIP_REMAINS_MB_IF_INITIAL_STATE(s, p) \ - if (s == 0) \ - { \ - while (inputwcs[p - buf_begin] == 0 \ - && mblen_buf[p - buf_begin] > 0 \ - && (unsigned char const *) p < buf_end) \ - ++p; \ - if ((char *) p >= end) \ - { \ - free (mblen_buf); \ - free (inputwcs); \ - *end = saved_end; \ - return NULL; \ - } \ - } - -static void -realloc_trans_if_necessary (struct dfa *d, state_num new_state) -{ - /* Make sure that the trans and fail arrays are allocated large enough - to hold a pointer for the new state. */ - if (new_state >= d->tralloc) - { - state_num oldalloc = d->tralloc; - - while (new_state >= d->tralloc) - d->tralloc *= 2; - REALLOC (d->realtrans, d->tralloc + 1); - d->trans = d->realtrans + 1; - REALLOC (d->fails, d->tralloc); - REALLOC (d->success, d->tralloc); - REALLOC (d->newlines, d->tralloc); - while (oldalloc < d->tralloc) - { - d->trans[oldalloc] = NULL; - d->fails[oldalloc++] = NULL; - } - } -} - /* Return values of transit_state_singlebyte, and transit_state_consume_1char. */ typedef enum @@ -3070,14 +3004,7 @@ works = 0; } else if (works < 0) - { - if (p == buf_end) - { - /* At the moment, it must not happen. */ - abort (); - } - works = 0; - } + works = 0; else if (d->fails[works]) { works = d->fails[works][*p]; @@ -3092,18 +3019,13 @@ return rval; } -/* Match a "." against the current context. buf_begin[IDX] is the - current position. Return the length of the match, in bytes. - POS is the position of the ".". */ +/* Match a "." against the current context. Return the length of the + match, in bytes. POS is the position of the ".". */ static int -match_anychar (struct dfa *d, state_num s, position pos, size_t idx) +match_anychar (struct dfa *d, state_num s, position pos, + wint_t wc, size_t mbclen) { int context; - wchar_t wc; - int mbclen; - - wc = inputwcs[idx]; - mbclen = (mblen_buf[idx] == 0) ? 1 : mblen_buf[idx]; /* Check syntax bits. */ if (wc == (wchar_t) eolbyte) @@ -3116,6 +3038,8 @@ if (syntax_bits & RE_DOT_NOT_NULL) return 0; } + else if (wc == WEOF) + return 0; context = wchar_context (wc); if (!SUCCEEDS_IN_CONTEXT (pos.constraint, d->states[s].context, context)) @@ -3125,16 +3049,14 @@ } /* Match a bracket expression against the current context. - buf_begin[IDX] is the current position. Return the length of the match, in bytes. POS is the position of the bracket expression. */ static int -match_mb_charset (struct dfa *d, state_num s, position pos, size_t idx) +match_mb_charset (struct dfa *d, state_num s, position pos, + char const *p, wint_t wc, size_t match_len) { size_t i; - int match; /* Matching succeeded. */ - int match_len; /* Length of the character (or collating element) - with which this operator matches. */ + bool match; /* Matching succeeded. */ int op_len; /* Length of the operator. */ char buffer[128]; @@ -3142,21 +3064,10 @@ struct mb_char_classes *work_mbc; int context; - wchar_t wc; /* Current referring character. */ - - wc = inputwcs[idx]; /* Check syntax bits. */ - if (wc == (wchar_t) eolbyte) - { - if (!(syntax_bits & RE_DOT_NEWLINE)) - return 0; - } - else if (wc == (wchar_t) '\0') - { - if (syntax_bits & RE_DOT_NOT_NULL) - return 0; - } + if (wc == WEOF) + return 0; context = wchar_context (wc); if (!SUCCEEDS_IN_CONTEXT (pos.constraint, d->states[s].context, context)) @@ -3165,7 +3076,6 @@ /* Assign the current referring operator to work_mbc. */ work_mbc = &(d->mbcsets[(d->multibyte_prop[pos.index]) >> 2]); match = !work_mbc->invert; - match_len = (mblen_buf[idx] == 0) ? 1 : mblen_buf[idx]; /* Match in range 0-255? */ if (wc < NOTCHAR && work_mbc->cset != -1 @@ -3179,14 +3089,14 @@ goto charset_matched; } - strncpy (buffer, (char const *) buf_begin + idx, match_len); + strncpy (buffer, p, match_len); buffer[match_len] = '\0'; /* match with an equivalence class? */ for (i = 0; i < work_mbc->nequivs; i++) { op_len = strlen (work_mbc->equivs[i]); - strncpy (buffer, (char const *) buf_begin + idx, op_len); + strncpy (buffer, p, op_len); buffer[op_len] = '\0'; if (strcoll (work_mbc->equivs[i], buffer) == 0) { @@ -3199,7 +3109,7 @@ for (i = 0; i < work_mbc->ncoll_elems; i++) { op_len = strlen (work_mbc->coll_elems[i]); - strncpy (buffer, (char const *) buf_begin + idx, op_len); + strncpy (buffer, p, op_len); buffer[op_len] = '\0'; if (strcoll (work_mbc->coll_elems[i], buffer) == 0) @@ -3212,7 +3122,7 @@ /* match with a range? */ for (i = 0; i < work_mbc->nranges; i++) { - if (work_mbc->range_sts[i] <= wc && wc <= work_mbc->range_ends[i]) + if (work_mbc->ranges[i].beg <= wc && wc <= work_mbc->ranges[i].end) goto charset_matched; } @@ -3233,27 +3143,25 @@ array which corresponds to 'd->states[s].mbps.elem'; each element of the array contains the number of bytes with which the element can match. - 'idx' is the index from buf_begin, and it is the current position - in the buffer. - The caller MUST free the array which this function return. */ static int * -check_matching_with_multibyte_ops (struct dfa *d, state_num s, size_t idx) +check_matching_with_multibyte_ops (struct dfa *d, state_num s, + char const *p, wint_t wc, size_t mbclen) { size_t i; int *rarray; - MALLOC (rarray, d->states[s].mbps.nelem); + rarray = d->mb_match_lens; for (i = 0; i < d->states[s].mbps.nelem; ++i) { position pos = d->states[s].mbps.elems[i]; switch (d->tokens[pos.index]) { case ANYCHAR: - rarray[i] = match_anychar (d, s, pos, idx); + rarray[i] = match_anychar (d, s, pos, wc, mbclen); break; case MBCSET: - rarray[i] = match_mb_charset (d, s, pos, idx); + rarray[i] = match_mb_charset (d, s, pos, p, wc, mbclen); break; default: break; /* cannot happen. */ @@ -3273,48 +3181,39 @@ static status_transit_state transit_state_consume_1char (struct dfa *d, state_num s, unsigned char const **pp, - int *match_lens, int *mbclen, position_set * pps) + wint_t wc, size_t mbclen, + int *match_lens) { size_t i, j; int k; state_num s1, s2; - int *work_mbls; status_transit_state rs = TRANSIT_STATE_DONE; - /* Calculate the length of the (single/multi byte) character - to which p points. */ - *mbclen = (mblen_buf[*pp - buf_begin] == 0) ? 1 : mblen_buf[*pp - buf_begin]; + if (! match_lens && d->states[s].mbps.nelem != 0) + match_lens = check_matching_with_multibyte_ops (d, s, (char const *) *pp, + wc, mbclen); /* Calculate the state which can be reached from the state 's' by - consuming '*mbclen' single bytes from the buffer. */ + consuming 'mbclen' single bytes from the buffer. */ s1 = s; - for (k = 0; k < *mbclen; k++) + for (k = 0; k < mbclen; k++) { s2 = s1; rs = transit_state_singlebyte (d, s2, (*pp)++, &s1); } - /* Copy the positions contained by 's1' to the set 'pps'. */ - copy (&(d->states[s1].elems), pps); - - /* Check (input) match_lens, and initialize if it is NULL. */ - if (match_lens == NULL && d->states[s].mbps.nelem != 0) - work_mbls = check_matching_with_multibyte_ops (d, s, *pp - buf_begin); - else - work_mbls = match_lens; + copy (&d->states[s1].elems, &d->mb_follows); /* Add all of the positions which can be reached from 's' by consuming a single character. */ for (i = 0; i < d->states[s].mbps.nelem; i++) { - if (work_mbls[i] == *mbclen) + if (match_lens[i] == mbclen) for (j = 0; j < d->follows[d->states[s].mbps.elems[i].index].nelem; j++) - insert (d->follows[d->states[s].mbps.elems[i].index].elems[j], pps); + insert (d->follows[d->states[s].mbps.elems[i].index].elems[j], + &d->mb_follows); } - if (match_lens == NULL && work_mbls != NULL) - free (work_mbls); - /* FIXME: this return value is always ignored. */ return rs; } @@ -3323,7 +3222,8 @@ buffer. This function is for some operator which can match with a multi- byte character or a collating element (which may be multi characters). */ static state_num -transit_state (struct dfa *d, state_num s, unsigned char const **pp) +transit_state (struct dfa *d, state_num s, unsigned char const **pp, + unsigned char const *end) { state_num s1; int mbclen; /* The length of current input multibyte character. */ @@ -3331,16 +3231,17 @@ size_t i, j; int *match_lens = NULL; size_t nelem = d->states[s].mbps.nelem; /* Just a alias. */ - position_set follows; unsigned char const *p1 = *pp; - wchar_t wc; + wint_t wc; if (nelem > 0) /* This state has (a) multibyte operator(s). We check whether each of them can match or not. */ { /* Note: caller must free the return value of this function. */ - match_lens = check_matching_with_multibyte_ops (d, s, *pp - buf_begin); + mbclen = mbs_to_wchar (&wc, (char const *) *pp, end - *pp, d); + match_lens = check_matching_with_multibyte_ops (d, s, (char const *) *pp, + wc, mbclen); for (i = 0; i < nelem; i++) /* Search the operator which match the longest string, @@ -3362,26 +3263,25 @@ if (rs == TRANSIT_STATE_DONE) ++*pp; - free (match_lens); return s1; } /* This state has some operators which can match a multibyte character. */ - alloc_position_set (&follows, d->nleaves); + d->mb_follows.nelem = 0; /* 'maxlen' may be longer than the length of a character, because it may not be a character but a (multi character) collating element. We enumerate all of the positions which 's' can reach by consuming 'maxlen' bytes. */ - transit_state_consume_1char (d, s, pp, match_lens, &mbclen, &follows); + transit_state_consume_1char (d, s, pp, wc, mbclen, match_lens); - wc = inputwcs[*pp - mbclen - buf_begin]; - s1 = state_index (d, &follows, wchar_context (wc)); + s1 = state_index (d, &d->mb_follows, wchar_context (wc)); realloc_trans_if_necessary (d, s1); while (*pp - p1 < maxlen) { - transit_state_consume_1char (d, s1, pp, NULL, &mbclen, &follows); + mbclen = mbs_to_wchar (&wc, (char const *) *pp, end - *pp, d); + transit_state_consume_1char (d, s1, pp, wc, mbclen, NULL); for (i = 0; i < nelem; i++) { @@ -3389,49 +3289,38 @@ for (j = 0; j < d->follows[d->states[s1].mbps.elems[i].index].nelem; j++) insert (d->follows[d->states[s1].mbps.elems[i].index].elems[j], - &follows); + &d->mb_follows); } - wc = inputwcs[*pp - mbclen - buf_begin]; - s1 = state_index (d, &follows, wchar_context (wc)); + s1 = state_index (d, &d->mb_follows, wchar_context (wc)); realloc_trans_if_necessary (d, s1); } - free (match_lens); - free (follows.elems); return s1; } +/* The initial state may encounter a byte which is not a single byte character + nor the first byte of a multibyte character. But it is incorrect for the + initial state to accept such a byte. For example, in Shift JIS the regular + expression "\\" accepts the codepoint 0x5c, but should not accept the second + byte of the codepoint 0x815c. Then the initial state must skip the bytes + that are not a single byte character nor the first byte of a multibyte + character. -/* Initialize mblen_buf and inputwcs with data from the next line. */ - -static void -prepare_wc_buf (struct dfa *d, const char *begin, const char *end) -{ -#if MBS_SUPPORT - unsigned char eol = eolbyte; - size_t i; - size_t ilim = end - begin + 1; - - buf_begin = (unsigned char *) begin; - - for (i = 0; i < ilim; i++) - { - size_t nbytes = mbs_to_wchar (d, inputwcs + i, begin + i, ilim - i, &mbs); - mblen_buf[i] = nbytes - (nbytes == 1); - if (begin[i] == eol) - break; - while (--nbytes != 0) - { - i++; - mblen_buf[i] = nbytes; - inputwcs[i] = 0; - } - } - - buf_end = (unsigned char *) (begin + i); - mblen_buf[i] = 0; - inputwcs[i] = 0; /* sentinel */ -#endif /* MBS_SUPPORT */ + Given DFA state d, use mbs_to_wchar to advance MBP until it reaches or + exceeds P. If WCP is non-NULL, set *WCP to the final wide character + processed, or if no wide character is processed, set it to WEOF. + Both P and MBP must be no larger than END. */ +static unsigned char const * +skip_remains_mb (struct dfa *d, unsigned char const *p, + unsigned char const *mbp, char const *end, wint_t *wcp) +{ + wint_t wc = WEOF; + while (mbp < p) + mbp += mbs_to_wchar (&wc, (char const *) mbp, + end - (char const *) mbp, d); + if (wcp != NULL) + *wcp = wc; + return mbp; } /* Search through a buffer looking for a match to the given struct dfa. @@ -3445,45 +3334,92 @@ If COUNT is non-NULL, increment *COUNT once for each newline processed. Finally, if BACKREF is non-NULL set *BACKREF to indicate whether we encountered a back-reference (1) or not (0). The caller may use this - to decide whether to fall back on a backtracking matcher. */ -char * -dfaexec (struct dfa *d, char const *begin, char *end, - int allow_nl, size_t *count, int *backref) + to decide whether to fall back on a backtracking matcher. + + If MULTIBYTE, the input consists of multibyte characters and/or + encoding-error bytes. Otherwise, the input consists of single-byte + characters. */ +static inline char * +dfaexec_main (struct dfa *d, char const *begin, char *end, + int allow_nl, size_t *count, int *backref, bool multibyte) { state_num s, s1; /* Current state. */ - unsigned char const *p; /* Current input character. */ + unsigned char const *p, *mbp; /* Current input character. */ state_num **trans, *t; /* Copy of d->trans so it can be optimized into a register. */ unsigned char eol = eolbyte; /* Likewise for eolbyte. */ unsigned char saved_end; + size_t nlcount = 0; if (!d->tralloc) - build_state_zero (d); + { + realloc_trans_if_necessary (d, 1); + build_state (0, d); + } s = s1 = 0; - p = (unsigned char const *) begin; + p = mbp = (unsigned char const *) begin; trans = d->trans; saved_end = *(unsigned char *) end; *end = eol; - if (d->mb_cur_max > 1) + if (multibyte) { - MALLOC (mblen_buf, end - begin + 2); - MALLOC (inputwcs, end - begin + 2); - memset (&mbs, 0, sizeof (mbstate_t)); - prepare_wc_buf (d, (const char *) p, end); + memset (&d->mbs, 0, sizeof d->mbs); + if (! d->mb_match_lens) + { + d->mb_match_lens = xnmalloc (d->nleaves, sizeof *d->mb_match_lens); + alloc_position_set (&d->mb_follows, d->nleaves); + } } for (;;) { - if (d->mb_cur_max > 1) + if (multibyte) { while ((t = trans[s]) != NULL) { - if (p > buf_end) - break; s1 = s; - SKIP_REMAINS_MB_IF_INITIAL_STATE (s, p); + + if (s < d->min_trcount) + { + if (d->min_trcount == 1) + { + if (d->states[s].mbps.nelem == 0) + { + do + { + while (t[*p] == 0) + p++; + p = mbp = skip_remains_mb (d, p, mbp, end, NULL); + } + while (t[*p] == 0); + } + else + p = mbp = skip_remains_mb (d, p, mbp, end, NULL); + } + else + { + wint_t wc; + mbp = skip_remains_mb (d, p, mbp, end, &wc); + + /* If d->min_trcount is greater than 1, maybe + transit to another initial state after skip. */ + if (p < mbp) + { + int context = wchar_context (wc); + if (context == CTX_LETTER) + s = d->initstate_letter; + else + /* It's CTX_NONE. CTX_NEWLINE cannot happen, + as we assume that a newline is always a + single byte character. */ + s = d->initstate_others; + p = mbp; + s1 = s; + } + } + } if (d->states[s].mbps.nelem == 0) { @@ -3491,27 +3427,60 @@ continue; } - /* Falling back to the glibc matcher in this case gives - better performance (up to 25% better on [a-z], for - example) and enables support for collating symbols and - equivalence classes. */ - if (backref) - { - *backref = 1; - free (mblen_buf); - free (inputwcs); - *end = saved_end; - return (char *) p; - } + /* The following code is used twice. + Use a macro to avoid the risk that they diverge. */ +#define State_transition() \ + do { \ + /* Falling back to the glibc matcher in this case gives \ + better performance (up to 25% better on [a-z], for \ + example) and enables support for collating symbols and \ + equivalence classes. */ \ + if (d->states[s].has_mbcset && backref) \ + { \ + *backref = 1; \ + goto done; \ + } \ + \ + /* Can match with a multibyte character (and multi-character \ + collating element). Transition table might be updated. */ \ + s = transit_state (d, s, &p, (unsigned char *) end); \ + \ + /* If previous character is newline after a transition \ + for ANYCHAR or MBCSET in non-UTF8 multibyte locales, \ + check whether current position is beyond the end of \ + the input buffer. Also, transit to initial state if \ + !ALLOW_NL, even if RE_DOT_NEWLINE is set. */ \ + if (p[-1] == eol) \ + { \ + if ((char *) p > end) \ + { \ + p = NULL; \ + goto done; \ + } \ + \ + nlcount++; \ + \ + if (!allow_nl) \ + s = 0; \ + } \ + \ + mbp = p; \ + trans = d->trans; \ + } while (0) - /* Can match with a multibyte character (and multi character - collating element). Transition table might be updated. */ - s = transit_state (d, s, &p); - trans = d->trans; + State_transition(); } } else { + if (s == 0 && (t = trans[s]) != NULL) + { + while (t[*p] == 0) + p++; + s1 = 0; + s = t[*p++]; + } + while ((t = trans[s]) != NULL) { s1 = t[*p++]; @@ -3526,71 +3495,89 @@ } } - if (s >= 0 && (char *) p <= end && d->fails[s]) + if (s < 0) { - if (d->success[s] & sbit[*p]) + if ((char *) p > end || p[-1] != eol || d->newlines[s1] < 0) { - if (backref) - *backref = (d->states[s].backref != 0); - if (d->mb_cur_max > 1) - { - free (mblen_buf); - free (inputwcs); - } - *end = saved_end; - return (char *) p; + p = NULL; + goto done; } - s1 = s; - if (d->mb_cur_max > 1) - { - /* Can match with a multibyte character (and multicharacter - collating element). Transition table might be updated. */ - s = transit_state (d, s, &p); - trans = d->trans; - } - else - s = d->fails[s][*p++]; - continue; - } + /* The previous character was a newline, count it, and skip + checking of multibyte character boundary until here. */ + nlcount++; + mbp = p; - /* If the previous character was a newline, count it. */ - if ((char *) p <= end && p[-1] == eol) - { - if (count) - ++*count; - - if (d->mb_cur_max > 1) - prepare_wc_buf (d, (const char *) p, end); + s = allow_nl ? d->newlines[s1] : 0; } - /* Check if we've run off the end of the buffer. */ - if ((char *) p > end) + if (d->fails[s]) { - if (d->mb_cur_max > 1) + if (d->success[s] & sbit[*p]) { - free (mblen_buf); - free (inputwcs); + if (backref) + *backref = d->states[s].has_backref; + goto done; } - *end = saved_end; - return NULL; - } - if (s >= 0) + s1 = s; + if (multibyte) + State_transition(); + else + s = d->fails[s][*p++]; + } + else { - build_state (s, d); + if (!d->trans[s]) + build_state (s, d); trans = d->trans; - continue; } + } - if (p[-1] == eol && allow_nl) - { - s = d->newlines[s1]; - continue; - } + done: + if (count) + *count += nlcount; + *end = saved_end; + return (char *) p; +} - s = 0; - } +/* Specialized versions of dfaexec_main for multibyte and single-byte + cases. This is for performance. */ + +static char * +dfaexec_mb (struct dfa *d, char const *begin, char *end, + int allow_nl, size_t *count, int *backref) +{ + return dfaexec_main (d, begin, end, allow_nl, count, backref, true); +} + +static char * +dfaexec_sb (struct dfa *d, char const *begin, char *end, + int allow_nl, size_t *count, int *backref) +{ + return dfaexec_main (d, begin, end, allow_nl, count, backref, false); +} + +/* Like dfaexec_main (D, BEGIN, END, ALLOW_NL, COUNT, BACKREF, D->multibyte), + but faster. */ + +char * +dfaexec (struct dfa *d, char const *begin, char *end, + int allow_nl, size_t *count, int *backref) +{ + return d->dfaexec (d, begin, end, allow_nl, count, backref); +} + +struct dfa * +dfasuperset (struct dfa const *d) +{ + return d->superset; +} + +bool +dfaisfast (struct dfa const *d) +{ + return d->fast; } static void @@ -3599,7 +3586,6 @@ size_t i; free (d->multibyte_prop); - d->multibyte_prop = NULL; for (i = 0; i < d->nmbcsets; ++i) { @@ -3607,8 +3593,7 @@ struct mb_char_classes *p = &(d->mbcsets[i]); free (p->chars); free (p->ch_classes); - free (p->range_sts); - free (p->range_ends); + free (p->ranges); for (j = 0; j < p->nequivs; ++j) free (p->equivs[j]); @@ -3620,8 +3605,9 @@ } free (d->mbcsets); - d->mbcsets = NULL; - d->nmbcsets = 0; + free (d->mb_follows.elems); + free (d->mb_match_lens); + d->mb_match_lens = NULL; } /* Initialize the components of a dfa that the other routines don't @@ -3630,30 +3616,18 @@ dfainit (struct dfa *d) { memset (d, 0, sizeof *d); - - d->calloc = 1; - MALLOC (d->charclasses, d->calloc); - - d->talloc = 1; - MALLOC (d->tokens, d->talloc); - - d->mb_cur_max = MB_CUR_MAX; - - if (d->mb_cur_max > 1) - { - d->nmultibyte_prop = 1; - MALLOC (d->multibyte_prop, d->nmultibyte_prop); - d->mbcsets_alloc = 1; - MALLOC (d->mbcsets, d->mbcsets_alloc); - } + d->multibyte = MB_CUR_MAX > 1; + d->dfaexec = d->multibyte ? dfaexec_mb : dfaexec_sb; + d->fast = !d->multibyte; } static void dfaoptimize (struct dfa *d) { size_t i; + bool have_backref = false; - if (!MBS_SUPPORT || !using_utf8 ()) + if (!using_utf8 ()) return; for (i = 0; i < d->tindex; ++i) @@ -3663,6 +3637,9 @@ case ANYCHAR: /* Lowered. */ abort (); + case BACKREF: + have_backref = true; + break; case MBCSET: /* Requires multi-byte algorithm. */ return; @@ -3671,8 +3648,100 @@ } } + if (!have_backref && d->superset) + { + /* The superset DFA is not likely to be much faster, so remove it. */ + dfafree (d->superset); + free (d->superset); + d->superset = NULL; + } + free_mbdata (d); - d->mb_cur_max = 1; + d->multibyte = false; + d->dfaexec = dfaexec_sb; +} + +static void +dfassbuild (struct dfa *d) +{ + size_t i, j; + charclass ccl; + bool have_achar = false; + bool have_nchar = false; + struct dfa *sup = dfaalloc (); + + *sup = *d; + sup->multibyte = false; + sup->dfaexec = dfaexec_sb; + sup->multibyte_prop = NULL; + sup->mbcsets = NULL; + sup->superset = NULL; + sup->states = NULL; + sup->sindex = 0; + sup->follows = NULL; + sup->tralloc = 0; + sup->trans = NULL; + sup->fails = NULL; + sup->success = NULL; + sup->newlines = NULL; + sup->musts = NULL; + + sup->charclasses = xnmalloc (sup->calloc, sizeof *sup->charclasses); + if (d->cindex) + { + memcpy (sup->charclasses, d->charclasses, + d->cindex * sizeof *sup->charclasses); + } + + sup->tokens = xnmalloc (d->tindex, 2 * sizeof *sup->tokens); + sup->talloc = d->tindex * 2; + + for (i = j = 0; i < d->tindex; i++) + { + switch (d->tokens[i]) + { + case ANYCHAR: + case MBCSET: + case BACKREF: + zeroset (ccl); + notset (ccl); + sup->tokens[j++] = CSET + dfa_charclass_index (sup, ccl); + sup->tokens[j++] = STAR; + if (d->tokens[i + 1] == QMARK || d->tokens[i + 1] == STAR + || d->tokens[i + 1] == PLUS) + i++; + have_achar = true; + break; + case BEGWORD: + case ENDWORD: + case LIMWORD: + case NOTLIMWORD: + if (d->multibyte) + { + /* These constraints aren't supported in a multibyte locale. + Ignore them in the superset DFA, and treat them as + backreferences in the main DFA. */ + sup->tokens[j++] = EMPTY; + d->tokens[i] = BACKREF; + break; + } + default: + sup->tokens[j++] = d->tokens[i]; + if ((0 <= d->tokens[i] && d->tokens[i] < NOTCHAR) + || d->tokens[i] >= CSET) + have_nchar = true; + break; + } + } + sup->tindex = j; + + if (have_nchar && (have_achar || d->multibyte)) + d->superset = sup; + else + { + dfafree (sup); + free (sup); + } } /* Parse and analyze a single string of the given length. */ @@ -3683,8 +3752,14 @@ dfambcache (d); dfaparse (s, len, d); dfamust (d); + dfassbuild (d); dfaoptimize (d); dfaanalyze (d, searchflag); + if (d->superset) + { + d->fast = true; + dfaanalyze (d->superset, searchflag); + } } /* Free the storage held by the components of a dfa. */ @@ -3697,34 +3772,46 @@ free (d->charclasses); free (d->tokens); - if (d->mb_cur_max > 1) + if (d->multibyte) free_mbdata (d); for (i = 0; i < d->sindex; ++i) { free (d->states[i].elems.elems); - if (MBS_SUPPORT) - free (d->states[i].mbps.elems); + free (d->states[i].mbps.elems); } free (d->states); - for (i = 0; i < d->tindex; ++i) - free (d->follows[i].elems); - free (d->follows); - for (i = 0; i < d->tralloc; ++i) - { - free (d->trans[i]); - free (d->fails[i]); - } - free (d->realtrans); - free (d->fails); - free (d->newlines); - free (d->success); + + if (d->follows) + { + for (i = 0; i < d->tindex; ++i) + free (d->follows[i].elems); + free (d->follows); + } + + if (d->trans) + { + for (i = 0; i < d->tralloc; ++i) + { + free (d->trans[i]); + free (d->fails[i]); + } + + free (d->trans - 1); + free (d->fails); + free (d->newlines); + free (d->success); + } + for (dm = d->musts; dm; dm = ndm) { ndm = dm->next; free (dm->must); free (dm); } + + if (d->superset) + dfafree (d->superset); } /* Having found the postfix representation of the regular expression, @@ -3772,13 +3859,13 @@ CAT (p->is==ZERO)? (q->is==ZERO)? (p->is!=ZERO && p->in plus p->left : q->right : q->is!=ZERO) ? q->in plus - p->is##q->left p->right##q->is p->is##q->is : p->right##q->left + p->is##q->left p->right##q->is p->is##q->is : p->right##q->left ZERO - OR longest common longest common (do p->is and substrings common to - leading trailing q->is have same p->in and q->in - (sub)sequence (sub)sequence length and - of p->left of p->right content) ? + OR longest common longest common (do p->is and substrings common + leading trailing to q->is have same p->in and + (sub)sequence (sub)sequence q->in length and content) ? + of p->left of p->right and q->left and q->right p->is : NULL If there's anything else we recognize in the tree, all four sequences get set @@ -3815,64 +3902,32 @@ icatalloc (char *old, char const *new) { char *result; - size_t oldsize = old == NULL ? 0 : strlen (old); - size_t newsize = new == NULL ? 0 : strlen (new); + size_t oldsize; + size_t newsize = strlen (new); if (newsize == 0) return old; + oldsize = strlen (old); result = xrealloc (old, oldsize + newsize + 1); memcpy (result + oldsize, new, newsize + 1); return result; } -static char * -icpyalloc (char const *string) -{ - return icatalloc (NULL, string); -} - -static char *_GL_ATTRIBUTE_PURE -istrstr (char const *lookin, char const *lookfor) -{ - char const *cp; - size_t len; - - len = strlen (lookfor); - for (cp = lookin; *cp != '\0'; ++cp) - if (strncmp (cp, lookfor, len) == 0) - return (char *) cp; - return NULL; -} - static void freelist (char **cpp) { - size_t i; - - if (cpp == NULL) - return; - for (i = 0; cpp[i] != NULL; ++i) - { - free (cpp[i]); - cpp[i] = NULL; - } + while (*cpp) + free (*cpp++); } static char ** enlist (char **cpp, char *new, size_t len) { size_t i, j; - - if (cpp == NULL) - return NULL; - if ((new = icpyalloc (new)) == NULL) - { - freelist (cpp); - return NULL; - } + new = memcpy (xmalloc (len + 1), new, len); new[len] = '\0'; /* Is there already something in the list that's new (or longer)? */ for (i = 0; cpp[i] != NULL; ++i) - if (istrstr (cpp[i], new) != NULL) + if (strstr (cpp[i], new) != NULL) { free (new); return cpp; @@ -3880,7 +3935,7 @@ /* Eliminate any obsoleted strings. */ j = 0; while (cpp[j] != NULL) - if (istrstr (new, cpp[j]) == NULL) + if (strstr (new, cpp[j]) == NULL) ++j; else { @@ -3891,53 +3946,35 @@ cpp[i] = NULL; } /* Add the new string. */ - REALLOC (cpp, i + 2); + cpp = xnrealloc (cpp, i + 2, sizeof *cpp); cpp[i] = new; cpp[i + 1] = NULL; return cpp; } /* Given pointers to two strings, return a pointer to an allocated - list of their distinct common substrings. Return NULL if something - seems wild. */ + list of their distinct common substrings. */ static char ** comsubs (char *left, char const *right) { - char **cpp; + char **cpp = xzalloc (sizeof *cpp); char *lcp; - char *rcp; - size_t i, len; - if (left == NULL || right == NULL) - return NULL; - cpp = malloc (sizeof *cpp); - if (cpp == NULL) - return NULL; - cpp[0] = NULL; for (lcp = left; *lcp != '\0'; ++lcp) { - len = 0; - rcp = strchr (right, *lcp); + size_t len = 0; + char *rcp = strchr (right, *lcp); while (rcp != NULL) { + size_t i; for (i = 1; lcp[i] != '\0' && lcp[i] == rcp[i]; ++i) continue; if (i > len) len = i; rcp = strchr (rcp + 1, *lcp); } - if (len == 0) - continue; - { - char **p = enlist (cpp, lcp, len); - if (p == NULL) - { - freelist (cpp); - cpp = NULL; - break; - } - cpp = p; - } + if (len != 0) + cpp = enlist (cpp, lcp, len); } return cpp; } @@ -3945,16 +3982,8 @@ static char ** addlists (char **old, char **new) { - size_t i; - - if (old == NULL || new == NULL) - return NULL; - for (i = 0; new[i] != NULL; ++i) - { - old = enlist (old, new[i], strlen (new[i])); - if (old == NULL) - break; - } + for (; *new; new++) + old = enlist (old, *new, strlen (*new)); return old; } @@ -3963,125 +3992,134 @@ static char ** inboth (char **left, char **right) { - char **both; - char **temp; + char **both = xzalloc (sizeof *both); size_t lnum, rnum; - if (left == NULL || right == NULL) - return NULL; - both = malloc (sizeof *both); - if (both == NULL) - return NULL; - both[0] = NULL; for (lnum = 0; left[lnum] != NULL; ++lnum) { for (rnum = 0; right[rnum] != NULL; ++rnum) { - temp = comsubs (left[lnum], right[rnum]); - if (temp == NULL) - { - freelist (both); - return NULL; - } + char **temp = comsubs (left[lnum], right[rnum]); both = addlists (both, temp); freelist (temp); free (temp); - if (both == NULL) - return NULL; } } return both; } -typedef struct +typedef struct must must; + +struct must { char **in; char *left; char *right; char *is; -} must; + bool begline; + bool endline; + must *prev; +}; + +static must * +allocmust (must *mp) +{ + must *new_mp = xmalloc (sizeof *new_mp); + new_mp->in = xzalloc (sizeof *new_mp->in); + new_mp->left = xzalloc (2); + new_mp->right = xzalloc (2); + new_mp->is = xzalloc (2); + new_mp->begline = false; + new_mp->endline = false; + new_mp->prev = mp; + return new_mp; +} static void -resetmust (must * mp) +resetmust (must *mp) { + freelist (mp->in); + mp->in[0] = NULL; mp->left[0] = mp->right[0] = mp->is[0] = '\0'; + mp->begline = false; + mp->endline = false; +} + +static void +freemust (must *mp) +{ freelist (mp->in); + free (mp->in); + free (mp->left); + free (mp->right); + free (mp->is); + free (mp); } static void dfamust (struct dfa *d) { - must *musts; - must *mp; - char *result; + must *mp = NULL; + char const *result = ""; size_t ri; size_t i; - int exact; - token t; - static must must0; + bool exact = false; + bool begline = false; + bool endline = false; struct dfamust *dm; - static char empty_string[] = ""; - result = empty_string; - exact = 0; - MALLOC (musts, d->tindex + 1); - mp = musts; - for (i = 0; i <= d->tindex; ++i) - mp[i] = must0; - for (i = 0; i <= d->tindex; ++i) - { - mp[i].in = xmalloc (sizeof *mp[i].in); - mp[i].left = xmalloc (2); - mp[i].right = xmalloc (2); - mp[i].is = xmalloc (2); - mp[i].left[0] = mp[i].right[0] = mp[i].is[0] = '\0'; - mp[i].in[0] = NULL; - } -#ifdef DEBUG - fprintf (stderr, "dfamust:\n"); - for (i = 0; i < d->tindex; ++i) - { - fprintf (stderr, " %zd:", i); - prtok (d->tokens[i]); - } - putc ('\n', stderr); -#endif for (ri = 0; ri < d->tindex; ++ri) { - switch (t = d->tokens[ri]) + token t = d->tokens[ri]; + switch (t) { + case BEGLINE: + mp = allocmust (mp); + mp->begline = true; + break; + case ENDLINE: + mp = allocmust (mp); + mp->endline = true; + break; case LPAREN: case RPAREN: assert (!"neither LPAREN nor RPAREN may appear here"); + case EMPTY: - case BEGLINE: - case ENDLINE: case BEGWORD: case ENDWORD: case LIMWORD: case NOTLIMWORD: case BACKREF: - resetmust (mp); + case ANYCHAR: + case MBCSET: + mp = allocmust (mp); break; + case STAR: case QMARK: - assert (musts < mp); - --mp; resetmust (mp); break; + case OR: - assert (&musts[2] <= mp); { char **new; - must *lmp; - must *rmp; + must *rmp = mp; + must *lmp = mp = mp->prev; size_t j, ln, rn, n; - rmp = --mp; - lmp = --mp; /* Guaranteed to be. Unlikely, but ... */ - if (!STREQ (lmp->is, rmp->is)) - lmp->is[0] = '\0'; + if (STREQ (lmp->is, rmp->is)) + { + lmp->begline &= rmp->begline; + lmp->endline &= rmp->endline; + } + else + { + lmp->is[0] = '\0'; + lmp->begline = false; + lmp->endline = false; + } /* Left side--easy */ i = 0; while (lmp->left[i] != '\0' && lmp->left[i] == rmp->left[i]) @@ -4100,133 +4138,126 @@ lmp->right[j] = lmp->right[(ln - i) + j]; lmp->right[j] = '\0'; new = inboth (lmp->in, rmp->in); - if (new == NULL) - goto done; freelist (lmp->in); free (lmp->in); lmp->in = new; + freemust (rmp); } break; + case PLUS: - assert (musts < mp); - --mp; mp->is[0] = '\0'; break; + case END: - assert (mp == &musts[1]); - for (i = 0; musts[0].in[i] != NULL; ++i) - if (strlen (musts[0].in[i]) > strlen (result)) - result = musts[0].in[i]; - if (STREQ (result, musts[0].is)) - exact = 1; + assert (!mp->prev); + for (i = 0; mp->in[i] != NULL; ++i) + if (strlen (mp->in[i]) > strlen (result)) + result = mp->in[i]; + if (STREQ (result, mp->is)) + { + exact = true; + begline = mp->begline; + endline = mp->endline; + } goto done; + case CAT: - assert (&musts[2] <= mp); { - must *lmp; - must *rmp; + must *rmp = mp; + must *lmp = mp = mp->prev; - rmp = --mp; - lmp = --mp; /* In. Everything in left, plus everything in right, plus concatenation of left's right and right's left. */ lmp->in = addlists (lmp->in, rmp->in); - if (lmp->in == NULL) - goto done; if (lmp->right[0] != '\0' && rmp->left[0] != '\0') { - char *tp; - - tp = icpyalloc (lmp->right); - tp = icatalloc (tp, rmp->left); - lmp->in = enlist (lmp->in, tp, strlen (tp)); + size_t lrlen = strlen (lmp->right); + size_t rllen = strlen (rmp->left); + char *tp = xmalloc (lrlen + rllen); + memcpy (tp, lmp->right, lrlen); + memcpy (tp + lrlen, rmp->left, rllen); + lmp->in = enlist (lmp->in, tp, lrlen + rllen); free (tp); - if (lmp->in == NULL) - goto done; } /* Left-hand */ if (lmp->is[0] != '\0') - { - lmp->left = icatalloc (lmp->left, rmp->left); - if (lmp->left == NULL) - goto done; - } + lmp->left = icatalloc (lmp->left, rmp->left); /* Right-hand */ if (rmp->is[0] == '\0') lmp->right[0] = '\0'; lmp->right = icatalloc (lmp->right, rmp->right); - if (lmp->right == NULL) - goto done; /* Guaranteed to be */ - if (lmp->is[0] != '\0' && rmp->is[0] != '\0') + if ((lmp->is[0] != '\0' || lmp->begline) + && (rmp->is[0] != '\0' || rmp->endline)) { lmp->is = icatalloc (lmp->is, rmp->is); - if (lmp->is == NULL) - goto done; + lmp->endline = rmp->endline; } else - lmp->is[0] = '\0'; + { + lmp->is[0] = '\0'; + lmp->begline = false; + lmp->endline = false; + } + freemust (rmp); } break; + + case '\0': + /* Not on *my* shift. */ + goto done; + default: - if (t < END) + mp = allocmust (mp); + if (CSET <= t) { - assert (!"oops! t >= END"); - } - else if (t == '\0') - { - /* not on *my* shift */ - goto done; - } - else if (t >= CSET || !MBS_SUPPORT || t == ANYCHAR || t == MBCSET) - { - /* easy enough */ - resetmust (mp); - } - else - { - /* plain character */ - resetmust (mp); - mp->is[0] = mp->left[0] = mp->right[0] = t; - mp->is[1] = mp->left[1] = mp->right[1] = '\0'; - mp->in = enlist (mp->in, mp->is, (size_t) 1); - if (mp->in == NULL) - goto done; + /* If T is a singleton, or if case-folding in a unibyte + locale and T's members all case-fold to the same char, + convert T to one of its members. Otherwise, do + nothing further with T. */ + charclass *ccl = &d->charclasses[t - CSET]; + int j; + for (j = 0; j < NOTCHAR; j++) + if (tstbit (j, *ccl)) + break; + if (! (j < NOTCHAR)) + break; + t = j; + while (++j < NOTCHAR) + if (tstbit (j, *ccl) + && ! (case_fold && !d->multibyte + && toupper (j) == toupper (t))) + break; + if (j < NOTCHAR) + break; } + mp->is[0] = mp->left[0] = mp->right[0] + = case_fold && !d->multibyte ? toupper (t) : t; + mp->is[1] = mp->left[1] = mp->right[1] = '\0'; + mp->in = enlist (mp->in, mp->is, 1); break; } -#ifdef DEBUG - fprintf (stderr, " node: %zd:", ri); - prtok (d->tokens[ri]); - fprintf (stderr, "\n in:"); - for (i = 0; mp->in[i]; ++i) - fprintf (stderr, " \"%s\"", mp->in[i]); - fprintf (stderr, "\n is: \"%s\"\n", mp->is); - fprintf (stderr, " left: \"%s\"\n", mp->left); - fprintf (stderr, " right: \"%s\"\n", mp->right); -#endif - ++mp; } done: - if (strlen (result)) + if (*result) { - MALLOC (dm, 1); + dm = xmalloc (sizeof *dm); dm->exact = exact; - dm->must = xmemdup (result, strlen (result) + 1); + dm->begline = begline; + dm->endline = endline; + dm->must = xstrdup (result); dm->next = d->musts; d->musts = dm; } - mp = musts; - for (i = 0; i <= d->tindex; ++i) + + while (mp) { - freelist (mp[i].in); - free (mp[i].in); - free (mp[i].left); - free (mp[i].right); - free (mp[i].is); + must *prev = mp->prev; + freemust (mp); + mp = prev; } - free (mp); } struct dfa * diff -urN gawk-4.1.1/dfa.h gawk-4.1.2/dfa.h --- gawk-4.1.1/dfa.h 2014-03-10 22:39:05.000000000 +0200 +++ gawk-4.1.2/dfa.h 2015-04-27 18:09:07.000000000 +0300 @@ -1,5 +1,5 @@ /* dfa.h - declarations for GNU deterministic regexp compiler - Copyright (C) 1988, 1998, 2007, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 1988, 1998, 2007, 2009-2015 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,13 +19,20 @@ /* Written June, 1988 by Mike Haertel */ #include +#ifdef HAVE_STDBOOL_H +#include +#else +#include "missing_d/gawkbool.h" +#endif /* HAVE_STDBOOL_H */ #include /* Element of a list of strings, at least one of which is known to appear in any R.E. matching the DFA. */ struct dfamust { - int exact; + bool exact; + bool begline; + bool endline; char *must; struct dfamust *next; }; @@ -68,6 +75,15 @@ extern char *dfaexec (struct dfa *d, char const *begin, char *end, int newline, size_t *count, int *backref); +/* Return a superset for D. The superset matches everything that D + matches, along with some other strings (though the latter should be + rare, for efficiency reasons). Return a null pointer if no useful + superset is available. */ +extern struct dfa *dfasuperset (struct dfa const *d) _GL_ATTRIBUTE_PURE; + +/* The DFA is likely to be fast. */ +extern bool dfaisfast (struct dfa const *) _GL_ATTRIBUTE_PURE; + /* Free the storage held by the components of a struct dfa. */ extern void dfafree (struct dfa *); @@ -101,11 +117,3 @@ extern _Noreturn void dfaerror (const char *); extern int using_utf8 (void); - -/* Maximum number of characters that can be the case-folded - counterparts of a single character, not counting the character - itself. This is 1 for towupper, 1 for towlower, and 1 for each - entry in LONESOME_LOWER; see dfa.c. */ -enum { CASE_FOLDED_BUFSIZE = 1 + 1 + 19 }; - -extern int case_folded_counterparts (wchar_t, wchar_t[CASE_FOLDED_BUFSIZE]); diff -urN gawk-4.1.1/doc/ChangeLog gawk-4.1.2/doc/ChangeLog --- gawk-4.1.1/doc/ChangeLog 2014-04-08 20:34:12.000000000 +0300 +++ gawk-4.1.2/doc/ChangeLog 2015-04-29 08:53:25.000000000 +0300 @@ -1,3 +1,580 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + +2015-04-08 Arnold D. Robbins + + * gawktexi.in: Update feature history section. + +2015-04-07 Arnold D. Robbins + + * gawktexi.in: Add a minor note to revisit FPAT pattern for CSV + files at some point. + +2015-04-05 Andrew J. Schorr + + * gawktexi.in: Replace http://gawkextlib.sourceforge.net with + http://sourceforge.net/projects/gawkextlib, since the former link + contains obsolete info. Update the gawkextlib build instructions + to point to http://sourceforge.net/projects/gawkextlib/files for the + current info. + +2015-04-05 Arnold D. Robbins + + * gawktexi.in: Fix a figure caption. Thanks to Antonio Colombo + for pointing this out. + +2015-03-31 Arnold D. Robbins + + * gawktexi.in: Update discussion of calling built-in functions + indirectly. Small additional fix relating to rand(). Thanks + to Antonio Colombo. + +2015-03-24 Arnold D. Robbins + + * gawktexi.in: Minor fixes from Antonio Colombo and new exercise + in chapter 16. + +2015-03-17 Andrew J. Schorr + + * gawktexi.in: Modify inplace.awk to call inplace_end in BEGINFILE + and END instead of in ENDFILE. This way, actions in ENDFILE rules + will be redirected as expected. + +2015-03-17 Arnold D. Robbins + + * gawktexi.in: Turn "positive" into non-negative as appropriate. + Thanks to Nicholas Mills for pointing out + the issue. + +2015-03-01 Arnold D. Robbins + + * gawktexi.in: Change quotes to @dfn for pseudorandom. + A last-minute O'Reilly fix. + +2015-02-27 Arnold D. Robbins + + * gawktexi.in: Update UPDATE-MONTH and copyright year. + Note that "the guide is definitive" quote is really + from "The Restaurant at the End of the Universe". Thanks + to Antonio Colombo for pointing this out. + +2015-02-24 Arnold D. Robbins + + * texinfo.tex: Update to most current version. + * gawktexi.in: Minor edit to match an O'Reilly fix. + Add some FIXMEs to one day use @sup. + +2015-02-22 Arnold D. Robbins + + * gawktexi.in: Change 'div' to 'divisor' in some examples. + This future-proofs against a new function in master. + Thanks to Antonio Giovanni Colombo for the report. + +2015-02-20 Arnold D. Robbins + + * gawktexi.in: More O'Reilly fixes. I think it's done! + +2015-02-19 Arnold D. Robbins + + * gawktexi.in: More O'Reilly fixes. + +2015-02-17 Arnold D. Robbins + + * gawktexi.in: A few minor formatting fixes to sync with O'Reilly + version. + +2015-02-13 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. Through QC1 review. + +2015-02-11 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + +2015-02-10 Arnold D. Robbins + + * gawktexi.in: Minor fixes, O'Reilly fixes. + +2015-02-09 Arnold D. Robbins + + * gawktexi.in: Restore a lost sentence. O'Reilly fixes. + +2015-02-08 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + +2015-02-06 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + +2015-02-04 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + +2015-02-02 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + +2015-02-01 Arnold D. Robbins + + * gawktexi.in: POSIX requirement that function parameters cannot + have the same name as a function is now --posix. + Restore indirectcall example. + + More O'Reilly fixes. + +2015-01-30 Arnold D. Robbins + + * gawktexi.in: Document POSIX requirement that function parameters + cannot have the same name as a function. Fix indirectcall example. + +2015-01-27 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + And still more. Also, fix @code --> @command in a number of places. + +2015-01-26 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + +2015-01-25 Arnold D. Robbins + + * gawktexi.in: Fix a bad URL. + More O'Reilly fixes. + +2015-01-23 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + (Glossary): Many new entries from Antonio Giovanni Colombo. + +2015-01-21 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + Remove obsolete start/end of range indexing comments. + +2015-01-20 Arnold D. Robbins + + * gawktexi.in: O'Reilly fixes. + +2015-01-19 Arnold D. Robbins + + * gawkinet.texi: Fix capitalization in document title. + * gawktexi.in: Here we go again: Starting on more O'Reilly fixes. + +2014-12-26 Antonio Giovanni Colombo + + * gawktexi.in (Glossary): Really sort the items. + +2014-12-24 Arnold D. Robbins + + * gawktexi.in: Add one more paragraph to new foreword. + * gawktexi.in: Fix exponentiation in TeX mode. Thanks to + Marco Curreli by way of Antonio Giovanni Colombo. + + * texinfo.tex: Updated. + +2014-12-12 Arnold D. Robbins + + * gawktexi.in: Minor fix. + Thanks to Teri Price . + +2014-12-10 Arnold D. Robbins + + * gawktexi.in: More minor fixes. + +2014-12-09 Arnold D. Robbins + + * gawktexi.in: More minor fixes. + +2014-12-07 Arnold D. Robbins + + * gawktexi.in: Minor fixes. + +2014-12-06 Arnold D. Robbins + + * gawktexi.in: A minor fix. + +2014-12-05 Arnold D. Robbins + + * gawktexi.in: Various minor fixes and updates. + +2014-11-19 Arnold D. Robbins + + * gawktexi.in: Update that RFC 4180 documents CSV data. + +2014-11-17 Arnold D. Robbins + + * gawktexi.in: Copyedits applied. + +2014-11-02 Arnold D. Robbins + + * gawktexi.in: Comment out that I need an owner for awk.info. + I may have found one or two people. + +2014-10-28 Arnold D. Robbins + + * gawk.1: Clarification that debugger reads stdin. + * gawktexi.in: Ditto, and correctly place the "Braces" entry in + the Glossary. Thanks to Antonio Colombo for that. + + Unrelated: + + * gawktexi.in: Restore use of @sc. Karl fixed makeinfo. :-) + +2014-10-25 Arnold D. Robbins + + * gawktexi.in: Minor typo fixes. + +2014-10-17 Arnold D. Robbins + + * gawktexi.in: Fix date in docbook attribution for new Foreword; + thanks to Antonio Colombo for the catch. Update latest version + of gettext. + +2014-10-15 Arnold D. Robbins + + * gawk.1: Fix default value for AWKLIBPATH. + * gawktexi.in: Revised text for AWKPATH and AWKLIBPATH. + +2014-10-14 Arnold D. Robbins + + * gawktexi.in: Add new Foreword from Mike Brennan. + +2014-10-13 Arnold D. Robbins + + * gawktexi.in: Fix example outputs in chapter 2. + Improve description of SYMTAB. + +2014-10-12 Arnold D. Robbins + + * gawktexi.in: Revise doc for {INT,STR}_CHAIN_MAX. Remove Pat + Rankin from VMS duties (per his request). Add a small TeX fix + for the table in ch 16 for requesting values. + +2014-10-05 Arnold D. Robbins + + * gawktexi.in: Finished changes! + +2014-10-03 Arnold D. Robbins + + * gawktexi.in (EMRED): Renamed from EMISTERED to match original. + Thanks to Warren Toomey at TUHS for access to archives recording + the text. + +2014-10-02 Arnold D. Robbins + + * gawktexi.in: Pretty much done! + +2014-10-01 Arnold D. Robbins + + * gawktexi.in: More fixes after reading through the MS. + +2014-09-30 Arnold D. Robbins + + * gawktexi.in: More fixes after reading through the MS. + +2014-09-29 Arnold D. Robbins + + * gawktexi.in: More fixes after reading through the MS. + And still more fixes. + +2014-09-28 Arnold D. Robbins + + * gawktexi.in: More fixes after reading through the MS. + Document the debugger's "where" command. + +2014-09-27 Arnold D. Robbins + + * gawktexi.in: Lots more fixes after reading through the MS. + +2014-09-23 Arnold D. Robbins + + * gawktexi.in: Rework the documentation of special files in + Chapter 5; some reordering as well as rewriting. + +2014-09-22 Arnold D. Robbins + + * gawktex.in: Continue fixes after reading through the MS. + +2014-09-21 Arnold D. Robbins + + * gawktex.in: Start on fixes after reading through the MS. + +2014-09-18 Arnold D. Robbins + + * gawktexi.in: Fix italics in quotations. Some docbook special + cases. + +2014-09-15 Arnold D. Robbins + + * gawktexi.in: Document that identifiers must use the English + letters. + +2014-09-14 Arnold D. Robbins + + * gawktexi.in: More edits during review, minor addition. + +2014-09-08 Arnold D. Robbins + + * gawktexi.in: Remove text that won't get used. + +2014-09-07 Arnold D. Robbins + + * gawktexi.in: Minor cleanups. + +2014-09-05 Arnold D. Robbins + + * gawktexi.in: Document builtin functions in FUNCTAB and in + PROCINFO["identifiers"]. + * gawk.1: Ditto. + + Unrelated: + + * gawktexi.in: More stuff from reviewer comments. + +2014-09-04 Arnold D. Robbins + + * gawktexi.in: Document that indirect calls now work on built-in + and extension functions. + * gawk.1: Same. + +2014-09-03 Arnold D. Robbins + + * gawktexi.in: Further fixes from reviews and bug reports. + +2014-09-02 Arnold D. Robbins + + * gawktexi.in: Corrections to walkthrough in debugger chapter. + Thanks to David Ward for the problem report. + +2014-09-01 Arnold D. Robbins + + * gawktexi.in: Add index entry for @ - @load, @include, + and indirect function calls. Thanks to "Kenny McKormack" in + comp.lang.awk. + +2014-08-29 Arnold D. Robbins + + * gawktexi.in: Continuing on reviewer comments, and other + bug fixes, miscellanious improvements. + +2014-08-26 Arnold D. Robbins + + * gawktexi.in: Use a different mechanism to exclude + exercises. Remove use of LC_ALL in an example; doesn't seem + to be needed anymore. + +2014-08-25 Arnold D. Robbins + + * gawktexi.in: Exercises are excluded from print edition. + +2014-08-24 Arnold D. Robbins + + * gawktexi.in: Continuing on reviewer comments. + +2014-08-23 Arnold D. Robbins + + * gawktexi.in: Continuing on reviewer comments. + +2014-08-22 Arnold D. Robbins + + * gawktexi.in: Continuing on reviewer comments. + +2014-08-20 Arnold D. Robbins + + * gawktexi.in: Continuing on reviewer comments. + +2014-08-16 Arnold D. Robbins + + * gawktexi.in: Continuing on reviewer comments. + +2014-08-15 Arnold D. Robbins + + * gawktexi.in: Continuing on reviewer comments. + +2014-08-13 Arnold D. Robbins + + * gawktexi.in: Starting on reviewer comments. + Update acknowledgements. + +2014-08-06 Arnold D. Robbins + + * gawktexi.in: Misc minor additions. + +2014-08-03 Arnold D. Robbins + + * gawktexi.in: For sprintf %c document that if value is a valid + wide character, gawk uses the low 8 bits of the value. + + Unrelated: + + * gawktexi.in: Fix doc for API get_record - errcode needs to + be greater than zero. + +2014-07-04 Arnold D. Robbins + + * gawktexi.in (Bracket Expressions): Add a note about how to + match ASCII characters. Thanks to Hermann Peifer. + +2014-06-25 Arnold D. Robbins + + * gawktexi.in: Update permissions on copyright page per + latest maintain.texi. Add GPL to print version of book. + +2014-06-22 Arnold D. Robbins + + * gawktexi.in: Typo fixes and minor corrections. + +2014-06-19 Arnold D. Robbins + + * gawktexi.in: Add thanks to Patrice Dumas and to Karl Berry. + Per request from Hermann Peifer, try to clarify how local variables + in functions are initialized. + +2014-06-18 Arnold D. Robbins + + * gawktexi.in: Split 6.1.4 into subsections. Other minor fixes. + +2014-06-17 Arnold D. Robbins + + * gawktexi.in: Finish adding exerices. + Rework chapter 15 on floating point and MPFR. + Spell check. Fix menues. + +2014-06-16 Arnold D. Robbins + + * gawktexi.in: Start adding exercises. + +2014-06-15 Arnold D. Robbins + + * gawktexi.in: Finish up summaries. Improvements in mystrtonum(). + +2014-06-13 Arnold D. Robbins + + * gawktexi.in: Fix typos from changes of 3 June when macros were + added for filename, data file, etc. Ooops. + +2014-06-12 Arnold D. Robbins + + * gawktexi.in: More "Summary" sections. Through chapter 14. + +2014-06-11 Arnold D. Robbins + + * gawktexi.in: More "Summary" sections. Through chapter 10. + +2014-06-10 Arnold D. Robbins + + * gawktexi.in: Update docbook figure markup. + +2014-06-09 Arnold D. Robbins + + * gawktexi.in: More "Summary" sections. + Judiciously arrange for full xrefs in docbook in a few spots. + +2014-06-08 Arnold D. Robbins + + * gawktexi.in: Start adding "Summary" sections. + +2014-06-03 Arnold D. Robbins + + * gawktexi.in: Restore macros for file name vs. filename etc. + Go through @if... and @ifnot... and fix them up too. Other misc. + cleanup. + +2014-05-29 Arnold D. Robbins + + * gawktexi.in: Remove some obsolete bits, fix up some other + minor stuff. + +2014-05-27 Arnold D. Robbins + + * gawktexi.in: Edits through the end! + +2014-05-25 Arnold D. Robbins + + * gawktexi.in: Edits through Appendix A. + * gawktexi.in: Tweak nested lists for docbook. + +2014-05-24 Arnold D. Robbins + + * gawktexi.in (Staying current): New section. + +2014-05-22 Andrew J. Schorr + + * gawktexi.in (BEGINFILE/ENDFILE): Update doc for getline - any + redirected form is allowed inside BEGINFILE/ENDFILE. + +2014-05-21 Arnold D. Robbins + + * gawktexi.in: Add comments for where we need full xrefs in + docbook. + +2014-05-20 Arnold D. Robbins + + * gawktexi.in: Misc improvements for docbook, consistency + in table and figure captions. + +2014-05-17 Arnold D. Robbins + + * gawktexi.in: Edits through Chapter 16. + +2014-05-16 Arnold D. Robbins + + * gawktexi.in: Edits through Chapter 14. + +2014-05-15 Arnold D. Robbins + + * gawktexi.in: Fix displays for docbook, edits through Chapter 11. + +2014-05-14 Arnold D. Robbins + + * gawktexi.in: Fix real preface for docbook. + +2014-05-13 Arnold D. Robbins + + * gawktexi.in: Complete formatting for FOR_PRINT and not FOR_PRINT. + +2014-05-07 Arnold D. Robbins + + * gawktexi.in: Docbook edits for preface and parts. + Document AWKBUFSIZE. + +2014-05-05 Arnold D. Robbins + + * gawktexi.in: Editing progress. Through Chapter 9. + +2014-05-05 Michal Jaegermann + + * array-elements.fig: Fix subscripts to be aligned + horizontally. Regenerate the other files. + +2014-05-02 Arnold D. Robbins + + * gawktexi.in: Editing progress. Through Chapter 8. + * array-elements.eps, array-elements.fig, array-elements.pdf, + array-elements.png array-elements.txt: New files. + * Makefile.am (EXTRA_DIST): Add them. + +2014-04-30 Arnold D. Robbins + + * gawktexi.in: Editing progress. Through Chapter 5. + * gawktexi.in: Editing progress. Through Chapter 6 and into + Chapter 7. + +2014-04-29 Arnold D. Robbins + + * gawktexi.in: Editing progress. Through Chapter 3. + +2014-04-24 Arnold D. Robbins + + * gawktexi.in: Start on revisions. + +2014-04-17 Arnold D. Robbins + + * gawk.1: Remove the bit about single character programs overflowing + the parse stack. It doesn't seem to be true anymore. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff -urN gawk-4.1.1/doc/Makefile.am gawk-4.1.2/doc/Makefile.am --- gawk-4.1.1/doc/Makefile.am 2014-01-20 21:52:59.000000000 +0200 +++ gawk-4.1.2/doc/Makefile.am 2015-04-28 16:49:46.000000000 +0300 @@ -36,6 +36,8 @@ api-figure2.png api-figure2.txt \ api-figure3.eps api-figure3.fig api-figure3.pdf \ api-figure3.png api-figure3.txt \ + array-elements.eps array-elements.fig array-elements.pdf \ + array-elements.png array-elements.txt \ gawktexi.in sidebar.awk \ general-program.eps general-program.fig general-program.pdf \ general-program.png general-program.txt \ diff -urN gawk-4.1.1/doc/Makefile.in gawk-4.1.2/doc/Makefile.in --- gawk-4.1.1/doc/Makefile.in 2014-04-08 19:12:38.000000000 +0300 +++ gawk-4.1.2/doc/Makefile.in 2015-04-29 08:35:51.000000000 +0300 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -38,7 +38,17 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -102,8 +112,6 @@ build_triplet = @build@ host_triplet = @host@ subdir = doc -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/mkinstalldirs texinfo.tex ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \ @@ -118,6 +126,7 @@ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -213,6 +222,8 @@ NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ + ChangeLog texinfo.tex DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -276,6 +287,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOCKET_LIBS = @SOCKET_LIBS@ @@ -350,6 +362,8 @@ api-figure2.png api-figure2.txt \ api-figure3.eps api-figure3.fig api-figure3.pdf \ api-figure3.png api-figure3.txt \ + array-elements.eps array-elements.fig array-elements.pdf \ + array-elements.png array-elements.txt \ gawktexi.in sidebar.awk \ general-program.eps general-program.fig general-program.pdf \ general-program.png general-program.txt \ @@ -391,7 +405,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -449,13 +462,9 @@ $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $(@:.html=.htp) $<; \ then \ - rm -rf $@; \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ + rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ - exit 1; \ + rm -rf $(@:.html=.htp); exit 1; \ fi $(srcdir)/gawk.info: gawk.texi gawk.dvi: gawk.texi @@ -857,6 +866,8 @@ uninstall-info-am uninstall-man uninstall-man1 \ uninstall-pdf-am uninstall-ps-am +.PRECIOUS: Makefile + # Uncomment the following definition of AWKCARD if your troff can produce # Postscript but still has troubles with macros from 'colors'. As this diff -urN gawk-4.1.1/doc/array-elements.eps gawk-4.1.2/doc/array-elements.eps --- gawk-4.1.1/doc/array-elements.eps 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/doc/array-elements.eps 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,158 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: array-elements.fig +%%Creator: fig2dev Version 3.2 Patchlevel 5d +%%CreationDate: Sun May 4 22:46:26 2014 +%%BoundingBox: 0 0 379 76 +%Magnification: 1.0000 +%%EndComments +%%BeginProlog +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +/pageheader { +save +newpath 0 76 moveto 0 0 lineto 379 0 lineto 379 76 lineto closepath clip newpath +-203.3 199.4 translate +1 -1 scale +$F2psBegin +10 setmiterlimit +0 slj 0 slc + 0.06299 0.06299 sc +} bind def +/pagefooter { +$F2psEnd +restore +} bind def +%%EndProlog +pageheader +% +% Fig objects follow +% +% +% here starts figure with depth 50 +% Polyline +0 slj +0 slc +7.500 slw +n 4455 1980 m 4455 2700 l 4455 2655 l + 4455 2700 l gs col0 s gr +% Polyline +n 6075 1980 m + 6075 2700 l gs col0 s gr +% Polyline +n 7425 1980 m + 7425 2700 l gs col0 s gr +/Courier-Bold ff 180.00 scf sf +3735 2340 m +gs 1 -1 sc (8) col0 sh gr +/Courier-Bold ff 180.00 scf sf +5175 2340 m +gs 1 -1 sc ("foo") col0 sh gr +/Courier-Bold ff 180.00 scf sf +6795 2340 m +gs 1 -1 sc ("") col0 sh gr +/Courier-Bold ff 180.00 scf sf +7875 2340 m +gs 1 -1 sc (30) col0 sh gr +/Times-Roman ff 180.00 scf sf +3735 3150 m +gs 1 -1 sc (0) col0 sh gr +/Times-Roman ff 180.00 scf sf +5175 3150 m +gs 1 -1 sc (1) col0 sh gr +/Times-Roman ff 180.00 scf sf +6795 3150 m +gs 1 -1 sc (2) col0 sh gr +/Times-Roman ff 180.00 scf sf +7875 3150 m +gs 1 -1 sc (3) col0 sh gr +/Times-Roman ff 180.00 scf sf +8730 2340 m +gs 1 -1 sc (Value) col0 sh gr +/Times-Roman ff 180.00 scf sf +8730 3150 m +gs 1 -1 sc (Index) col0 sh gr +% here ends figure; +% +% here starts figure with depth 40 +% Polyline +0 slj +0 slc +7.500 slw +n 3240 1980 m 8415 1980 l 8415 2700 l 3240 2700 l + cp gs col0 s gr +% here ends figure; +pagefooter +showpage +%%Trailer +%EOF diff -urN gawk-4.1.1/doc/array-elements.fig gawk-4.1.2/doc/array-elements.fig --- gawk-4.1.1/doc/array-elements.fig 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/doc/array-elements.fig 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,27 @@ +#FIG 3.2 Produced by xfig version 3.2.5b +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 2 0 1 0 7 40 -1 -1 0.000 0 0 -1 0 0 5 + 3240 1980 8415 1980 8415 2700 3240 2700 3240 1980 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 4 + 4455 1980 4455 2700 4455 2655 4455 2700 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 6075 1980 6075 2700 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 7425 1980 7425 2700 +4 0 0 50 -1 14 12 0.0000 4 120 120 3735 2340 8\001 +4 0 0 50 -1 14 12 0.0000 4 120 600 5175 2340 "foo"\001 +4 0 0 50 -1 14 12 0.0000 4 60 240 6795 2340 ""\001 +4 0 0 50 -1 14 12 0.0000 4 120 240 7875 2340 30\001 +4 0 0 50 -1 0 12 0.0000 4 135 105 3735 3150 0\001 +4 0 0 50 -1 0 12 0.0000 4 135 105 5175 3150 1\001 +4 0 0 50 -1 0 12 0.0000 4 135 105 6795 3150 2\001 +4 0 0 50 -1 0 12 0.0000 4 135 105 7875 3150 3\001 +4 0 0 50 -1 0 12 0.0000 4 135 480 8730 2340 Value\001 +4 0 0 50 -1 0 12 0.0000 4 135 465 8730 3150 Index\001 diff -urN gawk-4.1.1/doc/array-elements.txt gawk-4.1.2/doc/array-elements.txt --- gawk-4.1.1/doc/array-elements.txt 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/doc/array-elements.txt 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,4 @@ ++---------+---------+--------+---------+ +| 8 | "foo" | "" | 30 | @r{Value} ++---------+---------+--------+---------+ + 0 1 2 3 @r{Index} diff -urN gawk-4.1.1/doc/awkcard.in gawk-4.1.2/doc/awkcard.in --- gawk-4.1.1/doc/awkcard.in 2014-04-08 19:19:22.000000000 +0300 +++ gawk-4.1.2/doc/awkcard.in 2015-04-28 16:49:46.000000000 +0300 @@ -1,7 +1,7 @@ .\" AWK Reference Card --- Arnold Robbins, arnold@skeeve.com .\" .\" Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, -.\" 2003, 2004, 2005, 2007, 2009, 2010, 2011, 2012, 2013, 2014 +.\" 2003, 2004, 2005, 2007, 2009, 2010, 2011, 2012, 2013, 2014, 2015 .\" Free Software Foundation, Inc. .\" .\" Permission is granted to make and distribute verbatim copies of @@ -1939,7 +1939,7 @@ .ES .nf \*(CDHost: \*(FCftp.gnu.org\*(FR -File: \*(FC/gnu/gawk/gawk-4.1.1.tar.gz\fP +File: \*(FC/gnu/gawk/gawk-4.1.2.tar.gz\fP .in +.2i .fi GNU \*(AK (\*(GK). There may be a later version. diff -urN gawk-4.1.1/doc/gawk.1 gawk-4.1.2/doc/gawk.1 --- gawk-4.1.1/doc/gawk.1 2014-04-03 21:55:27.000000000 +0300 +++ gawk-4.1.2/doc/gawk.1 2015-04-28 16:49:46.000000000 +0300 @@ -13,7 +13,7 @@ . if \w'\(rq' .ds rq "\(rq . \} .\} -.TH GAWK 1 "Mar 08 2014" "Free Software Foundation" "Utility Commands" +.TH GAWK 1 "Aug 03 2014" "Free Software Foundation" "Utility Commands" .SH NAME gawk \- pattern scanning and processing language .SH SYNOPSIS @@ -231,7 +231,8 @@ .PD \fB\-\^\-debug\fR[\fB=\fIfile\fR] Enable debugging of \*(AK programs. -By default, the debugger reads commands interactively from the terminal. +By default, the debugger reads commands interactively from the keyboard +(standard input). The optional .IR file argument specifies a file with a list @@ -626,7 +627,7 @@ the .B \-l option. If this variable does not exist, the default path is -\fB".:/usr/local/lib/gawk"\fR. +\fB"/usr/local/lib/gawk"\fR. (The actual directory may vary, depending upon how .I gawk was built and installed.) @@ -1126,9 +1127,14 @@ \fB"array"\fR The identifier is an array. .TP +\fB"builtin"\fR +The identifier is a built-in function. +.TP \fB"extension"\fR The identifier is an extension function loaded via -.BR @load . +.B @load +or +.BR \-l . .TP \fB"scalar"\fR The identifier is a scalar. @@ -3264,7 +3270,7 @@ .RS .ft B .nf -function myfunc() +function myfunc() { print "myfunc called" \&.\|.\|. @@ -3278,6 +3284,8 @@ .fi .ft R .RE +As of version 4.1.2, this works with user-defined functions, +built-in functions, and extension functions. .PP If .B \-\^\-lint @@ -3906,11 +3914,6 @@ .B \-F option is not necessary given the command line variable assignment feature; it remains only for backwards compatibility. -.PP -Syntactically invalid single character programs tend to overflow -the parse stack, generating a rather unhelpful message. Such programs -are surprisingly difficult to diagnose in the completely general case, -and the effort to do so really is not worth it. .SH SEE ALSO .IR egrep (1), .IR sed (1), diff -urN gawk-4.1.1/doc/gawkinet.texi gawk-4.1.2/doc/gawkinet.texi --- gawk-4.1.1/doc/gawkinet.texi 2014-02-20 20:49:15.000000000 +0200 +++ gawk-4.1.2/doc/gawkinet.texi 2015-04-27 18:09:07.000000000 +0300 @@ -60,7 +60,7 @@ @c fit into that chapter, thus this separate document. At over 50 @c pages, I think this is the right decision. ADR. -@set TITLE TCP/IP Internetworking With @command{gawk} +@set TITLE TCP/IP Internetworking with @command{gawk} @set EDITION 1.3 @set UPDATE-MONTH December, 2010 @c gawk versions: diff -urN gawk-4.1.1/doc/gawktexi.in gawk-4.1.2/doc/gawktexi.in --- gawk-4.1.1/doc/gawktexi.in 2014-04-08 19:12:01.000000000 +0300 +++ gawk-4.1.2/doc/gawktexi.in 2015-04-28 16:49:46.000000000 +0300 @@ -19,6 +19,7 @@ \gdef\xrefprintnodename#1{``#1''} @end tex @end ifset + @ifclear FOR_PRINT @c With early 2014 texinfo.tex, restore PDF links and colors @tex @@ -28,6 +29,16 @@ @end tex @end ifclear +@ifnotdocbook +@set BULLET @bullet{} +@set MINUS @minus{} +@end ifnotdocbook + +@ifdocbook +@set BULLET +@set MINUS +@end ifdocbook + @set xref-automatic-section-title @c The following information should be updated here only! @@ -35,13 +46,17 @@ @c applies to and all the info about who's publishing this edition @c These apply across the board. -@set UPDATE-MONTH April, 2014 +@set UPDATE-MONTH April, 2015 @set VERSION 4.1 -@set PATCHLEVEL 1 - -@set FSF +@set PATCHLEVEL 2 +@set GAWKINETTITLE TCP/IP Internetworking with @command{gawk} +@ifset FOR_PRINT +@set TITLE Effective awk Programming +@end ifset +@ifclear FOR_PRINT @set TITLE GAWK: Effective AWK Programming +@end ifclear @set SUBTITLE A User's Guide for GNU Awk @set EDITION 4.1 @@ -53,6 +68,7 @@ @set SUBSECTION subsection @set DARKCORNER @inmargin{@image{lflashlight,1cm}, @image{rflashlight,1cm}} @set COMMONEXT (c.e.) +@set PAGE page @end iftex @ifinfo @set DOCUMENT Info file @@ -62,6 +78,7 @@ @set SUBSECTION node @set DARKCORNER (d.c.) @set COMMONEXT (c.e.) +@set PAGE screen @end ifinfo @ifhtml @set DOCUMENT Web page @@ -71,6 +88,7 @@ @set SUBSECTION subsection @set DARKCORNER (d.c.) @set COMMONEXT (c.e.) +@set PAGE screen @end ifhtml @ifdocbook @set DOCUMENT book @@ -80,6 +98,7 @@ @set SUBSECTION subsection @set DARKCORNER (d.c.) @set COMMONEXT (c.e.) +@set PAGE page @end ifdocbook @ifxml @set DOCUMENT book @@ -89,6 +108,7 @@ @set SUBSECTION subsection @set DARKCORNER (d.c.) @set COMMONEXT (c.e.) +@set PAGE page @end ifxml @ifplaintext @set DOCUMENT book @@ -98,16 +118,38 @@ @set SUBSECTION subsection @set DARKCORNER (d.c.) @set COMMONEXT (c.e.) +@set PAGE page @end ifplaintext +@ifdocbook +@c empty on purpose +@set PART1 +@set PART2 +@set PART3 +@set PART4 +@end ifdocbook + +@ifnotdocbook +@set PART1 Part I:@* +@set PART2 Part II:@* +@set PART3 Part III:@* +@set PART4 Part IV:@* +@end ifnotdocbook + @c some special symbols @iftex @set LEQ @math{@leq} @set PI @math{@pi} @end iftex +@ifdocbook +@set LEQ @inlineraw{docbook, ≤} +@set PI @inlineraw{docbook, &pgr;} +@end ifdocbook @ifnottex +@ifnotdocbook @set LEQ <= @set PI @i{pi} +@end ifnotdocbook @end ifnottex @ifnottex @@ -124,6 +166,46 @@ @end macro @end ifdocbook +@c hack for docbook, where comma shouldn't always follow an @ref{} +@ifdocbook +@macro DBREF{text} +@ref{\text\} +@end macro +@macro DBXREF{text} +@xref{\text\} +@end macro +@macro DBPXREF{text} +@pxref{\text\} +@end macro +@end ifdocbook + +@ifnotdocbook +@macro DBREF{text} +@ref{\text\}, +@end macro +@macro DBXREF{text} +@xref{\text\}, +@end macro +@macro DBPXREF{text} +@pxref{\text\}, +@end macro +@end ifnotdocbook + +@ifclear FOR_PRINT +@set FN file name +@set FFN File name +@set DF data file +@set DDF Data file +@set PVERSION version +@end ifclear +@ifset FOR_PRINT +@set FN filename +@set FFN Filename +@set DF datafile +@set DDF Datafile +@set PVERSION version +@end ifset + @c For HTML, spell out email addresses, to avoid problems with @c address harvesters for spammers. @ifhtml @@ -198,6 +280,10 @@ @copying @docbook + +“To boldly go where no man has gone before” is a +Registered Trademark of Paramount Pictures Corporation. + Published by: Free Software Foundation @@ -208,13 +294,13 @@ Email: gnu@@gnu.org URL: http://www.gnu.org/ -Copyright © 1989, 1991, 1992, 1993, 1996–2005, 2007, 2009–2014 +Copyright © 1989, 1991, 1992, 1993, 1996–2005, 2007, 2009–2015 Free Software Foundation, Inc. All Rights Reserved. @end docbook @ifnotdocbook -Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2014 @* +Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2015 @* Free Software Foundation, Inc. @end ifnotdocbook @sp 2 @@ -226,19 +312,24 @@ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the -Invariant Sections being ``GNU General Public License'', the Front-Cover -texts being (a) (see below), and with the Back-Cover Texts being (b) -(see below). A copy of the license is included in the section entitled +Invariant Sections being ``GNU General Public License'', with the +Front-Cover Texts being ``A GNU Manual'', and with the Back-Cover Texts +as in (a) below. +@ifclear FOR_PRINT +A copy of the license is included in the section entitled ``GNU Free Documentation License''. +@end ifclear +@ifset FOR_PRINT +A copy of the license +may be found on the Internet at +@uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html, +the GNU Project's website}. +@end ifset @enumerate a @item -``A GNU Manual'' - -@item -``You have the freedom to -copy and modify this GNU manual. Buying copies from the FSF -supports it in developing GNU and promoting software freedom.'' +The FSF's Back-Cover Text is: ``You have the freedom to +copy and modify this GNU manual.'' @end enumerate @end copying @@ -298,15 +389,13 @@ @page @w{ } @sp 9 -@center @i{To Miriam, for making me complete.} +@center @i{To my parents, for their love, and for the wonderful example they set for me.} @sp 1 -@center @i{To Chana, for the joy you bring us.} +@center @i{To my wife, Miriam, for making me complete. +Thank you for building your life together with me.} @sp 1 -@center @i{To Rivka, for the exponential increase.} +@center @i{To our children, Chana, Rivka, Nachum, and Malka, for enrichening our lives in innumerable ways.} @sp 1 -@center @i{To Nachum, for the added dimension.} -@sp 1 -@center @i{To Malka, for the new beginning.} @w{ } @page @w{ } @@ -316,13 +405,12 @@ @docbook - -To Miriam, for making me complete. -To Chana, for the joy you bring us. -To Rivka, for the exponential increase. -To Nachum, for the added dimension. -To Malka, for the new beginning. - +To my parents, for their love, and for the wonderful +example they set for me. +To my wife Miriam, for making me complete. +Thank you for building your life together with me. +To our children Chana, Rivka, Nachum and Malka, +for enrichening our lives in innumerable ways. @end docbook @@ -351,8 +439,9 @@ @end ifnottex @menu -* Foreword:: Some nice words about this +* Foreword3:: Some nice words about this @value{DOCUMENT}. +* Foreword4:: More nice words. * Preface:: What this @value{DOCUMENT} is about; brief history and acknowledgments. * Getting Started:: A basic introduction to using @@ -379,7 +468,7 @@ @command{gawk}. * Internationalization:: Getting @command{gawk} to speak your language. -* Debugger:: The @code{gawk} debugger. +* Debugger:: The @command{gawk} debugger. * Arbitrary Precision Arithmetic:: Arbitrary precision arithmetic with @command{gawk}. * Dynamic Extensions:: Adding new built-in functions to @@ -414,8 +503,8 @@ includes command-line syntax. * One-shot:: Running a short throwaway @command{awk} program. -* Read Terminal:: Using no input files (input from - terminal instead). +* Read Terminal:: Using no input files (input from the + keyboard instead). * Long:: Putting permanent @command{awk} programs in files. * Executable Scripts:: Making self-contained @command{awk} @@ -437,6 +526,7 @@ * Other Features:: Other Features of @command{awk}. * When:: When to use @command{gawk} and when to use other things. +* Intro Summary:: Summary of the introduction. * Command Line:: How to run @command{awk}. * Options:: Command-line options and their meanings. @@ -458,16 +548,21 @@ program. * Obsolete:: Obsolete Options and/or features. * Undocumented:: Undocumented Options and Features. +* Invoking Summary:: Invocation summary. * Regexp Usage:: How to Use Regular Expressions. * Escape Sequences:: How to write nonprinting characters. * Regexp Operators:: Regular Expression Operators. * Bracket Expressions:: What can go between @samp{[...]}. -* GNU Regexp Operators:: Operators specific to GNU software. -* Case-sensitivity:: How to do case-insensitive matching. * Leftmost Longest:: How much text matches. * Computed Regexps:: Using Dynamic Regexps. +* GNU Regexp Operators:: Operators specific to GNU software. +* Case-sensitivity:: How to do case-insensitive matching. +* Regexp Summary:: Regular expressions summary. * Records:: Controlling how data is split into records. +* awk split records:: How standard @command{awk} splits + records. +* gawk split records:: How @command{gawk} splits records. * Fields:: An introduction to fields. * Nonconstant Fields:: Nonconstant Field Numbers. * Changing Fields:: Changing the Contents of a Field. @@ -477,8 +572,8 @@ * Regexp Field Splitting:: Using regexps as the field separator. * Single Character Fields:: Making each character a separate field. -* Command Line Field Separator:: Setting @code{FS} from the - command-line. +* Command Line Field Separator:: Setting @code{FS} from the command + line. * Full Line Fields:: Making the full line be a single field. * Field Splitting Summary:: Some final points and a summary table. @@ -504,8 +599,10 @@ @code{getline}. * Getline Summary:: Summary of @code{getline} Variants. * Read Timeout:: Reading input with a timeout. -* Command line directories:: What happens if you put a directory on +* Command-line directories:: What happens if you put a directory on the command line. +* Input Summary:: Input summary. +* Input Exercises:: Exercises. * Print:: The @code{print} statement. * Print Examples:: Simple examples of @code{print} statements. @@ -520,15 +617,19 @@ * Printf Examples:: Several examples. * Redirection:: How to redirect output to multiple files and pipes. +* Special FD:: Special files for I/O. * Special Files:: File name interpretation in @command{gawk}. @command{gawk} allows access to inherited file descriptors. -* Special FD:: Special files for I/O. +* Other Inherited Files:: Accessing other open files with + @command{gawk}. * Special Network:: Special files for network communications. * Special Caveats:: Things to watch out for. * Close Files And Pipes:: Closing Input and Output Files and Pipes. +* Output Summary:: Output summary. +* Output Exercises:: Exercises. * Values:: Constants, Variables, and Regular Expressions. * Constants:: String, numeric and regexp constants. @@ -539,11 +640,14 @@ * Variables:: Variables give names to values for later use. * Using Variables:: Using variables in your programs. -* Assignment Options:: Setting variables on the command-line +* Assignment Options:: Setting variables on the command line and a summary of command-line syntax. This is an advanced method of input. * Conversion:: The conversion of strings to numbers and vice versa. +* Strings And Numbers:: How @command{awk} Converts Between + Strings And Numbers. +* Locale influences conversions:: How the locale may affect conversions. * All Operators:: @command{gawk}'s operators. * Arithmetic Ops:: Arithmetic operations (@samp{+}, @samp{-}, etc.) @@ -571,6 +675,7 @@ * Function Calls:: A function call is an expression. * Precedence:: How various operators nest. * Locales:: How the locale affects things. +* Expressions Summary:: Expressions summary. * Pattern Overview:: What goes into a pattern. * Regexp Patterns:: Using regexps as patterns. * Expression Patterns:: Any expression can be used as a @@ -610,13 +715,14 @@ record. * Nextfile Statement:: Stop processing the current file. * Exit Statement:: Stop execution of @command{awk}. -* Built-in Variables:: Summarizes the built-in variables. +* Built-in Variables:: Summarizes the predefined variables. * User-modified:: Built-in variables that you change to control @command{awk}. * Auto-set:: Built-in variables where @command{awk} gives you information. * ARGC and ARGV:: Ways to use @code{ARGC} and @code{ARGV}. +* Pattern Action Summary:: Patterns and Actions summary. * Array Basics:: The basics of arrays. * Array Intro:: Introduction to Arrays * Reference to Elements:: How to examine one element of an @@ -629,16 +735,17 @@ elements. * Controlling Scanning:: Controlling the order in which arrays are scanned. -* Delete:: The @code{delete} statement removes an - element from an array. * Numeric Array Subscripts:: How to use numbers as subscripts in @command{awk}. * Uninitialized Subscripts:: Using Uninitialized variables as subscripts. +* Delete:: The @code{delete} statement removes an + element from an array. * Multidimensional:: Emulating multidimensional arrays in @command{awk}. * Multiscanning:: Scanning multidimensional arrays. * Arrays of Arrays:: True multidimensional arrays. +* Arrays Summary:: Summary of arrays. * Built-in:: Summarizes the built-in functions. * Calling Built-in:: How to call built-in functions. * Numeric Functions:: Functions that work with numbers, @@ -673,6 +780,7 @@ runtime. * Indirect Calls:: Choosing the function to call at runtime. +* Functions Summary:: Summary of functions. * Library Names:: How to best name private global variables in library functions. * General Functions:: Functions that are of general use. @@ -691,6 +799,8 @@ * Getlocaltime Function:: A function to get formatted times. * Readfile Function:: A function to read an entire file at once. +* Shell Quoting:: A function to quote strings for the + shell. * Data File Management:: Functions for managing command-line data files. * Filetrans Function:: A function for handling data file @@ -707,6 +817,8 @@ * Group Functions:: Functions for getting group information. * Walking Arrays:: A function to walk arrays of arrays. +* Library Functions Summary:: Summary of library functions. +* Library Exercises:: Exercises. * Running Examples:: How to run these examples. * Clones:: Clones of common utilities. * Cut Program:: The @command{cut} utility. @@ -736,6 +848,8 @@ * Anagram Program:: Finding anagrams from a dictionary. * Signature Program:: People do amazing things with too much time on their hands. +* Programs Summary:: Summary of programs. +* Programs Exercises:: Exercises. * Nondecimal Data:: Allowing nondecimal input data. * Array Sorting:: Facilities for controlling array traversal and sorting arrays. @@ -747,8 +861,9 @@ * TCP/IP Networking:: Using @command{gawk} for network programming. * Profiling:: Profiling your @command{awk} programs. +* Advanced Features Summary:: Summary of advanced features. * I18N and L10N:: Internationalization and Localization. -* Explaining gettext:: How GNU @code{gettext} works. +* Explaining gettext:: How GNU @command{gettext} works. * Programmer i18n:: Features for the programmer. * Translator i18n:: Features for the translator. * String Extraction:: Extracting marked strings. @@ -758,6 +873,7 @@ * I18N Example:: A simple i18n example. * Gawk I18N:: @command{gawk} is also internationalized. +* I18N Summary:: Summary of I18N stuff. * Debugging:: Introduction to @command{gawk} debugger. * Debugging Concepts:: Debugging in General. @@ -776,38 +892,29 @@ * Miscellaneous Debugger Commands:: Miscellaneous Commands. * Readline Support:: Readline support. * Limitations:: Limitations and future plans. -* General Arithmetic:: An introduction to computer - arithmetic. -* Floating Point Issues:: Stuff to know about floating-point - numbers. -* String Conversion Precision:: The String Value Can Lie. -* Unexpected Results:: Floating Point Numbers Are Not - Abstract Numbers. -* POSIX Floating Point Problems:: Standards Versus Existing Practice. -* Integer Programming:: Effective integer programming. -* Floating-point Programming:: Effective Floating-point Programming. -* Floating-point Representation:: Binary floating-point representation. -* Floating-point Context:: Floating-point context. -* Rounding Mode:: Floating-point rounding mode. -* Gawk and MPFR:: How @command{gawk} provides - arbitrary-precision arithmetic. -* Arbitrary Precision Floats:: Arbitrary Precision Floating-point - Arithmetic with @command{gawk}. -* Setting Precision:: Setting the working precision. -* Setting Rounding Mode:: Setting the rounding mode. -* Floating-point Constants:: Representing floating-point constants. -* Changing Precision:: Changing the precision of a number. -* Exact Arithmetic:: Exact arithmetic with floating-point - numbers. +* Debugging Summary:: Debugging summary. +* Computer Arithmetic:: A quick intro to computer math. +* Math Definitions:: Defining terms used. +* MPFR features:: The MPFR features in @command{gawk}. +* FP Math Caution:: Things to know. +* Inexactness of computations:: Floating point math is not exact. +* Inexact representation:: Numbers are not exactly represented. +* Comparing FP Values:: How to compare floating point values. +* Errors accumulate:: Errors get bigger as they go. +* Getting Accuracy:: Getting more accuracy takes some work. +* Try To Round:: Add digits and round. +* Setting precision:: How to set the precision. +* Setting the rounding mode:: How to set the rounding mode. * Arbitrary Precision Integers:: Arbitrary Precision Integer Arithmetic with @command{gawk}. +* POSIX Floating Point Problems:: Standards Versus Existing Practice. +* Floating point summary:: Summary of floating point discussion. * Extension Intro:: What is an extension. * Plugin License:: A note about licensing. * Extension Mechanism Outline:: An outline of how it works. * Extension API Description:: A full description of the API. * Extension API Functions Introduction:: Introduction to the API functions. * General Data Types:: The data types. -* Requesting Values:: How to get a value. * Memory Allocation Functions:: Functions for allocating memory. * Constructor Functions:: Functions for creating values. * Registration Functions:: Functions to register things with @@ -820,6 +927,7 @@ * Two-way processors:: Registering a two-way processor. * Printing Messages:: Functions for printing messages. * Updating @code{ERRNO}:: Functions for updating @code{ERRNO}. +* Requesting Values:: How to get a value. * Accessing Parameters:: Functions for accessing parameters. * Symbol Table Access:: Functions for accessing global variables. @@ -843,7 +951,7 @@ * Internal File Ops:: The code for internal file operations. * Using Internal File Ops:: How to use an external extension. * Extension Samples:: The sample extensions that ship with - @code{gawk}. + @command{gawk}. * Extension Sample File Functions:: The file functions sample. * Extension Sample Fnmatch:: An interface to @code{fnmatch()}. * Extension Sample Fork:: An interface to @code{fork()} and @@ -858,10 +966,12 @@ processor. * Extension Sample Read write array:: Serializing an array to a file. * Extension Sample Readfile:: Reading an entire file into a string. -* Extension Sample API Tests:: Tests for the API. * Extension Sample Time:: An interface to @code{gettimeofday()} and @code{sleep()}. +* Extension Sample API Tests:: Tests for the API. * gawkextlib:: The @code{gawkextlib} project. +* Extension summary:: Extension summary. +* Extension Exercises:: Exercises. * V7/SVR3.1:: The major changes between V7 and System V Release 3.1. * SVR4:: Minor changes between System V @@ -878,6 +988,7 @@ ranges. * Contributors:: The major contributors to @command{gawk}. +* History summary:: History summary. * Gawk Distribution:: What is in the @command{gawk} distribution. * Getting:: How to get the distribution. @@ -916,6 +1027,7 @@ * Bugs:: Reporting Problems and Bugs. * Other Versions:: Other freely available @command{awk} implementations. +* Installation summary:: Summary of installation. * Compatibility Mode:: How to disable certain @command{gawk} extensions. * Additions:: Making Additions To @command{gawk}. @@ -924,8 +1036,8 @@ @command{gawk}. * New Ports:: Porting @command{gawk} to a new operating system. -* Derived Files:: Why derived files are kept in the - @command{git} repository. +* Derived Files:: Why derived files are kept in the Git + repository. * Future Extensions:: New features that may be implemented one day. * Implementation Limitations:: Some limitations of the @@ -936,6 +1048,7 @@ * Extension Other Design Decisions:: Some other design decisions. * Extension Future Growth:: Some room for future growth. * Old Extension Mechanism:: Some compatibility for old extensions. +* Notes summary:: Summary of implementation notes. * Basic High Level:: The high level view. * Basic Data Typing:: A very quick intro to data types. @end detailmenu @@ -943,22 +1056,36 @@ @c dedication for Info file @ifinfo -@center To Miriam, for making me complete. +To my parents, for their love, and for the wonderful +example they set for me. @sp 1 -@center To Chana, for the joy you bring us. +To my wife Miriam, for making me complete. +Thank you for building your life together with me. @sp 1 -@center To Rivka, for the exponential increase. -@sp 1 -@center To Nachum, for the added dimension. -@sp 1 -@center To Malka, for the new beginning. +To our children Chana, Rivka, Nachum and Malka, +for enrichening our lives in innumerable ways. @end ifinfo @summarycontents @contents -@node Foreword -@unnumbered Foreword +@node Foreword3 +@unnumbered Foreword to the Third Edition + +@c This bit is post-processed by a script which turns the chapter +@c tag into a preface tag, and moves this stuff to before the title. +@c Bleah. +@docbook + + + Michael + Brennan + + Author of mawk + + March 2001 + +@end docbook Arnold Robbins and I are good friends. We were introduced @c 11 years ago @@ -968,21 +1095,23 @@ earlier. I was working at a new job and noticed an unplugged Unix computer sitting in the corner. No one knew how to use it, and neither did I. However, -a couple of days later it was running, and +a couple of days later, it was running, and I was @code{root} and the one-and-only user. That day, I began the transition from statistician to Unix programmer. On one of many trips to the library or bookstore in search of -books on Unix, I found the gray AWK book, a.k.a.@: Aho, Kernighan and -Weinberger, @cite{The AWK Programming Language}, Addison-Wesley, -1988. AWK's simple programming paradigm---find a pattern in the +books on Unix, I found the gray AWK book, a.k.a.@: +Alfred V.@: Aho, Brian W.@: Kernighan, and +Peter J.@: Weinberger's @cite{The AWK Programming Language} (Addison-Wesley, +1988). @command{awk}'s simple programming paradigm---find a pattern in the input and then perform an action---often reduced complex or tedious -data manipulations to few lines of code. I was excited to try my +data manipulations to a few lines of code. I was excited to try my hand at programming in AWK. Alas, the @command{awk} on my computer was a limited version of the -language described in the AWK book. I discovered that my computer -had ``old @command{awk}'' and the AWK book described ``new @command{awk}.'' +language described in the gray book. I discovered that my computer +had ``old @command{awk}'' and the book described +``new @command{awk}.'' I learned that this was typical; the old version refused to step aside or relinquish its name. If a system had a new @command{awk}, it was invariably called @command{nawk}, and few systems had it. @@ -1000,7 +1129,7 @@ plugged into a network. So, oblivious to the existence of @command{gawk} and the Unix community in general, and desiring a new @command{awk}, I wrote my own, called @command{mawk}. -Before I was finished I knew about @command{gawk}, +Before I was finished, I knew about @command{gawk}, but it was too late to stop, so I eventually posted to a @code{comp.sources} newsgroup. @@ -1009,7 +1138,7 @@ himself. He suggested we share design and algorithms and attached a draft of the POSIX standard so that I could update @command{mawk} to support language extensions added -after publication of the AWK book. +after publication of @cite{The AWK Programming Language}. Frankly, if our roles had been reversed, I would not have been so open and we probably would @@ -1028,7 +1157,7 @@ On the other hand, the novice AWK programmer can study a wealth of practical programs that emphasize the power of AWK's basic idioms: -data driven control-flow, pattern matching with regular expressions, +data-driven control flow, pattern matching with regular expressions, and associative arrays. Those looking for something new can try out @command{gawk}'s interface to network protocols via special @file{/inet} files. @@ -1036,7 +1165,7 @@ The programs in this book make clear that an AWK program is typically much smaller and faster to develop than a counterpart written in C. -Consequently, there is often a payoff to prototype an +Consequently, there is often a payoff to prototyping an algorithm or design in AWK to get it running quickly and expose problems early. Often, the interpreted performance is adequate and the AWK prototype becomes the product. @@ -1084,12 +1213,69 @@ using AWK programs, and developing @command{gawk}, into this book. If you use AWK or want to learn how, then read this book. +@ifnotdocbook +@cindex Brennan, Michael +@display +Michael Brennan +Author of @command{mawk} +March 2001 +@end display +@end ifnotdocbook + +@node Foreword4 +@unnumbered Foreword to the Fourth Edition + +@c This bit is post-processed by a script which turns the chapter +@c tag into a preface tag, and moves this stuff to before the title. +@c Bleah. +@docbook + + + Michael + Brennan + + Author of mawk + + October 2014 + +@end docbook + +Some things don't change. Thirteen years ago I wrote: +``If you use AWK or want to learn how, then read this book.'' +True then, and still true today. + +Learning to use a programming language is about more than mastering the +syntax. One needs to acquire an understanding of how to use the +features of the language to solve practical programming problems. +A focus of this book is many examples that show how to use AWK. + +Some things do change. Our computers are much faster and have more memory. +Consequently, speed and storage inefficiencies of a high-level language +matter less. Prototyping in AWK and then rewriting in C for performance +reasons happens less, because more often the prototype is fast enough. + +Of course, there are computing operations that are best done in C or C++. +With @command{gawk} 4.1 and later, you do not have to choose between writing +your program in AWK or in C/C++. You can write most of your +program in AWK and the aspects that require C/C++ capabilities can be written +in C/C++, and then the pieces glued together when the @command{gawk} module loads +the C/C++ module as a dynamic plug-in. +@c Chapter 16 +@ref{Dynamic Extensions}, +has all the +details, and, as expected, many examples to help you learn the ins and outs. + +I enjoy programming in AWK and had fun (re)reading this book. +I think you will too. + +@ifnotdocbook @cindex Brennan, Michael @display Michael Brennan Author of @command{mawk} -March, 2001 +October 2014 @end display +@end ifnotdocbook @node Preface @unnumbered Preface @@ -1098,30 +1284,39 @@ @c @c 12/2000: Chuck wants the preface & intro combined. -Several kinds of tasks occur repeatedly -when working with text files. -You might want to extract certain lines and discard the rest. -Or you may need to make changes wherever certain patterns appear, -but leave the rest of the file alone. -Writing single-use programs for these tasks in languages such as C, C++, -or Java is time-consuming and inconvenient. -Such jobs are often easier with @command{awk}. -The @command{awk} utility interprets a special-purpose programming language -that makes it easy to handle simple data-reformatting jobs. +@c This bit is post-processed by a script which turns the chapter +@c tag into a preface tag, and moves this stuff to before the title. +@c Bleah. +@docbook + + + Arnold + Robbins + Nof Ayalon + Israel + + February 2015 + +@end docbook + +Several kinds of tasks occur repeatedly when working with text files. +You might want to extract certain lines and discard the rest. Or you +may need to make changes wherever certain patterns appear, but leave the +rest of the file alone. Such jobs are often easy with @command{awk}. +The @command{awk} utility interprets a special-purpose programming +language that makes it easy to handle simple data-reformatting jobs. -@cindex Brian Kernighan's @command{awk} The GNU implementation of @command{awk} is called @command{gawk}; if you -invoke it with the proper options or environment variables -(@pxref{Options}), it is fully -compatible with -the POSIX@footnote{The 2008 POSIX standard is online at -@url{http://www.opengroup.org/onlinepubs/9699919799/}.} +invoke it with the proper options or environment variables, +it is fully compatible with +the POSIX@footnote{The 2008 POSIX standard is accessible online at +@w{@url{http://www.opengroup.org/onlinepubs/9699919799/}.}} specification of the @command{awk} language and with the Unix version of @command{awk} maintained by Brian Kernighan. This means that all properly written @command{awk} programs should work with @command{gawk}. -Thus, we usually don't distinguish between @command{gawk} and other +So most of the time, we don't distinguish between @command{gawk} and other @command{awk} implementations. @cindex @command{awk}, POSIX and, See Also POSIX @command{awk} @@ -1130,9 +1325,9 @@ @cindex @command{gawk}, @command{awk} and @cindex @command{awk}, @command{gawk} and @cindex @command{awk}, uses for -Using @command{awk} allows you to: +Using @command{awk} you can: -@itemize @bullet +@itemize @value{BULLET} @item Manage small, personal databases @@ -1143,7 +1338,7 @@ Validate data @item -Produce indexes and perform other document preparation tasks +Produce indexes and perform other document-preparation tasks @item Experiment with algorithms that you can adapt later to other computer @@ -1157,7 +1352,7 @@ @command{gawk} provides facilities that make it easy to: -@itemize @bullet +@itemize @value{BULLET} @item Extract bits and pieces of data for processing @@ -1166,11 +1361,17 @@ @item Perform simple network communications + +@item +Profile and debug @command{awk} programs + +@item +Extend the language with functions written in C or C++ @end itemize This @value{DOCUMENT} teaches you about the @command{awk} language and how you can use it effectively. You should already be familiar with basic -system commands, such as @command{cat} and @command{ls},@footnote{These commands +system commands, such as @command{cat} and @command{ls},@footnote{These utilities are available on POSIX-compliant systems, as well as on traditional Unix-based systems. If you are using some other operating system, you still need to be familiar with the ideas of I/O redirection and pipes.} as well as basic shell @@ -1181,15 +1382,20 @@ different computing environments. This @value{DOCUMENT}, while describing the @command{awk} language in general, also describes the particular implementation of @command{awk} called @command{gawk} (which stands for -``GNU awk''). @command{gawk} runs on a broad range of Unix systems, -ranging from Intel@registeredsymbol{}-architecture PC-based computers -up through large-scale systems, -such as Crays. @command{gawk} has also been ported to Mac OS X, -Microsoft Windows (all versions) and OS/2 PCs, -and VMS. -(Some other, obsolete systems to which @command{gawk} was once ported -are no longer supported and the code for those systems -has been removed.) +``GNU @command{awk}''). @command{gawk} runs on a broad range of Unix systems, +ranging from Intel-architecture PC-based computers +up through large-scale systems. +@command{gawk} has also been ported to Mac OS X, +Microsoft Windows +@ifset FOR_PRINT +(all versions), +@end ifset +@ifclear FOR_PRINT +(all versions) and OS/2 PCs, +@end ifclear +and OpenVMS.@footnote{Some other, obsolete systems to which @command{gawk} +was once ported are no longer supported and the code for those systems +has been removed.} @menu * History:: The history of @command{gawk} and @@ -1208,7 +1414,7 @@ @unnumberedsec History of @command{awk} and @command{gawk} @cindex recipe for a programming language @cindex programming language, recipe for -@sidebar Recipe For A Programming Language +@sidebar Recipe for a Programming Language @multitable {2 parts} {1 part @code{egrep}} {1 part @code{snobol}} @item @tab 1 part @code{egrep} @tab 1 part @code{snobol} @@ -1227,7 +1433,7 @@ @cindex Kernighan, Brian @cindex @command{awk}, history of The name @command{awk} comes from the initials of its designers: Alfred V.@: -Aho, Peter J.@: Weinberger and Brian W.@: Kernighan. The original version of +Aho, Peter J.@: Weinberger, and Brian W.@: Kernighan. The original version of @command{awk} was written in 1977 at AT&T Bell Laboratories. In 1985, a new version made the programming language more powerful, introducing user-defined functions, multiple input @@ -1238,36 +1444,36 @@ up the behavior in some of the ``dark corners'' of the language. The specification for @command{awk} in the POSIX Command Language and Utilities standard further clarified the language. -Both the @command{gawk} designers and the original Bell Laboratories @command{awk} -designers provided feedback for the POSIX specification. +Both the @command{gawk} designers and the original @command{awk} designers at Bell Laboratories +provided feedback for the POSIX specification. @cindex Rubin, Paul @cindex Fenlason, Jay @cindex Trueman, David -Paul Rubin wrote the GNU implementation, @command{gawk}, in 1986. +Paul Rubin wrote @command{gawk} in 1986. Jay Fenlason completed it, with advice from Richard Stallman. John Woods contributed parts of the code as well. In 1988 and 1989, David Trueman, with help from me, thoroughly reworked @command{gawk} for compatibility with the newer @command{awk}. Circa 1994, I became the primary maintainer. Current development focuses on bug fixes, -performance improvements, standards compliance, and occasionally, new features. +performance improvements, standards compliance, and, occasionally, new features. -In May of 1997, J@"urgen Kahrs felt the need for network access +In May 1997, J@"urgen Kahrs felt the need for network access from @command{awk}, and with a little help from me, set about adding features to do this for @command{gawk}. At that time, he also wrote the bulk of -@cite{TCP/IP Internetworking with @command{gawk}} +@cite{@value{GAWKINETTITLE}} (a separate document, available as part of the @command{gawk} distribution). His code finally became part of the main @command{gawk} distribution -with @command{gawk} version 3.1. +with @command{gawk} @value{PVERSION} 3.1. John Haque rewrote the @command{gawk} internals, in the process providing an @command{awk}-level debugger. This version became available as -@command{gawk} version 4.0, in 2011. +@command{gawk} @value{PVERSION} 4.0 in 2011. -@xref{Contributors}, -for a complete list of those who made important contributions to @command{gawk}. +@DBXREF{Contributors} +for a full list of those who have made important contributions to @command{gawk}. @node Names @unnumberedsec A Rose by Any Other Name @@ -1276,29 +1482,27 @@ The @command{awk} language has evolved over the years. Full details are provided in @ref{Language History}. The language described in this @value{DOCUMENT} -is often referred to as ``new @command{awk}'' (@command{nawk}). +is often referred to as ``new @command{awk}.'' +By analogy, the original version of @command{awk} is +referred to as ``old @command{awk}.'' -@cindex @command{awk}, versions of -Because of this, there are systems with multiple -versions of @command{awk}. -Some systems have an @command{awk} utility that implements the -original version of the @command{awk} language and a @command{nawk} utility -for the new version. -Others have an @command{oawk} version for the ``old @command{awk}'' -language and plain @command{awk} for the new one. Still others only -have one version, which is usually the new one.@footnote{Often, these systems -use @command{gawk} for their @command{awk} implementation!} - -@cindex @command{nawk} utility -@cindex @command{oawk} utility -All in all, this makes it difficult for you to know which version of -@command{awk} you should run when writing your programs. The best advice -we can give here is to check your local documentation. Look for @command{awk}, -@command{oawk}, and @command{nawk}, as well as for @command{gawk}. -It is likely that you already -have some version of new @command{awk} on your system, which is what -you should use when running your programs. (Of course, if you're reading -this @value{DOCUMENT}, chances are good that you have @command{gawk}!) +On most current systems, when you run the @command{awk} utility +you get some version of new @command{awk}.@footnote{Only +Solaris systems still use an old @command{awk} for the +default @command{awk} utility. A more modern @command{awk} lives in +@file{/usr/xpg6/bin} on these systems.} If your system's standard +@command{awk} is the old one, you will see something like this +if you try the test program: + +@example +$ @kbd{awk 1 /dev/null} +@error{} awk: syntax error near line 1 +@error{} awk: bailing out near line 1 +@end example + +@noindent +In this case, you should find a version of new @command{awk}, +or just install @command{gawk}! Throughout this @value{DOCUMENT}, whenever we refer to a language feature that should be available in any complete implementation of POSIX @command{awk}, @@ -1326,56 +1530,79 @@ as defined in the POSIX standard. It does so in the context of the @command{gawk} implementation. While doing so, it also attempts to describe important differences between @command{gawk} -and other @command{awk} implementations.@footnote{All such differences +and other @command{awk} +@ifclear FOR_PRINT +implementations.@footnote{All such differences appear in the index under the entry ``differences in @command{awk} and @command{gawk}.''} -Finally, any @command{gawk} features that are not in -the POSIX standard for @command{awk} are noted. +@end ifclear +@ifset FOR_PRINT +implementations. +@end ifset +Finally, it notes any @command{gawk} features that are not in +the POSIX standard for @command{awk}. @ifnotinfo This @value{DOCUMENT} has the difficult task of being both a tutorial and a reference. If you are a novice, feel free to skip over details that seem too complex. You should also ignore the many cross-references; they are for the -expert user and for the online Info and HTML versions of the document. +expert user and for the Info and +@uref{http://www.gnu.org/software/gawk/manual/, HTML} +versions of the @value{DOCUMENT}. @end ifnotinfo There are sidebars scattered throughout the @value{DOCUMENT}. They add a more complete explanation of points that are relevant, but not likely to be of interest on first reading. +@ifclear FOR_PRINT All appear in the index, under the heading ``sidebar.'' +@end ifclear Most of the time, the examples use complete @command{awk} programs. Some of the more advanced sections show only the part of the @command{awk} -program that illustrates the concept currently being described. +program that illustrates the concept being described. -While this @value{DOCUMENT} is aimed principally at people who have not been +Although this @value{DOCUMENT} is aimed principally at people who have not been exposed to @command{awk}, there is a lot of information here that even the @command{awk} expert should find useful. In particular, the description of POSIX @command{awk} and the example programs in -@ref{Library Functions}, and in +@ref{Library Functions}, and +@ifnotdocbook +in +@end ifnotdocbook @ref{Sample Programs}, should be of interest. This @value{DOCUMENT} is split into several parts, as follows: -Part I describes the @command{awk} language and @command{gawk} program in detail. +@c FULLXREF ON + +@itemize @value{BULLET} +@item +Part I describes the @command{awk} language and the @command{gawk} program in detail. It starts with the basics, and continues through all of the features of @command{awk}. It contains the following chapters: +@c nested +@itemize @value{MINUS} +@item @ref{Getting Started}, provides the essentials you need to know to begin using @command{awk}. +@item @ref{Invoking Gawk}, describes how to run @command{gawk}, the meaning of its command-line options, and how it finds @command{awk} program source files. +@item @ref{Regexp}, introduces regular expressions in general, and in particular the flavors supported by POSIX @command{awk} and @command{gawk}. +@item @ref{Reading Files}, describes how @command{awk} reads your data. It introduces the concepts of records and fields, as well @@ -1383,75 +1610,106 @@ I/O redirection is first described here. Network I/O is also briefly introduced here. +@item @ref{Printing}, describes how @command{awk} programs can produce output with @code{print} and @code{printf}. +@item @ref{Expressions}, describes expressions, which are the basic building blocks for getting most things done in a program. +@item @ref{Patterns and Actions}, describes how to write patterns for matching records, actions for -doing something when a record is matched, and the built-in variables +doing something when a record is matched, and the predefined variables @command{awk} and @command{gawk} use. +@item @ref{Arrays}, -covers @command{awk}'s one-and-only data structure: associative arrays. -Deleting array elements and whole arrays is also described, as well as -sorting arrays in @command{gawk}. It also describes how @command{gawk} -provides arrays of arrays. +covers @command{awk}'s one-and-only data structure: the associative array. +Deleting array elements and whole arrays is described, as well as +sorting arrays in @command{gawk}. The @value{CHAPTER} also describes how +@command{gawk} provides arrays of arrays. +@item @ref{Functions}, -describes the built-in functions @command{awk} and -@command{gawk} provide, as well as how to define -your own functions. +describes the built-in functions @command{awk} and @command{gawk} provide, +as well as how to define your own functions. It also discusses how +@command{gawk} lets you call functions indirectly. +@end itemize +@item Part II shows how to use @command{awk} and @command{gawk} for problem solving. There is lots of code here for you to read and learn from. -It contains the following chapters: +This part contains the following chapters: -@ref{Library Functions}, which provides a number of functions meant to +@c nested +@itemize @value{MINUS} +@item +@ref{Library Functions}, provides a number of functions meant to be used from main @command{awk} programs. +@item @ref{Sample Programs}, -which provides many sample @command{awk} programs. +provides many sample @command{awk} programs. +@end itemize Reading these two chapters allows you to see @command{awk} solving real problems. +@item Part III focuses on features specific to @command{gawk}. It contains the following chapters: +@c nested +@itemize @value{MINUS} +@item @ref{Advanced Features}, -describes a number of @command{gawk}-specific advanced features. +describes a number of advanced features. Of particular note -are the abilities to have two-way communications with another process, +are the abilities to control the order of array traversal, +have two-way communications with another process, perform TCP/IP networking, and profile your @command{awk} programs. +@item @ref{Internationalization}, -describes special features in @command{gawk} for translating program +describes special features for translating program messages into different languages at runtime. -@ref{Debugger}, describes the @command{awk} debugger. +@item +@ref{Debugger}, describes the @command{gawk} debugger. +@item @ref{Arbitrary Precision Arithmetic}, -describes advanced arithmetic facilities provided by -@command{gawk}. +describes advanced arithmetic facilities. +@item @ref{Dynamic Extensions}, describes how to add new variables and functions to @command{gawk} by writing extensions in C or C++. +@end itemize +@item +@ifclear FOR_PRINT Part IV provides the appendices, the Glossary, and two licenses that cover the @command{gawk} source code and this @value{DOCUMENT}, respectively. It contains the following appendices: +@end ifclear +@ifset FOR_PRINT +Part IV provides the following appendices, +including the GNU General Public License: +@end ifset +@itemize @value{MINUS} +@item @ref{Language History}, describes how the @command{awk} language has evolved since -its first release to present. It also describes how @command{gawk} +its first release to the present. It also describes how @command{gawk} has acquired features over time. +@item @ref{Installation}, describes how to get @command{gawk}, how to compile it on POSIX-compatible systems, @@ -1460,23 +1718,76 @@ in @command{gawk} and where to get other freely available @command{awk} implementations. +@ifset FOR_PRINT +@item +@ref{Copying}, +presents the license that covers the @command{gawk} source code. +@end ifset + +@ifclear FOR_PRINT +@item @ref{Notes}, describes how to disable @command{gawk}'s extensions, as well as how to contribute new code to @command{gawk}, and some possible future directions for @command{gawk} development. +@item @ref{Basic Concepts}, provides some very cursory background material for those who are completely unfamiliar with computer programming. -The @ref{Glossary}, defines most, if not all, the significant terms used -throughout the book. If you find terms that you aren't familiar with, +The @ref{Glossary}, defines most, if not all, of the significant terms used +throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, try looking them up here. +@item @ref{Copying}, and @ref{GNU Free Documentation License}, present the licenses that cover the @command{gawk} source code and this @value{DOCUMENT}, respectively. +@end ifclear +@end itemize +@end itemize + +@ifset FOR_PRINT +The version of this @value{DOCUMENT} distributed with @command{gawk} +contains additional appendices and other end material. +To save space, we have omitted them from the +printed edition. You may find them online, as follows: + +@itemize @value{BULLET} +@item +@uref{http://www.gnu.org/software/gawk/manual/html_node/Notes.html, +The appendix on implementation notes} +describes how to disable @command{gawk}'s extensions, how to contribute +new code to @command{gawk}, where to find information on some possible +future directions for @command{gawk} development, and the design decisions +behind the extension API. + +@item +@uref{http://www.gnu.org/software/gawk/manual/html_node/Basic-Concepts.html, +The appendix on basic concepts} +provides some very cursory background material for those who +are completely unfamiliar with computer programming. + +@item +@uref{http://www.gnu.org/software/gawk/manual/html_node/Glossary.html, +The Glossary} +defines most, if not all, of the significant terms used +throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with, +try looking them up here. + +@item +@uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html, +The GNU FDL} +is the license that covers this @value{DOCUMENT}. +@end itemize + +Some of the chapters have exercise sections; these have also been +omitted from the print edition but are available online. +@end ifset + +@c FULLXREF OFF @node Conventions @unnumberedsec Typographical Conventions @@ -1494,12 +1805,19 @@ This @value{SECTION} briefly documents the typographical conventions used in Texinfo. @end ifinfo -Examples you would type at the command-line are preceded by the common +Examples you would type at the command line are preceded by the common shell primary and secondary prompts, @samp{$} and @samp{>}. Input that you type is shown @kbd{like this}. +@c 8/2014: @print{} is stripped from the texi to make docbook. +@ifclear FOR_PRINT Output from the command is preceded by the glyph ``@print{}''. This typically represents the command's standard output. -Error messages, and other output on the command's standard error, are preceded +@end ifclear +@ifset FOR_PRINT +Output from the command, usually its standard output, appears +@code{like this}. +@end ifset +Error messages and other output on the command's standard error are preceded by the glyph ``@error{}''. For example: @example @@ -1510,15 +1828,23 @@ @end example @ifnotinfo -In the text, command names appear in @code{this font}, while code segments +In the text, almost anything related to programming, such as +command names, +variable and function names, and string, numeric and regexp constants +appear in @code{this font}. Code fragments appear in the same font and quoted, @samp{like this}. +Things that are replaced by the user or programmer +appear in @var{this font}. Options look like this: @option{-f}. +@value{FFN}s are indicated like this: @file{/path/to/ourfile}. +@ifclear FOR_PRINT Some things are emphasized @emph{like this}, and if a point needs to be made -strongly, it is done @strong{like this}. The first occurrence of +strongly, it is done @strong{like this}. +@end ifclear +The first occurrence of a new term is usually its @dfn{definition} and appears in the same font as the previous occurrence of ``definition'' in this sentence. -Finally, file names are indicated like this: @file{/path/to/ourfile}. @end ifnotinfo Characters that you type at the keyboard look @kbd{like this}. In particular, @@ -1526,13 +1852,27 @@ characters that you type by holding down both the @kbd{CONTROL} key and another key, at the same time. For example, a @kbd{Ctrl-d} is typed by first pressing and holding the @kbd{CONTROL} key, next -pressing the @kbd{d} key and finally releasing both keys. +pressing the @kbd{d} key, and finally releasing both keys. + +For the sake of brevity, throughout this @value{DOCUMENT}, we refer to +Brian Kernighan's version of @command{awk} as ``BWK @command{awk}.'' +(@DBXREF{Other Versions} for information on his and other versions.) + +@ifset FOR_PRINT +@quotation NOTE +Notes of interest look like this. +@end quotation + +@quotation CAUTION +Cautionary or warning notes look like this. +@end quotation +@end ifset @c fakenode --- for prepinfo @unnumberedsubsec Dark Corners @cindex Kernighan, Brian @quotation -@i{Dark corners are basically fractal --- no matter how much +@i{Dark corners are basically fractal---no matter how much you illuminate, there's always a smaller but darker one.} @author Brian Kernighan @end quotation @@ -1548,18 +1888,25 @@ @value{DARKCORNER} @end iftex @ifnottex -``(d.c.)''. +``(d.c.).'' @end ifnottex +@ifclear FOR_PRINT They also appear in the index under the heading ``dark corner.'' +@end ifclear -As noted by the opening quote, though, any -coverage of dark corners -is, by definition, incomplete. +But, as noted by the opening quote, any coverage of dark +corners is by definition incomplete. +@cindex c.e., See common extensions Extensions to the standard @command{awk} language that are supported by more than one @command{awk} implementation are marked +@ifclear FOR_PRINT ``@value{COMMONEXT},'' and listed in the index under ``common extensions'' and ``extensions, common.'' +@end ifclear +@ifset FOR_PRINT +``@value{COMMONEXT}'' for ``common extension.'' +@end ifset @node Manual History @unnumberedsec The GNU Project and This Book @@ -1576,25 +1923,28 @@ @cindex GPL (General Public License) @cindex General Public License, See GPL @cindex documentation, online -The GNU@footnote{GNU stands for ``GNU's not Unix.''} +The GNU@footnote{GNU stands for ``GNU's Not Unix.''} Project is an ongoing effort on the part of the Free Software Foundation to create a complete, freely distributable, POSIX-compliant computing environment. -The FSF uses the ``GNU General Public License'' (GPL) to ensure that -their software's -source code is always available to the end user. A -copy of the GPL is included +The FSF uses the GNU General Public License (GPL) to ensure that +its software's +source code is always available to the end user. +@ifclear FOR_PRINT +A copy of the GPL is included @ifnotinfo in this @value{DOCUMENT} @end ifnotinfo for your reference (@pxref{Copying}). +@end ifclear The GPL applies to the C language source code for @command{gawk}. To find out more about the FSF and the GNU Project online, see @uref{http://www.gnu.org, the GNU Project's home page}. This @value{DOCUMENT} may also be read from -@uref{http://www.gnu.org/software/gawk/manual/, their web site}. +@uref{http://www.gnu.org/software/gawk/manual/, GNU's website}. +@ifclear FOR_PRINT A shell, an editor (Emacs), highly portable optimizing C, C++, and Objective-C compilers, a symbolic debugger and dozens of large and small utilities (such as @command{gawk}), have all been completed and are @@ -1605,113 +1955,84 @@ @cindex Linux @cindex GNU/Linux @cindex operating systems, BSD-based -@cindex Alpha (DEC) Until the GNU operating system is more fully developed, you should consider using GNU/Linux, a freely distributable, Unix-like operating -system for Intel@registeredsymbol{}, +system for Intel, Power Architecture, Sun SPARC, IBM S/390, and other systems.@footnote{The terminology ``GNU/Linux'' is explained in the @ref{Glossary}.} Many GNU/Linux distributions are available for download from the Internet. - -(There are numerous other freely available, Unix-like operating systems -based on the -Berkeley Software Distribution, and some of them use recent versions -of @command{gawk} for their versions of @command{awk}. -@uref{http://www.netbsd.org, NetBSD}, -@uref{http://www.freebsd.org, FreeBSD}, -and -@uref{http://www.openbsd.org, OpenBSD} -are three of the most popular ones, but there -are others.) +@end ifclear @ifnotinfo The @value{DOCUMENT} you are reading is actually free---at least, the information in it is free to anyone. The machine-readable -source code for the @value{DOCUMENT} comes with @command{gawk}; anyone -may take this @value{DOCUMENT} to a copying machine and make as many -copies as they like. (Take a moment to check the Free Documentation +source code for the @value{DOCUMENT} comes with @command{gawk}. +@ifclear FOR_PRINT +(Take a moment to check the Free Documentation License in @ref{GNU Free Documentation License}.) +@end ifclear @end ifnotinfo -@ignore -@cindex Close, Diane -The @value{DOCUMENT} itself has gone through several previous, -preliminary editions. -Paul Rubin wrote the very first draft of @cite{The GAWK Manual}; -it was around 40 pages in size. -Diane Close and Richard Stallman improved it, yielding the -version which I started working with in the fall of 1988. -It was around 90 pages long and barely described the original, ``old'' -version of @command{awk}. After substantial revision, the first version of -the @cite{The GAWK Manual} to be released was Edition 0.11 Beta in -October of 1989. The manual then underwent more substantial revision -for Edition 0.13 of December 1991. -David Trueman, Pat Rankin and Michal Jaegermann contributed sections -of the manual for Edition 0.13. -That edition was published by the -FSF as a bound book early in 1992. Since then there were several -minor revisions, notably Edition 0.14 of November 1992 that was published -by the FSF in January of 1993 and Edition 0.16 of August 1993. - -Edition 1.0 of @cite{GAWK: The GNU Awk User's Guide} represented a significant re-working -of @cite{The GAWK Manual}, with much additional material. -The FSF and I agreed that I was now the primary author. -@c I also felt that the manual needed a more descriptive title. - -In January 1996, SSC published Edition 1.0 under the title @cite{Effective AWK Programming}. -In February 1997, they published Edition 1.0.3 which had minor changes -as a ``second edition.'' -In 1999, the FSF published this same version as Edition 2 -of @cite{GAWK: The GNU Awk User's Guide}. - -Edition @value{EDITION} maintains the basic structure of Edition 1.0, -but with significant additional material, reflecting the host of new features -in @command{gawk} version @value{VERSION}. -Of particular note is -@ref{Array Sorting}, -@ref{Bitwise Functions}, -@ref{Internationalization}, -@ref{Advanced Features}, -and -@ref{Dynamic Extensions}. -@end ignore - @cindex Close, Diane -The @value{DOCUMENT} itself has gone through a number of previous editions. +The @value{DOCUMENT} itself has gone through multiple previous editions. Paul Rubin wrote the very first draft of @cite{The GAWK Manual}; -it was around 40 pages in size. +it was around 40 pages long. Diane Close and Richard Stallman improved it, yielding a version that was -around 90 pages long and barely described the original, ``old'' +around 90 pages and barely described the original, ``old'' version of @command{awk}. I started working with that version in the fall of 1988. As work on it progressed, the FSF published several preliminary versions (numbered 0.@var{x}). -In 1996, Edition 1.0 was released with @command{gawk} 3.0.0. +In 1996, edition 1.0 was released with @command{gawk} 3.0.0. The FSF published the first two editions under the title @cite{The GNU Awk User's Guide}. +@ifset FOR_PRINT +SSC published two editions of the @value{DOCUMENT} under the +title @cite{Effective awk Programming}, and O'Reilly published +the third edition in 2001. +@end ifset This edition maintains the basic structure of the previous editions. -For Edition 4.0, the content has been thoroughly reviewed -and updated. All references to @command{gawk} versions prior to 4.0 have been -removed. -Of significant note for this edition was @ref{Debugger}. +For FSF edition 4.0, the content was thoroughly reviewed and updated. All +references to @command{gawk} versions prior to 4.0 were removed. +Of significant note for that edition was the addition of @ref{Debugger}. -For edition @value{EDITION}, the content has been reorganized into parts, +For FSF edition +@ifclear FOR_PRINT +@value{EDITION}, +@end ifclear +@ifset FOR_PRINT +@value{EDITION} +(the fourth edition as published by O'Reilly), +@end ifset +the content has been reorganized into parts, and the major new additions are @ref{Arbitrary Precision Arithmetic}, and @ref{Dynamic Extensions}. -@cite{@value{TITLE}} will undoubtedly continue to evolve. -An electronic version -comes with the @command{gawk} distribution from the FSF. -If you find an error in this @value{DOCUMENT}, please report it! -@xref{Bugs}, for information on submitting -problem reports electronically. +This @value{DOCUMENT} will undoubtedly continue to evolve. If you +find an error in the @value{DOCUMENT}, please report it! @DBXREF{Bugs} +for information on submitting problem reports electronically. + +@ifset FOR_PRINT +@c fakenode --- for prepinfo +@unnumberedsec How to Stay Current + +You may have a newer version of @command{gawk} than the +one described here. To find out what has changed, +you should first look at the @file{NEWS} file in the @command{gawk} +distribution, which provides a high-level summary of the changes in +each release. + +You can then look at the @uref{http://www.gnu.org/software/gawk/manual/, +online version} of this @value{DOCUMENT} to read about any new features. +@end ifset +@ifclear FOR_PRINT @node How To Contribute @unnumberedsec How to Contribute @@ -1728,20 +2049,26 @@ contributed code: the archive did not grow and the domain went unused for several years. -Fortunately, late in 2008, a volunteer took on the task of setting up -an @command{awk}-related web site---@uref{http://awk.info}---and did a very +Late in 2008, a volunteer took on the task of setting up +an @command{awk}-related website---@uref{http://awk.info}---and did a very nice job. If you have written an interesting @command{awk} program, or have written a @command{gawk} extension that you would like to share with the rest of the world, please see @uref{http://awk.info/?contribute} for how to -contribute it to the web site. +contribute it to the website. + +@ignore +As of this writing, this website is in search of a maintainer; please +contact me if you are interested. +@end ignore @ignore Other links: http://www.reddit.com/r/linux/comments/dtect/composing_music_in_awk/ @end ignore +@end ifclear @node Acknowledgments @unnumberedsec Acknowledgments @@ -1752,7 +2079,7 @@ Many people need to be thanked for their assistance in producing this manual. Jay Fenlason contributed many ideas and sample programs. Richard Mlynarik and Robert Chassell gave helpful comments on drafts of this -manual. The paper @cite{A Supplemental Document for @command{awk}} by John W.@: +manual. The paper @cite{A Supplemental Document for AWK} by John W.@: Pierce of the Chemistry Department at UC San Diego, pinpointed several issues relevant both to @command{awk} implementation and to this manual, that would otherwise have escaped us. @@ -1763,12 +2090,18 @@ better world and for his courage in founding the FSF and starting the GNU Project. +@ifclear FOR_PRINT Earlier editions of this @value{DOCUMENT} had the following acknowledgements: +@end ifclear +@ifset FOR_PRINT +The previous edition of this @value{DOCUMENT} had +the following acknowledgements: +@end ifset @quotation The following people (in alphabetical order) provided helpful comments on various -versions of this book, +versions of this book: Rick Adams, Dr.@: Nelson H.F. Beebe, Karl Berry, @@ -1796,7 +2129,7 @@ the use of Texinfo. He also deserves special thanks for convincing me @emph{not} to title this @value{DOCUMENT} -@cite{How To Gawk Politely}. +@cite{How to Gawk Politely}. Karl Berry helped significantly with the @TeX{} part of Texinfo. @cindex Hartholz, Marshall @@ -1870,22 +2203,48 @@ Corinna Vinschen, and Eli Zaretskii (in alphabetical order) -make up the current -@command{gawk} ``crack portability team.'' Without their hard work and -help, @command{gawk} would not be nearly the fine program it is today. It -has been and continues to be a pleasure working with this team of fine -people. +make up the current @command{gawk} ``crack portability team.'' Without +their hard work and help, @command{gawk} would not be nearly the robust, +portable program it is today. It has been and continues to be a pleasure +working with this team of fine people. Notable code and documentation contributions were made by -a number of people. @xref{Contributors}, for the full list. +a number of people. @DBXREF{Contributors} for the full list. + +@ifset FOR_PRINT +@cindex Oram, Andy +Thanks to Andy Oram of O'Reilly Media for initiating +the fourth edition and for his support during the work. +Thanks to Jasmine Kwityn for her copyediting work. +@end ifset + +Thanks to Michael Brennan for the Forewords. + +@cindex Duman, Patrice +@cindex Berry, Karl +Thanks to Patrice Dumas for the new @command{makeinfo} program. +Thanks to Karl Berry, who continues to work to keep +the Texinfo markup language sane. @cindex Kernighan, Brian -I would like to thank Brian Kernighan for invaluable assistance during the -testing and debugging of @command{gawk}, and for ongoing +@cindex Brennan, Michael +@cindex Day, Robert P.J.@: +Robert P.J.@: Day, Michael Brennan, and Brian Kernighan kindly acted as +reviewers for the 2015 edition of this @value{DOCUMENT}. Their feedback +helped improve the final work. + +I would also like to thank Brian Kernighan for his invaluable assistance during the +testing and debugging of @command{gawk}, and for his ongoing help and advice in clarifying numerous points about the language. We could not have done nearly as good a job on either @command{gawk} or its documentation without his help. +Brian is in a class by himself as a programmer and technical +author. I have to thank him (yet again) for his ongoing friendship +and for being a role model to me for close to 30 years! +Having him as a reviewer is an exciting privilege. It has also +been extremely humbling@enddots{} + @cindex Robbins, Miriam @cindex Robbins, Jean @cindex Robbins, Harry @@ -1898,55 +2257,56 @@ Finally, I also must acknowledge my gratitude to G-d, for the many opportunities He has sent my way, as well as for the gifts He has given me with which to take advantage of those opportunities. +@ifnotdocbook @sp 2 @noindent Arnold Robbins @* Nof Ayalon @* -ISRAEL @* -May, 2013 +Israel @* +February 2015 +@end ifnotdocbook -@iftex -@part Part I:@* The @command{awk} Language -@end iftex +@ifnotinfo +@part @value{PART1}The @command{awk} Language +@end ifnotinfo -@ignore @ifdocbook -@part Part I:@* The @command{awk} Language -Part I describes the @command{awk} language and @command{gawk} program in detail. -It starts with the basics, and continues through all of the features of @command{awk} -and @command{gawk}. It contains the following chapters: +Part I describes the @command{awk} language and @command{gawk} program +in detail. It starts with the basics, and continues through all of +the features of @command{awk}. Included also are many, but not all, +of the features of @command{gawk}. This part contains the +following chapters: -@itemize @bullet +@itemize @value{BULLET} @item -@ref{Getting Started}. +@ref{Getting Started} @item -@ref{Invoking Gawk}. +@ref{Invoking Gawk} @item -@ref{Regexp}. +@ref{Regexp} @item -@ref{Reading Files}. +@ref{Reading Files} @item -@ref{Printing}. +@ref{Printing} @item -@ref{Expressions}. +@ref{Expressions} @item -@ref{Patterns and Actions}. +@ref{Patterns and Actions} @item -@ref{Arrays}. +@ref{Arrays} @item -@ref{Functions}. +@ref{Functions} @end itemize @end ifdocbook -@end ignore @node Getting Started @chapter Getting Started with @command{awk} @@ -1959,17 +2319,17 @@ The basic function of @command{awk} is to search files for lines (or other units of text) that contain certain patterns. When a line matches one of the patterns, @command{awk} performs specified actions on that line. -@command{awk} keeps processing input lines in this way until it reaches +@command{awk} continues to process input lines in this way until it reaches the end of the input files. @cindex @command{awk}, uses for @cindex programming languages@comma{} data-driven vs.@: procedural @cindex @command{awk} programs Programs in @command{awk} are different from programs in most other languages, -because @command{awk} programs are @dfn{data-driven}; that is, you describe -the data you want to work with and then what to do when you find it. +because @command{awk} programs are @dfn{data driven} (i.e., you describe +the data you want to work with and then what to do when you find it). Most other languages are @dfn{procedural}; you have to describe, in great -detail, every step the program is to take. When working with procedural +detail, every step the program should take. When working with procedural languages, it is usually much harder to clearly describe the data your program will process. For this reason, @command{awk} programs are often refreshingly easy to @@ -1979,15 +2339,15 @@ @cindex rule, definition of When you run @command{awk}, you specify an @command{awk} @dfn{program} that tells @command{awk} what to do. The program consists of a series of -@dfn{rules}. (It may also contain @dfn{function definitions}, -an advanced feature that we will ignore for now. -@xref{User-defined}.) Each rule specifies one +@dfn{rules} (it may also contain @dfn{function definitions}, +an advanced feature that we will ignore for now; +@pxref{User-defined}). Each rule specifies one pattern to search for and one action to perform upon finding the pattern. -Syntactically, a rule consists of a pattern followed by an action. The -action is enclosed in curly braces to separate it from the pattern. -Newlines usually separate rules. Therefore, an @command{awk} +Syntactically, a rule consists of a @dfn{pattern} followed by an +@dfn{action}. The action is enclosed in braces to separate it from the +pattern. Newlines usually separate rules. Therefore, an @command{awk} program looks like this: @example @@ -2010,6 +2370,7 @@ * Other Features:: Other Features of @command{awk}. * When:: When to use @command{gawk} and when to use other things. +* Intro Summary:: Summary of the introduction. @end menu @node Running gawk @@ -2038,7 +2399,7 @@ @menu * One-shot:: Running a short throwaway @command{awk} program. -* Read Terminal:: Using no input files (input from terminal +* Read Terminal:: Using no input files (input from the keyboard instead). * Long:: Putting permanent @command{awk} programs in files. @@ -2060,8 +2421,8 @@ @end example @noindent -where @var{program} consists of a series of @var{patterns} and -@var{actions}, as described earlier. +where @var{program} consists of a series of patterns and +actions, as described earlier. @cindex single quote (@code{'}) @cindex @code{'} (single quote) @@ -2080,11 +2441,12 @@ file for the @command{awk} program. A self-contained shell script is more reliable because there are no other files to misplace. +Later in this chapter, in +@ifdocbook +the section +@end ifdocbook @ref{Very Simple}, -@ifnotinfo -later in this @value{CHAPTER}, -@end ifnotinfo -presents several short, +we'll see examples of several short, self-contained programs. @node Read Terminal @@ -2102,10 +2464,15 @@ @noindent @command{awk} applies the @var{program} to the @dfn{standard input}, -which usually means whatever you type on the terminal. This continues +which usually means whatever you type on the keyboard. This continues until you indicate end-of-file by typing @kbd{Ctrl-d}. -(On other operating systems, the end-of-file character may be different. +@ifset FOR_PRINT +(On non-POSIX operating systems, the end-of-file character may be different.) +@end ifset +@ifclear FOR_PRINT +(On non-POSIX operating systems, the end-of-file character may be different. For example, on OS/2, it is @kbd{Ctrl-z}.) +@end ifclear @cindex files, input, See input files @cindex input files, running @command{awk} without @@ -2113,33 +2480,31 @@ As an example, the following program prints a friendly piece of advice (from Douglas Adams's @cite{The Hitchhiker's Guide to the Galaxy}), to keep you from worrying about the complexities of computer -programming@footnote{If you use Bash as your shell, you should execute -the command @samp{set +H} before running this program interactively, -to disable the C shell-style command history, which treats -@samp{!} as a special character. We recommend putting this command into -your personal startup file.} -(@code{BEGIN} is a feature we haven't discussed yet): +programming: @example -$ @kbd{awk "BEGIN @{ print \"Don't Panic!\" @}"} +$ @kbd{awk 'BEGIN @{ print "Don\47t Panic!" @}'} @print{} Don't Panic! @end example -@cindex shell quoting, double quote -@cindex double quote (@code{"}) in shell commands -@cindex @code{"} (double quote) in shell commands -@cindex @code{\} (backslash) in shell commands -@cindex backslash (@code{\}) in shell commands -This program does not read any input. The @samp{\} before each of the -inner double quotes is necessary because of the shell's quoting -rules---in particular because it mixes both single quotes and -double quotes.@footnote{Although we generally recommend the use of single -quotes around the program text, double quotes are needed here in order to -put the single quote into the message.} +@command{awk} executes statements associated with @code{BEGIN} before +reading any input. If there are no other statements in your program, +as is the case here, @command{awk} just stops, instead of trying to read +input it doesn't know how to process. +The @samp{\47} is a magic way (explained later) of getting a single quote into +the program, without having to engage in ugly shell quoting tricks. + +@quotation NOTE +If you use Bash as your shell, you should execute the +command @samp{set +H} before running this program interactively, to +disable the C shell-style command history, which treats @samp{!} as a +special character. We recommend putting this command into your personal +startup file. +@end quotation This next simple @command{awk} program emulates the @command{cat} utility; it copies whatever you type on the -keyboard to its standard output (why this works is explained shortly). +keyboard to its standard output (why this works is explained shortly): @example $ @kbd{awk '@{ print @}'} @@ -2160,7 +2525,7 @@ @cindex @command{awk} programs, running @cindex @command{awk} programs, lengthy @cindex files, @command{awk} programs in -Sometimes your @command{awk} programs can be very long. In this case, it is +Sometimes @command{awk} programs are very long. In these cases, it is more convenient to put the program into a separate file. In order to tell @command{awk} to use that file for its program, you type: @@ -2170,9 +2535,10 @@ @cindex @option{-f} option @cindex command line, option @option{-f} -The @option{-f} instructs the @command{awk} utility to get the @command{awk} program -from the file @var{source-file}. Any file name can be used for -@var{source-file}. For example, you could put the program: +The @option{-f} instructs the @command{awk} utility to get the +@command{awk} program from the file @var{source-file} (@pxref{Options}). +Any @value{FN} can be used for @var{source-file}. For example, you +could put the program: @example BEGIN @{ print "Don't Panic!" @} @@ -2189,25 +2555,25 @@ does the same thing as this one: @example -awk "BEGIN @{ print \"Don't Panic!\" @}" +awk 'BEGIN @{ print "Don\47t Panic!" @}' @end example @cindex quoting in @command{gawk} command lines @noindent This was explained earlier (@pxref{Read Terminal}). -Note that you don't usually need single quotes around the file name that you -specify with @option{-f}, because most file names don't contain any of the shell's +Note that you don't usually need single quotes around the @value{FN} that you +specify with @option{-f}, because most @value{FN}s don't contain any of the shell's special characters. Notice that in @file{advice}, the @command{awk} program did not have single quotes around it. The quotes are only needed for programs that are provided on the @command{awk} command line. +(Also, placing the program in a file allows us to use a literal single quote in the program +text, instead of the magic @samp{\47}.) -@c STARTOFRANGE sq1x @cindex single quote (@code{'}) in @command{gawk} command lines -@c STARTOFRANGE qs2x @cindex @code{'} (single quote) in @command{gawk} command lines -If you want to clearly identify your @command{awk} program files as such, -you can add the extension @file{.awk} to the file name. This doesn't +If you want to clearly identify an @command{awk} program file as such, +you can add the extension @file{.awk} to the @value{FN}. This doesn't affect the execution of the @command{awk} program but it does make ``housekeeping'' easier. @@ -2221,7 +2587,7 @@ Once you have learned @command{awk}, you may want to write self-contained @command{awk} scripts, using the @samp{#!} script mechanism. You can do this on many systems.@footnote{The @samp{#!} mechanism works on -GNU/Linux systems, BSD-based systems and commercial Unix systems.} +GNU/Linux systems, BSD-based systems, and commercial Unix systems.} For example, you could update the file @file{advice} to look like this: @example @@ -2233,16 +2599,7 @@ @noindent After making this file executable (with the @command{chmod} utility), simply type @samp{advice} -at the shell and the system arranges to run @command{awk}@footnote{The -line beginning with @samp{#!} lists the full file name of an interpreter -to run and an optional initial command-line argument to pass to that -interpreter. The operating system then runs the interpreter with the given -argument and the full argument list of the executed program. The first argument -in the list is the full file name of the @command{awk} program. -The rest of the -argument list contains either options to @command{awk}, or data files, -or both. Note that on many systems @command{awk} may be found in -@file{/usr/bin} instead of in @file{/bin}. Caveat Emptor.} as if you had +at the shell and the system arranges to run @command{awk} as if you had typed @samp{awk -f advice}: @example @@ -2260,9 +2617,27 @@ program that users can invoke without their having to know that the program is written in @command{awk}. -@sidebar Portability Issues with @samp{#!} +@sidebar Understanding @samp{#!} @cindex portability, @code{#!} (executable scripts) +@command{awk} is an @dfn{interpreted} language. This means that the +@command{awk} utility reads your program and then processes your data +according to the instructions in your program. (This is different +from a @dfn{compiled} language such as C, where your program is first +compiled into machine code that is executed directly by your system's +processor.) The @command{awk} utility is thus termed an @dfn{interpreter}. +Many modern languages are interpreted. + +The line beginning with @samp{#!} lists the full @value{FN} of an +interpreter to run and a single optional initial command-line argument +to pass to that interpreter. The operating system then runs the +interpreter with the given argument and the full argument list of the +executed program. The first argument in the list is the full @value{FN} +of the @command{awk} program. The rest of the argument list contains +either options to @command{awk}, or @value{DF}s, or both. (Note that on +many systems @command{awk} may be found in @file{/usr/bin} instead of +in @file{/bin}.) + Some systems limit the length of the interpreter name to 32 characters. Often, this can be dealt with by using a symbolic link. @@ -2274,8 +2649,7 @@ @cindex @code{ARGC}/@code{ARGV} variables, portability and @cindex portability, @code{ARGV} variable -Finally, -the value of @code{ARGV[0]} +Finally, the value of @code{ARGV[0]} (@pxref{Built-in Variables}) varies depending upon your operating system. Some systems put @samp{awk} there, some put the full pathname @@ -2298,14 +2672,14 @@ programming languages have provisions for comments, as programs are typically hard to understand without them. -In the @command{awk} language, a comment starts with the sharp sign +In the @command{awk} language, a comment starts with the number sign character (@samp{#}) and continues to the end of the line. The @samp{#} does not have to be the first character on the line. The -@command{awk} language ignores the rest of a line following a sharp sign. +@command{awk} language ignores the rest of a line following a number sign. For example, we could have put the following into @file{advice}: @example -# This program prints a nice friendly message. It helps +# This program prints a nice, friendly message. It helps # keep novice users from being afraid of the computer. BEGIN @{ print "Don't Panic!" @} @end example @@ -2321,7 +2695,8 @@ @quotation CAUTION As mentioned in @ref{One-shot}, -you can enclose small to medium programs in single quotes, in order to keep +you can enclose short to medium-sized programs in single quotes, +in order to keep your shell scripts self-contained. When doing so, @emph{don't} put an apostrophe (i.e., a single quote) into a comment (or anywhere else in your program). The shell interprets the quote as the closing @@ -2331,7 +2706,7 @@ For example, look at the following: @example -$ @kbd{awk '@{ print "hello" @} # let's be cute'} +$ @kbd{awk 'BEGIN @{ print "hello" @} # let's be cute'} > @end example @@ -2350,19 +2725,19 @@ @cindex @code{\} (backslash) @cindex backslash (@code{\}) Putting a backslash before the single quote in @samp{let's} wouldn't help, -since backslashes are not special inside single quotes. +because backslashes are not special inside single quotes. The next @value{SUBSECTION} describes the shell's quoting rules. @end quotation @node Quoting -@subsection Shell-Quoting Issues +@subsection Shell Quoting Issues @cindex shell quoting, rules for @menu * DOS Quoting:: Quoting in Windows Batch Files. @end menu -For short to medium length @command{awk} programs, it is most convenient +For short to medium-length @command{awk} programs, it is most convenient to enter the program on the @command{awk} command line. This is best done by enclosing the entire program in single quotes. This is true whether you are entering the program interactively at @@ -2379,7 +2754,27 @@ POSIX-compliant, Bourne-style shells (such as Bash, the GNU Bourne-Again Shell). If you use the C shell, you're on your own. -@itemize @bullet +Before diving into the rules, we introduce a concept that appears +throughout this @value{DOCUMENT}, which is that of the @dfn{null}, +or empty, string. + +The null string is character data that has no value. +In other words, it is empty. It is written in @command{awk} programs +like this: @code{""}. In the shell, it can be written using single +or double quotes: @code{""} or @code{''}. Although the null string has +no characters in it, it does exist. For example, consider this command: + +@example +$ @kbd{echo ""} +@end example + +@noindent +Here, the @command{echo} utility receives a single argument, even +though that argument has no characters in it. In the rest of this +@value{DOCUMENT}, we use the terms @dfn{null string} and @dfn{empty string} +interchangeably. Now, on to the quoting rules: + +@itemize @value{BULLET} @item Quoted items can be concatenated with nonquoted items as well as with other quoted items. The shell turns everything into one argument for @@ -2400,7 +2795,7 @@ to the command. It is @emph{impossible} to embed a single quote inside single-quoted text. Refer back to -@ref{Comments}, +@DBREF{Comments} for an example of what happens if you try. @item @@ -2410,7 +2805,7 @@ The shell does at least variable and command substitution on the quoted text. Different shells may do additional kinds of processing on double-quoted text. -Since certain characters within double-quoted text are processed by the shell, +Because certain characters within double-quoted text are processed by the shell, they must be @dfn{escaped} within the text. Of note are the characters @samp{$}, @samp{`}, @samp{\}, and @samp{"}, all of which must be preceded by a backslash within double-quoted text if they are to be passed on literally @@ -2419,8 +2814,14 @@ @ifnotinfo previously @end ifnotinfo -in @ref{Read Terminal}, -is applicable: +in @ref{Read Terminal}: + +@example +awk 'BEGIN @{ print "Don\47t Panic!" @}' +@end example + +@noindent +could instead be written this way: @example $ @kbd{awk "BEGIN @{ print \"Don't Panic!\" @}"} @@ -2433,7 +2834,7 @@ @item Null strings are removed when they occur as part of a non-null -command-line argument, while explicit non-null objects are kept. +command-line argument, while explicit null objects are kept. For example, to specify that the field separator @code{FS} should be set to the null string, use: @@ -2450,8 +2851,8 @@ @end example @noindent -In the second case, @command{awk} will attempt to use the text of the program -as the value of @code{FS}, and the first file name as the text of the program! +In the second case, @command{awk} attempts to use the text of the program +as the value of @code{FS}, and the first @value{FN} as the text of the program! This results in syntax errors at best, and confusing behavior at worst. @end itemize @@ -2466,7 +2867,7 @@ @noindent This program consists of three concatenated quoted strings. The first and the -third are single-quoted, the second is double-quoted. +third are single-quoted, and the second is double-quoted. This can be ``simplified'' to: @@ -2487,8 +2888,6 @@ @end example @noindent -@c ENDOFRANGE sq1x -@c ENDOFRANGE qs2x This option is also painful, because double quotes, backslashes, and dollar signs are very common in more advanced @command{awk} programs. @@ -2505,19 +2904,22 @@ @end example @noindent -This works nicely, except that you should comment clearly what the +This works nicely, but you should comment clearly what the escapes mean. A fourth option is to use command-line variable assignment, like this: @example -$ awk -v sq="'" 'BEGIN @{ print "Here is a single quote <" sq ">" @}' +$ @kbd{awk -v sq="'" 'BEGIN @{ print "Here is a single quote <" sq ">" @}'} @print{} Here is a single quote <'> @end example +(Here, the two string constants and the value of @code{sq} are concatenated +into a single string that is printed by @code{print}.) + If you really need both single and double quotes in your @command{awk} program, it is probably best to move it into a separate file, where -the shell won't be part of the picture, and you can say what you mean. +the shell won't be part of the picture and you can say what you mean. @node DOS Quoting @subsubsection Quoting in MS-Windows Batch Files @@ -2554,6 +2956,7 @@ POSIX shell, the following issue arises often enough for many users that it is worth addressing. +@cindex Brink, Jeroen The ``shells'' on Microsoft Windows systems use the double-quote character for quoting, and make it difficult or impossible to include an escaped double-quote character in a command-line script. @@ -2566,21 +2969,22 @@ @node Sample Data Files -@section Data Files for the Examples -@c For gawk >= 4.0, update these data files. No-one has such slow modems! +@section @value{DDF}s for the Examples @cindex input files, examples @cindex @code{mail-list} file Many of the examples in this @value{DOCUMENT} take their input from two sample -data files. The first, @file{mail-list}, represents a list of peoples' names +@value{DF}s. The first, @file{mail-list}, represents a list of peoples' names together with their email addresses and information about those people. -The second data file, called @file{inventory-shipped}, contains +The second @value{DF}, called @file{inventory-shipped}, contains information about monthly shipments. In both files, each line is considered to be one @dfn{record}. -In the data file @file{mail-list}, each record contains the name of a person, -his/her phone number, his/her email-address, and a code for their relationship -with the author of the list. An @samp{A} in the last column +In @file{mail-list}, each record contains the name of a person, +his/her phone number, his/her email address, and a code for his/her relationship +with the author of the list. +The columns are aligned using spaces. +An @samp{A} in the last column means that the person is an acquaintance. An @samp{F} in the last column means that the person is a friend. An @samp{R} means that the person is a relative: @@ -2607,13 +3011,14 @@ @end example @cindex @code{inventory-shipped} file -The data file @file{inventory-shipped} represents +The @value{DF} @file{inventory-shipped} represents information about shipments during the year. Each record contains the month, the number of green crates shipped, the number of red boxes shipped, the number of orange bags shipped, and the number of blue packages shipped, respectively. There are 16 entries, covering the 12 months of last year and the first four months of the current year. +An empty line separates the data for the two years: @example @c file eg/data/inventory-shipped @@ -2647,7 +3052,7 @@ input file @file{mail-list} for the character string @samp{li} (a grouping of characters is usually called a @dfn{string}; the term @dfn{string} is based on similar usage in English, such -as ``a string of pearls,'' or ``a string of cars in a train''): +as ``a string of pearls'' or ``a string of cars in a train''): @example awk '/li/ @{ print $0 @}' mail-list @@ -2687,56 +3092,61 @@ action is to print all lines that match the pattern. @cindex actions, empty -Thus, we could leave out the action (the @code{print} statement and the curly +Thus, we could leave out the action (the @code{print} statement and the braces) in the previous example and the result would be the same: @command{awk} prints all lines matching the pattern @samp{li}. By comparison, -omitting the @code{print} statement but retaining the curly braces makes an +omitting the @code{print} statement but retaining the braces makes an empty action that does nothing (i.e., no lines are printed). @cindex @command{awk} programs, one-line examples -Many practical @command{awk} programs are just a line or two. Following is a +Many practical @command{awk} programs are just a line or two long. Following is a collection of useful, short programs to get you started. Some of these programs contain constructs that haven't been covered yet. (The description -of the program will give you a good idea of what is going on, but please -read the rest of the @value{DOCUMENT} to become an @command{awk} expert!) -Most of the examples use a data file named @file{data}. This is just a +of the program will give you a good idea of what is going on, but you'll +need to read the rest of the @value{DOCUMENT} to become an @command{awk} expert!) +Most of the examples use a @value{DF} named @file{data}. This is just a placeholder; if you use these programs yourself, substitute -your own file names for @file{data}. +your own @value{FN}s for @file{data}. For future reference, note that there is often more than one way to do things in @command{awk}. At some point, you may want to look back at these examples and see if you can come up with different ways to do the same things shown here: -@itemize @bullet +@itemize @value{BULLET} @item -Print the length of the longest input line: +Print every line that is longer than 80 characters: @example -awk '@{ if (length($0) > max) max = length($0) @} - END @{ print max @}' data +awk 'length($0) > 80' data @end example +The sole rule has a relational expression as its pattern and has no +action---so it uses the default action, printing the record. + @item -Print every line that is longer than 80 characters: +Print the length of the longest input line: @example -awk 'length($0) > 80' data +awk '@{ if (length($0) > max) max = length($0) @} + END @{ print max @}' data @end example -The sole rule has a relational expression as its pattern and it has no -action---so the default action, printing the record, is used. +The code associated with @code{END} executes after all +input has been read; it's the other side of the coin to @code{BEGIN}. @cindex @command{expand} utility @item Print the length of the longest line in @file{data}: @example -expand data | awk '@{ if (x < length()) x = length() @} - END @{ print "maximum line length is " x @}' +expand data | awk '@{ if (x < length($0)) x = length($0) @} + END @{ print "maximum line length is " x @}' @end example -The input is processed by the @command{expand} utility to change TABs -into spaces, so the widths compared are actually the right-margin columns. +This example differs slightly from the previous one: +the input is processed by the @command{expand} utility to change TABs +into spaces, so the widths compared are actually the right-margin columns, +as opposed to the number of input characters on each line. @item Print every line that has at least one field: @@ -2762,7 +3172,7 @@ @example ls -l @var{files} | awk '@{ x += $5 @} - END @{ print "total bytes: " x @}' + END @{ print "total bytes: " x @}' @end example @item @@ -2791,13 +3201,13 @@ @end example @item -Print the even-numbered lines in the data file: +Print the even-numbered lines in the @value{DF}: @example awk 'NR % 2 == 0' data @end example -If you use the expression @samp{NR % 2 == 1} instead, +If you used the expression @samp{NR % 2 == 1} instead, the program would print the odd-numbered lines. @end itemize @@ -2806,15 +3216,20 @@ @cindex @command{awk} programs The @command{awk} utility reads the input files one line at a -time. For each line, @command{awk} tries the patterns of each of the rules. -If several patterns match, then several actions are run in the order in +time. For each line, @command{awk} tries the patterns of each rule. +If several patterns match, then several actions execute in the order in which they appear in the @command{awk} program. If no patterns match, then -no actions are run. +no actions run. After processing all the rules that match the line (and perhaps there are none), @command{awk} reads the next line. (However, -@pxref{Next Statement}, -and also @pxref{Nextfile Statement}). +@DBPXREF{Next Statement} +@ifdocbook +and @DBREF{Nextfile Statement}.) +@end ifdocbook +@ifnotdocbook +and also @pxref{Nextfile Statement}.) +@end ifnotdocbook This continues until the program reaches the end of the file. For example, the following @command{awk} program contains two rules: @@ -2833,7 +3248,7 @@ @samp{12} @emph{or} the string @samp{21}. If a line contains both strings, it is printed twice, once by each rule. -This is what happens if we run this program on our two sample data files, +This is what happens if we run this program on our two sample @value{DF}s, @file{mail-list} and @file{inventory-shipped}: @example @@ -2863,8 +3278,8 @@ understand all the details: @example -LC_ALL=C ls -l | awk '$6 == "Nov" @{ sum += $5 @} - END @{ print sum @}' +ls -l | awk '$6 == "Nov" @{ sum += $5 @} + END @{ print sum @}' @end example @cindex @command{ls} utility @@ -2888,21 +3303,20 @@ @noindent @cindex line continuations, with C shell The first field contains read-write permissions, the second field contains -the number of links to the file, and the third field identifies the owner of -the file. The fourth field identifies the group of the file. -The fifth field contains the size of the file in bytes. The +the number of links to the file, and the third field identifies the file's owner. +The fourth field identifies the file's group. +The fifth field contains the file's size in bytes. The sixth, seventh, and eighth fields contain the month, day, and time, respectively, that the file was last modified. Finally, the ninth field -contains the file name.@footnote{The @samp{LC_ALL=C} is -needed to produce this traditional-style output from @command{ls}.} +contains the @value{FN}. @c @cindex automatic initialization @cindex initialization, automatic The @samp{$6 == "Nov"} in our @command{awk} program is an expression that tests whether the sixth field of the output from @w{@samp{ls -l}} matches the string @samp{Nov}. Each time a line has the string -@samp{Nov} for its sixth field, the action @samp{sum += $5} is -performed. This adds the fifth field (the file's size) to the variable +@samp{Nov} for its sixth field, @command{awk} performs the action +@samp{sum += $5}. This adds the fifth field (the file's size) to the variable @code{sum}. As a result, when @command{awk} has finished reading all the input lines, @code{sum} is the total of the sizes of the files whose lines matched the pattern. (This works because @command{awk} variables @@ -2969,7 +3383,7 @@ @command{gawk} places no limit on the length of a line, so backslash continuation is never strictly necessary; it just makes programs more readable. For this same reason, as well as -for clarity, we have kept most statements short in the sample programs +for clarity, we have kept most statements short in the programs presented throughout the @value{DOCUMENT}. Backslash continuation is most useful when your @command{awk} program is in a separate source file instead of entered from the command line. You should also note that @@ -2989,7 +3403,7 @@ with the C shell.} It works for @command{awk} programs in files and for one-shot programs, @emph{provided} you are using a POSIX-compliant shell, such as the Unix Bourne shell or Bash. But the C shell behaves -differently! There, you must use two backslashes in a row, followed by +differently! There you must use two backslashes in a row, followed by a newline. Note also that when using the C shell, @emph{every} newline in your @command{awk} program must be escaped with a backslash. To illustrate: @@ -3030,11 +3444,11 @@ line. For example: @example -$ gawk 'BEGIN @{ print "dont panic" # a friendly \ -> BEGIN rule -> @}' +$ @kbd{gawk 'BEGIN @{ print "dont panic" # a friendly \} +> @kbd{ BEGIN rule} +> @kbd{@}'} @error{} gawk: cmd. line:2: BEGIN rule -@error{} gawk: cmd. line:2: ^ parse error +@error{} gawk: cmd. line:2: ^ syntax error @end example @noindent @@ -3080,9 +3494,9 @@ determining the type of a variable, and array sorting. -As we develop our presentation of the @command{awk} language, we introduce +As we develop our presentation of the @command{awk} language, we will introduce most of the variables and many of the functions. They are described -systematically in @ref{Built-in Variables}, and +systematically in @DBREF{Built-in Variables} and in @ref{Built-in}. @node When @@ -3107,25 +3521,64 @@ @cindex Brian Kernighan's @command{awk} Complex programs have been written in @command{awk}, including a complete -retargetable assembler for eight-bit microprocessors (@pxref{Glossary}, for -more information), and a microcode assembler for a special-purpose Prolog +retargetable assembler for +@ifclear FOR_PRINT +eight-bit microprocessors (@pxref{Glossary}, for more information), +@end ifclear +@ifset FOR_PRINT +eight-bit microprocessors, +@end ifset +and a microcode assembler for a special-purpose Prolog computer. -While the original @command{awk}'s capabilities were strained by tasks -of such complexity, modern versions are more capable. Even Brian Kernighan's -version of @command{awk} has fewer predefined limits, and those -that it has are much larger than they used to be. +The original @command{awk}'s capabilities were strained by tasks +of such complexity, but modern versions are more capable. @cindex @command{awk} programs, complex -If you find yourself writing @command{awk} scripts of more than, say, a few -hundred lines, you might consider using a different programming -language. Emacs Lisp is a good choice if you need sophisticated string -or pattern matching capabilities. The shell is also good at string and -pattern matching; in addition, it allows powerful use of the system -utilities. More conventional languages, such as C, C++, and Java, offer -better facilities for system programming and for managing the complexity -of large programs. Programs in these languages may require more lines -of source code than the equivalent @command{awk} programs, but they are -easier to maintain and usually run more efficiently. +If you find yourself writing @command{awk} scripts of more than, say, +a few hundred lines, you might consider using a different programming +language. The shell is good at string and pattern matching; in addition, +it allows powerful use of the system utilities. Python offers a nice +balance between high-level ease of programming and access to system +facilities.@footnote{Other popular scripting languages include Ruby +and Perl.} + +@node Intro Summary +@section Summary + +@c FIXME: Review this chapter for summary of builtin functions called. +@itemize @value{BULLET} +@item +Programs in @command{awk} consist of @var{pattern}--@var{action} pairs. + +@item +An @var{action} without a @var{pattern} always runs. The default +@var{action} for a pattern without one is @samp{@{ print $0 @}}. + +@item +Use either +@samp{awk '@var{program}' @var{files}} +or +@samp{awk -f @var{program-file} @var{files}} +to run @command{awk}. + +@item +You may use the special @samp{#!} header line to create @command{awk} +programs that are directly executable. + +@item +Comments in @command{awk} programs start with @samp{#} and continue to +the end of the same line. + +@item +Be aware of quoting issues when writing @command{awk} programs as +part of a larger shell script (or MS-Windows batch file). + +@item +You may use backslash continuation to continue a source line. +Lines are automatically continued after +a comma, open brace, question mark, colon, +@samp{||}, @samp{&&}, @code{do}, and @code{else}. +@end itemize @node Invoking Gawk @chapter Running @command{awk} and @command{gawk} @@ -3133,7 +3586,7 @@ This @value{CHAPTER} covers how to run @command{awk}, both POSIX-standard and @command{gawk}-specific command-line options, and what @command{awk} and -@command{gawk} do with non-option arguments. +@command{gawk} do with nonoption arguments. It then proceeds to cover how @command{gawk} searches for source files, reading standard input along with other files, @command{gawk}'s environment variables, @command{gawk}'s exit status, using include files, @@ -3155,6 +3608,7 @@ * Loading Shared Libraries:: Loading shared libraries into your program. * Obsolete:: Obsolete Options and/or features. * Undocumented:: Undocumented Options and Features. +* Invoking Summary:: Invocation summary. @end menu @node Command Line @@ -3168,24 +3622,15 @@ one or more program files. Here are templates for both of them; items enclosed in [@dots{}] in these templates are optional: -@ifnotdocbook -@example -awk @r{[@var{options}]} -f progfile @r{[@code{--}]} @var{file} @dots{} -awk @r{[@var{options}]} @r{[@code{--}]} '@var{program}' @var{file} @dots{} -@end example -@end ifnotdocbook - -@c FIXME - find a better way to mark this up in docbook -@docbook -awk [options] -f progfile [--] file … -awk [options] [--] 'program' file … - -@end docbook +@display +@command{awk} [@var{options}] @option{-f} @var{progfile} [@option{--}] @var{file} @dots{} +@command{awk} [@var{options}] [@option{--}] @code{'@var{program}'} @var{file} @dots{} +@end display @cindex GNU long options @cindex long options @cindex options, long -Besides traditional one-letter POSIX-style options, @command{gawk} also +In addition to traditional one-letter POSIX-style options, @command{gawk} also supports GNU long options. @cindex dark corner, invoking @command{awk} @@ -3207,20 +3652,16 @@ @node Options @section Command-Line Options -@c STARTOFRANGE ocl @cindex options, command-line -@c STARTOFRANGE clo @cindex command line, options -@c STARTOFRANGE gnulo @cindex GNU long options -@c STARTOFRANGE longo @cindex options, long Options begin with a dash and consist of a single character. GNU-style long options consist of two dashes and a keyword. The keyword can be abbreviated, as long as the abbreviation allows the option -to be uniquely identified. If the option takes an argument, then the -keyword is either immediately followed by an equals sign (@samp{=}) and the +to be uniquely identified. If the option takes an argument, either the +keyword is immediately followed by an equals sign (@samp{=}) and the argument's value, or the keyword and the argument's value are separated by whitespace. If a particular option with a value is given more than once, it is the @@ -3247,8 +3688,8 @@ @cindex @option{-f} option @cindex @option{--file} option @cindex @command{awk} programs, location of -Read @command{awk} program source from @var{source-file} -instead of in the first non-option argument. +Read the @command{awk} program source from @var{source-file} +instead of in the first nonoption argument. This option may be given multiple times; the @command{awk} program consists of the concatenation of the contents of each specified @var{source-file}. @@ -3267,13 +3708,13 @@ more than once, setting another variable each time, like this: @samp{awk @w{-v foo=1} @w{-v bar=2} @dots{}}. -@cindex built-in variables, @code{-v} option@comma{} setting with -@cindex variables, built-in, @code{-v} option@comma{} setting with +@cindex predefined variables, @code{-v} option@comma{} setting with +@cindex variables, predefined @code{-v} option@comma{} setting with @quotation CAUTION Using @option{-v} to set the values of the built-in variables may lead to surprising results. @command{awk} will reset the values of those variables as it needs to, possibly ignoring any -predefined value you may have given. +initial value you may have given. @end quotation @item -W @var{gawk-opt} @@ -3296,54 +3737,56 @@ @cindex @code{-} (hyphen), filenames beginning with @cindex hyphen (@code{-}), filenames beginning with -This is useful if you have file names that start with @samp{-}, -or in shell scripts, if you have file names that will be specified +This is useful if you have @value{FN}s that start with @samp{-}, +or in shell scripts, if you have @value{FN}s that will be specified by the user that could start with @samp{-}. It is also useful for passing options on to the @command{awk} program; see @ref{Getopt Function}. @end table -@c ENDOFRANGE gnulo -@c ENDOFRANGE longo The following list describes @command{gawk}-specific options: -@table @code -@item -b -@itemx --characters-as-bytes +@c Have to use @asis here to get docbook to come out right. +@table @asis +@item @option{-b} +@itemx @option{--characters-as-bytes} @cindex @option{-b} option @cindex @option{--characters-as-bytes} option Cause @command{gawk} to treat all input data as single-byte characters. In addition, all output written with @code{print} or @code{printf} -are treated as single-byte characters. +is treated as single-byte characters. Normally, @command{gawk} follows the POSIX standard and attempts to process -its input data according to the current locale. This can often involve +its input data according to the current locale (@pxref{Locales}). This can often involve converting multibyte characters into wide characters (internally), and can lead to problems or confusion if the input data does not contain valid -multibyte characters. This option is an easy way to tell @command{gawk}: -``hands off my data!''. +multibyte characters. This option is an easy way to tell @command{gawk}, +``Hands off my data!'' -@item -c -@itemx --traditional +@item @option{-c} +@itemx @option{--traditional} @cindex @option{-c} option @cindex @option{--traditional} option @cindex compatibility mode (@command{gawk}), specifying Specify @dfn{compatibility mode}, in which the GNU extensions to the @command{awk} language are disabled, so that @command{gawk} behaves just -like Brian Kernighan's version @command{awk}. +like BWK @command{awk}. @xref{POSIX/GNU}, -which summarizes the extensions. Also see +which summarizes the extensions. +@ifclear FOR_PRINT +Also see @ref{Compatibility Mode}. +@end ifclear -@item -C -@itemx --copyright +@item @option{-C} +@itemx @option{--copyright} @cindex @option{-C} option @cindex @option{--copyright} option @cindex GPL (General Public License), printing Print the short version of the General Public License and then exit. -@item -d@r{[}@var{file}@r{]} -@itemx --dump-variables@r{[}=@var{file}@r{]} +@item @option{-d}[@var{file}] +@itemx @option{--dump-variables}[@code{=}@var{file}] @cindex @option{-d} option @cindex @option{--dump-variables} option @cindex dump all variables of a program @@ -3352,7 +3795,7 @@ @cindex variables, global, printing list of Print a sorted list of global variables, their types, and final values to @var{file}. If no @var{file} is provided, print this -list to the file named @file{awkvars.out} in the current directory. +list to a file named @file{awkvars.out} in the current directory. No space is allowed between the @option{-d} and @var{file}, if @var{file} is supplied. @@ -3365,21 +3808,22 @@ (This is a particularly easy mistake to make with simple variable names like @code{i}, @code{j}, etc.) -@item -D@r{[}@var{file}@r{]} -@itemx --debug=@r{[}@var{file}@r{]} +@item @option{-D}[@var{file}] +@itemx @option{--debug}[@code{=}@var{file}] @cindex @option{-D} option @cindex @option{--debug} option @cindex @command{awk} debugging, enabling Enable debugging of @command{awk} programs (@pxref{Debugging}). -By default, the debugger reads commands interactively from the terminal. +By default, the debugger reads commands interactively from the keyboard +(standard input). The optional @var{file} argument allows you to specify a file with a list -of commands for the debugger to execute non-interactively. +of commands for the debugger to execute noninteractively. No space is allowed between the @option{-D} and @var{file}, if @var{file} is supplied. -@item -e @var{program-text} -@itemx --source @var{program-text} +@item @option{-e} @var{program-text} +@itemx @option{--source} @var{program-text} @cindex @option{-e} option @cindex @option{--source} option @cindex source code, mixing @@ -3390,8 +3834,8 @@ when you have library functions that you want to use from your command-line programs (@pxref{AWKPATH Variable}). -@item -E @var{file} -@itemx --exec @var{file} +@item @option{-E} @var{file} +@itemx @option{--exec} @var{file} @cindex @option{-E} option @cindex @option{--exec} option @cindex @command{awk} programs, location of @@ -3399,7 +3843,7 @@ Similar to @option{-f}, read @command{awk} program text from @var{file}. There are two differences from @option{-f}: -@itemize @bullet +@itemize @value{BULLET} @item This option terminates option processing; anything else on the command line is passed on directly to the @command{awk} program. @@ -3412,7 +3856,13 @@ This option is particularly necessary for World Wide Web CGI applications that pass arguments through the URL; using this option prevents a malicious (or other) user from passing in options, assignments, or @command{awk} source -code (via @option{--source}) to the CGI application. This option should be used +code (via @option{-e}) to the CGI application.@footnote{For more detail, +please see Section 4.4 of @uref{http://www.ietf.org/rfc/rfc3875, +RFC 3875}. Also see the +@uref{http://lists.gnu.org/archive/html/bug-gawk/2014-11/msg00022.html, +explanatory note sent to the @command{gawk} bug +mailing list}.} +This option should be used with @samp{#!} scripts (@pxref{Executable Scripts}), like so: @example @@ -3421,64 +3871,69 @@ @var{awk program here @dots{}} @end example -@item -g -@itemx --gen-pot +@item @option{-g} +@itemx @option{--gen-pot} @cindex @option{-g} option @cindex @option{--gen-pot} option @cindex portable object files, generating @cindex files, portable object, generating Analyze the source program and -generate a GNU @code{gettext} Portable Object Template file on standard +generate a GNU @command{gettext} portable object template file on standard output for all string constants that have been marked for translation. @xref{Internationalization}, for information about this option. -@item -h -@itemx --help +@item @option{-h} +@itemx @option{--help} @cindex @option{-h} option @cindex @option{--help} option @cindex GNU long options, printing list of @cindex options, printing list of @cindex printing, list of options -Print a ``usage'' message summarizing the short and long style options +Print a ``usage'' message summarizing the short- and long-style options that @command{gawk} accepts and then exit. -@item -i @var{source-file} -@itemx --include @var{source-file} +@item @option{-i} @var{source-file} +@itemx @option{--include} @var{source-file} @cindex @option{-i} option @cindex @option{--include} option @cindex @command{awk} programs, location of -Read @command{awk} source library from @var{source-file}. This option is -completely equivalent to using the @samp{@@include} directive inside -your program. This option is very -similar to the @option{-f} option, but there are two important differences. -First, when @option{-i} is used, the program source will not be loaded if it has -been previously loaded, whereas the @option{-f} will always load the file. +Read an @command{awk} source library from @var{source-file}. This option +is completely equivalent to using the @code{@@include} directive inside +your program. It is very similar to the @option{-f} option, +but there are two important differences. First, when @option{-i} is +used, the program source is not loaded if it has been previously +loaded, whereas with @option{-f}, @command{gawk} always loads the file. Second, because this option is intended to be used with code libraries, @command{gawk} does not recognize such files as constituting main program -input. Thus, after processing an @option{-i} argument, @command{gawk} still expects to -find the main source code via the @option{-f} option or on the command-line. +input. Thus, after processing an @option{-i} argument, @command{gawk} +still expects to find the main source code via the @option{-f} option +or on the command line. -@item -l @var{lib} -@itemx --load @var{lib} +@item @option{-l} @var{ext} +@itemx @option{--load} @var{ext} @cindex @option{-l} option @cindex @option{--load} option -@cindex loading, library -Load a shared library @var{lib}. This searches for the library using the @env{AWKLIBPATH} +@cindex loading, extensions +Load a dynamic extension named @var{ext}. Extensions +are stored as system shared libraries. +This option searches for the library using the @env{AWKLIBPATH} environment variable. The correct library suffix for your platform will be -supplied by default, so it need not be specified in the library name. -The library initialization routine should be named @code{dl_load()}. -An alternative is to use the @samp{@@load} keyword inside the program to load -a shared library. +supplied by default, so it need not be specified in the extension name. +The extension initialization routine should be named @code{dl_load()}. +An alternative is to use the @code{@@load} keyword inside the program to load +a shared library. This advanced feature is described in detail in @ref{Dynamic Extensions}. -@item -L @r{[}value@r{]} -@itemx --lint@r{[}=value@r{]} +@item @option{-L}[@var{value}] +@itemx @option{--lint}[@code{=}@var{value}] @cindex @option{-l} option @cindex @option{--lint} option @cindex lint checking, issuing warnings @cindex warnings, issuing Warn about constructs that are dubious or nonportable to other @command{awk} implementations. +No space is allowed between the @option{-L} and @var{value}, if +@var{value} is supplied. Some warnings are issued when @command{gawk} first reads your program. Others are issued at runtime, as your program executes. With an optional argument of @samp{fatal}, @@ -3494,16 +3949,16 @@ care to search for all occurrences of each inappropriate construct. As @command{awk} programs are usually short, doing so is not burdensome. -@item -M -@itemx --bignum +@item @option{-M} +@itemx @option{--bignum} @cindex @option{-M} option @cindex @option{--bignum} option -Force arbitrary precision arithmetic on numbers. This option has no effect +Force arbitrary-precision arithmetic on numbers. This option has no effect if @command{gawk} is not compiled to use the GNU MPFR and MP libraries -(@pxref{Gawk and MPFR}). +(@pxref{Arbitrary Precision Arithmetic}). -@item -n -@itemx --non-decimal-data +@item @option{-n} +@itemx @option{--non-decimal-data} @cindex @option{-n} option @cindex @option{--non-decimal-data} option @cindex hexadecimal values@comma{} enabling interpretation of @@ -3514,38 +3969,45 @@ (@pxref{Nondecimal Data}). @quotation CAUTION -This option can severely break old programs. -Use with care. +This option can severely break old programs. Use with care. Also note +that this option may disappear in a future version of @command{gawk}. @end quotation -@item -N -@itemx --use-lc-numeric +@item @option{-N} +@itemx @option{--use-lc-numeric} @cindex @option{-N} option @cindex @option{--use-lc-numeric} option Force the use of the locale's decimal point character when parsing numeric input data (@pxref{Locales}). -@item -o@r{[}@var{file}@r{]} -@itemx --pretty-print@r{[}=@var{file}@r{]} +@item @option{-o}[@var{file}] +@itemx @option{--pretty-print}[@code{=}@var{file}] @cindex @option{-o} option @cindex @option{--pretty-print} option Enable pretty-printing of @command{awk} programs. -By default, output program is created in a file named @file{awkprof.out}. +By default, the output program is created in a file named @file{awkprof.out} +(@pxref{Profiling}). The optional @var{file} argument allows you to specify a different -file name for the output. +@value{FN} for the output. No space is allowed between the @option{-o} and @var{file}, if @var{file} is supplied. -@item -O -@itemx --optimize +@quotation NOTE +Due to the way @command{gawk} has evolved, with this option +your program still executes. This will change in the +next major release, such that @command{gawk} will only +pretty-print the program and not run it. +@end quotation + +@item @option{-O} +@itemx @option{--optimize} @cindex @option{--optimize} option @cindex @option{-O} option Enable some optimizations on the internal representation of the program. -At the moment this includes just simple constant folding. The @command{gawk} -maintainer hopes to add more optimizations over time. +At the moment, this includes just simple constant folding. -@item -p@r{[}@var{file}@r{]} -@itemx --profile@r{[}=@var{file}@r{]} +@item @option{-p}[@var{file}] +@itemx @option{--profile}[@code{=}@var{file}] @cindex @option{-p} option @cindex @option{--profile} option @cindex @command{awk} profiling, enabling @@ -3553,15 +4015,15 @@ (@pxref{Profiling}). By default, profiles are created in a file named @file{awkprof.out}. The optional @var{file} argument allows you to specify a different -file name for the profile file. +@value{FN} for the profile file. No space is allowed between the @option{-p} and @var{file}, if @var{file} is supplied. The profile contains execution counts for each statement in the program in the left margin, and function call counts for each function. -@item -P -@itemx --posix +@item @option{-P} +@itemx @option{--posix} @cindex @option{-P} option @cindex @option{--posix} option @cindex POSIX mode @@ -3569,13 +4031,13 @@ Operate in strict POSIX mode. This disables all @command{gawk} extensions (just like @option{--traditional}) and disables all extensions not allowed by POSIX. -@xref{Common Extensions}, for a summary of the extensions +@DBXREF{Common Extensions} for a summary of the extensions in @command{gawk} that are disabled by this option. Also, the following additional restrictions apply: -@itemize @bullet +@itemize @value{BULLET} @cindex newlines @cindex whitespace, newlines as @@ -3591,7 +4053,7 @@ @cindex @code{FS} variable, as TAB character @item -Specifying @samp{-Ft} on the command-line does not set the value +Specifying @samp{-Ft} on the command line does not set the value of @code{FS} to be a single TAB character (@pxref{Field Separators}). @@ -3608,10 +4070,10 @@ @cindex @option{--posix} option, @code{--traditional} option and If you supply both @option{--traditional} and @option{--posix} on the command line, @option{--posix} takes precedence. @command{gawk} -also issues a warning if both options are supplied. +issues a warning if both options are supplied. -@item -r -@itemx --re-interval +@item @option{-r} +@itemx @option{--re-interval} @cindex @option{-r} option @cindex @option{--re-interval} option @cindex regular expressions, interval expressions and @@ -3619,11 +4081,11 @@ (@pxref{Regexp Operators}) in regexps. This is now @command{gawk}'s default behavior. -Nevertheless, this option remains both for backward compatibility, -and for use in combination with the @option{--traditional} option. +Nevertheless, this option remains (both for backward compatibility +and for use in combination with @option{--traditional}). -@item -S -@itemx --sandbox +@item @option{-S} +@itemx @option{--sandbox} @cindex @option{-S} option @cindex @option{--sandbox} option @cindex sandbox mode @@ -3633,18 +4095,18 @@ and dynamic extensions. This is particularly useful when you want to run @command{awk} scripts from questionable sources and need to make sure the scripts -can't access your system (other than the specified input data file). +can't access your system (other than the specified input @value{DF}). -@item -t -@itemx --lint-old +@item @option{-t} +@itemx @option{--lint-old} @cindex @option{-L} option @cindex @option{--lint-old} option Warn about constructs that are not available in the original version of @command{awk} from Version 7 Unix (@pxref{V7/SVR3.1}). -@item -V -@itemx --version +@item @option{-V} +@itemx @option{--version} @cindex @option{-V} option @cindex @option{--version} option @cindex @command{gawk}, versions of, information about@comma{} printing @@ -3673,30 +4135,31 @@ if they had been concatenated together into one big file. This is useful for creating libraries of @command{awk} functions. These functions can be written once and then retrieved from a standard place, instead -of having to be included into each individual program. +of having to be included in each individual program. +The @option{-i} option is similar in this regard. (As mentioned in @ref{Definition Syntax}, function names must be unique.) With standard @command{awk}, library functions can still be used, even -if the program is entered at the terminal, +if the program is entered at the keyboard, by specifying @samp{-f /dev/tty}. After typing your program, type @kbd{Ctrl-d} (the end-of-file character) to terminate it. (You may also use @samp{-f -} to read program source from the standard -input but then you will not be able to also use the standard input as a +input, but then you will not be able to also use the standard input as a source of data.) -Because it is clumsy using the standard @command{awk} mechanisms to mix source -file and command-line @command{awk} programs, @command{gawk} provides the -@option{--source} option. This does not require you to pre-empt the standard -input for your source code; it allows you to easily mix command-line -and library source code -(@pxref{AWKPATH Variable}). -The @option{--source} option may also be used multiple times on the command line. +Because it is clumsy using the standard @command{awk} mechanisms to mix +source file and command-line @command{awk} programs, @command{gawk} +provides the @option{-e} option. This does not require you to +preempt the standard input for your source code; it allows you to easily +mix command-line and library source code (@pxref{AWKPATH Variable}). +As with @option{-f}, the @option{-e} and @option{-i} +options may also be used multiple times on the command line. -@cindex @option{--source} option -If no @option{-f} or @option{--source} option is specified, then @command{gawk} -uses the first non-option command-line argument as the text of the +@cindex @option{-e} option +If no @option{-f} or @option{-e} option is specified, then @command{gawk} +uses the first nonoption command-line argument as the text of the program source code. @cindex @env{POSIXLY_CORRECT} environment variable @@ -3704,7 +4167,7 @@ @cindex POSIX mode If the environment variable @env{POSIXLY_CORRECT} exists, then @command{gawk} behaves in strict POSIX mode, exactly as if -you had supplied the @option{--posix} command-line option. +you had supplied @option{--posix}. Many GNU programs look for this environment variable to suppress extensions that conflict with POSIX, but @command{gawk} behaves differently: it suppresses all extensions, even those that do not @@ -3735,8 +4198,6 @@ Having @env{POSIXLY_CORRECT} set is not recommended for daily use, but it is good for testing the portability of your programs to other environments. -@c ENDOFRANGE ocl -@c ENDOFRANGE clo @node Other Arguments @section Other Command-Line Arguments @@ -3747,27 +4208,35 @@ input files to be processed in the order specified. However, an argument that has the form @code{@var{var}=@var{value}}, assigns the value @var{value} to the variable @var{var}---it does not specify a -file at all. -(See -@ref{Assignment Options}.) +file at all. (See @ref{Assignment Options}.) In the following example, +@var{count=1} is a variable assignment, not a @value{FN}: + +@example +awk -f program.awk file1 count=1 file2 +@end example @cindex @command{gawk}, @code{ARGIND} variable in @cindex @code{ARGIND} variable, command-line arguments @cindex @code{ARGV} array, indexing into @cindex @code{ARGC}/@code{ARGV} variables, command-line arguments -All these arguments are made available to your @command{awk} program in the +All the command-line arguments are made available to your @command{awk} program in the @code{ARGV} array (@pxref{Built-in Variables}). Command-line options and the program text (if present) are omitted from @code{ARGV}. All other arguments, including variable assignments, are included. As each element of @code{ARGV} is processed, @command{gawk} -sets the variable @code{ARGIND} to the index in @code{ARGV} of the +sets @code{ARGIND} to the index in @code{ARGV} of the current element. +@c FIXME: One day, move the ARGC and ARGV node closer to here. +Changing @code{ARGC} and @code{ARGV} in your @command{awk} program lets +you control how @command{awk} processes the input files; this is described +in more detail in @ref{ARGC and ARGV}. + @cindex input files, variable assignments and @cindex variable assignments and input files -The distinction between file name arguments and variable-assignment +The distinction between @value{FN} arguments and variable-assignment arguments is made when @command{awk} is about to open the next input file. -At that point in execution, it checks the file name to see whether +At that point in execution, it checks the @value{FN} to see whether it is really a variable assignment; if so, @command{awk} sets the variable instead of reading a file. @@ -3783,8 +4252,8 @@ sequences (@pxref{Escape Sequences}). @value{DARKCORNER} -In some earlier implementations of @command{awk}, when a variable assignment -occurred before any file names, the assignment would happen @emph{before} +In some very early implementations of @command{awk}, when a variable assignment +occurred before any @value{FN}s, the assignment would happen @emph{before} the @code{BEGIN} rule was executed. @command{awk}'s behavior was thus inconsistent; some command-line assignments were available inside the @code{BEGIN} rule, while others were not. Unfortunately, @@ -3795,8 +4264,8 @@ The variable assignment feature is most useful for assigning to variables such as @code{RS}, @code{OFS}, and @code{ORS}, which control input and -output formats before scanning the data files. It is also useful for -controlling state if multiple passes are needed over a data file. For +output formats, before scanning the @value{DF}s. It is also useful for +controlling state if multiple passes are needed over a @value{DF}. For example: @cindex files, multiple passes over @@ -3832,13 +4301,13 @@ files with @code{getline} (@pxref{Getline/File}). In addition, @command{gawk} allows you to specify the special -file name @file{/dev/stdin}, both on the command line and +@value{FN} @file{/dev/stdin}, both on the command line and with @code{getline}. Some other versions of @command{awk} also support this, but it is not standard. (Some operating systems provide a @file{/dev/stdin} file -in the file system, however, @command{gawk} always processes -this file name itself.) +in the filesystem; however, @command{gawk} always processes +this @value{FN} itself.) @node Environment Variables @section The Environment Variables @command{gawk} Uses @@ -3860,71 +4329,79 @@ @cindex @env{AWKPATH} environment variable @cindex directories, searching for source files @cindex search paths, for source files -@cindex differences in @command{awk} and @command{gawk}, @code{AWKPATH} environment variable +@cindex differences in @command{awk} and @command{gawk}, @env{AWKPATH} environment variable @ifinfo The previous @value{SECTION} described how @command{awk} program files can be named -on the command-line with the @option{-f} option. +on the command line with the @option{-f} option. @end ifinfo In most @command{awk} -implementations, you must supply a precise path name for each program +implementations, you must supply a precise pathname for each program file, unless the file is in the current directory. -But in @command{gawk}, if the file name supplied to the @option{-f} +But with @command{gawk}, if the @value{FN} supplied to the @option{-f} or @option{-i} options does not contain a directory separator @samp{/}, then @command{gawk} searches a list of -directories (called the @dfn{search path}), one by one, looking for a +directories (called the @dfn{search path}) one by one, looking for a file with the specified name. The search path is a string consisting of directory names -separated by colons@footnote{Semicolons on MS-Windows and MS-DOS.}. @command{gawk} gets its search path from the +separated by colons.@footnote{Semicolons on MS-Windows and MS-DOS.} +@command{gawk} gets its search path from the @env{AWKPATH} environment variable. If that variable does not exist, -@command{gawk} uses a default path, -@samp{.:/usr/local/share/awk}.@footnote{Your version of @command{gawk} -may use a different directory; it -will depend upon how @command{gawk} was built and installed. The actual -directory is the value of @samp{$(datadir)} generated when -@command{gawk} was configured. You probably don't need to worry about this, -though.} +or if it has an empty value, +@command{gawk} uses a default path (described shortly). -The search path feature is particularly useful for building libraries +The search path feature is particularly helpful for building libraries of useful @command{awk} functions. The library files can be placed in a standard directory in the default path and then specified on -the command line with a short file name. Otherwise, the full file name -would have to be typed for each file. +the command line with a short @value{FN}. Otherwise, you would have to +type the full @value{FN} for each file. -By using the @option{-i} option, or the @option{--source} and @option{-f} options, your command-line +By using the @option{-i} or @option{-f} options, your command-line @command{awk} programs can use facilities in @command{awk} library files (@pxref{Library Functions}). Path searching is not done if @command{gawk} is in compatibility mode. This is true for both @option{--traditional} and @option{--posix}. @xref{Options}. -If the source code is not found after the initial search, the path is searched -again after adding the default @samp{.awk} suffix to the filename. +If the source code file is not found after the initial search, the path is searched +again after adding the suffix @samp{.awk} to the @value{FN}. -@quotation NOTE -To include -the current directory in the path, either place -@file{.} explicitly in the path or write a null entry in the -path. (A null entry is indicated by starting or ending the path with a -colon or by placing two colons next to each other (@samp{::}).) -This path search mechanism is similar +@command{gawk}'s path search mechanism is similar to the shell's. -@c someday, @cite{The Bourne Again Shell}.... +(See @uref{http://www.gnu.org/software/bash/manual/, +@cite{The Bourne-Again SHell manual}}.) +It treats a null entry in the path as indicating the current +directory. +(A null entry is indicated by starting or ending the path with a +colon or by placing two colons next to each other [@samp{::}].) -However, @command{gawk} always looks in the current directory @emph{before} -searching @env{AWKPATH}, so there is no real reason to include -the current directory in the search path. -@c Prior to 4.0, gawk searched the current directory after the -@c path search, but it's not worth documenting it. -@end quotation - -If @env{AWKPATH} is not defined in the -environment, @command{gawk} places its default search path into -@code{ENVIRON["AWKPATH"]}. This makes it easy to determine -the actual search path that @command{gawk} will use -from within an @command{awk} program. +@quotation NOTE +To include the current directory in the path, either place @file{.} +as an entry in the path or write a null entry in the path. + +Different past versions of @command{gawk} would also look explicitly in +the current directory, either before or after the path search. As of +@value{PVERSION} 4.1.2, this no longer happens; if you wish to look +in the current directory, you must include @file{.} either as a separate +entry or as a null entry in the search path. +@end quotation + +The default value for @env{AWKPATH} is +@samp{.:/usr/local/share/awk}.@footnote{Your version of @command{gawk} +may use a different directory; it +will depend upon how @command{gawk} was built and installed. The actual +directory is the value of @code{$(datadir)} generated when +@command{gawk} was configured. You probably don't need to worry about this, +though.} Since @file{.} is included at the beginning, @command{gawk} +searches first in the current directory and then in @file{/usr/local/share/awk}. +In practice, this means that you will rarely need to change the +value of @env{AWKPATH}. + +@command{gawk} places the value of the search path that it used into +@code{ENVIRON["AWKPATH"]}. This provides access to the actual search +path value from within an @command{awk} program. -While you can change @code{ENVIRON["AWKPATH"]} within your @command{awk} +Although you can change @code{ENVIRON["AWKPATH"]} within your @command{awk} program, this has no effect on the running program's behavior. This makes sense: the @env{AWKPATH} environment variable is used to find the program source files. Once your program is running, all the files have been @@ -3933,37 +4410,36 @@ @node AWKLIBPATH Variable @subsection The @env{AWKLIBPATH} Environment Variable @cindex @env{AWKLIBPATH} environment variable -@cindex directories, searching for shared libraries -@cindex search paths, for shared libraries +@cindex directories, searching for loadable extensions +@cindex search paths, for loadable extensions @cindex differences in @command{awk} and @command{gawk}, @code{AWKLIBPATH} environment variable The @env{AWKLIBPATH} environment variable is similar to the @env{AWKPATH} -variable, but it is used to search for shared libraries specified -with the @option{-l} option rather than for source files. If the library -is not found, the path is searched again after adding the appropriate -shared library suffix for the platform. For example, on GNU/Linux systems, -the suffix @samp{.so} is used. -The search path specified is also used for libraries loaded via the -@samp{@@load} keyword (@pxref{Loading Shared Libraries}). +variable, but it is used to search for loadable extensions (stored as +system shared libraries) specified with the @option{-l} option rather +than for source files. If the extension is not found, the path is +searched again after adding the appropriate shared library suffix for +the platform. For example, on GNU/Linux systems, the suffix @samp{.so} +is used. The search path specified is also used for extensions loaded +via the @code{@@load} keyword (@pxref{Loading Shared Libraries}). + +If @env{AWKLIBPATH} does not exist in the environment, or if it has +an empty value, @command{gawk} uses a default path; this +is typically @samp{/usr/local/lib/gawk}, although it can vary depending +upon how @command{gawk} was built. + +@command{gawk} places the value of the search path that it used into +@code{ENVIRON["AWKLIBPATH"]}. This provides access to the actual search +path value from within an @command{awk} program. @node Other Environment Variables @subsection Other Environment Variables A number of other environment variables affect @command{gawk}'s behavior, but they are more specialized. Those in the following -list are meant to be used by regular users. +list are meant to be used by regular users: @table @env -@item POSIXLY_CORRECT -Causes @command{gawk} to switch POSIX compatibility -mode, disabling all traditional and GNU extensions. -@xref{Options}. - -@item GAWK_SOCK_RETRIES -Controls the number of time @command{gawk} will attempt to -retry a two-way TCP/IP (socket) connection before giving up. -@xref{TCP/IP Networking}. - @item GAWK_MSEC_SLEEP Specifies the interval between connection retries, in milliseconds. On systems that do not support @@ -3974,6 +4450,16 @@ Specifies the time, in milliseconds, for @command{gawk} to wait for input before returning with an error. @xref{Read Timeout}. + +@item GAWK_SOCK_RETRIES +Controls the number of times @command{gawk} attempts to +retry a two-way TCP/IP (socket) connection before giving up. +@xref{TCP/IP Networking}. + +@item POSIXLY_CORRECT +Causes @command{gawk} to switch to POSIX-compatibility +mode, disabling all traditional and GNU extensions. +@xref{Options}. @end table The environment variables in the following list are meant @@ -3981,9 +4467,18 @@ They are subject to change. The variables are: @table @env +@item AWKBUFSIZE +This variable only affects @command{gawk} on POSIX-compliant systems. +With a value of @samp{exact}, @command{gawk} uses the size of each input +file as the size of the memory buffer to allocate for I/O. Otherwise, +the value should be a number, and @command{gawk} uses that number as +the size of the buffer to allocate. (When this variable is not set, +@command{gawk} uses the smaller of the file's size and the ``default'' +blocksize, which is usually the filesystem's I/O blocksize.) + @item AWK_HASH If this variable exists with a value of @samp{gst}, @command{gawk} -will switch to using the hash function from GNU Smalltalk for +switches to using the hash function from GNU Smalltalk for managing arrays. This function may be marginally faster than the standard function. @@ -3994,10 +4489,11 @@ where I/O is performed in records, not in blocks. @item GAWK_MSG_SRC -If this variable exists, @command{gawk} includes the source file -name and line number from which warning and/or fatal messages +If this variable exists, @command{gawk} includes the @value{FN} +and line number within the @command{gawk} source code +from which warning and/or fatal messages are generated. Its purpose is to help isolate the source of a -message, since there can be multiple places which produce the +message, as there are multiple places that produce the same warning or error message. @item GAWK_NO_DFA @@ -4008,21 +4504,29 @@ supposed to be differences, but occasionally theory and practice don't coordinate with each other.) +@item GAWK_NO_PP_RUN +When @command{gawk} is invoked with the @option{--pretty-print} option, +it will not run the program if this environment variable exists. + +@quotation CAUTION +This variable will not survive into the next major release. +@end quotation + @item GAWK_STACKSIZE This specifies the amount by which @command{gawk} should grow its internal evaluation stack, when needed. @item INT_CHAIN_MAX -The average number of items @command{gawk} will maintain on a +This specifies intended maximum number of items @command{gawk} will maintain on a hash chain for managing arrays indexed by integers. @item STR_CHAIN_MAX -The average number of items @command{gawk} will maintain on a +This specifies intended maximum number of items @command{gawk} will maintain on a hash chain for managing arrays indexed by strings. @item TIDYMEM If this variable exists, @command{gawk} uses the @code{mtrace()} library -calls from GNU LIBC to help track down possible memory leaks. +calls from the GNU C library to help track down possible memory leaks. @end table @node Exit Status @@ -4041,24 +4545,27 @@ the C constant @code{EXIT_FAILURE}. This is usually one. If @command{gawk} exits because of a fatal error, the exit -status is 2. On non-POSIX systems, this value may be mapped +status is two. On non-POSIX systems, this value may be mapped to @code{EXIT_FAILURE}. @node Include Files -@section Including Other Files Into Your Program +@section Including Other Files into Your Program @c Panos Papadopoulos contributed the original @c text for this section. This @value{SECTION} describes a feature that is specific to @command{gawk}. -The @samp{@@include} keyword can be used to read external @command{awk} source +@cindex @code{@@include} directive +@cindex file inclusion, @code{@@include} directive +@cindex including files, @code{@@include} directive +The @code{@@include} keyword can be used to read external @command{awk} source files. This gives you the ability to split large @command{awk} source files into smaller, more manageable pieces, and also lets you reuse common @command{awk} code from various @command{awk} scripts. In other words, you can group -together @command{awk} functions, used to carry out specific tasks, +together @command{awk} functions used to carry out specific tasks into external files. These files can be used just like function libraries, -using the @samp{@@include} keyword in conjunction with the @env{AWKPATH} +using the @code{@@include} keyword in conjunction with the @env{AWKPATH} environment variable. Note that source files may also be included using the @option{-i} option. @@ -4087,19 +4594,19 @@ @example $ @kbd{gawk -f test2} -@print{} This is file test1. -@print{} This is file test2. +@print{} This is script test1. +@print{} This is script test2. @end example -@code{gawk} runs the @file{test2} script which includes @file{test1} -using the @samp{@@include} -keyword. So, to include external @command{awk} source files you just -use @samp{@@include} followed by the name of the file to be included, +@command{gawk} runs the @file{test2} script, which includes @file{test1} +using the @code{@@include} +keyword. So, to include external @command{awk} source files, you just +use @code{@@include} followed by the name of the file to be included, enclosed in double quotes. @quotation NOTE -Keep in mind that this is a language construct and the file name cannot -be a string variable, but rather just a literal string in double quotes. +Keep in mind that this is a language construct and the @value{FN} cannot +be a string variable, but rather just a literal string constant in double quotes. @end quotation The files to be included may be nested; e.g., given a third @@ -4118,70 +4625,75 @@ @example $ @kbd{gawk -f test3} -@print{} This is file test1. -@print{} This is file test2. -@print{} This is file test3. +@print{} This is script test1. +@print{} This is script test2. +@print{} This is script test3. @end example -The file name can, of course, be a pathname. For example: +The @value{FN} can, of course, be a pathname. For example: @example @@include "../io_funcs" @end example @noindent -or: +and: @example @@include "/usr/awklib/network" @end example @noindent -are valid. The @code{AWKPATH} environment variable can be of great -value when using @samp{@@include}. The same rules for the use -of the @code{AWKPATH} variable in command-line file searches +are both valid. The @env{AWKPATH} environment variable can be of great +value when using @code{@@include}. The same rules for the use +of the @env{AWKPATH} variable in command-line file searches (@pxref{AWKPATH Variable}) apply to -@samp{@@include} also. +@code{@@include} also. This is very helpful in constructing @command{gawk} function libraries. -If you have a large script with useful, general purpose @command{awk} +If you have a large script with useful, general-purpose @command{awk} functions, you can break it down into library files and put those files -in a special directory. You can then include those ``libraries,'' using -either the full pathnames of the files, or by setting the @code{AWKPATH} -environment variable accordingly and then using @samp{@@include} with -just the file part of the full pathname. Of course you can have more -than one directory to keep library files; the more complex the working +in a special directory. You can then include those ``libraries,'' +either by using the full pathnames of the files, or by setting the @env{AWKPATH} +environment variable accordingly and then using @code{@@include} with +just the file part of the full pathname. Of course, +you can keep library files in more than one directory; +the more complex the working environment is, the more directories you may need to organize the files to be included. Given the ability to specify multiple @option{-f} options, the -@samp{@@include} mechanism is not strictly necessary. -However, the @samp{@@include} keyword +@code{@@include} mechanism is not strictly necessary. +However, the @code{@@include} keyword can help you in constructing self-contained @command{gawk} programs, thus reducing the need for writing complex and tedious command lines. -In particular, @samp{@@include} is very useful for writing CGI scripts +In particular, @code{@@include} is very useful for writing CGI scripts to be run from web pages. As mentioned in @ref{AWKPATH Variable}, the current directory is always -searched first for source files, before searching in @env{AWKPATH}, -and this also applies to files named with @samp{@@include}. +searched first for source files, before searching in @env{AWKPATH}; +this also applies to files named with @code{@@include}. @node Loading Shared Libraries -@section Loading Shared Libraries Into Your Program +@section Loading Dynamic Extensions into Your Program This @value{SECTION} describes a feature that is specific to @command{gawk}. -The @samp{@@load} keyword can be used to read external @command{awk} shared -libraries. This allows you to link in compiled code that may offer superior -performance and/or give you access to extended capabilities not supported +@cindex @code{@@load} directive +@cindex loading extensions, @code{@@load} directive +@cindex extensions, loading, @code{@@load} directive +The @code{@@load} keyword can be used to read external @command{awk} extensions +(stored as system shared libraries). +This allows you to link in compiled code that may offer superior +performance and/or give you access to extended capabilities not supported by the @command{awk} language. The @env{AWKLIBPATH} variable is used to -search for the shared library. Using @samp{@@load} is completely equivalent +search for the extension. Using @code{@@load} is completely equivalent to using the @option{-l} command-line option. -If the shared library is not initially found in @env{AWKLIBPATH}, another +If the extension is not initially found in @env{AWKLIBPATH}, another search is conducted after appending the platform's default shared library -suffix to the filename. For example, on GNU/Linux systems, the suffix -@samp{.so} is used. +suffix to the @value{FN}. For example, on GNU/Linux systems, the suffix +@samp{.so} is used: @example $ @kbd{gawk '@@load "ordchr"; BEGIN @{print chr(65)@}'} @@ -4198,29 +4710,29 @@ @noindent For command-line usage, the @option{-l} option is more convenient, -but @samp{@@load} is useful for embedding inside an @command{awk} source file -that requires access to a shared library. +but @code{@@load} is useful for embedding inside an @command{awk} source file +that requires access to an extension. @ref{Dynamic Extensions}, describes how to write extensions (in C or C++) -that can be loaded with either @samp{@@load} or the @option{-l} option. +that can be loaded with either @code{@@load} or the @option{-l} option. +It also describes the @code{ordchr} extension. @node Obsolete @section Obsolete Options and/or Features -@cindex features, advanced, See advanced features +@c update this section for each release! + @cindex options, deprecated @cindex features, deprecated @cindex obsolete features This @value{SECTION} describes features and/or command-line options from -previous releases of @command{gawk} that are either not available in the -current version or that are still supported but deprecated (meaning that +previous releases of @command{gawk} that either are not available in the +current version or are still supported but deprecated (meaning that they will @emph{not} be in the next release). -@c update this section for each release! - The process-related special files @file{/dev/pid}, @file{/dev/ppid}, @file{/dev/pgrpid}, and @file{/dev/user} were deprecated in @command{gawk} -3.1, but still worked. As of version 4.0, they are no longer +3.1, but still worked. As of @value{PVERSION} 4.0, they are no longer interpreted specially by @command{gawk}. (Use @code{PROCINFO} instead; see @ref{Auto-set}.) @@ -4272,15 +4784,15 @@ @end example @command{gawk} actually supports this but it is purposely undocumented -because it is considered bad style. The correct way to write such a program -is either +because it is bad style. The correct way to write such a program +is either: @example awk '@{ sum += $1 @} ; END @{ print sum @}' @end example @noindent -or +or: @example awk '@{ sum += $1 @} @@ -4288,22 +4800,73 @@ @end example @noindent -@xref{Statements/Lines}, for a fuller -explanation. +@xref{Statements/Lines}, for a fuller explanation. You can insert newlines after the @samp{;} in @code{for} loops. This seems to have been a long-undocumented feature in Unix @command{awk}. Similarly, you may use @code{print} or @code{printf} statements in the @var{init} and @var{increment} parts of a @code{for} loop. This is another -long-undocumented ``feature'' of Unix @code{awk}. +long-undocumented ``feature'' of Unix @command{awk}. @end ignore +@node Invoking Summary +@section Summary + +@itemize @value{BULLET} +@item +Use either +@samp{awk '@var{program}' @var{files}} +or +@samp{awk -f @var{program-file} @var{files}} +to run @command{awk}. + +@item +The three standard options for all versions of @command{awk} are +@option{-f}, @option{-F}, and @option{-v}. @command{gawk} supplies these +and many others, as well as corresponding GNU-style long options. + +@item +Nonoption command-line arguments are usually treated as @value{FN}s, +unless they have the form @samp{@var{var}=@var{value}}, in which case +they are taken as variable assignments to be performed at that point +in processing the input. + +@item +All nonoption command-line arguments, excluding the program text, +are placed in the @code{ARGV} array. Adjusting @code{ARGC} and @code{ARGV} +affects how @command{awk} processes input. + +@item +You can use a single minus sign (@samp{-}) to refer to standard input +on the command line. @command{gawk} also lets you use the special +@value{FN} @file{/dev/stdin}. + +@item +@command{gawk} pays attention to a number of environment variables. +@env{AWKPATH}, @env{AWKLIBPATH}, and @env{POSIXLY_CORRECT} are the +most important ones. + +@item +@command{gawk}'s exit status conveys information to the program +that invoked it. Use the @code{exit} statement from within +an @command{awk} program to set the exit status. + +@item +@command{gawk} allows you to include other @command{awk} source files into +your program using the @code{@@include} statement and/or the @option{-i} +and @option{-f} command-line options. + +@item +@command{gawk} allows you to load additional functions written in C +or C++ using the @code{@@load} statement and/or the @option{-l} option. +(This advanced feature is described later, in @ref{Dynamic Extensions}.) +@end itemize + @node Regexp @chapter Regular Expressions @cindex regexp -@c STARTOFRANGE regexp @cindex regular expressions A @dfn{regular expression}, or @dfn{regexp}, is a way of describing a @@ -4319,8 +4882,8 @@ The simplest regular expression is a sequence of letters, numbers, or both. Such a regexp matches any string that contains that sequence. Thus, the regexp @samp{foo} matches any string containing @samp{foo}. -Therefore, the pattern @code{/foo/} matches any input record containing -the three characters @samp{foo} @emph{anywhere} in the record. Other +Thus, the pattern @code{/foo/} matches any input record containing +the three adjacent characters @samp{foo} @emph{anywhere} in the record. Other kinds of regexps let you specify more complicated classes of strings. @ifnotinfo @@ -4334,10 +4897,11 @@ * Escape Sequences:: How to write nonprinting characters. * Regexp Operators:: Regular Expression Operators. * Bracket Expressions:: What can go between @samp{[...]}. -* GNU Regexp Operators:: Operators specific to GNU software. -* Case-sensitivity:: How to do case-insensitive matching. * Leftmost Longest:: How much text matches. * Computed Regexps:: Using Dynamic Regexps. +* GNU Regexp Operators:: Operators specific to GNU software. +* Case-sensitivity:: How to do case-insensitive matching. +* Regexp Summary:: Regular expressions summary. @end menu @node Regexp Usage @@ -4348,8 +4912,8 @@ slashes. Then the regular expression is tested against the entire text of each record. (Normally, it only needs to match some part of the text in order to succeed.) For example, the -following prints the second field of each record that contains the string -@samp{li} anywhere in it: +following prints the second field of each record where the string +@samp{li} appears anywhere in the record: @example $ @kbd{awk '/li/ @{ print $2 @}' mail-list} @@ -4381,17 +4945,16 @@ using these operators can be used as patterns, or in @code{if}, @code{while}, @code{for}, and @code{do} statements. (@xref{Statements}.) -For example: +For example, the following is true if the expression @var{exp} (taken +as a string) matches @var{regexp}: @example @var{exp} ~ /@var{regexp}/ @end example @noindent -is true if the expression @var{exp} (taken as a string) -matches @var{regexp}. The following example matches, or selects, -all input records with the uppercase letter @samp{J} somewhere in the -first field: +This example matches, or selects, all input records with the uppercase +letter @samp{J} somewhere in the first field: @example $ @kbd{awk '$1 ~ /J/' inventory-shipped} @@ -4461,11 +5024,11 @@ @samp{"} and @samp{\} must be written @code{"\"\\"}. Other escape sequences represent unprintable characters -such as TAB or newline. While there is nothing to stop you from entering most +such as TAB or newline. There is nothing to stop you from entering most unprintable characters directly in a string constant or regexp constant, -they may look ugly. +but they may look ugly. -The following table lists +The following list presents all the escape sequences used in @command{awk} and what they represent. Unless noted otherwise, all these escape sequences apply to both string constants and regexp constants: @@ -4479,7 +5042,7 @@ @cindex backslash (@code{\}), @code{\a} escape sequence @item \a The ``alert'' character, @kbd{Ctrl-g}, ASCII code 7 (BEL). -(This usually makes some sort of audible noise.) +(This often makes some sort of audible noise.) @cindex @code{\} (backslash), @code{\b} escape sequence @cindex backslash (@code{\}), @code{\b} escape sequence @@ -4510,7 +5073,7 @@ @cindex @code{\} (backslash), @code{\v} escape sequence @cindex backslash (@code{\}), @code{\v} escape sequence @item \v -Vertical tab, @kbd{Ctrl-k}, ASCII code 11 (VT). +Vertical TAB, @kbd{Ctrl-k}, ASCII code 11 (VT). @cindex @code{\} (backslash), @code{\}@var{nnn} escape sequence @cindex backslash (@code{\}), @code{\}@var{nnn} escape sequence @@ -4535,13 +5098,22 @@ undefined results. (The @samp{\x} escape sequence is not allowed in POSIX @command{awk}.) +@quotation CAUTION +The next major release of @command{gawk} will change, such +that a maximum of two hexadecimal digits following the +@samp{\x} will be used. +@end quotation + @cindex @code{\} (backslash), @code{\/} escape sequence @cindex backslash (@code{\}), @code{\/} escape sequence @item \/ A literal slash (necessary for regexp constants only). This sequence is used when you want to write a regexp -constant that contains a slash. Because the regexp is delimited by -slashes, you need to escape the slash that is part of the pattern, +constant that contains a slash +(such as @code{/.*:\/home\/[[:alnum:]]+:.*/}; the @samp{[[:alnum:]]} +notation is discussed in @ref{Bracket Expressions}). +Because the regexp is delimited by +slashes, you need to escape any slash that is part of the pattern, in order to tell @command{awk} to keep processing the rest of the regexp. @cindex @code{\} (backslash), @code{\"} escape sequence @@ -4549,8 +5121,10 @@ @item \" A literal double quote (necessary for string constants only). This sequence is used when you want to write a string -constant that contains a double quote. Because the string is delimited by -double quotes, you need to escape the quote that is part of the string, +constant that contains a double quote +(such as @code{"He said \"hi!\" to her."}). +Because the string is delimited by +double quotes, you need to escape any quote that is part of the string, in order to tell @command{awk} to keep processing the rest of the string. @end table @@ -4560,7 +5134,7 @@ In a regexp, a backslash before any character that is not in the previous list and not listed in -@ref{GNU Regexp Operators}, +@DBREF{GNU Regexp Operators} means that the next character should be taken literally, even if it would normally be a regexp operator. For example, @code{/a\+b/} matches the three characters @samp{a+b}. @@ -4569,27 +5143,9 @@ @cindex @code{\} (backslash), in escape sequences @cindex portability For complete portability, do not use a backslash before any character not -shown in the previous list. - -To summarize: - -@itemize @bullet -@item -The escape sequences in the table above are always processed first, -for both string constants and regexp constants. This happens very early, -as soon as @command{awk} reads your program. - -@item -@command{gawk} processes both regexp constants and dynamic regexps -(@pxref{Computed Regexps}), -for the special operators listed in -@ref{GNU Regexp Operators}. - -@item -A backslash before any other character means to treat that character -literally. -@end itemize +shown in the previous list or that is not an operator. +@c 11/2014: Moved so as to not stack sidebars @sidebar Backslash Before Regular Characters @cindex portability, backslash in escape sequences @cindex POSIX @command{awk}, backslashes in string constants @@ -4606,7 +5162,7 @@ @cindex Brian Kernighan's @command{awk} @table @asis @item Strip the backslash out -This is what Brian Kernighan's @command{awk} and @command{gawk} both do. +This is what BWK @command{awk} and @command{gawk} both do. For example, @code{"a\qc"} is the same as @code{"aqc"}. (Because this is such an easy bug both to introduce and to miss, @command{gawk} warns you about it.) @@ -4625,6 +5181,25 @@ @end table @end sidebar +To summarize: + +@itemize @value{BULLET} +@item +The escape sequences in the preceding list are always processed first, +for both string constants and regexp constants. This happens very early, +as soon as @command{awk} reads your program. + +@item +@command{gawk} processes both regexp constants and dynamic regexps +(@pxref{Computed Regexps}), +for the special operators listed in +@ref{GNU Regexp Operators}. + +@item +A backslash before any other character means to treat that character +literally. +@end itemize + @sidebar Escape Sequences for Metacharacters @cindex metacharacters, escape sequences for @@ -4647,7 +5222,6 @@ @node Regexp Operators @section Regular Expression Operators -@c STARTOFRANGE regexpo @cindex regular expressions, operators @cindex metacharacters in regular expressions @@ -4659,19 +5233,20 @@ @ifnotinfo earlier @end ifnotinfo -in @ref{Escape Sequences}, +in @DBREF{Escape Sequences} are valid inside a regexp. They are introduced by a @samp{\} and are recognized and converted into corresponding real characters as the very first step in processing regexps. Here is a list of metacharacters. All characters that are not escape -sequences and that are not listed in the table stand for themselves: +sequences and that are not listed here stand for themselves: -@table @code +@c Use @asis so the docbook comes out ok. Sigh. +@table @asis @cindex backslash (@code{\}), regexp operator @cindex @code{\} (backslash), regexp operator -@item \ -This is used to suppress the special meaning of a character when +@item @code{\} +This suppresses the special meaning of a character when matching. For example, @samp{\$} matches the character @samp{$}. @@ -4679,15 +5254,16 @@ @cindex Texinfo, chapter beginnings in files @cindex @code{^} (caret), regexp operator @cindex caret (@code{^}), regexp operator -@item ^ -This matches the beginning of a string. For example, @samp{^@@chapter} -matches @samp{@@chapter} at the beginning of a string and can be used +@item @code{^} +This matches the beginning of a string. @samp{^@@chapter} +matches @samp{@@chapter} at the beginning of a string, +for example, and can be used to identify chapter beginnings in Texinfo source files. The @samp{^} is known as an @dfn{anchor}, because it anchors the pattern to match only at the beginning of the string. It is important to realize that @samp{^} does not match the beginning of -a line embedded in a string. +a line (the point right after a @samp{\n} newline character) embedded in a string. The condition is not true in the following example: @example @@ -4696,11 +5272,13 @@ @cindex @code{$} (dollar sign), regexp operator @cindex dollar sign (@code{$}), regexp operator -@item $ +@item @code{$} This is similar to @samp{^}, but it matches only at the end of a string. For example, @samp{p$} matches a record that ends with a @samp{p}. The @samp{$} is an anchor -and does not match the end of a line embedded in a string. +and does not match the end of a line +(the point right before a @samp{\n} newline character) +embedded in a string. The condition in the following example is not true: @example @@ -4709,7 +5287,7 @@ @cindex @code{.} (period), regexp operator @cindex period (@code{.}), regexp operator -@item . @r{(period)} +@item @code{.} (period) This matches any single character, @emph{including} the newline character. For example, @samp{.P} matches any single character followed by a @samp{P} in a string. Using @@ -4730,7 +5308,7 @@ @cindex character sets, See Also bracket expressions @cindex character lists, See bracket expressions @cindex character classes, See bracket expressions -@item [@dots{}] +@item @code{[}@dots{}@code{]} This is called a @dfn{bracket expression}.@footnote{In other literature, you may see a bracket expression referred to as either a @dfn{character set}, a @dfn{character class}, or a @dfn{character list}.} @@ -4742,7 +5320,7 @@ @ref{Bracket Expressions}. @cindex bracket expressions, complemented -@item [^ @dots{}] +@item @code{[^}@dots{}@code{]} This is a @dfn{complemented bracket expression}. The first character after the @samp{[} @emph{must} be a @samp{^}. It matches any characters @emph{except} those in the square brackets. For example, @samp{[^awk]} @@ -4751,20 +5329,19 @@ @cindex @code{|} (vertical bar) @cindex vertical bar (@code{|}) -@item | +@item @code{|} This is the @dfn{alternation operator} and it is used to specify -alternatives. -The @samp{|} has the lowest precedence of all the regular -expression operators. -For example, @samp{^P|[[:digit:]]} -matches any string that matches either @samp{^P} or @samp{[[:digit:]]}. This -means it matches any string that starts with @samp{P} or contains a digit. +alternatives. The @samp{|} has the lowest precedence of all the regular +expression operators. For example, @samp{^P|[aeiouy]} matches any string +that matches either @samp{^P} or @samp{[aeiouy]}. This means it matches +any string that starts with @samp{P} or contains (anywhere within it) +a lowercase English vowel. The alternation applies to the largest possible regexps on either side. @cindex @code{()} (parentheses), regexp operator @cindex parentheses @code{()}, regexp operator -@item (@dots{}) +@item @code{(}@dots{}@code{)} Parentheses are used for grouping in regular expressions, as in arithmetic. They can be used to concatenate regular expressions containing the alternation operator, @samp{|}. For example, @@ -4775,47 +5352,42 @@ @cindex @code{*} (asterisk), @code{*} operator, as regexp operator @cindex asterisk (@code{*}), @code{*} operator, as regexp operator -@item * +@item @code{*} This symbol means that the preceding regular expression should be repeated as many times as necessary to find a match. For example, @samp{ph*} applies the @samp{*} symbol to the preceding @samp{h} and looks for matches of one @samp{p} followed by any number of @samp{h}s. This also matches just @samp{p} if no @samp{h}s are present. -The @samp{*} repeats the @emph{smallest} possible preceding expression. -(Use parentheses if you want to repeat a larger expression.) It finds -as many repetitions as possible. For example, -@samp{awk '/\(c[ad][ad]*r x\)/ @{ print @}' sample} -prints every record in @file{sample} containing a string of the form -@samp{(car x)}, @samp{(cdr x)}, @samp{(cadr x)}, and so on. -Notice the escaping of the parentheses by preceding them -with backslashes. +There are two subtle points to understand about how @samp{*} works. +First, the @samp{*} applies only to the single preceding regular expression +component (e.g., in @samp{ph*}, it applies just to the @samp{h}). +To cause @samp{*} to apply to a larger subexpression, use parentheses: +@samp{(ph)*} matches @samp{ph}, @samp{phph}, @samp{phphph}, and so on. + +Second, @samp{*} finds as many repetitions as possible. If the text +to be matched is @samp{phhhhhhhhhhhhhhooey}, @samp{ph*} matches all of +the @samp{h}s. @cindex @code{+} (plus sign), regexp operator @cindex plus sign (@code{+}), regexp operator -@item + +@item @code{+} This symbol is similar to @samp{*}, except that the preceding expression must be matched at least once. This means that @samp{wh+y} would match @samp{why} and @samp{whhy}, but not @samp{wy}, whereas -@samp{wh*y} would match all three of these strings. -The following is a simpler -way of writing the last @samp{*} example: - -@example -awk '/\(c[ad]+r x\)/ @{ print @}' sample -@end example +@samp{wh*y} would match all three. @cindex @code{?} (question mark), regexp operator @cindex question mark (@code{?}), regexp operator -@item ? +@item @code{?} This symbol is similar to @samp{*}, except that the preceding expression can be matched either once or not at all. For example, @samp{fe?d} matches @samp{fed} and @samp{fd}, but nothing else. @cindex interval expressions, regexp operator -@item @{@var{n}@} -@itemx @{@var{n},@} -@itemx @{@var{n},@var{m}@} +@item @code{@{}@var{n}@code{@}} +@itemx @code{@{}@var{n}@code{,@}} +@itemx @code{@{}@var{n}@code{,}@var{m}@code{@}} One or two numbers inside braces denote an @dfn{interval expression}. If there is one number in the braces, the preceding regexp is repeated @var{n} times. @@ -4829,10 +5401,10 @@ Matches @samp{whhhy}, but not @samp{why} or @samp{whhhhy}. @item wh@{3,5@}y -Matches @samp{whhhy}, @samp{whhhhy}, or @samp{whhhhhy}, only. +Matches @samp{whhhy}, @samp{whhhhy}, or @samp{whhhhhy} only. @item wh@{2,@}y -Matches @samp{whhy} or @samp{whhhy}, and so on. +Matches @samp{whhy}, @samp{whhhy}, and so on. @end table @cindex POSIX @command{awk}, interval expressions in @@ -4846,7 +5418,7 @@ @command{gawk} did @emph{not} match interval expressions in regexps. -However, beginning with version 4.0, +However, beginning with @value{PVERSION} 4.0, @command{gawk} does match interval expressions by default. This is because compatibility with POSIX has become more important to most @command{gawk} users than compatibility with @@ -4881,24 +5453,22 @@ If @command{gawk} is in compatibility mode (@pxref{Options}), interval expressions are not available in regular expressions. -@c ENDOFRANGE regexpo @node Bracket Expressions @section Using Bracket Expressions -@c STARTOFRANGE charlist @cindex bracket expressions @cindex bracket expressions, range expressions @cindex range expressions (regexps) @cindex character lists in regular expression -As mentioned earlier, a bracket expression matches any character amongst +As mentioned earlier, a bracket expression matches any character among those listed between the opening and closing square brackets. Within a bracket expression, a @dfn{range expression} consists of two characters separated by a hyphen. It matches any single character that sorts between the two characters, based upon the system's native character set. For example, @samp{[0-9]} is equivalent to @samp{[0123456789]}. -(See @ref{Ranges and Locales}, for an explanation of how the POSIX +(See @DBREF{Ranges and Locales} for an explanation of how the POSIX standard and @command{gawk} have changed over time. This is mainly of historical interest.) @@ -4917,12 +5487,15 @@ @noindent matches either @samp{d} or @samp{]}. +Additionally, if you place @samp{]} right after the opening +@samp{[}, the closing bracket is treated as one of the +characters to be matched. @cindex POSIX @command{awk}, bracket expressions and @cindex Extended Regular Expressions (EREs) @cindex EREs (Extended Regular Expressions) @cindex @command{egrep} utility -This treatment of @samp{\} in bracket expressions +The treatment of @samp{\} in bracket expressions is compatible with other @command{awk} implementations and is also mandated by POSIX. The regular expressions in @command{awk} are a superset @@ -4946,23 +5519,23 @@ POSIX standard. @float Table,table-char-classes -@caption{POSIX Character Classes} +@caption{POSIX character classes} @multitable @columnfractions .15 .85 @headitem Class @tab Meaning -@item @code{[:alnum:]} @tab Alphanumeric characters. -@item @code{[:alpha:]} @tab Alphabetic characters. -@item @code{[:blank:]} @tab Space and TAB characters. -@item @code{[:cntrl:]} @tab Control characters. -@item @code{[:digit:]} @tab Numeric characters. -@item @code{[:graph:]} @tab Characters that are both printable and visible. -(A space is printable but not visible, whereas an @samp{a} is both.) -@item @code{[:lower:]} @tab Lowercase alphabetic characters. -@item @code{[:print:]} @tab Printable characters (characters that are not control characters). +@item @code{[:alnum:]} @tab Alphanumeric characters +@item @code{[:alpha:]} @tab Alphabetic characters +@item @code{[:blank:]} @tab Space and TAB characters +@item @code{[:cntrl:]} @tab Control characters +@item @code{[:digit:]} @tab Numeric characters +@item @code{[:graph:]} @tab Characters that are both printable and visible +(a space is printable but not visible, whereas an @samp{a} is both) +@item @code{[:lower:]} @tab Lowercase alphabetic characters +@item @code{[:print:]} @tab Printable characters (characters that are not control characters) @item @code{[:punct:]} @tab Punctuation characters (characters that are not letters, digits, -control characters, or space characters). -@item @code{[:space:]} @tab Space characters (such as space, TAB, and formfeed, to name a few). -@item @code{[:upper:]} @tab Uppercase alphabetic characters. -@item @code{[:xdigit:]} @tab Characters that are hexadecimal digits. +control characters, or space characters) +@item @code{[:space:]} @tab Space characters (such as space, TAB, and formfeed, to name a few) +@item @code{[:upper:]} @tab Uppercase alphabetic characters +@item @code{[:xdigit:]} @tab Characters that are hexadecimal digits @end multitable @end float @@ -4974,6 +5547,17 @@ @code{/[[:alnum:]]/} to match the alphabetic and numeric characters in your character set. +@c Thanks to +@c Date: Tue, 01 Jul 2014 07:39:51 +0200 +@c From: Hermann Peifer +Some utilities that match regular expressions provide a nonstandard +@samp{[:ascii:]} character class; @command{awk} does not. However, you +can simulate such a construct using @samp{[\x00-\x7F]}. This matches +all values numerically between zero and 127, which is the defined +range of the ASCII character set. Use a complemented character list +(@samp{[^\x00-\x7F]}) to match any single-byte characters that are not +in the ASCII range. + @cindex bracket expressions, collating elements @cindex bracket expressions, non-ASCII @cindex collating elements @@ -5000,8 +5584,8 @@ characters that are equal. The name is enclosed between @samp{[=} and @samp{=]}. For example, the name @samp{e} might be used to represent all of -``e,'' ``@`e,'' and ``@'e.'' In this case, @samp{[[=e=]]} is a regexp -that matches any of @samp{e}, @samp{@'e}, or @samp{@`e}. +``e,'' ``@^e,'' ``@`e,'' and ``@'e.'' In this case, @samp{[[=e=]]} is a regexp +that matches any of @samp{e}, @samp{@^e}, @samp{@'e}, or @samp{@`e}. @end table These features are very valuable in non-English-speaking locales. @@ -5015,67 +5599,214 @@ they do not recognize collating symbols or equivalence classes. @end quotation @c maybe one day ... -@c ENDOFRANGE charlist -@node GNU Regexp Operators -@section @command{gawk}-Specific Regexp Operators +@node Leftmost Longest +@section How Much Text Matches? -@c This section adapted (long ago) from the regex-0.12 manual +@cindex regular expressions, leftmost longest match +@c @cindex matching, leftmost longest +Consider the following: -@c STARTOFRANGE regexpg -@cindex regular expressions, operators, @command{gawk} -@c STARTOFRANGE gregexp -@cindex @command{gawk}, regular expressions, operators -@cindex operators, GNU-specific -@cindex regular expressions, operators, for words -@cindex word, regexp definition of -GNU software that deals with regular expressions provides a number of -additional regexp operators. These operators are described in this -@value{SECTION} and are specific to @command{gawk}; -they are not available in other @command{awk} implementations. -Most of the additional operators deal with word matching. -For our purposes, a @dfn{word} is a sequence of one or more letters, digits, -or underscores (@samp{_}): +@example +echo aaaabcd | awk '@{ sub(/a+/, ""); print @}' +@end example -@table @code -@c @cindex operators, @code{\s} (@command{gawk}) -@cindex backslash (@code{\}), @code{\s} operator (@command{gawk}) -@cindex @code{\} (backslash), @code{\s} operator (@command{gawk}) -@item \s -Matches any whitespace character. -Think of it as shorthand for -@w{@samp{[[:space:]]}}. +This example uses the @code{sub()} function to make a change to the input +record. (@code{sub()} replaces the first instance of any text matched +by the first argument with the string provided as the second argument; +@pxref{String Functions}.) Here, the regexp @code{/a+/} indicates ``one +or more @samp{a} characters,'' and the replacement text is @samp{}. -@c @cindex operators, @code{\S} (@command{gawk}) -@cindex backslash (@code{\}), @code{\S} operator (@command{gawk}) -@cindex @code{\} (backslash), @code{\S} operator (@command{gawk}) -@item \S -Matches any character that is not whitespace. -Think of it as shorthand for -@w{@samp{[^[:space:]]}}. +The input contains four @samp{a} characters. +@command{awk} (and POSIX) regular expressions always match +the leftmost, @emph{longest} sequence of input characters that can +match. Thus, all four @samp{a} characters are +replaced with @samp{} in this example: -@c @cindex operators, @code{\w} (@command{gawk}) -@cindex backslash (@code{\}), @code{\w} operator (@command{gawk}) -@cindex @code{\} (backslash), @code{\w} operator (@command{gawk}) -@item \w -Matches any word-constituent character---that is, it matches any -letter, digit, or underscore. Think of it as shorthand for -@w{@samp{[[:alnum:]_]}}. +@example +$ @kbd{echo aaaabcd | awk '@{ sub(/a+/, ""); print @}'} +@print{} bcd +@end example -@c @cindex operators, @code{\W} (@command{gawk}) -@cindex backslash (@code{\}), @code{\W} operator (@command{gawk}) -@cindex @code{\} (backslash), @code{\W} operator (@command{gawk}) -@item \W -Matches any character that is not word-constituent. -Think of it as shorthand for -@w{@samp{[^[:alnum:]_]}}. +For simple match/no-match tests, this is not so important. But when doing +text matching and substitutions with the @code{match()}, @code{sub()}, @code{gsub()}, +and @code{gensub()} functions, it is very important. +@ifinfo +@xref{String Functions}, +for more information on these functions. +@end ifinfo +Understanding this principle is also important for regexp-based record +and field splitting (@pxref{Records}, +and also @pxref{Field Separators}). -@c @cindex operators, @code{\<} (@command{gawk}) -@cindex backslash (@code{\}), @code{\<} operator (@command{gawk}) -@cindex @code{\} (backslash), @code{\<} operator (@command{gawk}) -@item \< -Matches the empty string at the beginning of a word. -For example, @code{/\>> \t\n]" <<< +@end example + +@cindex newlines, in regexp constants +But a newline in a regexp constant works with no problem: + +@example +$ @kbd{awk '$0 ~ /[ \t\n]/'} +@kbd{here is a sample line} +@print{} here is a sample line +@kbd{Ctrl-d} +@end example + +@command{gawk} does not have this problem, and it isn't likely to +occur often in practice, but it's worth noting for future reference. +@end sidebar + +@node GNU Regexp Operators +@section @command{gawk}-Specific Regexp Operators + +@c This section adapted (long ago) from the regex-0.12 manual + +@cindex regular expressions, operators, @command{gawk} +@cindex @command{gawk}, regular expressions, operators +@cindex operators, GNU-specific +@cindex regular expressions, operators, for words +@cindex word, regexp definition of +GNU software that deals with regular expressions provides a number of +additional regexp operators. These operators are described in this +@value{SECTION} and are specific to @command{gawk}; +they are not available in other @command{awk} implementations. +Most of the additional operators deal with word matching. +For our purposes, a @dfn{word} is a sequence of one or more letters, digits, +or underscores (@samp{_}): + +@table @code +@c @cindex operators, @code{\s} (@command{gawk}) +@cindex backslash (@code{\}), @code{\s} operator (@command{gawk}) +@cindex @code{\} (backslash), @code{\s} operator (@command{gawk}) +@item \s +Matches any whitespace character. +Think of it as shorthand for +@w{@samp{[[:space:]]}}. + +@c @cindex operators, @code{\S} (@command{gawk}) +@cindex backslash (@code{\}), @code{\S} operator (@command{gawk}) +@cindex @code{\} (backslash), @code{\S} operator (@command{gawk}) +@item \S +Matches any character that is not whitespace. +Think of it as shorthand for +@w{@samp{[^[:space:]]}}. + +@c @cindex operators, @code{\w} (@command{gawk}) +@cindex backslash (@code{\}), @code{\w} operator (@command{gawk}) +@cindex @code{\} (backslash), @code{\w} operator (@command{gawk}) +@item \w +Matches any word-constituent character---that is, it matches any +letter, digit, or underscore. Think of it as shorthand for +@w{@samp{[[:alnum:]_]}}. + +@c @cindex operators, @code{\W} (@command{gawk}) +@cindex backslash (@code{\}), @code{\W} operator (@command{gawk}) +@cindex @code{\} (backslash), @code{\W} operator (@command{gawk}) +@item \W +Matches any character that is not word-constituent. +Think of it as shorthand for +@w{@samp{[^[:alnum:]_]}}. + +@c @cindex operators, @code{\<} (@command{gawk}) +@cindex backslash (@code{\}), @code{\<} operator (@command{gawk}) +@cindex @code{\} (backslash), @code{\<} operator (@command{gawk}) +@item \< +Matches the empty string at the beginning of a word. +For example, @code{/\} (@command{gawk}) @@ -5100,7 +5831,7 @@ @item \B Matches the empty string that occurs between two word-constituent characters. For example, -@code{/\Brat\B/} matches @samp{crate} but it does not match @samp{dirty rat}. +@code{/\Brat\B/} matches @samp{crate}, but it does not match @samp{dirty rat}. @samp{\B} is essentially the opposite of @samp{\y}. @end table @@ -5108,9 +5839,9 @@ @cindex regular expressions, operators, for buffers @cindex operators, string-matching, for buffers There are two other operators that work on buffers. In Emacs, a -@dfn{buffer} is, naturally, an Emacs buffer. For other programs, -@command{gawk}'s regexp library routines consider the entire -string to match as the buffer. +@dfn{buffer} is, naturally, an Emacs buffer. +Other GNU programs, including @command{gawk}, +consider the entire string to match as the buffer. The operators are: @table @code @@ -5119,14 +5850,14 @@ @cindex backslash (@code{\}), @code{\`} operator (@command{gawk}) @cindex @code{\} (backslash), @code{\`} operator (@command{gawk}) Matches the empty string at the -beginning of a buffer (string). +beginning of a buffer (string) @c @cindex operators, @code{\'} (@command{gawk}) @cindex backslash (@code{\}), @code{\'} operator (@command{gawk}) @cindex @code{\} (backslash), @code{\'} operator (@command{gawk}) @item \' Matches the empty string at the -end of a buffer (string). +end of a buffer (string) @end table @cindex @code{^} (caret), regexp operator @@ -5149,9 +5880,6 @@ method of using @samp{\y} for the GNU @samp{\b} appears to be the lesser of two evils. -@c NOTE!!! Keep this in sync with the same table in the summary appendix! -@c -@c Should really do this with file inclusion. @cindex regular expressions, @command{gawk}, command-line options @cindex @command{gawk}, command-line options, and regular expressions The various command-line options @@ -5167,21 +5895,23 @@ GNU regexp operators. @end ifnotinfo @ifnottex +@ifnotdocbook GNU regexp operators described in @ref{Regexp Operators}. +@end ifnotdocbook @end ifnottex @item @code{--posix} -Only POSIX regexps are supported; the GNU operators are not special +Match only POSIX regexps; the GNU operators are not special (e.g., @samp{\w} matches a literal @samp{w}). Interval expressions are allowed. @cindex Brian Kernighan's @command{awk} @item @code{--traditional} -Traditional Unix @command{awk} regexps are matched. The GNU operators +Match traditional Unix @command{awk} regexps. The GNU operators are not special, and interval expressions are not available. -The POSIX character classes (@samp{[[:alnum:]]}, etc.) are supported, -as Brian Kernighan's @command{awk} does support them. +Because BWK @command{awk} supports them, +the POSIX character classes (@samp{[[:alnum:]]}, etc.) are available. Characters described by octal and hexadecimal escape sequences are treated literally, even if they represent regexp metacharacters. @@ -5190,15 +5920,11 @@ has been provided. Otherwise, interval expressions are available by default. @end table -@c ENDOFRANGE gregexp -@c ENDOFRANGE regexpg @node Case-sensitivity @section Case Sensitivity in Matching -@c STARTOFRANGE regexpcs @cindex regular expressions, case sensitivity -@c STARTOFRANGE csregexp @cindex case sensitivity, regexps and Case is normally significant in regular expressions, both when matching ordinary characters (i.e., not metacharacters) and inside bracket @@ -5238,10 +5964,12 @@ Another method, specific to @command{gawk}, is to set the variable @code{IGNORECASE} to a nonzero value (@pxref{Built-in Variables}). When @code{IGNORECASE} is not zero, @emph{all} regexp and string -operations ignore case. Changing the value of -@code{IGNORECASE} dynamically controls the case-sensitivity of the -program as it runs. Case is significant by default because -@code{IGNORECASE} (like most variables) is initialized to zero: +operations ignore case. + +Changing the value of @code{IGNORECASE} dynamically controls the +case sensitivity of the program as it runs. Case is significant by +default because @code{IGNORECASE} (like most variables) is initialized +to zero: @example x = "aB" @@ -5252,7 +5980,7 @@ @end example In general, you cannot use @code{IGNORECASE} to make certain rules -case-insensitive and other rules case-sensitive, because there is no +case insensitive and other rules case sensitive, as there is no straightforward way to set @code{IGNORECASE} just for the pattern of a particular rule.@footnote{Experienced C and C++ programmers will note @@ -5263,16 +5991,13 @@ However, this is somewhat obscure and we don't recommend it.} To do this, use either bracket expressions or @code{tolower()}. However, one thing you can do with @code{IGNORECASE} only is dynamically turn -case-sensitivity on or off for all the rules at once. +case sensitivity on or off for all the rules at once. @code{IGNORECASE} can be set on the command line or in a @code{BEGIN} rule (@pxref{Other Arguments}; also @pxref{Using BEGIN/END}). Setting @code{IGNORECASE} from the command line is a way to make -a program case-insensitive without having to edit it. - -Both regexp and string comparison -operations are affected by @code{IGNORECASE}. +a program case insensitive without having to edit it. @c @cindex ISO 8859-1 @c @cindex ISO Latin-1 @@ -5291,168 +6016,56 @@ The value of @code{IGNORECASE} has no effect if @command{gawk} is in compatibility mode (@pxref{Options}). Case is always significant in compatibility mode. -@c ENDOFRANGE csregexp -@c ENDOFRANGE regexpcs - -@node Leftmost Longest -@section How Much Text Matches? - -@cindex regular expressions, leftmost longest match -@c @cindex matching, leftmost longest -Consider the following: - -@example -echo aaaabcd | awk '@{ sub(/a+/, ""); print @}' -@end example - -This example uses the @code{sub()} function (which we haven't discussed yet; -@pxref{String Functions}) -to make a change to the input record. Here, the regexp @code{/a+/} -indicates ``one or more @samp{a} characters,'' and the replacement -text is @samp{}. - -The input contains four @samp{a} characters. -@command{awk} (and POSIX) regular expressions always match -the leftmost, @emph{longest} sequence of input characters that can -match. Thus, all four @samp{a} characters are -replaced with @samp{} in this example: - -@example -$ @kbd{echo aaaabcd | awk '@{ sub(/a+/, ""); print @}'} -@print{} bcd -@end example - -For simple match/no-match tests, this is not so important. But when doing -text matching and substitutions with the @code{match()}, @code{sub()}, @code{gsub()}, -and @code{gensub()} functions, it is very important. -@ifinfo -@xref{String Functions}, -for more information on these functions. -@end ifinfo -Understanding this principle is also important for regexp-based record -and field splitting (@pxref{Records}, -and also @pxref{Field Separators}). - -@node Computed Regexps -@section Using Dynamic Regexps - -@c STARTOFRANGE dregexp -@cindex regular expressions, computed -@c STARTOFRANGE regexpd -@cindex regular expressions, dynamic -@cindex @code{~} (tilde), @code{~} operator -@cindex tilde (@code{~}), @code{~} operator -@cindex @code{!} (exclamation point), @code{!~} operator -@cindex exclamation point (@code{!}), @code{!~} operator -@c @cindex operators, @code{~} -@c @cindex operators, @code{!~} -The righthand side of a @samp{~} or @samp{!~} operator need not be a -regexp constant (i.e., a string of characters between slashes). It may -be any expression. The expression is evaluated and converted to a string -if necessary; the contents of the string are then used as the -regexp. A regexp computed in this way is called a @dfn{dynamic -regexp}: - -@example -BEGIN @{ digits_regexp = "[[:digit:]]+" @} -$0 ~ digits_regexp @{ print @} -@end example - -@noindent -This sets @code{digits_regexp} to a regexp that describes one or more digits, -and tests whether the input record matches this regexp. - -@quotation NOTE -When using the @samp{~} and @samp{!~} -operators, there is a difference between a regexp constant -enclosed in slashes and a string constant enclosed in double quotes. -If you are going to use a string constant, you have to understand that -the string is, in essence, scanned @emph{twice}: the first time when -@command{awk} reads your program, and the second time when it goes to -match the string on the lefthand side of the operator with the pattern -on the right. This is true of any string-valued expression (such as -@code{digits_regexp}, shown previously), not just string constants. -@end quotation - -@cindex regexp constants, slashes vs.@: quotes -@cindex @code{\} (backslash), in regexp constants -@cindex backslash (@code{\}), in regexp constants -@cindex @code{"} (double quote), in regexp constants -@cindex double quote (@code{"}), in regexp constants -What difference does it make if the string is -scanned twice? The answer has to do with escape sequences, and particularly -with backslashes. To get a backslash into a regular expression inside a -string, you have to type two backslashes. -For example, @code{/\*/} is a regexp constant for a literal @samp{*}. -Only one backslash is needed. To do the same thing with a string, -you have to type @code{"\\*"}. The first backslash escapes the -second one so that the string actually contains the -two characters @samp{\} and @samp{*}. +@node Regexp Summary +@section Summary -@cindex troubleshooting, regexp constants vs.@: string constants -@cindex regexp constants, vs.@: string constants -@cindex string constants, vs.@: regexp constants -Given that you can use both regexp and string constants to describe -regular expressions, which should you use? The answer is ``regexp -constants,'' for several reasons: +@itemize @value{BULLET} +@item +Regular expressions describe sets of strings to be matched. +In @command{awk}, regular expression constants are written enclosed +between slashes: @code{/}@dots{}@code{/}. -@itemize @bullet @item -String constants are more complicated to write and -more difficult to read. Using regexp constants makes your programs -less error-prone. Not understanding the difference between the two -kinds of constants is a common source of errors. +Regexp constants may be used standalone in patterns and +in conditional expressions, or as part of matching expressions +using the @samp{~} and @samp{!~} operators. @item -It is more efficient to use regexp constants. @command{awk} can note -that you have supplied a regexp and store it internally in a form that -makes pattern matching more efficient. When using a string constant, -@command{awk} must first convert the string into this internal form and -then perform the pattern matching. +Escape sequences let you represent nonprintable characters and +also let you represent regexp metacharacters as literal characters +to be matched. @item -Using regexp constants is better form; it shows clearly that you -intend a regexp match. -@end itemize +Regexp operators provide grouping, alternation, and repetition. -@sidebar Using @code{\n} in Bracket Expressions of Dynamic Regexps -@cindex regular expressions, dynamic, with embedded newlines -@cindex newlines, in dynamic regexps +@item +Bracket expressions give you a shorthand for specifying sets +of characters that can match at a particular point in a regexp. +Within bracket expressions, POSIX character classes let you specify +certain groups of characters in a locale-independent fashion. -Some commercial versions of @command{awk} do not allow the newline -character to be used inside a bracket expression for a dynamic regexp: +@item +Regular expressions match the leftmost longest text in the string being +matched. This matters for cases where you need to know the extent of +the match, such as for text substitution and when the record separator +is a regexp. -@example -$ @kbd{awk '$0 ~ "[ \t\n]"'} -@error{} awk: newline in character class [ -@error{} ]... -@error{} source line number 1 -@error{} context is -@error{} >>> <<< -@end example +@item +Matching expressions may use dynamic regexps (i.e., string values +treated as regular expressions). -@cindex newlines, in regexp constants -But a newline in a regexp constant works with no problem: +@item +@command{gawk}'s @code{IGNORECASE} variable lets you control the +case sensitivity of regexp matching. In other @command{awk} +versions, use @code{tolower()} or @code{toupper()}. -@example -$ @kbd{awk '$0 ~ /[ \t\n]/'} -@kbd{here is a sample line} -@print{} here is a sample line -@kbd{Ctrl-d} -@end example +@end itemize -@command{gawk} does not have this problem, and it isn't likely to -occur often in practice, but it's worth noting for future reference. -@end sidebar -@c ENDOFRANGE dregexp -@c ENDOFRANGE regexpd -@c ENDOFRANGE regexp @node Reading Files @chapter Reading Input Files -@c STARTOFRANGE infir @cindex reading input files @cindex input files, reading @cindex input files @@ -5463,7 +6076,7 @@ command) or from files whose names you specify on the @command{awk} command line. If you specify input files, @command{awk} reads them in order, processing all the data from one before going on to the next. -The name of the current input file can be found in the built-in variable +The name of the current input file can be found in the predefined variable @code{FILENAME} (@pxref{Built-in Variables}). @@ -5477,7 +6090,7 @@ @cindex @code{getline} command On rare occasions, you may need to use the @code{getline} command. -The @code{getline} command is valuable, both because it +The @code{getline} command is valuable both because it can do explicit input from any number of files, and because the files used with it do not have to be named on the @command{awk} command line (@pxref{Getline}). @@ -5494,37 +6107,42 @@ * Getline:: Reading files under explicit program control using the @code{getline} function. * Read Timeout:: Reading input with a timeout. -* Command line directories:: What happens if you put a directory on the +* Command-line directories:: What happens if you put a directory on the command line. +* Input Summary:: Input summary. +* Input Exercises:: Exercises. @end menu @node Records @section How Input Is Split into Records -@c STARTOFRANGE inspl @cindex input, splitting into records -@c STARTOFRANGE recspl @cindex records, splitting input into @cindex @code{NR} variable @cindex @code{FNR} variable -The @command{awk} utility divides the input for your @command{awk} -program into records and fields. -@command{awk} keeps track of the number of records that have -been read -so far -from the current input file. This value is stored in a -built-in variable called @code{FNR}. It is reset to zero when a new -file is started. Another built-in variable, @code{NR}, records the total -number of input records read so far from all data files. It starts at zero, -but is never automatically reset to zero. +@command{awk} divides the input for your program into records and fields. +It keeps track of the number of records that have been read so far from +the current input file. This value is stored in a predefined variable +called @code{FNR}, which is reset to zero every time a new file is started. +Another predefined variable, @code{NR}, records the total number of input +records read so far from all @value{DF}s. It starts at zero, but is +never automatically reset to zero. + +@menu +* awk split records:: How standard @command{awk} splits records. +* gawk split records:: How @command{gawk} splits records. +@end menu + +@node awk split records +@subsection Record Splitting with Standard @command{awk} @cindex separators, for records @cindex record separators Records are separated by a character called the @dfn{record separator}. By default, the record separator is the newline character. This is why records are, by default, single lines. -A different character can be used for the record separator by -assigning the character to the built-in variable @code{RS}. +To use a different character for the record separator, +simply assign that character to the predefined variable @code{RS}. @cindex newlines, as record separators @cindex @code{RS} variable @@ -5533,7 +6151,7 @@ with the assignment operator, @samp{=} (@pxref{Assignment Ops}). The new record-separator character should be enclosed in quotation marks, -which indicate a string constant. Often the right time to do this is +which indicate a string constant. Often, the right time to do this is at the beginning of execution, before any input is processed, so that the very first record is read with the proper separator. To do this, use the special @code{BEGIN} pattern @@ -5547,8 +6165,8 @@ @noindent changes the value of @code{RS} to @samp{u}, before reading any input. -This is a string whose first character is the letter ``u;'' as a result, records -are separated by the letter ``u.'' Then the input file is read, and the second +The new value is a string whose first character is the letter ``u''; as a result, records +are separated by the letter ``u''. Then the input file is read, and the second rule in the @command{awk} program (the action with no pattern) prints each record. Because each @code{print} statement adds a newline at the end of its output, this @command{awk} program copies the input @@ -5595,12 +6213,12 @@ @print{} m@@ny @print{} .ed @print{} R -@print{} +@print{} @end example @noindent Note that the entry for the name @samp{Bill} is not split. -In the original data file +In the original @value{DF} (@pxref{Sample Data Files}), the line looks like this: @@ -5609,11 +6227,11 @@ @end example @noindent -It contains no @samp{u} so there is no reason to split the record, -unlike the others which have one or more occurrences of the @samp{u}. +It contains no @samp{u}, so there is no reason to split the record, +unlike the others, which each have one or more occurrences of the @samp{u}. In fact, this record is treated as part of the previous record; the newline separating them in the output -is the original newline in the data file, not the one added by +is the original newline in the @value{DF}, not the one added by @command{awk} when it printed the record! @cindex record separators, changing @@ -5635,12 +6253,13 @@ produce correct behavior in the majority of cases, but there are no guarantees. The moral is: Know Your Data. -There is one unusual case, that occurs when @command{gawk} is +When using regular characters as the record separator, +there is one unusual case that occurs when @command{gawk} is being fully POSIX-compliant (@pxref{Options}). Then, the following (extreme) pipeline prints a surprising @samp{1}: @example -$ echo | gawk --posix 'BEGIN @{ RS = "a" @} ; @{ print NF @}' +$ @kbd{echo | gawk --posix 'BEGIN @{ RS = "a" @} ; @{ print NF @}'} @print{} 1 @end example @@ -5662,7 +6281,7 @@ has a special meaning as the value of @code{RS}. It means that records are separated by one or more blank lines and nothing else. -@xref{Multiple Line}, for more details. +@DBXREF{Multiple Line} for more details. If you change the value of @code{RS} in the middle of an @command{awk} run, the new value is used to delimit subsequent records, but the record @@ -5681,6 +6300,9 @@ sets the variable @code{RT} to the text in the input that matched @code{RS}. +@node gawk split records +@subsection Record Splitting with @command{gawk} + @cindex common extensions, @code{RS} as a regexp @cindex extensions, common@comma{} @code{RS} as a regexp When using @command{gawk}, @@ -5701,7 +6323,7 @@ regular expression, @code{RT} contains the actual input text that matched the regular expression. -If the input file ended without any text that matches @code{RS}, +If the input file ends without any text matching @code{RS}, @command{gawk} sets @code{RT} to the null string. The following example illustrates both of these features. @@ -5712,22 +6334,22 @@ @example $ @kbd{echo record 1 AAAA record 2 BBBB record 3 |} > @kbd{gawk 'BEGIN @{ RS = "\n|( *[[:upper:]]+ *)" @}} -> @kbd{@{ print "Record =", $0, "and RT =", RT @}'} -@print{} Record = record 1 and RT = AAAA -@print{} Record = record 2 and RT = BBBB -@print{} Record = record 3 and RT = -@print{} +> @kbd{@{ print "Record =", $0,"and RT = [" RT "]" @}'} +@print{} Record = record 1 and RT = [ AAAA ] +@print{} Record = record 2 and RT = [ BBBB ] +@print{} Record = record 3 and RT = [ +@print{} ] @end example @noindent -The final line of output has an extra blank line. This is because the -value of @code{RT} is a newline, and the @code{print} statement -supplies its own terminating newline. -@xref{Simple Sed}, for a more useful example +The square brackets delineate the contents of @code{RT}, letting you +see the leading and trailing whitespace. The final value of +@code{RT} is a newline. +@DBXREF{Simple Sed} for a more useful example of @code{RS} as a regexp and @code{RT}. If you set @code{RS} to a regular expression that allows optional -trailing text, such as @samp{RS = "abc(XYZ)?"} it is possible, due +trailing text, such as @samp{RS = "abc(XYZ)?"}, it is possible, due to implementation constraints, that @command{gawk} may match the leading part of the regular expression, but not the trailing part, particularly if the input text that could match the trailing part is fairly long. @@ -5740,8 +6362,8 @@ the beginning and end of a @emph{line}. As a result, something like @samp{RS = "^[[:upper:]]"} can only match at the beginning of a file. This is because @command{gawk} views the input file as one long string -that happens to contain newline characters in it. -It is thus best to avoid anchor characters in the value of @code{RS}. +that happens to contain newline characters. +It is thus best to avoid anchor metacharacters in the value of @code{RS}. @end quotation @cindex differences in @command{awk} and @command{gawk}, @code{RS}/@code{RT} variables @@ -5750,16 +6372,15 @@ compatibility mode (@pxref{Options}). In compatibility mode, only the first character of the value of -@code{RS} is used to determine the end of the record. +@code{RS} determines the end of the record. @sidebar @code{RS = "\0"} Is Not Portable @cindex portability, data files as single record -There are times when you might want to treat an entire data file as a +There are times when you might want to treat an entire @value{DF} as a single record. The only way to make this happen is to give @code{RS} a value that you know doesn't occur in the input file. This is hard to do in a general way, such that a program always works for arbitrary input files. -@c can you say `understatement' boys and girls? You might think that for text files, the @sc{nul} character, which consists of a character with all bits equal to zero, is a good @@ -5772,6 +6393,8 @@ @cindex differences in @command{awk} and @command{gawk}, strings, storing @command{gawk} in fact accepts this, and uses the @sc{nul} character for the record separator. +This works for certain special files, such as @file{/proc/environ} on +GNU/Linux systems, where the @sc{nul} character is in fact the record separator. However, this usage is @emph{not} portable to most other @command{awk} implementations. @@ -5785,17 +6408,14 @@ It happens that recent versions of @command{mawk} can use the @sc{nul} character as a record separator. However, this is a special case: @command{mawk} does not allow embedded @sc{nul} characters in strings. +(This may change in a future version of @command{mawk}.) @cindex records, treating files as @cindex treating files, as single records -The best way to treat a whole file as a single record is to -simply read the file in, one record at a time, concatenating each -record onto the end of the previous ones. - -@c @strong{FIXME}: Using @sc{nul} is good for @file{/proc/environ} etc. +@DBXREF{Readfile Function} for an interesting way to read +whole files. If you are using @command{gawk}, see @DBREF{Extension Sample +Readfile} for another option. @end sidebar -@c ENDOFRANGE inspl -@c ENDOFRANGE recspl @node Fields @section Examining Fields @@ -5803,7 +6423,6 @@ @cindex examining fields @cindex fields @cindex accessing fields -@c STARTOFRANGE fiex @cindex fields, examining @cindex POSIX @command{awk}, field separators and @cindex field separators, POSIX and @@ -5814,9 +6433,9 @@ like words in a line. Whitespace in @command{awk} means any string of one or more spaces, TABs, or newlines;@footnote{In POSIX @command{awk}, newlines are not -considered whitespace for separating fields.} other characters, such as -formfeed, vertical tab, etc., that are -considered whitespace by other languages, are @emph{not} considered +considered whitespace for separating fields.} other characters +that are considered whitespace by other languages +(such as formfeed, vertical tab, etc.) are @emph{not} considered whitespace by @command{awk}. The purpose of fields is to make it more convenient for you to refer to @@ -5828,12 +6447,12 @@ @cindex @code{$} (dollar sign), @code{$} field operator @cindex dollar sign (@code{$}), @code{$} field operator @cindex field operators@comma{} dollar sign as -A dollar-sign (@samp{$}) is used +You use a dollar sign (@samp{$}) to refer to a field in an @command{awk} program, followed by the number of the field you want. Thus, @code{$1} refers to the first field, @code{$2} to the second, and so on. -(Unlike the Unix shells, the field numbers are not limited to single digits. -@code{$127} is the one hundred twenty-seventh field in the record.) +(Unlike in the Unix shells, the field numbers are not limited to single digits. +@code{$127} is the 127th field in the record.) For example, suppose the following is a line of input: @example @@ -5849,7 +6468,7 @@ @cindex @code{NF} variable @cindex fields, number of -@code{NF} is a built-in variable whose value is the number of fields +@code{NF} is a predefined variable whose value is the number of fields in the current record. @command{awk} automatically updates the value of @code{NF} each time it reads a record. No matter how many fields there are, the last field in a record can be represented by @code{$NF}. @@ -5858,8 +6477,8 @@ one (such as @code{$8} when the record has only seven fields), you get the empty string. (If used in a numeric operation, you get zero.) -The use of @code{$0}, which looks like a reference to the ``zero-th'' field, is -a special case: it represents the whole input record +The use of @code{$0}, which looks like a reference to the ``zeroth'' field, is +a special case: it represents the whole input record. Use it when you are not interested in specific fields. Here are some more examples: @@ -5871,15 +6490,11 @@ @noindent This example prints each record in the file @file{mail-list} whose first -field contains the string @samp{li}. The operator @samp{~} is called a -@dfn{matching operator} -(@pxref{Regexp Usage}); -it tests whether a string (here, the field @code{$1}) matches a given regular -expression. - -By contrast, the following example -looks for @samp{li} in @emph{the entire record} and prints the first -field and the last field for each matching input record: +field contains the string @samp{li}. + +By contrast, the following example looks for @samp{li} in @emph{the +entire record} and prints the first and last fields for each matching +input record: @example $ @kbd{awk '/li/ @{ print $1, $NF @}' mail-list} @@ -5888,14 +6503,13 @@ @print{} Julie F @print{} Samuel A @end example -@c ENDOFRANGE fiex @node Nonconstant Fields @section Nonconstant Field Numbers @cindex fields, numbers @cindex field numbers -The number of a field does not need to be a constant. Any expression in +A field number need not be a constant. Any expression in the @command{awk} language can be used after a @samp{$} to refer to a field. The value of the expression specifies the field number. If the value is a string, rather than a number, it is converted to a number. @@ -5907,7 +6521,7 @@ @noindent Recall that @code{NR} is the number of records read so far: one in the -first record, two in the second, etc. So this example prints the first +first record, two in the second, and so on. So this example prints the first field of the first record, the second field of the second record, and so on. For the twentieth record, field number 20 is printed; most likely, the record has fewer than 20 fields, so this prints a blank line. @@ -5918,11 +6532,15 @@ @end example @command{awk} evaluates the expression @samp{(2*2)} and uses -its value as the number of the field to print. The @samp{*} sign +its value as the number of the field to print. The @samp{*} represents multiplication, so the expression @samp{2*2} evaluates to four. The parentheses are used so that the multiplication is done before the @samp{$} operation; they are necessary whenever there is a binary -operator in the field-number expression. This example, then, prints the +operator@footnote{A @dfn{binary operator}, such as @samp{*} for +multiplication, is one that takes two operands. The distinction +is required because @command{awk} also has unary (one-operand) +and ternary (three-operand) operators.} +in the field-number expression. This example, then, prints the type of relationship (the fourth field) for every line of the file @file{mail-list}. (All of the @command{awk} operators are listed, in order of decreasing precedence, in @@ -5938,14 +6556,13 @@ As mentioned in @ref{Fields}, @command{awk} stores the current record's number of fields in the built-in -variable @code{NF} (also @pxref{Built-in Variables}). The expression +variable @code{NF} (also @pxref{Built-in Variables}). Thus, the expression @code{$NF} is not a special feature---it is the direct consequence of evaluating @code{NF} and using its value as a field number. @node Changing Fields @section Changing the Contents of a Field -@c STARTOFRANGE ficon @cindex fields, changing contents of The contents of a field, as seen by @command{awk}, can be changed within an @command{awk} program; this changes what @command{awk} perceives as the @@ -5972,7 +6589,7 @@ (Someone in the warehouse made a consistent mistake while inventorying the red boxes.) -For this to work, the text in field @code{$3} must make sense +For this to work, the text in @code{$3} must make sense as a number; the string of characters must be converted to a number for the computer to do arithmetic on it. The number resulting from the subtraction is converted back to a string of characters that @@ -5994,12 +6611,12 @@ @dots{} @end example -It is also possible to also assign contents to fields that are out +It is also possible to assign contents to fields that are out of range. For example: @example -$ awk '@{ $6 = ($5 + $4 + $3 + $2) -> print $6 @}' inventory-shipped +$ @kbd{awk '@{ $6 = ($5 + $4 + $3 + $2)} +> @kbd{ print $6 @}' inventory-shipped} @print{} 168 @print{} 297 @print{} 301 @@ -6045,9 +6662,9 @@ @noindent should print @samp{everything is normal}, because @code{NF+1} is certain -to be out of range. (@xref{If Statement}, +to be out of range. (@DBXREF{If Statement} for more information about @command{awk}'s @code{if-else} statements. -@xref{Typing and Comparison}, +@DBXREF{Typing and Comparison} for more information about the @samp{!=} operator.) It is important to note that making an assignment to an existing field @@ -6063,7 +6680,7 @@ @end example @noindent -The field is still there; it just has an empty value, denoted by +The field is still there; it just has an empty value, delimited by the two colons between @samp{a} and @samp{c}. This example shows what happens if you create a new field: @@ -6087,8 +6704,8 @@ Here is an example: @example -$ echo a b c d e f | awk '@{ print "NF =", NF; -> NF = 3; print $0 @}' +$ @kbd{echo a b c d e f | awk '@{ print "NF =", NF;} +> @kbd{ NF = 3; print $0 @}'} @print{} NF = 6 @print{} a b c @end example @@ -6096,12 +6713,12 @@ @cindex portability, @code{NF} variable@comma{} decrementing @quotation CAUTION Some versions of @command{awk} don't -rebuild @code{$0} when @code{NF} is decremented. Caveat emptor. +rebuild @code{$0} when @code{NF} is decremented. @end quotation Finally, there are times when it is convenient to force @command{awk} to rebuild the entire record, using the current -value of the fields and @code{OFS}. To do this, use the +values of the fields and @code{OFS}. To do this, use the seemingly innocuous assignment: @example @@ -6125,19 +6742,18 @@ It is important to remember that @code{$0} is the @emph{full} record, exactly as it was read from the input. This includes any leading or trailing whitespace, and the exact whitespace (or other -characters) that separate the fields. +characters) that separates the fields. -It is a not-uncommon error to try to change the field separators +It is a common error to try to change the field separators in a record simply by setting @code{FS} and @code{OFS}, and then expecting a plain @samp{print} or @samp{print $0} to print the modified record. -But this does not work, since nothing was done to change the record +But this does not work, because nothing was done to change the record itself. Instead, you must force the record to be rebuilt, typically with a statement such as @samp{$1 = $1}, as described earlier. @end sidebar -@c ENDOFRANGE ficon @node Field Separators @section Specifying How Fields Are Separated @@ -6146,16 +6762,14 @@ * Default Field Splitting:: How fields are normally separated. * Regexp Field Splitting:: Using regexps as the field separator. * Single Character Fields:: Making each character a separate field. -* Command Line Field Separator:: Setting @code{FS} from the command-line. +* Command Line Field Separator:: Setting @code{FS} from the command line. * Full Line Fields:: Making the full line be a single field. * Field Splitting Summary:: Some final points and a summary table. @end menu @cindex @code{FS} variable @cindex fields, separating -@c STARTOFRANGE fisepr @cindex field separators -@c STARTOFRANGE fisepg @cindex fields, separating The @dfn{field separator}, which is either a single character or a regular expression, controls the way @command{awk} splits an input record into fields. @@ -6176,7 +6790,7 @@ Note the leading spaces in the values of the second and third fields. @cindex troubleshooting, @command{awk} uses @code{FS} not @code{IFS} -The field separator is represented by the built-in variable @code{FS}. +The field separator is represented by the predefined variable @code{FS}. Shell programmers take note: @command{awk} does @emph{not} use the name @code{IFS} that is used by the POSIX-compliant shells (such as the Unix Bourne shell, @command{sh}, or Bash). @@ -6184,7 +6798,7 @@ @cindex @code{FS} variable, changing value of The value of @code{FS} can be changed in the @command{awk} program with the assignment operator, @samp{=} (@pxref{Assignment Ops}). -Often the right time to do this is at the beginning of execution +Often, the right time to do this is at the beginning of execution before any input has been processed, so that the very first record is read with the proper separator. To do this, use the special @code{BEGIN} pattern @@ -6221,7 +6835,7 @@ @end example @noindent -The same program would extract @samp{@bullet{}LXIX}, instead of +The same program would extract @samp{@bullet{}LXIX} instead of @samp{@bullet{}29@bullet{}Oak@bullet{}St.}. If you were expecting the program to print the address, you would be surprised. The moral is to choose your data layout and @@ -6255,9 +6869,7 @@ @node Regexp Field Splitting @subsection Using Regular Expressions to Separate Fields -@c STARTOFRANGE regexpfs @cindex regular expressions, as field separators -@c STARTOFRANGE fsregexp @cindex field separators, regular expressions as The previous @value{SUBSECTION} discussed the use of single characters or simple strings as the @@ -6315,7 +6927,7 @@ @cindex null strings @cindex strings, null @cindex empty strings, See null strings -In this case, the first field is @dfn{null} or empty. +In this case, the first field is null, or empty. The stripping of leading and trailing whitespace also comes into play whenever @code{$0} is recomputed. For instance, study this pipeline: @@ -6330,16 +6942,17 @@ The first @code{print} statement prints the record as it was read, with leading whitespace intact. The assignment to @code{$2} rebuilds @code{$0} by concatenating @code{$1} through @code{$NF} together, -separated by the value of @code{OFS}. Because the leading whitespace -was ignored when finding @code{$1}, it is not part of the new @code{$0}. -Finally, the last @code{print} statement prints the new @code{$0}. +separated by the value of @code{OFS} (which is a space by default). +Because the leading whitespace was ignored when finding @code{$1}, +it is not part of the new @code{$0}. Finally, the last @code{print} +statement prints the new @code{$0}. @cindex @code{FS}, containing @code{^} @cindex @code{^} (caret), in @code{FS} @cindex dark corner, @code{^}, in @code{FS} There is an additional subtlety to be aware of when using regular expressions for field splitting. -It is not well-specified in the POSIX standard, or anywhere else, what @samp{^} +It is not well specified in the POSIX standard, or anywhere else, what @samp{^} means when splitting fields. Does the @samp{^} match only at the beginning of the entire record? Or is each field separator a new string? It turns out that different @command{awk} versions answer this question differently, and you @@ -6347,21 +6960,19 @@ @value{DARKCORNER} @cindex Brian Kernighan's @command{awk} -As a point of information, Brian Kernighan's @command{awk} allows @samp{^} +As a point of information, BWK @command{awk} allows @samp{^} to match only at the beginning of the record. @command{gawk} also works this way. For example: @example $ @kbd{echo 'xxAA xxBxx C' |} > @kbd{gawk -F '(^x+)|( +)' '@{ for (i = 1; i <= NF; i++)} -> @kbd{printf "-->%s<--\n", $i @}'} +> @kbd{ printf "-->%s<--\n", $i @}'} @print{} --><-- @print{} -->AA<-- @print{} -->xxBxx<-- @print{} -->C<-- @end example -@c ENDOFRANGE regexpfs -@c ENDOFRANGE fsregexp @node Single Character Fields @subsection Making Each Character a Separate Field @@ -6402,7 +7013,7 @@ @node Command Line Field Separator @subsection Setting @code{FS} from the Command Line -@cindex @option{-F} option, command line +@cindex @option{-F} option, command-line @cindex field separator, on command line @cindex command line, @code{FS} on@comma{} setting @cindex @code{FS} variable, setting from command line @@ -6417,15 +7028,10 @@ @noindent sets @code{FS} to the @samp{,} character. Notice that the option uses an uppercase @samp{F} instead of a lowercase @samp{f}. The latter -option (@option{-f}) specifies a file -containing an @command{awk} program. Case is significant in command-line -options: -the @option{-F} and @option{-f} options have nothing to do with each other. -You can use both options at the same time to set the @code{FS} variable -@emph{and} get an @command{awk} program from a file. +option (@option{-f}) specifies a file containing an @command{awk} program. The value used for the argument to @option{-F} is processed in exactly the -same way as assignments to the built-in variable @code{FS}. +same way as assignments to the predefined variable @code{FS}. Any special characters in the field separator must be escaped appropriately. For example, to use a @samp{\} as the field separator on the command line, you would have to type: @@ -6452,6 +7058,8 @@ figures that you really want your fields to be separated with TABs and not @samp{t}s. Use @samp{-v FS="t"} or @samp{-F"[t]"} on the command line if you really do want to separate your fields with @samp{t}s. +Use @samp{-F '\t'} when not in compatibility mode to specify that TABs +separate fields. As an example, let's use an @command{awk} program file called @file{edu.awk} that contains the pattern @code{/edu/} and the action @samp{print $1}: @@ -6465,7 +7073,6 @@ list of the names of the people that work at or attend a university, and the first three digits of their phone numbers: -@c tweaked to make the tex output look better in @smallbook @example $ @kbd{awk -F- -f edu.awk mail-list} @print{} Fabius 555 @@ -6489,7 +7096,7 @@ @cindex Unix @command{awk}, password files@comma{} field separators and Perhaps the most common use of a single character as the field separator occurs when processing the Unix system password file. On many Unix -systems, each user has a separate entry in the system password file, one +systems, each user has a separate entry in the system password file, with one line per user. The information in these lines is separated by colons. The first field is the user's login name and the second is the user's encrypted or shadow password. (A shadow password is indicated by the @@ -6509,11 +7116,11 @@ @end example @node Full Line Fields -@subsection Making The Full Line Be A Single Field +@subsection Making the Full Line Be a Single Field Occasionally, it's useful to treat the whole input line as a single field. This can be done easily and portably simply by -setting @code{FS} to @code{"\n"} (a newline).@footnote{Thanks to +setting @code{FS} to @code{"\n"} (a newline):@footnote{Thanks to Andrew Schorr for this tip.} @example @@ -6523,43 +7130,6 @@ @noindent When you do this, @code{$1} is the same as @code{$0}. -@node Field Splitting Summary -@subsection Field-Splitting Summary - -It is important to remember that when you assign a string constant -as the value of @code{FS}, it undergoes normal @command{awk} string -processing. For example, with Unix @command{awk} and @command{gawk}, -the assignment @samp{FS = "\.."} assigns the character string @code{".."} -to @code{FS} (the backslash is stripped). This creates a regexp meaning -``fields are separated by occurrences of any two characters.'' -If instead you want fields to be separated by a literal period followed -by any single character, use @samp{FS = "\\.."}. - -The following table summarizes how fields are split, based on the value -of @code{FS} (@samp{==} means ``is equal to''): - -@table @code -@item FS == " " -Fields are separated by runs of whitespace. Leading and trailing -whitespace are ignored. This is the default. - -@item FS == @var{any other single character} -Fields are separated by each occurrence of the character. Multiple -successive occurrences delimit empty fields, as do leading and -trailing occurrences. -The character can even be a regexp metacharacter; it does not need -to be escaped. - -@item FS == @var{regexp} -Fields are separated by occurrences of characters that match @var{regexp}. -Leading and trailing matches of @var{regexp} delimit empty fields. - -@item FS == "" -Each individual character in the record becomes a separate field. -(This is a @command{gawk} extension; it is not specified by the -POSIX standard.) -@end table - @sidebar Changing @code{FS} Does Not Affect the Fields @cindex POSIX @command{awk}, field separators and @@ -6567,7 +7137,7 @@ According to the POSIX standard, @command{awk} is supposed to behave as if each record is split into fields at the time it is read. In particular, this means that if you change the value of @code{FS} -after a record is read, the value of the fields (i.e., how they were split) +after a record is read, the values of the fields (i.e., how they were split) should reflect the old value of @code{FS}, not the new one. @cindex dark corner, field separators @@ -6580,10 +7150,7 @@ @value{DARKCORNER} This behavior can be difficult to diagnose. The following example illustrates the difference -between the two methods. -(The @command{sed}@footnote{The @command{sed} utility is a ``stream editor.'' -Its behavior is also defined by the POSIX standard.} -command prints just the first line of @file{/etc/passwd}.) +between the two methods: @example sed 1q /etc/passwd | awk '@{ FS = ":" ; print $1 @}' @@ -6598,13 +7165,53 @@ @noindent on an incorrect implementation of @command{awk}, while @command{gawk} -prints something like: +prints the full first line of the file, something like: @example -root:nSijPlPhZZwgE:0:0:Root:/: +root:x:0:0:Root:/: @end example + +(The @command{sed}@footnote{The @command{sed} utility is a ``stream editor.'' +Its behavior is also defined by the POSIX standard.} +command prints just the first line of @file{/etc/passwd}.) @end sidebar +@node Field Splitting Summary +@subsection Field-Splitting Summary + +It is important to remember that when you assign a string constant +as the value of @code{FS}, it undergoes normal @command{awk} string +processing. For example, with Unix @command{awk} and @command{gawk}, +the assignment @samp{FS = "\.."} assigns the character string @code{".."} +to @code{FS} (the backslash is stripped). This creates a regexp meaning +``fields are separated by occurrences of any two characters.'' +If instead you want fields to be separated by a literal period followed +by any single character, use @samp{FS = "\\.."}. + +The following list summarizes how fields are split, based on the value +of @code{FS} (@samp{==} means ``is equal to''): + +@table @code +@item FS == " " +Fields are separated by runs of whitespace. Leading and trailing +whitespace are ignored. This is the default. + +@item FS == @var{any other single character} +Fields are separated by each occurrence of the character. Multiple +successive occurrences delimit empty fields, as do leading and +trailing occurrences. +The character can even be a regexp metacharacter; it does not need +to be escaped. + +@item FS == @var{regexp} +Fields are separated by occurrences of characters that match @var{regexp}. +Leading and trailing matches of @var{regexp} delimit empty fields. + +@item FS == "" +Each individual character in the record becomes a separate field. +(This is a common extension; it is not specified by the POSIX standard.) +@end table + @sidebar @code{FS} and @code{IGNORECASE} The @code{IGNORECASE} variable @@ -6623,30 +7230,28 @@ @noindent The output is @samp{aCa}. If you really want to split fields on an alphabetic character while ignoring case, use a regexp that will -do it for you. E.g., @samp{FS = "[c]"}. In this case, @code{IGNORECASE} +do it for you (e.g., @samp{FS = "[c]"}). In this case, @code{IGNORECASE} will take effect. @end sidebar -@c ENDOFRANGE fisepr -@c ENDOFRANGE fisepg @node Constant Size @section Reading Fixed-Width Data -@quotation NOTE +@cindex data, fixed-width +@cindex fixed-width data +@cindex advanced features, fixed-width data + +@c O'Reilly doesn't like it as a note the first thing in the section. This @value{SECTION} discusses an advanced feature of @command{gawk}. If you are a novice @command{awk} user, you might want to skip it on the first reading. -@end quotation -@cindex data, fixed-width -@cindex fixed-width data -@cindex advanced features, fixed-width data -@command{gawk} provides a facility for dealing with -fixed-width fields with no distinctive field separator. For example, -data of this nature arises in the input for old Fortran programs where -numbers are run together, or in the output of programs that did not -anticipate the use of their output as input for other programs. +@command{gawk} provides a facility for dealing with fixed-width fields +with no distinctive field separator. For example, data of this nature +arises in the input for old Fortran programs where numbers are run +together, or in the output of programs that did not anticipate the use +of their output as input for other programs. An example of the latter is a table where all the columns are lined up by the use of a variable number of spaces and @emph{empty fields are just @@ -6666,7 +7271,7 @@ @emph{including} columns between fields. If you want to ignore the columns between fields, you can specify the width as a separate field that is subsequently ignored. -It is a fatal error to supply a field width that is not a positive number. +It is a fatal error to supply a field width that has a negative value. The following data is the output of the Unix @command{w} utility. It is useful to illustrate the use of @code{FIELDWIDTHS}: @@ -6685,20 +7290,15 @@ @end group @end example -The following program takes the above input, converts the idle time to +The following program takes this input, converts the idle time to number of seconds, and prints out the first two fields and the calculated idle time: -@quotation NOTE -This program uses a number of @command{awk} features that -haven't been introduced yet. -@end quotation - @example BEGIN @{ FIELDWIDTHS = "9 6 10 6 7 7 35" @} NR > 2 @{ idle = $4 - sub(/^ */, "", idle) # strip leading spaces + sub(/^ +/, "", idle) # strip leading spaces if (idle == "") idle = 0 if (idle ~ /:/) @{ @@ -6712,6 +7312,11 @@ @} @end example +@quotation NOTE +The preceding program uses a number of @command{awk} features that +haven't been introduced yet. +@end quotation + Running the program on the data produces the following results: @example @@ -6735,10 +7340,6 @@ to simplify reading the data. (Of course, getting @command{gawk} to run on a system with card readers is another story!) -@ignore -Exercise: Write a ballot card reading program -@end ignore - @cindex @command{gawk}, splitting fields and Assigning a value to @code{FS} causes @command{gawk} to use @code{FS} for field splitting again. Use @samp{FS = FS} to make this happen, @@ -6747,7 +7348,7 @@ use @code{PROCINFO["FS"]} (@pxref{Auto-set}). The value is @code{"FS"} if regular field splitting is being used, -or it is @code{"FIELDWIDTHS"} if fixed-width field splitting is being used: +or @code{"FIELDWIDTHS"} if fixed-width field splitting is being used: @example if (PROCINFO["FS"] == "FS") @@ -6755,23 +7356,22 @@ else if (PROCINFO["FS"] == "FIELDWIDTHS") @var{fixed-width field splitting} @dots{} else - @var{content-based field splitting} @dots{} (see next @value{SECTION}) + @var{content-based field splitting} @dots{} @ii{(see next @value{SECTION})} @end example This information is useful when writing a function that needs to temporarily change @code{FS} or @code{FIELDWIDTHS}, read some records, and then restore the original settings -(@pxref{Passwd Functions}, +(@DBPXREF{Passwd Functions} for an example of such a function). @node Splitting By Content -@section Defining Fields By Content +@section Defining Fields by Content -@quotation NOTE +@c O'Reilly doesn't like it as a note the first thing in the section. This @value{SECTION} discusses an advanced feature of @command{gawk}. If you are a novice @command{awk} user, you might want to skip it on the first reading. -@end quotation @cindex advanced features, specifying field content Normally, when using @code{FS}, @command{gawk} defines the fields as the @@ -6782,14 +7382,16 @@ what they are, and not by what they are not. The most notorious such case -is so-called @dfn{comma separated value} (CSV) data. Many spreadsheet programs, +is so-called @dfn{comma-separated values} (CSV) data. Many spreadsheet programs, for example, can export their data into text files, where each record is -terminated with a newline, and fields are separated by commas. If only -commas separated the data, there wouldn't be an issue. The problem comes when -one of the fields contains an @emph{embedded} comma. While there is no -formal standard specification for CSV data@footnote{At least, we don't know of one.}, -in such cases, most programs embed the field in double quotes. So we might -have data like this: +terminated with a newline, and fields are separated by commas. If +commas only separated the data, there wouldn't be an issue. The problem comes when +one of the fields contains an @emph{embedded} comma. +In such cases, most programs embed the field in double quotes.@footnote{The +CSV format lacked a formal standard definition for many years. +@uref{http://www.ietf.org/rfc/rfc4180.txt, RFC 4180} +standardizes the most common practices.} +So, we might have data like this: @example @c file eg/misc/addresses.csv @@ -6803,7 +7405,7 @@ The value of @code{FPAT} should be a string that provides a regular expression. This regular expression describes the contents of each field. -In the case of CSV data as presented above, each field is either ``anything that +In the case of CSV data as presented here, each field is either ``anything that is not a comma,'' or ``a double quote, anything that is not a double quote, and a closing double quote.'' If written as a regular expression constant (@pxref{Regexp}), @@ -6860,38 +7462,48 @@ As with @code{FS}, the @code{IGNORECASE} variable (@pxref{User-modified}) affects field splitting with @code{FPAT}. +Assigning a value to @code{FPAT} overrides field splitting +with @code{FS} and with @code{FIELDWIDTHS}. Similar to @code{FIELDWIDTHS}, the value of @code{PROCINFO["FS"]} will be @code{"FPAT"} if content-based field splitting is being used. @quotation NOTE Some programs export CSV data that contains embedded newlines between the double quotes. @command{gawk} provides no way to deal with this. -Since there is no formal specification for CSV data, there isn't much +Even though a formal specification for CSV data exists, there isn't much more to be done; the @code{FPAT} mechanism provides an elegant solution for the majority -of cases, and the @command{gawk} maintainer is satisfied with that. +of cases, and the @command{gawk} developers are satisfied with that. @end quotation As written, the regexp used for @code{FPAT} requires that each field -have a least one character. A straightforward modification -(changing changed the first @samp{+} to @samp{*}) allows fields to be empty: +contain at least one character. A straightforward modification +(changing the first @samp{+} to @samp{*}) allows fields to be empty: @example FPAT = "([^,]*)|(\"[^\"]+\")" @end example +@c FIXME: 4/2015 +@c Consider use of FPAT = "([^,]*)|(\"[^\"]*\")" +@c (star in latter part of value) to allow quoted strings to be empty. +@c Per email from Ed Morton + Finally, the @code{patsplit()} function makes the same functionality available for splitting regular strings (@pxref{String Functions}). +To recap, @command{gawk} provides three independent methods +to split input records into fields. +The mechanism used is based on which of the three +variables---@code{FS}, @code{FIELDWIDTHS}, or @code{FPAT}---was +last assigned to. + @node Multiple Line @section Multiple-Line Records @cindex multiple-line records -@c STARTOFRANGE recm @cindex records, multiline -@c STARTOFRANGE imr @cindex input, multiline records -@c STARTOFRANGE frm @cindex files, reading, multiline records @cindex input, files, See input files In some databases, a single line cannot conveniently hold all the @@ -6926,14 +7538,14 @@ In addition, a regular expression always matches the longest possible sequence when there is a choice (@pxref{Leftmost Longest}). -So the next record doesn't start until +So, the next record doesn't start until the first nonblank line that follows---no matter how many blank lines appear in a row, they are considered one record separator. @cindex dark corner, multiline records -There is an important difference between @samp{RS = ""} and +However, there is an important difference between @samp{RS = ""} and @samp{RS = "\n\n+"}. In the first case, leading newlines in the input -data file are ignored, and if a file ends without extra blank lines +@value{DF} are ignored, and if a file ends without extra blank lines after the last record, the final newline is removed from the record. In the second case, this special processing is not done. @value{DARKCORNER} @@ -6941,10 +7553,10 @@ @cindex field separator, in multiline records @cindex @code{FS}, in multiline records Now that the input is separated into records, the second step is to -separate the fields in the record. One way to do this is to divide each +separate the fields in the records. One way to do this is to divide each of the lines into fields in the normal manner. This happens by default as the result of a special feature. When @code{RS} is set to the empty -string, @emph{and} @code{FS} is set to a single character, +string @emph{and} @code{FS} is set to a single character, the newline character @emph{always} acts as a field separator. This is in addition to whatever field separations result from @code{FS}.@footnote{When @code{FS} is the null string (@code{""}) @@ -6959,7 +7571,7 @@ prevent it. However, you can work around this by using the @code{split()} function to break up the record manually (@pxref{String Functions}). -If you have a single character field separator, you can work around +If you have a single-character field separator, you can work around the special feature in a different way, by making @code{FS} into a regexp for that single character. For example, if the field separator is a percent character, instead of @@ -6967,10 +7579,10 @@ Another way to separate fields is to put each field on a separate line: to do this, just set the -variable @code{FS} to the string @code{"\n"}. (This single -character separator matches a single newline.) -A practical example of a data file organized this way might be a mailing -list, where each entry is separated by blank lines. Consider a mailing +variable @code{FS} to the string @code{"\n"}. +(This single-character separator matches a single newline.) +A practical example of a @value{DF} organized this way might be a mailing +list, where blank lines separate the entries. Consider a mailing list in a file named @file{addresses}, which looks like this: @example @@ -7005,7 +7617,7 @@ Running the program produces the following output: @example -$ awk -f addrs.awk addresses +$ @kbd{awk -f addrs.awk addresses} @print{} Name is: Jane Doe @print{} Address is: 123 Main Street @print{} City and State are: Anywhere, SE 12345-6789 @@ -7017,12 +7629,9 @@ @dots{} @end example -@xref{Labels Program}, for a more realistic -program that deals with address lists. -The following -table -summarizes how records are split, based on the -value of +@DBXREF{Labels Program} for a more realistic program dealing with +address lists. The following list summarizes how records are split, +based on the value of @ifinfo @code{RS}. (@samp{==} means ``is equal to.'') @@ -7034,7 +7643,7 @@ @table @code @item RS == "\n" Records are separated by the newline character (@samp{\n}). In effect, -every line in the data file is a separate record, including blank lines. +every line in the @value{DF} is a separate record, including blank lines. This is the default. @item RS == @var{any single character} @@ -7057,24 +7666,19 @@ @cindex @command{gawk}, @code{RT} variable in @cindex @code{RT} variable -In all cases, @command{gawk} sets @code{RT} to the input text that matched the -value specified by @code{RS}. +If not in compatibility mode (@pxref{Options}), @command{gawk} sets +@code{RT} to the input text that matched the value specified by @code{RS}. But if the input file ended without any text that matches @code{RS}, then @command{gawk} sets @code{RT} to the null string. -@c ENDOFRANGE recm -@c ENDOFRANGE imr -@c ENDOFRANGE frm @node Getline @section Explicit Input with @code{getline} -@c STARTOFRANGE getl @cindex @code{getline} command, explicit input with -@c STARTOFRANGE inex @cindex input, explicit So far we have been getting our input data from @command{awk}'s main -input stream---either the standard input (usually your terminal, sometimes -the output from another program) or from the +input stream---either the standard input (usually your keyboard, sometimes +the output from another program) or the files specified on the command line. The @command{awk} language has a special built-in command called @code{getline} that can be used to read input under your explicit control. @@ -7084,7 +7688,19 @@ The examples that follow the explanation of the @code{getline} command include material that has not been covered yet. Therefore, come back and study the @code{getline} command @emph{after} you have reviewed the -rest of this @value{DOCUMENT} and have a good knowledge of how @command{awk} works. +rest of +@ifinfo +this @value{DOCUMENT} +@end ifinfo +@ifhtml +this @value{DOCUMENT} +@end ifhtml +@ifnotinfo +@ifnothtml +Parts I and II +@end ifnothtml +@end ifnotinfo +and have a good knowledge of how @command{awk} works. @cindex @command{gawk}, @code{ERRNO} variable in @cindex @code{ERRNO} variable, with @command{getline} command @@ -7092,7 +7708,7 @@ @cindex @code{getline} command, return values @cindex @option{--sandbox} option, input redirection with @code{getline} -The @code{getline} command returns one if it finds a record and zero if +The @code{getline} command returns 1 if it finds a record and 0 if it encounters the end of the file. If there is some error in getting a record, such as a file that cannot be opened, then @code{getline} returns @minus{}1. In this case, @command{gawk} sets the variable @@ -7103,7 +7719,7 @@ @quotation NOTE When @option{--sandbox} is specified (@pxref{Options}), -reading lines from files, pipes and coprocesses is disabled. +reading lines from files, pipes, and coprocesses is disabled. @end quotation @menu @@ -7132,42 +7748,61 @@ processing on the next record @emph{right now}. For example: @example +# Remove text between /* and */, inclusive @{ - if ((t = index($0, "/*")) != 0) @{ - # value of `tmp' will be "" if t is 1 - tmp = substr($0, 1, t - 1) - u = index(substr($0, t + 2), "*/") - offset = t + 2 - while (u == 0) @{ - if (getline <= 0) @{ - m = "unexpected EOF or error" - m = (m ": " ERRNO) - print m > "/dev/stderr" + if ((i = index($0, "/*")) != 0) @{ + out = substr($0, 1, i - 1) # leading part of the string + rest = substr($0, i + 2) # ... */ ... + j = index(rest, "*/") # is */ in trailing part? + if (j > 0) @{ + rest = substr(rest, j + 2) # remove comment + @} else @{ + while (j == 0) @{ + # get more text + if (getline <= 0) @{ + print("unexpected EOF or error:", ERRNO) > "/dev/stderr" exit - @} - u = index($0, "*/") - offset = 0 - @} - # substr() expression will be "" if */ - # occurred at end of line - $0 = tmp substr($0, offset + u + 2) - @} - print $0 + @} + # build up the line using string concatenation + rest = rest $0 + j = index(rest, "*/") # is */ in trailing part? + if (j != 0) @{ + rest = substr(rest, j + 2) + break + @} + @} + @} + # build up the output line using string concatenation + $0 = out rest + @} + print $0 @} @end example +@c 8/2014: Here is some sample input: +@ignore +mon/*comment*/key +rab/*commen +t*/bit +horse /*comment*/more text +part 1 /*comment*/part 2 /*comment*/part 3 +no comment +@end ignore + This @command{awk} program deletes C-style comments (@samp{/* @dots{} -*/}) from the input. By replacing the @samp{print $0} with other +*/}) from the input. +It uses a number of features we haven't covered yet, including +string concatenation +(@pxref{Concatenation}) +and the @code{index()} and @code{substr()} built-in +functions +(@pxref{String Functions}). +By replacing the @samp{print $0} with other statements, you could perform more complicated processing on the decommented input, such as searching for matches of a regular expression. (This program has a subtle problem---it does not work if one comment ends and another begins on the same line.) -@ignore -Exercise, -write a program that does handle multiple comments on the line. -@end ignore - This form of the @code{getline} command sets @code{NF}, @code{NR}, @code{FNR}, @code{RT}, and the value of @code{$0}. @@ -7227,7 +7862,7 @@ @end example The @code{getline} command used in this way sets only the variables -@code{NR}, @code{FNR} and @code{RT} (and of course, @var{var}). +@code{NR}, @code{FNR}, and @code{RT} (and, of course, @var{var}). The record is not split into fields, so the values of the fields (including @code{$0}) and the value of @code{NF} do not change. @@ -7242,8 +7877,8 @@ @cindex left angle bracket (@code{<}), @code{<} operator (I/O) @cindex operators, input/output Use @samp{getline < @var{file}} to read the next record from @var{file}. -Here @var{file} is a string-valued expression that -specifies the file name. @samp{< @var{file}} is called a @dfn{redirection} +Here, @var{file} is a string-valued expression that +specifies the @value{FN}. @samp{< @var{file}} is called a @dfn{redirection} because it directs input to come from a different place. For example, the following program reads its input record from the file @file{secondary.input} when it @@ -7271,9 +7906,9 @@ According to POSIX, @samp{getline < @var{expression}} is ambiguous if @var{expression} contains unparenthesized operators other than @samp{$}; for example, @samp{getline < dir "/" file} is ambiguous -because the concatenation operator is not parenthesized. You should -write it as @samp{getline < (dir "/" file)} if you want your program -to be portable to all @command{awk} implementations. +because the concatenation operator (not discussed yet; @pxref{Concatenation}) +is not parenthesized. You should write it as @samp{getline < (dir "/" file)} if +you want your program to be portable to all @command{awk} implementations. @node Getline/Variable/File @subsection Using @code{getline} into a Variable from a File @@ -7281,10 +7916,10 @@ Use @samp{getline @var{var} < @var{file}} to read input from the file -@var{file}, and put it in the variable @var{var}. As above, @var{file} +@var{file}, and put it in the variable @var{var}. As earlier, @var{file} is a string-valued expression that specifies the file from which to read. -In this version of @code{getline}, none of the built-in variables are +In this version of @code{getline}, none of the predefined variables are changed and the record is not split into fields. The only variable changed is @var{var}.@footnote{This is not quite true. @code{RT} could be changed if @code{RS} is a regular expression.} @@ -7306,19 +7941,19 @@ Note here how the name of the extra input file is not built into the program; it is taken directly from the data, specifically from the second field on -the @samp{@@include} line. +the @code{@@include} line. The @code{close()} function is called to ensure that if two identical -@samp{@@include} lines appear in the input, the entire specified file is +@code{@@include} lines appear in the input, the entire specified file is included twice. @xref{Close Files And Pipes}. One deficiency of this program is that it does not process nested -@samp{@@include} statements -(i.e., @samp{@@include} statements in included files) +@code{@@include} statements +(i.e., @code{@@include} statements in included files) the way a true macro preprocessor would. -@xref{Igawk Program}, for a program -that does handle nested @samp{@@include} statements. +@DBXREF{Igawk Program} for a program +that does handle nested @code{@@include} statements. @node Getline/Pipe @subsection Using @code{getline} from a Pipe @@ -7362,9 +7997,10 @@ @samp{@@execute} lines appear in the input, the command is run for each one. @ifnottex +@ifnotdocbook @xref{Close Files And Pipes}. +@end ifnotdocbook @end ifnottex -@c Exercise!! @c This example is unrealistic, since you could just use system Given the input: @@ -7393,7 +8029,7 @@ @end example @noindent -Notice that this program ran the command @command{who} and printed the previous result. +Notice that this program ran the command @command{who} and printed the result. (If you try this program yourself, you will of course get different results, depending upon who is logged in on your system.) @@ -7418,8 +8054,8 @@ of a construct like @samp{@w{"echo "} "date" | getline}. Most versions, including the current version, treat it at as @samp{@w{("echo "} "date") | getline}. -(This how Brian Kernighan's @command{awk} behaves.) -Some versions changed and treated it as +(This is also how BWK @command{awk} behaves.) +Some versions instead treat it as @samp{@w{"echo "} ("date" | getline)}. (This is how @command{mawk} behaves.) In short, @emph{always} use explicit parentheses, and then you won't @@ -7445,8 +8081,8 @@ @} @end example -In this version of @code{getline}, none of the built-in variables are -changed and the record is not split into fields. +In this version of @code{getline}, none of the predefined variables are +changed and the record is not split into fields. However, @code{RT} is set. @ifinfo @c Thanks to Paul Eggert for initial wording here @@ -7467,7 +8103,7 @@ @cindex operators, input/output @cindex differences in @command{awk} and @command{gawk}, input/output operators -Input into @code{getline} from a pipe is a one-way operation. +Reading input into @code{getline} from a pipe is a one-way operation. The command that is started with @samp{@var{command} | getline} only sends data @emph{to} your @command{awk} program. @@ -7477,7 +8113,7 @@ communications are possible. This is done with the @samp{|&} operator. Typically, you write data to the coprocess first and then -read results back, as shown in the following: +read the results back, as shown in the following: @example print "@var{some query}" |& "db_server" @@ -7507,7 +8143,7 @@ the coprocess @var{command} is sent through a two-way pipe to @code{getline} and into the variable @var{var}. -In this version of @code{getline}, none of the built-in variables are +In this version of @code{getline}, none of the predefined variables are changed and the record is not split into fields. The only variable changed is @var{var}. However, @code{RT} is set. @@ -7524,7 +8160,7 @@ Here are some miscellaneous points about @code{getline} that you should bear in mind: -@itemize @bullet +@itemize @value{BULLET} @item When @code{getline} changes the value of @code{$0} and @code{NF}, @command{awk} does @emph{not} automatically jump to the start of the @@ -7536,7 +8172,7 @@ @cindex @command{awk}, implementations, limits @cindex @command{gawk}, implementation issues, limits @item -Many @command{awk} implementations limit the number of pipelines that an @command{awk} +Some very old @command{awk} implementations limit the number of pipelines that an @command{awk} program may have open to just one. In @command{gawk}, there is no such limit. You can open as many pipelines (and coprocesses) as the underlying operating system permits. @@ -7549,36 +8185,43 @@ @item An interesting side effect occurs if you use @code{getline} without a redirection inside a @code{BEGIN} rule. Because an unredirected @code{getline} -reads from the command-line data files, the first @code{getline} command +reads from the command-line @value{DF}s, the first @code{getline} command causes @command{awk} to set the value of @code{FILENAME}. Normally, @code{FILENAME} does not have a value inside @code{BEGIN} rules, because you -have not yet started to process the command-line data files. +have not yet started to process the command-line @value{DF}s. @value{DARKCORNER} -(@xref{BEGIN/END}, +(See @ref{BEGIN/END}; also @pxref{Auto-set}.) @item Using @code{FILENAME} with @code{getline} (@samp{getline < FILENAME}) -is likely to be a source for +is likely to be a source of confusion. @command{awk} opens a separate input stream from the current input file. However, by not using a variable, @code{$0} -and @code{NR} are still updated. If you're doing this, it's +and @code{NF} are still updated. If you're doing this, it's probably by accident, and you should reconsider what it is you're trying to accomplish. @item -@ref{Getline Summary}, presents a table summarizing the +@ifdocbook +The next section +@end ifdocbook +@ifnotdocbook +@ref{Getline Summary}, +@end ifnotdocbook +presents a table summarizing the @code{getline} variants and which variables they can affect. -It is worth noting that those variants which do not use redirection +It is worth noting that those variants that do not use redirection can cause @code{FILENAME} to be updated if they cause @command{awk} to start reading a new input file. @item +@cindex Moore, Duncan If the variable being assigned is an expression with side effects, different versions of @command{awk} behave differently upon encountering end-of-file. Some versions don't evaluate the expression; many versions -(including @command{gawk}) do. Here is an example, due to Duncan Moore: +(including @command{gawk}) do. Here is an example, courtesy of Duncan Moore: @ignore Date: Sun, 01 Apr 2012 11:49:33 +0100 @@ -7595,12 +8238,12 @@ @noindent Here, the side effect is the @samp{++c}. Is @code{c} incremented if -end of file is encountered, before the element in @code{a} is assigned? +end-of-file is encountered before the element in @code{a} is assigned? @command{gawk} treats @code{getline} like a function call, and evaluates the expression @samp{a[++c]} before attempting to read from @file{f}. -Other versions of @command{awk} only evaluate the expression once they -know that there is a string value to be assigned. Caveat Emptor. +However, some versions of @command{awk} only evaluate the expression once they +know that there is a string value to be assigned. @end itemize @node Getline Summary @@ -7609,36 +8252,36 @@ @ref{table-getline-variants} summarizes the eight variants of @code{getline}, -listing which built-in variables are set by each one, +listing which predefined variables are set by each one, and whether the variant is standard or a @command{gawk} extension. -Note: for each variant, @command{gawk} sets the @code{RT} built-in variable. +Note: for each variant, @command{gawk} sets the @code{RT} predefined variable. @float Table,table-getline-variants -@caption{@code{getline} Variants and What They Set} +@caption{@code{getline} variants and what they set} @multitable @columnfractions .33 .38 .27 -@headitem Variant @tab Effect @tab Standard / Extension -@item @code{getline} @tab Sets @code{$0}, @code{NF}, @code{FNR}, @code{NR}, and @code{RT} @tab Standard -@item @code{getline} @var{var} @tab Sets @var{var}, @code{FNR}, @code{NR}, and @code{RT} @tab Standard -@item @code{getline <} @var{file} @tab Sets @code{$0}, @code{NF}, and @code{RT} @tab Standard -@item @code{getline @var{var} < @var{file}} @tab Sets @var{var} and @code{RT} @tab Standard -@item @var{command} @code{| getline} @tab Sets @code{$0}, @code{NF}, and @code{RT} @tab Standard -@item @var{command} @code{| getline} @var{var} @tab Sets @var{var} and @code{RT} @tab Standard -@item @var{command} @code{|& getline} @tab Sets @code{$0}, @code{NF}, and @code{RT} @tab Extension -@item @var{command} @code{|& getline} @var{var} @tab Sets @var{var} and @code{RT} @tab Extension +@headitem Variant @tab Effect @tab @command{awk} / @command{gawk} +@item @code{getline} @tab Sets @code{$0}, @code{NF}, @code{FNR}, @code{NR}, and @code{RT} @tab @command{awk} +@item @code{getline} @var{var} @tab Sets @var{var}, @code{FNR}, @code{NR}, and @code{RT} @tab @command{awk} +@item @code{getline <} @var{file} @tab Sets @code{$0}, @code{NF}, and @code{RT} @tab @command{awk} +@item @code{getline @var{var} < @var{file}} @tab Sets @var{var} and @code{RT} @tab @command{awk} +@item @var{command} @code{| getline} @tab Sets @code{$0}, @code{NF}, and @code{RT} @tab @command{awk} +@item @var{command} @code{| getline} @var{var} @tab Sets @var{var} and @code{RT} @tab @command{awk} +@item @var{command} @code{|& getline} @tab Sets @code{$0}, @code{NF}, and @code{RT} @tab @command{gawk} +@item @var{command} @code{|& getline} @var{var} @tab Sets @var{var} and @code{RT} @tab @command{gawk} @end multitable @end float -@c ENDOFRANGE getl -@c ENDOFRANGE inex -@c ENDOFRANGE infir @node Read Timeout -@section Reading Input With A Timeout +@section Reading Input with a Timeout @cindex timeout, reading input -You may specify a timeout in milliseconds for reading input from a terminal, -pipe or two-way communication including, TCP/IP sockets. This can be done -on a per input, command or connection basis, by setting a special element -in the @code{PROCINFO} array: +@cindex differences in @command{awk} and @command{gawk}, read timeouts +This @value{SECTION} describes a feature that is specific to @command{gawk}. + +You may specify a timeout in milliseconds for reading input from the keyboard, +a pipe, or two-way communication, including TCP/IP sockets. This can be done +on a per-input, per-command, or per-connection basis, by setting a special +element in the @code{PROCINFO} array (@pxref{Auto-set}): @example PROCINFO["input_name", "READ_TIMEOUT"] = @var{timeout in milliseconds} @@ -7658,8 +8301,8 @@ print ERRNO @end example -Here is how to read interactively from the terminal@footnote{This assumes -that standard input is the keyboard} without waiting +Here is how to read interactively from the user@footnote{This assumes +that standard input is the keyboard.} without waiting for more than five seconds: @example @@ -7668,18 +8311,18 @@ print $0 @end example -@command{gawk} will terminate the read operation if input does not -arrive after waiting for the timeout period, return failure -and set the @code{ERRNO} variable to an appropriate string value. +@command{gawk} terminates the read operation if input does not +arrive after waiting for the timeout period, returns failure, +and sets @code{ERRNO} to an appropriate string value. A negative or zero value for the timeout is the same as specifying no timeout at all. -A timeout can also be set for reading from the terminal in the implicit +A timeout can also be set for reading from the keyboard in the implicit loop that reads input records and matches them against patterns, like so: @example -$ @kbd{ gawk 'BEGIN @{ PROCINFO["-", "READ_TIMEOUT"] = 5000 @}} +$ @kbd{gawk 'BEGIN @{ PROCINFO["-", "READ_TIMEOUT"] = 5000 @}} > @kbd{@{ print "You entered: " $0 @}'} @kbd{gawk} @print{} You entered: gawk @@ -7702,7 +8345,7 @@ PROCINFO[Service, "READ_TIMEOUT"] = 1000 while ((Service |& getline) > 0) @{ print $0 - PROCINFO[S, "READ_TIMEOUT"] -= 100 + PROCINFO[Service, "READ_TIMEOUT"] -= 100 @} @end example @@ -7711,15 +8354,15 @@ exactly after the tenth record has been printed. It is possible that @command{gawk} will read and buffer more than one record's worth of data the first time. Because of this, changing the value -of timeout like in the above example is not very useful. +of timeout like in the preceding example is not very useful. @end quotation -If the @code{PROCINFO} element is not present and the environment -variable @env{GAWK_READ_TIMEOUT} exists, +If the @code{PROCINFO} element is not present and the +@env{GAWK_READ_TIMEOUT} environment variable exists, @command{gawk} uses its value to initialize the timeout value. The exclusive use of the environment variable to specify timeout has the disadvantage of not being able to control it -on a per command or connection basis. +on a per-command or per-connection basis. @command{gawk} considers a timeout event to be an error even though the attempt to read from the underlying device may @@ -7735,26 +8378,132 @@ or the attempt to open a FIFO special file for reading can block indefinitely until some other process opens it for writing. -@node Command line directories -@section Directories On The Command Line -@cindex differences in @command{awk} and @command{gawk}, command line directories -@cindex directories, command line +@node Command-line directories +@section Directories on the Command Line +@cindex differences in @command{awk} and @command{gawk}, command-line directories +@cindex directories, command-line @cindex command line, directories on According to the POSIX standard, files named on the @command{awk} -command line must be text files. It is a fatal error if they are not. +command line must be text files; it is a fatal error if they are not. Most versions of @command{awk} treat a directory on the command line as a fatal error. By default, @command{gawk} produces a warning for a directory on the -command line, but otherwise ignores it. If either of the @option{--posix} +command line, but otherwise ignores it. This makes it easier to use +shell wildcards with your @command{awk} program: + +@example +$ @kbd{gawk -f whizprog.awk *} @ii{Directories could kill this program} +@end example + +If either of the @option{--posix} or @option{--traditional} options is given, then @command{gawk} reverts to treating a directory on the command line as a fatal error. +@DBXREF{Extension Sample Readdir} for a way to treat directories +as usable data from an @command{awk} program. + +@node Input Summary +@section Summary + +@itemize @value{BULLET} +@item +Input is split into records based on the value of @code{RS}. +The possibilities are as follows: + +@multitable @columnfractions .25 .35 .40 +@headitem Value of @code{RS} @tab Records are split on @dots{} @tab @command{awk} / @command{gawk} +@item Any single character @tab That character @tab @command{awk} +@item The empty string (@code{""}) @tab Runs of two or more newlines @tab @command{awk} +@item A regexp @tab Text that matches the regexp @tab @command{gawk} +@end multitable + +@item +@code{FNR} indicates how many records have been read from the current input file; +@code{NR} indicates how many records have been read in total. + +@item +@command{gawk} sets @code{RT} to the text matched by @code{RS}. + +@item +After splitting the input into records, @command{awk} further splits +the records into individual fields, named @code{$1}, @code{$2}, and so +on. @code{$0} is the whole record, and @code{NF} indicates how many +fields there are. The default way to split fields is between whitespace +characters. + +@item +Fields may be referenced using a variable, as in @code{$NF}. Fields +may also be assigned values, which causes the value of @code{$0} to be +recomputed when it is later referenced. Assigning to a field with a number +greater than @code{NF} creates the field and rebuilds the record, using +@code{OFS} to separate the fields. Incrementing @code{NF} does the same +thing. Decrementing @code{NF} throws away fields and rebuilds the record. + +@item +Field splitting is more complicated than record splitting: + +@multitable @columnfractions .40 .40 .20 +@headitem Field separator value @tab Fields are split @dots{} @tab @command{awk} / @command{gawk} +@item @code{FS == " "} @tab On runs of whitespace @tab @command{awk} +@item @code{FS == @var{any single character}} @tab On that character @tab @command{awk} +@item @code{FS == @var{regexp}} @tab On text matching the regexp @tab @command{awk} +@item @code{FS == ""} @tab Such that each individual character is a separate field @tab @command{gawk} +@item @code{FIELDWIDTHS == @var{list of columns}} @tab Based on character position @tab @command{gawk} +@item @code{FPAT == @var{regexp}} @tab On the text surrounding text matching the regexp @tab @command{gawk} +@end multitable + +@item +Using @samp{FS = "\n"} causes the entire record to be a single field +(assuming that newlines separate records). + +@item +@code{FS} may be set from the command line using the @option{-F} option. +This can also be done using command-line variable assignment. + +@item +Use @code{PROCINFO["FS"]} to see how fields are being split. + +@item +Use @code{getline} in its various forms to read additional records +from the default input stream, from a file, or from a pipe or coprocess. + +@item +Use @code{PROCINFO[@var{file}, "READ_TIMEOUT"]} to cause reads to time out +for @var{file}. + +@item +Directories on the command line are fatal for standard @command{awk}; +@command{gawk} ignores them if not in POSIX mode. + +@end itemize + +@c EXCLUDE START +@node Input Exercises +@section Exercises + +@enumerate +@item +Using the @code{FIELDWIDTHS} variable (@pxref{Constant Size}), +write a program to read election data, where each record represents +one voter's votes. Come up with a way to define which columns are +associated with each ballot item, and print the total votes, +including abstentions, for each item. + +@item +@ref{Plain Getline}, presented a program to remove C-style +comments (@samp{/* @dots{} */}) from the input. That program +does not work if one comment ends on one line and another one +starts later on the same line. +That can be fixed by making one simple change. What is it? + +@end enumerate +@c EXCLUDE END + @node Printing @chapter Printing Output -@c STARTOFRANGE prnt @cindex printing @cindex output, printing, See printing One of the most common programming actions is to @dfn{print}, or output, @@ -7765,17 +8514,16 @@ computing @emph{which} values to print. However, with two exceptions, you cannot specify @emph{how} to print them---how many columns, whether to use exponential notation or not, and so on. -(For the exceptions, @pxref{Output Separators}, and +(For the exceptions, @DBPXREF{Output Separators} and @ref{OFMT}.) For printing with specifications, you need the @code{printf} statement (@pxref{Printf}). -@c STARTOFRANGE prnts @cindex @code{print} statement @cindex @code{printf} statement Besides basic and formatted printing, this @value{CHAPTER} also covers I/O redirections to files and pipes, introduces -the special file names that @command{gawk} processes internally, +the special @value{FN}s that @command{gawk} processes internally, and discusses the @code{close()} built-in function. @menu @@ -7786,17 +8534,20 @@ * Printf:: The @code{printf} statement. * Redirection:: How to redirect output to multiple files and pipes. +* Special FD:: Special files for I/O. * Special Files:: File name interpretation in @command{gawk}. @command{gawk} allows access to inherited file descriptors. * Close Files And Pipes:: Closing Input and Output Files and Pipes. +* Output Summary:: Output summary. +* Output Exercises:: Exercises. @end menu @node Print @section The @code{print} Statement -The @code{print} statement is used for producing output with simple, standardized -formatting. Specify only the strings or numbers to print, in a +Use the @code{print} statement to produce output with simple, standardized +formatting. You specify only the strings or numbers to print, in a list separated by commas. They are output, separated by single spaces, followed by a newline. The statement looks like this: @@ -7819,13 +8570,17 @@ @cindex text, printing The simple statement @samp{print} with no items is equivalent to @samp{print $0}: it prints the entire current record. To print a blank -line, use @samp{print ""}, where @code{""} is the empty string. +line, use @samp{print ""}. To print a fixed piece of text, use a string constant, such as @w{@code{"Don't Panic"}}, as one item. If you forget to use the double-quote characters, your text is taken as an @command{awk} expression, and you will probably get an error. Keep in mind that a space is printed between any two items. +Note that the @code{print} statement is a statement and not an +expression---you can't use it in the pattern part of a +pattern--action statement, for example. + @node Print Examples @section @code{print} Statement Examples @@ -7835,9 +8590,22 @@ single @code{print} statement can make any number of lines this way. @cindex newlines, printing -The following is an example of printing a string that contains embedded newlines +The following is an example of printing a string that contains embedded +@ifinfo +newlines +(the @samp{\n} is an escape sequence, used to represent the newline +character; @pxref{Escape Sequences}): +@end ifinfo +@ifhtml +newlines (the @samp{\n} is an escape sequence, used to represent the newline character; @pxref{Escape Sequences}): +@end ifhtml +@ifnotinfo +@ifnothtml +newlines: +@end ifnothtml +@end ifnotinfo @example $ @kbd{awk 'BEGIN @{ print "line one\nline two\nline three" @}'} @@ -7879,10 +8647,9 @@ To someone unfamiliar with the @file{inventory-shipped} file, neither example's output makes much sense. A heading line at the beginning would make it clearer. Let's add some headings to our table of months -(@code{$1}) and green crates shipped (@code{$2}). We do this using the -@code{BEGIN} pattern -(@pxref{BEGIN/END}) -so that the headings are only printed once: +(@code{$1}) and green crates shipped (@code{$2}). We do this using +a @code{BEGIN} rule (@pxref{BEGIN/END}) so that the headings are only +printed once: @example awk 'BEGIN @{ print "Month Crates" @@ -7931,7 +8698,6 @@ @code{printf} statement simply by putting a newline after any comma (@pxref{Statements/Lines}). @end quotation -@c ENDOFRANGE prnts @node Output Separators @section Output Separators @@ -7942,15 +8708,15 @@ separated by single spaces. However, this doesn't need to be the case; a single space is simply the default. Any string of characters may be used as the @dfn{output field separator} by setting the -built-in variable @code{OFS}. The initial value of this variable -is the string @w{@code{" "}}---that is, a single space. +predefined variable @code{OFS}. The initial value of this variable +is the string @w{@code{" "}} (i.e., a single space). -The output from an entire @code{print} statement is called an -@dfn{output record}. Each @code{print} statement outputs one output -record, and then outputs a string called the @dfn{output record separator} -(or @code{ORS}). The initial -value of @code{ORS} is the string @code{"\n"}; i.e., a newline -character. Thus, each @code{print} statement normally makes a separate line. +The output from an entire @code{print} statement is called an @dfn{output +record}. Each @code{print} statement outputs one output record, and +then outputs a string called the @dfn{output record separator} (or +@code{ORS}). The initial value of @code{ORS} is the string @code{"\n"} +(i.e., a newline character). Thus, each @code{print} statement normally +makes a separate line. @cindex output, records @cindex output record separator, See @code{ORS} variable @@ -7968,42 +8734,32 @@ record, separated by a semicolon, with a blank line added after each newline: -@ignore -Exercise, -Rewrite the -@example -awk 'BEGIN @{ print "Month Crates" - print "----- ------" @} - @{ print $1, " ", $2 @}' inventory-shipped -@end example -program by using a new value of @code{OFS}. -@end ignore @example $ @kbd{awk 'BEGIN @{ OFS = ";"; ORS = "\n\n" @}} > @kbd{@{ print $1, $2 @}' mail-list} @print{} Amelia;555-5553 -@print{} +@print{} @print{} Anthony;555-3412 -@print{} +@print{} @print{} Becky;555-7685 -@print{} +@print{} @print{} Bill;555-1675 -@print{} +@print{} @print{} Broderick;555-0542 -@print{} +@print{} @print{} Camilla;555-2912 -@print{} +@print{} @print{} Fabius;555-1234 -@print{} +@print{} @print{} Julie;555-6699 -@print{} +@print{} @print{} Martin;555-6480 -@print{} +@print{} @print{} Samuel;555-3430 -@print{} +@print{} @print{} Jean-Paul;555-2127 -@print{} +@print{} @end example If the value of @code{ORS} does not contain a newline, the program's output @@ -8014,7 +8770,7 @@ @cindex numeric, output format @cindex formats@comma{} numeric output When printing numeric values with the @code{print} statement, -@command{awk} internally converts the number to a string of characters +@command{awk} internally converts each number to a string of characters and prints that string. @command{awk} uses the @code{sprintf()} function to do this conversion (@pxref{String Functions}). @@ -8028,13 +8784,13 @@ @cindexawkfunc{sprintf} @cindex @code{OFMT} variable @cindex output, format specifier@comma{} @code{OFMT} -The built-in variable @code{OFMT} contains the default format specification +The predefined variable @code{OFMT} contains the format specification that @code{print} uses with @code{sprintf()} when it wants to convert a number to a string for printing. The default value of @code{OFMT} is @code{"%.6g"}. The way @code{print} prints numbers can be changed -by supplying different format specifications -as the value of @code{OFMT}, as shown in the following example: +by supplying a different format specification +for the value of @code{OFMT}, as shown in the following example: @example $ @kbd{awk 'BEGIN @{} @@ -8054,7 +8810,6 @@ @node Printf @section Using @code{printf} Statements for Fancier Printing -@c STARTOFRANGE printfs @cindex @code{printf} statement @cindex output, formatted @cindex formatting output @@ -8064,9 +8819,7 @@ specify the width to use for each item, as well as various formatting choices for numbers (such as what output base to use, whether to print an exponent, whether to print a sign, and how many digits to print -after the decimal point). You do this by supplying a string, called -the @dfn{format string}, that controls how and where to print the other -arguments. +after the decimal point). @menu * Basic Printf:: Syntax of the @code{printf} statement. @@ -8086,10 +8839,10 @@ @end example @noindent -The entire list of arguments may optionally be enclosed in parentheses. The -parentheses are necessary if any of the item expressions use the @samp{>} -relational operator; otherwise, it can be confused with an output redirection -(@pxref{Redirection}). +As for @code{print}, the entire list of arguments may optionally be +enclosed in parentheses. Here too, the parentheses are necessary if any +of the item expressions uses the @samp{>} relational operator; otherwise, +it can be confused with an output redirection (@pxref{Redirection}). @cindex format specifiers The difference between @code{printf} and @code{print} is the @var{format} @@ -8112,14 +8865,14 @@ @example $ @kbd{awk 'BEGIN @{} > @kbd{ORS = "\nOUCH!\n"; OFS = "+"} -> @kbd{msg = "Dont Panic!"} +> @kbd{msg = "Don\47t Panic!"} > @kbd{printf "%s\n", msg} > @kbd{@}'} -@print{} Dont Panic! +@print{} Don't Panic! @end example @noindent -Here, neither the @samp{+} nor the @samp{OUCH} appear in +Here, neither the @samp{+} nor the @samp{OUCH!} appears in the output message. @node Control Letters @@ -8134,25 +8887,16 @@ optional @dfn{modifiers} that control @emph{how} to print the value, such as the field width. Here is a list of the format-control letters: -@table @code -@item %c -Print a number as an ASCII character; thus, @samp{printf "%c", +@c @asis for docbook to come out right +@table @asis +@item @code{%c} +Print a number as a character; thus, @samp{printf "%c", 65} outputs the letter @samp{A}. The output for a string value is the first character of the string. @cindex dark corner, format-control characters @cindex @command{gawk}, format-control characters @quotation NOTE -@ignore -The @samp{%c} format does @emph{not} handle values outside the range -0--255. On most systems, values from 0--127 are within the range of -ASCII and will yield an ASCII character. Values in the range 128--255 -may format as characters in some extended character set, or they may not. -System 390 (IBM architecture mainframe) systems use 8-bit characters, -and thus values from 0--255 yield the corresponding EBCDIC character. -Any value above 255 is treated as modulo 255; i.e., the lowest eight bits -of the value are used. The locale and character set are always ignored. -@end ignore The POSIX standard says the first character of a string is printed. In locales with multibyte characters, @command{gawk} attempts to convert the leading bytes of the string into a valid wide character @@ -8160,6 +8904,8 @@ Similarly, when printing a numeric value, @command{gawk} allows the value to be within the numeric range of values that can be held in a wide character. +If the conversion to multibyte encoding fails, @command{gawk} +uses the low eight bits of the value as the character to print. Other @command{awk} versions generally restrict themselves to printing the first byte of a string or to numeric values within the range of @@ -8167,14 +8913,14 @@ @end quotation -@item %d@r{,} %i +@item @code{%d}, @code{%i} Print a decimal integer. The two control letters are equivalent. (The @samp{%i} specification is for compatibility with ISO C.) -@item %e@r{,} %E -Print a number in scientific (exponential) notation; -for example: +@item @code{%e}, @code{%E} +Print a number in scientific (exponential) notation. +For example: @example printf "%4.3e\n", 1950 @@ -8187,7 +8933,7 @@ discussed in the next @value{SUBSECTION}.) @samp{%E} uses @samp{E} instead of @samp{e} in the output. -@item %f +@item @code{%f} Print a number in floating-point notation. For example: @@ -8201,45 +8947,46 @@ (The @samp{4.3} represents two modifiers, discussed in the next @value{SUBSECTION}.) -On systems supporting IEEE 754 floating point format, values +On systems supporting IEEE 754 floating-point format, values representing negative infinity are formatted as @samp{-inf} or @samp{-infinity}, and positive infinity as -@samp{inf} and @samp{infinity}. -The special ``not a number'' value formats as @samp{-nan} or @samp{nan}. +@samp{inf} or @samp{infinity}. +The special ``not a number'' value formats as @samp{-nan} or @samp{nan} +(@pxref{Math Definitions}). -@item %F -Like @samp{%f} but the infinity and ``not a number'' values are spelled +@item @code{%F} +Like @samp{%f}, but the infinity and ``not a number'' values are spelled using uppercase letters. The @samp{%F} format is a POSIX extension to ISO C; not all systems support it. On those that don't, @command{gawk} uses @samp{%f} instead. -@item %g@r{,} %G +@item @code{%g}, @code{%G} Print a number in either scientific notation or in floating-point notation, whichever uses fewer characters; if the result is printed in scientific notation, @samp{%G} uses @samp{E} instead of @samp{e}. -@item %o +@item @code{%o} Print an unsigned octal integer (@pxref{Nondecimal-numbers}). -@item %s +@item @code{%s} Print a string. -@item %u +@item @code{%u} Print an unsigned decimal integer. (This format is of marginal use, because all numbers in @command{awk} -are floating-point; it is provided primarily for compatibility with C.) +are floating point; it is provided primarily for compatibility with C.) -@item %x@r{,} %X +@item @code{%x}, @code{%X} Print an unsigned hexadecimal integer; @samp{%X} uses the letters @samp{A} through @samp{F} instead of @samp{a} through @samp{f} (@pxref{Nondecimal-numbers}). -@item %% +@item @code{%%} Print a single @samp{%}. This does not consume an argument and it ignores any modifiers. @@ -8260,23 +9007,22 @@ @node Format Modifiers @subsection Modifiers for @code{printf} Formats -@c STARTOFRANGE pfm @cindex @code{printf} statement, modifiers @cindex modifiers@comma{} in format specifiers A format specification can also include @dfn{modifiers} that can control how much of the item's value is printed, as well as how much space it gets. The modifiers come between the @samp{%} and the format-control letter. -We will use the bullet symbol ``@bullet{}'' in the following examples to +We use the bullet symbol ``@bullet{}'' in the following examples to represent spaces in the output. Here are the possible modifiers, in the order in which they may appear: -@table @code +@table @asis @cindex differences in @command{awk} and @command{gawk}, @code{print}/@code{printf} statements @cindex @code{printf} statement, positional specifiers -@c the command does NOT start a secondary +@c the code{} does NOT start a secondary @cindex positional specifiers, @code{printf} statement -@item @var{N}$ +@item @code{@var{N}$} An integer constant followed by a @samp{$} is a @dfn{positional specifier}. Normally, format specifications are applied to arguments in the order given in the format string. With a positional specifier, the format @@ -8297,9 +9043,9 @@ messages at runtime. @xref{Printf Ordering}, which describes how and why to use positional specifiers. -For now, we will not use them. +For now, we ignore them. -@item - +@item @code{-} (Minus) The minus sign, used before the width modifier (see later on in this list), says to left-justify @@ -8317,14 +9063,14 @@ For numeric conversions, prefix positive values with a space and negative values with a minus sign. -@item + +@item @code{+} The plus sign, used before the width modifier (see later on in this list), says to always supply a sign for numeric conversions, even if the data to format is positive. The @samp{+} overrides the space modifier. -@item # -Use an ``alternate form'' for certain control letters. +@item @code{#} +Use an ``alternative form'' for certain control letters. For @samp{%o}, supply a leading zero. For @samp{%x} and @samp{%X}, supply a leading @samp{0x} or @samp{0X} for a nonzero result. @@ -8332,16 +9078,16 @@ contains a decimal point. For @samp{%g} and @samp{%G}, trailing zeros are not removed from the result. -@item 0 -A leading @samp{0} (zero) acts as a flag that indicates that output should be +@item @code{0} +A leading @samp{0} (zero) acts as a flag indicating that output should be padded with zeros instead of spaces. This applies only to the numeric output formats. This flag only has an effect when the field width is wider than the value to print. -@item ' +@item @code{'} A single quote or apostrophe character is a POSIX extension to ISO C. -It indicates that the integer part of a floating point value, or the +It indicates that the integer part of a floating-point value, or the entire part of an integer decimal value, should have a thousands-separator character in it. This only works in locales that support such characters. For example: @@ -8350,7 +9096,7 @@ $ @kbd{cat thousands.awk} @ii{Show source program} @print{} BEGIN @{ printf "%'d\n", 1234567 @} $ @kbd{LC_ALL=C gawk -f thousands.awk} -@print{} 1234567 @ii{Results in "C" locale} +@print{} 1234567 @ii{Results in} "C" @ii{locale} $ @kbd{LC_ALL=en_US.UTF-8 gawk -f thousands.awk} @print{} 1,234,567 @ii{Results in US English UTF locale} @end example @@ -8392,7 +9138,7 @@ Preceding the @var{width} with a minus sign causes the output to be padded with spaces on the right, instead of on the left. -@item .@var{prec} +@item @code{.@var{prec}} A period followed by an integer constant specifies the precision to use when printing. The meaning of the precision varies by control letter: @@ -8422,7 +9168,7 @@ @end table The C library @code{printf}'s dynamic @var{width} and @var{prec} -capability (for example, @code{"%*.*s"}) is supported. Instead of +capability (e.g., @code{"%*.*s"}) is supported. Instead of supplying explicit @var{width} and/or @var{prec} values in the format string, they are passed in the argument list. For example: @@ -8455,20 +9201,17 @@ @end example @noindent -This is not particularly easy to read but it does work. +This is not particularly easy to read, but it does work. @c @cindex lint checks @cindex troubleshooting, fatal errors, @code{printf} format strings @cindex POSIX @command{awk}, @code{printf} format strings and -C programmers may be used to supplying additional -@samp{l}, @samp{L}, and @samp{h} -modifiers in @code{printf} format strings. These are not valid in @command{awk}. -Most @command{awk} implementations silently ignore them. -If @option{--lint} is provided on the command line -(@pxref{Options}), -@command{gawk} warns about their use. If @option{--posix} is supplied, -their use is a fatal error. -@c ENDOFRANGE pfm +C programmers may be used to supplying additional modifiers (@samp{h}, +@samp{j}, @samp{l}, @samp{L}, @samp{t}, and @samp{z}) in @code{printf} +format strings. These are not valid in @command{awk}. Most @command{awk} +implementations silently ignore them. If @option{--lint} is provided +on the command line (@pxref{Options}), @command{gawk} warns about their +use. If @option{--posix} is supplied, their use is a fatal error. @node Printf Examples @subsection Examples Using @code{printf} @@ -8504,7 +9247,7 @@ @end example In this case, the phone numbers had to be printed as strings because -the numbers are separated by a dash. Printing the phone numbers as +the numbers are separated by dashes. Printing the phone numbers as numbers would have produced just the first three digits: @samp{555}. This would have been pretty confusing. @@ -8513,7 +9256,7 @@ after them. The table could be made to look even nicer by adding headings to the -tops of the columns. This is done using the @code{BEGIN} pattern +tops of the columns. This is done using a @code{BEGIN} rule (@pxref{BEGIN/END}) so that the headers are only printed once, at the beginning of the @command{awk} program: @@ -8521,17 +9264,17 @@ @example awk 'BEGIN @{ print "Name Number" print "---- ------" @} - @{ printf "%-10s %s\n", $1, $2 @}' mail-list + @{ printf "%-10s %s\n", $1, $2 @}' mail-list @end example -The above example mixes @code{print} and @code{printf} statements in +The preceding example mixes @code{print} and @code{printf} statements in the same program. Using just @code{printf} statements can produce the same results: @example awk 'BEGIN @{ printf "%-10s %s\n", "Name", "Number" printf "%-10s %s\n", "----", "------" @} - @{ printf "%-10s %s\n", $1, $2 @}' mail-list + @{ printf "%-10s %s\n", $1, $2 @}' mail-list @end example @noindent @@ -8546,23 +9289,14 @@ awk 'BEGIN @{ format = "%-10s %s\n" printf format, "Name", "Number" printf format, "----", "------" @} - @{ printf format, $1, $2 @}' mail-list + @{ printf format, $1, $2 @}' mail-list @end example -@c !!! exercise -At this point, it would be a worthwhile exercise to use the -@code{printf} statement to line up the headings and table data for the -@file{inventory-shipped} example that was covered earlier in the @value{SECTION} -on the @code{print} statement -(@pxref{Print}). -@c ENDOFRANGE printfs @node Redirection @section Redirecting Output of @code{print} and @code{printf} -@c STARTOFRANGE outre @cindex output redirection -@c STARTOFRANGE reout @cindex redirection of output @cindex @option{--sandbox} option, output redirection with @code{print}, @code{printf} So far, the output from @code{print} and @code{printf} has gone @@ -8573,7 +9307,7 @@ @quotation NOTE When @option{--sandbox} is specified (@pxref{Options}), -redirecting output to files and pipes is disabled. +redirecting output to files, pipes, and coprocesses is disabled. @end quotation A redirection appears after the @code{print} or @code{printf} statement. @@ -8585,7 +9319,7 @@ @cindex @code{printf} statement, See Also redirection@comma{} of output There are four forms of output redirection: output to a file, output appended to a file, output through a pipe to another command, and output -to a coprocess. They are all shown for the @code{print} statement, +to a coprocess. We show them all for the @code{print} statement, but they work identically for @code{printf}: @table @code @@ -8594,9 +9328,9 @@ @cindex operators, input/output @item print @var{items} > @var{output-file} This redirection prints the items into the output file named -@var{output-file}. The file name @var{output-file} can be any +@var{output-file}. The @value{FN} @var{output-file} can be any expression. Its value is changed to a string and then used as a -file name (@pxref{Expressions}). +@value{FN} (@pxref{Expressions}). When this type of redirection is used, the @var{output-file} is erased before the first output is written to it. Subsequent writes to the same @@ -8626,7 +9360,7 @@ @cindex @code{>} (right angle bracket), @code{>>} operator (I/O) @cindex right angle bracket (@code{>}), @code{>>} operator (I/O) @item print @var{items} >> @var{output-file} -This redirection prints the items into the pre-existing output file +This redirection prints the items into the preexisting output file named @var{output-file}. The difference between this and the single-@samp{>} redirection is that the old contents (if any) of @var{output-file} are not erased. Instead, the @command{awk} output is @@ -8665,32 +9399,26 @@ the sorted list is written by piping through the @command{sort} utility. The next example uses redirection to mail a message to the mailing -list @samp{bug-system}. This might be useful when trouble is encountered +list @code{bug-system}. This might be useful when trouble is encountered in an @command{awk} script run periodically for system maintenance: @example report = "mail bug-system" -print "Awk script failed:", $0 | report -m = ("at record number " FNR " of " FILENAME) -print m | report +print("Awk script failed:", $0) | report +print("at record number", FNR, "of", FILENAME) | report close(report) @end example -The message is built using string concatenation and saved in the variable -@code{m}. It's then sent down the pipeline to the @command{mail} program. -(The parentheses group the items to concatenate---see -@ref{Concatenation}.) - The @code{close()} function is called here because it's a good idea to close the pipe as soon as all the intended output has been sent to it. -@xref{Close Files And Pipes}, +@DBXREF{Close Files And Pipes} for more information. This example also illustrates the use of a variable to represent a @var{file} or @var{command}---it is not necessary to always use a string constant. Using a variable is generally a good idea, because (if you mean to refer to that same file or command) -@command{awk} requires that the string value be spelled identically +@command{awk} requires that the string value be written identically every time. @cindex coprocesses @@ -8702,15 +9430,23 @@ The difference between this and the single-@samp{|} redirection is that the output from @var{command} can be read with @code{getline}. -Thus @var{command} is a @dfn{coprocess}, which works together with, -but subsidiary to, the @command{awk} program. +Thus, @var{command} is a @dfn{coprocess}, which works together with +but is subsidiary to the @command{awk} program. This feature is a @command{gawk} extension, and is not available in POSIX @command{awk}. +@ifnotdocbook @xref{Getline/Coprocess}, for a brief discussion. @xref{Two-way I/O}, for a more complete discussion. +@end ifnotdocbook +@ifdocbook +@DBXREF{Getline/Coprocess} +for a brief discussion and +@DBREF{Two-way I/O} +for a more complete discussion. +@end ifdocbook @end table Redirecting output using @samp{>}, @samp{>>}, @samp{|}, or @samp{|&} @@ -8733,9 +9469,9 @@ @noindent This is indeed how redirections must be used from the shell. But in @command{awk}, it isn't necessary. In this kind of case, a program should -use @samp{>} for all the @code{print} statements, since the output file +use @samp{>} for all the @code{print} statements, because the output file is only opened once. (It happens that if you mix @samp{>} and @samp{>>} -that output is produced in the expected order. However, mixing the operators +output is produced in the expected order. However, mixing the operators for the same file is definitely poor style, and is confusing to readers of your program.) @@ -8749,7 +9485,9 @@ many @end ifnotinfo @ifnottex +@ifnotdocbook Many +@end ifnotdocbook @end ifnottex older @command{awk} implementations limit the number of pipelines that an @command{awk} @@ -8762,7 +9500,7 @@ A particularly powerful way to use redirection is to build command lines and pipe them into the shell, @command{sh}. For example, suppose you -have a list of files brought over from a system where all the file names +have a list of files brought over from a system where all the @value{FN}s are stored in uppercase, and you wish to rename them to have names in all lowercase. The following program is both simple and efficient: @@ -8779,27 +9517,13 @@ The program builds up a list of command lines, using the @command{mv} utility to rename the files. It then sends the list to the shell for execution. -@end sidebar -@c ENDOFRANGE outre -@c ENDOFRANGE reout - -@node Special Files -@section Special File Names in @command{gawk} -@c STARTOFRANGE gfn -@cindex @command{gawk}, file names in -@command{gawk} provides a number of special file names that it interprets -internally. These file names provide access to standard file descriptors -and TCP/IP networking. - -@menu -* Special FD:: Special files for I/O. -* Special Network:: Special files for network communications. -* Special Caveats:: Things to watch out for. -@end menu +@DBXREF{Shell Quoting} for a function that can help in generating +command lines to be fed to the shell. +@end sidebar @node Special FD -@subsection Special Files for Standard Descriptors +@section Special Files for Standard Preopened Data Streams @cindex standard input @cindex input, standard @cindex standard output @@ -8810,9 +9534,12 @@ @cindex files, descriptors, See file descriptors Running programs conventionally have three input and output streams -already available to them for reading and writing. These are known as -the @dfn{standard input}, @dfn{standard output}, and @dfn{standard error -output}. These streams are, by default, connected to your keyboard and screen, but +already available to them for reading and writing. These are known +as the @dfn{standard input}, @dfn{standard output}, and @dfn{standard +error output}. These open streams (and any other open files or pipes) +are often referred to by the technical term @dfn{file descriptors}. + +These streams are, by default, connected to your keyboard and screen, but they are often redirected with the shell, via the @samp{<}, @samp{<<}, @samp{>}, @samp{>>}, @samp{>&}, and @samp{|} operators. Standard error is typically used for writing error messages; the reason there are two separate @@ -8821,7 +9548,7 @@ @cindex differences in @command{awk} and @command{gawk}, error messages @cindex error handling -In other implementations of @command{awk}, the only way to write an error +In traditional implementations of @command{awk}, the only way to write an error message to standard error in an @command{awk} program is as follows: @example @@ -8831,7 +9558,8 @@ @noindent This works by opening a pipeline to a shell command that can access the standard error stream that it inherits from the @command{awk} process. -This is far from elegant, and it is also inefficient, because it requires a +@c 8/2014: Mike Brennan says not to cite this as inefficient. So, fixed. +This is far from elegant, and it also requires a separate process. So people writing @command{awk} programs often don't do this. Instead, they send the error messages to the screen, like this: @@ -8846,19 +9574,19 @@ ``terminal,''@footnote{The ``tty'' in @file{/dev/tty} stands for ``Teletype,'' a serial terminal.} which on modern systems is a keyboard and screen, not a serial console.) -This usually has the same effect but not always: although the +This generally has the same effect, but not always: although the standard error stream is usually the screen, it can be redirected; when that happens, writing to the screen is not correct. In fact, if @command{awk} is run from a background job, it may not have a terminal at all. Then opening @file{/dev/tty} fails. -@command{gawk} provides special file names for accessing the three standard -streams. @value{COMMONEXT}. It also provides syntax for accessing -any other inherited open files. If the file name matches -one of these special names when @command{gawk} redirects input or output, -then it directly uses the stream that the file name stands for. -These special file names work for all operating systems that @command{gawk} +@command{gawk}, BWK @command{awk}, and @command{mawk} provide +special @value{FN}s for accessing the three standard streams. +If the @value{FN} matches one of these special names when @command{gawk} +(or one of the others) redirects input or output, then it directly uses +the descriptor that the @value{FN} stands for. These special +@value{FN}s work for all operating systems that @command{gawk} has been ported to, not just those that are POSIX-compliant: @cindex common extensions, @code{/dev/stdin} special file @@ -8880,39 +9608,65 @@ @item /dev/stderr The standard error output (file descriptor 2). - -@item /dev/fd/@var{N} -The file associated with file descriptor @var{N}. Such a file must -be opened by the program initiating the @command{awk} execution (typically -the shell). Unless special pains are taken in the shell from which -@command{gawk} is invoked, only descriptors 0, 1, and 2 are available. @end table -The file names @file{/dev/stdin}, @file{/dev/stdout}, and @file{/dev/stderr} -are aliases for @file{/dev/fd/0}, @file{/dev/fd/1}, and @file{/dev/fd/2}, -respectively. However, they are more self-explanatory. -The proper way to write an error message in a @command{gawk} program -is to use @file{/dev/stderr}, like this: +With these facilities, +the proper way to write an error message then becomes: @example print "Serious error detected!" > "/dev/stderr" @end example @cindex troubleshooting, quotes with file names -Note the use of quotes around the file name. -Like any other redirection, the value must be a string. +Note the use of quotes around the @value{FN}. +Like with any other redirection, the value must be a string. It is a common error to omit the quotes, which leads to confusing results. -@c Exercise: What does it do? :-) -Finally, using the @code{close()} function on a file name of the +@command{gawk} does not treat these @value{FN}s as special when +in POSIX-compatibility mode. However, because BWK @command{awk} +supports them, @command{gawk} does support them even when +invoked with the @option{--traditional} option (@pxref{Options}). + +@node Special Files +@section Special @value{FFN}s in @command{gawk} +@cindex @command{gawk}, file names in + +Besides access to standard input, standard output, and standard error, +@command{gawk} provides access to any open file descriptor. +Additionally, there are special @value{FN}s reserved for +TCP/IP networking. + +@menu +* Other Inherited Files:: Accessing other open files with + @command{gawk}. +* Special Network:: Special files for network communications. +* Special Caveats:: Things to watch out for. +@end menu + +@node Other Inherited Files +@subsection Accessing Other Open Files with @command{gawk} + +Besides the @code{/dev/stdin}, @code{/dev/stdout}, and @code{/dev/stderr} +special @value{FN}s mentioned earlier, @command{gawk} provides syntax +for accessing any other inherited open file: + +@table @file +@item /dev/fd/@var{N} +The file associated with file descriptor @var{N}. Such a file must +be opened by the program initiating the @command{awk} execution (typically +the shell). Unless special pains are taken in the shell from which +@command{gawk} is invoked, only descriptors 0, 1, and 2 are available. +@end table + +The @value{FN}s @file{/dev/stdin}, @file{/dev/stdout}, and @file{/dev/stderr} +are essentially aliases for @file{/dev/fd/0}, @file{/dev/fd/1}, and +@file{/dev/fd/2}, respectively. However, those names are more self-explanatory. + +Note that using @code{close()} on a @value{FN} of the form @code{"/dev/fd/@var{N}"}, for file descriptor numbers above two, does actually close the given file descriptor. -The @file{/dev/stdin}, @file{/dev/stdout}, and @file{/dev/stderr} -special files are also recognized internally by several other -versions of @command{awk}. - @node Special Network @subsection Special Files for Network Communications @cindex networks, support for @@ -8921,17 +9675,17 @@ @command{gawk} programs can open a two-way TCP/IP connection, acting as either a client or a server. -This is done using a special file name of the form: +This is done using a special @value{FN} of the form: @example @file{/@var{net-type}/@var{protocol}/@var{local-port}/@var{remote-host}/@var{remote-port}} @end example -The @var{net-type} is one of @samp{inet}, @samp{inet4} or @samp{inet6}. +The @var{net-type} is one of @samp{inet}, @samp{inet4}, or @samp{inet6}. The @var{protocol} is one of @samp{tcp} or @samp{udp}, and the other fields represent the other essential pieces of information for making a networking connection. -These file names are used with the @samp{|&} operator for communicating +These @value{FN}s are used with the @samp{|&} operator for communicating with a coprocess (@pxref{Two-way I/O}). This is an advanced feature, mentioned here only for completeness. @@ -8939,44 +9693,44 @@ @ref{TCP/IP Networking}. @node Special Caveats -@subsection Special File Name Caveats +@subsection Special @value{FFN} Caveats -Here is a list of things to bear in mind when using the -special file names that @command{gawk} provides: +Here are some things to bear in mind when using the +special @value{FN}s that @command{gawk} provides: -@itemize @bullet +@itemize @value{BULLET} @cindex compatibility mode (@command{gawk}), file names @cindex file names, in compatibility mode @item -Recognition of these special file names is disabled if @command{gawk} is in -compatibility mode (@pxref{Options}). +Recognition of the @value{FN}s for the three standard preopened +files is disabled only in POSIX mode. + +@item +Recognition of the other special @value{FN}s is disabled if @command{gawk} is in +compatibility mode (either @option{--traditional} or @option{--posix}; +@pxref{Options}). @item @command{gawk} @emph{always} -interprets these special file names. +interprets these special @value{FN}s. For example, using @samp{/dev/fd/4} for output actually writes on file descriptor 4, and not on a new -file descriptor that is @code{dup()}'ed from file descriptor 4. Most of +file descriptor that is @code{dup()}ed from file descriptor 4. Most of the time this does not matter; however, it is important to @emph{not} close any of the files related to file descriptors 0, 1, and 2. Doing so results in unpredictable behavior. @end itemize -@c ENDOFRANGE gfn @node Close Files And Pipes @section Closing Input and Output Redirections @cindex files, output, See output files -@c STARTOFRANGE ifc @cindex input files, closing -@c STARTOFRANGE ofc @cindex output, files@comma{} closing -@c STARTOFRANGE pc @cindex pipe, closing -@c STARTOFRANGE cc @cindex coprocesses, closing @cindex @code{getline} command, coprocesses@comma{} using from -If the same file name or the same shell command is used with @code{getline} +If the same @value{FN} or the same shell command is used with @code{getline} more than once during the execution of an @command{awk} program (@pxref{Getline}), the file is opened (or the command is executed) the first time only. @@ -8985,7 +9739,7 @@ another record is read from it, and so on. Similarly, when a file or pipe is opened for output, @command{awk} remembers -the file name or command associated with it, and subsequent +the @value{FN} or command associated with it, and subsequent writes to the same file or command are appended to the previous writes. The file or pipe stays open until @command{awk} exits. @@ -9027,7 +9781,7 @@ file or command, reopens the file or reruns the command. Because the expression that you use to close a file or pipeline must exactly match the expression used to open the file or run the command, -it is good practice to use a variable to store the file name or command. +it is good practice to use a variable to store the @value{FN} or command. The previous example becomes the following: @example @@ -9041,7 +9795,7 @@ This helps avoid hard-to-find typographical errors in your @command{awk} programs. Here are some of the reasons for closing an output file: -@itemize @bullet +@itemize @value{BULLET} @item To write a file and read it back later on in the same @command{awk} program. Close the file after writing it, then @@ -9077,7 +9831,7 @@ @cindex @code{close()} function, portability If you use more files than the system allows you to have open, @command{gawk} attempts to multiplex the available open files among -your data files. @command{gawk}'s ability to do this depends upon the +your @value{DF}s. @command{gawk}'s ability to do this depends upon the facilities of your operating system, so it may not always work. It is therefore both good practice and good portability advice to always use @code{close()} on your files when you are done with them. @@ -9110,15 +9864,17 @@ is not closed and released until @code{close()} is called or @command{awk} exits. -@code{close()} will silently do nothing if given an argument that -does not represent a file, pipe or coprocess that was opened with -a redirection. - -Note also that @samp{close(FILENAME)} has no -``magic'' effects on the implicit loop that reads through the -files named on the command line. It is, more likely, a close -of a file that was never opened, so @command{awk} silently -does nothing. +@code{close()} silently does nothing if given an argument that +does not represent a file, pipe, or coprocess that was opened with +a redirection. In such a case, it returns a negative value, +indicating an error. In addition, @command{gawk} sets @code{ERRNO} +to a string indicating the error. + +Note also that @samp{close(FILENAME)} has no ``magic'' effects on the +implicit loop that reads through the files named on the command line. +It is, more likely, a close of a file that was never opened with a +redirection, so @command{awk} silently does nothing, except return +a negative value. @cindex @code{|} (vertical bar), @code{|&} operator (I/O), pipes@comma{} closing When using the @samp{|&} operator to communicate with a coprocess, @@ -9130,10 +9886,10 @@ to start the coprocess. The second argument should be a string, with either of the values @code{"to"} or @code{"from"}. Case does not matter. -As this is an advanced feature, a more complete discussion is +As this is an advanced feature, discussion is delayed until @ref{Two-way I/O}, -which discusses it in more detail and gives an example. +which describes it in more detail and gives an example. @sidebar Using @code{close()}'s Return Value @cindex dark corner, @code{close()} function @@ -9142,10 +9898,11 @@ @cindex differences in @command{awk} and @command{gawk}, @code{close()} function @cindex Unix @command{awk}, @code{close()} function and -In many versions of Unix @command{awk}, the @code{close()} function -is actually a statement. It is a syntax error to try and use the return -value from @code{close()}: +In many older versions of Unix @command{awk}, the @code{close()} function +is actually a statement. @value{DARKCORNER} +It is a syntax error to try and use the return +value from @code{close()}: @example command = "@dots{}" @@ -9159,7 +9916,7 @@ The return value is @minus{}1 if the argument names something that was never opened with a redirection, or if there is a system problem closing the file or process. -In these cases, @command{gawk} sets the built-in variable +In these cases, @command{gawk} sets the predefined variable @code{ERRNO} to a string describing the problem. In @command{gawk}, @@ -9175,23 +9932,80 @@ it fails. The POSIX standard is very vague; it says that @code{close()} -returns zero on success and nonzero otherwise. In general, +returns zero on success and a nonzero value otherwise. In general, different implementations vary in what they report when closing -pipes; thus the return value cannot be used portably. +pipes; thus, the return value cannot be used portably. @value{DARKCORNER} In POSIX mode (@pxref{Options}), @command{gawk} just returns zero when closing a pipe. @end sidebar -@c ENDOFRANGE ifc -@c ENDOFRANGE ofc -@c ENDOFRANGE pc -@c ENDOFRANGE cc -@c ENDOFRANGE prnt + +@node Output Summary +@section Summary + +@itemize @value{BULLET} +@item +The @code{print} statement prints comma-separated expressions. Each +expression is separated by the value of @code{OFS} and terminated by +the value of @code{ORS}. @code{OFMT} provides the conversion format +for numeric values for the @code{print} statement. + +@item +The @code{printf} statement provides finer-grained control over output, +with format-control letters for different data types and various flags +that modify the behavior of the format-control letters. + +@item +Output from both @code{print} and @code{printf} may be redirected to +files, pipes, and coprocesses. + +@item +@command{gawk} provides special @value{FN}s for access to standard input, +output, and error, and for network communications. + +@item +Use @code{close()} to close open file, pipe, and coprocess redirections. +For coprocesses, it is possible to close only one direction of the +communications. + +@end itemize + +@c EXCLUDE START +@node Output Exercises +@section Exercises + +@enumerate +@item +Rewrite the program: + +@example +awk 'BEGIN @{ print "Month Crates" + print "----- ------" @} + @{ print $1, " ", $2 @}' inventory-shipped +@end example + +@noindent +from @ref{Output Separators}, by using a new value of @code{OFS}. + +@item +Use the @code{printf} statement to line up the headings and table data +for the @file{inventory-shipped} example that was covered in @ref{Print}. + +@item +What happens if you forget the double quotes when redirecting +output, as follows: + +@example +BEGIN @{ print "Serious error detected!" > /dev/stderr @} +@end example + +@end enumerate +@c EXCLUDE END + @node Expressions @chapter Expressions -@c STARTOFRANGE exps @cindex expressions Expressions are the basic building blocks of @command{awk} patterns @@ -9202,7 +10016,7 @@ An expression can serve as a pattern or action statement on its own. Most other kinds of statements contain one or more expressions that specify the data on which to -operate. As in other languages, expressions in @command{awk} include +operate. As in other languages, expressions in @command{awk} can include variables, array references, constants, and function calls, as well as combinations of these with various operators. @@ -9213,14 +10027,15 @@ * Function Calls:: A function call is an expression. * Precedence:: How various operators nest. * Locales:: How the locale affects things. +* Expressions Summary:: Expressions summary. @end menu @node Values -@section Constants, Variables and Conversions +@section Constants, Variables, and Conversions Expressions are built up from values and the operations performed upon them. This @value{SECTION} describes the elementary objects -which provide the values used in expressions. +that provide the values used in expressions. @menu * Constants:: String, numeric and regexp constants. @@ -9233,7 +10048,6 @@ @node Constants @subsection Constant Expressions -@c STARTOFRANGE cnst @cindex constants, types of The simplest type of expression is the @dfn{constant}, which always has @@ -9242,7 +10056,7 @@ Each is used in the appropriate context when you need a data value that isn't going to change. Numeric constants can -have different forms, but are stored identically internally. +have different forms, but are internally stored in an identical manner. @menu * Scalar Constants:: Numeric and string constants. @@ -9258,9 +10072,9 @@ A @dfn{numeric constant} stands for a number. This number can be an integer, a decimal fraction, or a number in scientific (exponential) notation.@footnote{The internal representation of all numbers, -including integers, uses double precision -floating-point numbers. -On most modern systems, these are in IEEE 754 standard format.} +including integers, uses double-precision floating-point numbers. +On most modern systems, these are in IEEE 754 standard format. +@xref{Arbitrary Precision Arithmetic}, for much more information.} Here are some examples of numeric constants that all have the same value: @@ -9271,8 +10085,8 @@ @end example @cindex string constants -A string constant consists of a sequence of characters enclosed in -double-quotation marks. For example: +A @dfn{string constant} consists of a sequence of characters enclosed in +double quotation marks. For example: @example "parrot" @@ -9283,7 +10097,7 @@ @cindex strings, length limitations represents the string whose contents are @samp{parrot}. Strings in @command{gawk} can be of any length, and they can contain any of the possible -eight-bit ASCII characters including ASCII @sc{nul} (character code zero). +eight-bit ASCII characters, including ASCII @sc{nul} (character code zero). Other @command{awk} implementations may have difficulty with some character codes. @@ -9294,19 +10108,19 @@ @cindex numbers, octal @cindex numbers, hexadecimal -In @command{awk}, all numbers are in decimal; i.e., base 10. Many other +In @command{awk}, all numbers are in decimal (i.e., base 10). Many other programming languages allow you to specify numbers in other bases, often octal (base 8) and hexadecimal (base 16). -In octal, the numbers go 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, etc. -Just as @samp{11}, in decimal, is 1 times 10 plus 1, so -@samp{11}, in octal, is 1 times 8, plus 1. This equals 9 in decimal. -In hexadecimal, there are 16 digits. Since the everyday decimal +In octal, the numbers go 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, and so on. +Just as @samp{11} in decimal is 1 times 10 plus 1, so +@samp{11} in octal is 1 times 8 plus 1. This equals 9 in decimal. +In hexadecimal, there are 16 digits. Because the everyday decimal number system only has ten digits (@samp{0}--@samp{9}), the letters @samp{a} through @samp{f} are used to represent the rest. (Case in the letters is usually irrelevant; hexadecimal @samp{a} and @samp{A} have the same value.) -Thus, @samp{11}, in -hexadecimal, is 1 times 16 plus 1, which equals 17 in decimal. +Thus, @samp{11} in +hexadecimal is 1 times 16 plus 1, which equals 17 in decimal. Just by looking at plain @samp{11}, you can't tell what base it's in. So, in C, C++, and other languages derived from C, @@ -9317,13 +10131,13 @@ @table @code @item 11 -Decimal value 11. +Decimal value 11 @item 011 -Octal 11, decimal value 9. +Octal 11, decimal value 9 @item 0x11 -Hexadecimal 11, decimal value 17. +Hexadecimal 11, decimal value 17 @end table This example shows the difference: @@ -9351,12 +10165,13 @@ (@pxref{String Functions}) to convert the data into a number. Most of the time, you will want to use octal or hexadecimal constants -when working with the built-in bit manipulation functions; -see @ref{Bitwise Functions}, +when working with the built-in bit-manipulation functions; +see @DBREF{Bitwise Functions} for more information. -Unlike some early C implementations, @samp{8} and @samp{9} are not valid -in octal constants; e.g., @command{gawk} treats @samp{018} as decimal 18: +Unlike in some early C implementations, @samp{8} and @samp{9} are not +valid in octal constants. For example, @command{gawk} treats @samp{018} +as decimal 18: @example $ @kbd{gawk 'BEGIN @{ print "021 is", 021 ; print 018 @}'} @@ -9389,18 +10204,17 @@ @node Regexp Constants @subsubsection Regular Expression Constants -@c STARTOFRANGE rec @cindex regexp constants @cindex @code{~} (tilde), @code{~} operator @cindex tilde (@code{~}), @code{~} operator @cindex @code{!} (exclamation point), @code{!~} operator @cindex exclamation point (@code{!}), @code{!~} operator -A regexp constant is a regular expression description enclosed in +A @dfn{regexp constant} is a regular expression description enclosed in slashes, such as @code{@w{/^beginning and end$/}}. Most regexps used in @command{awk} programs are constant, but the @samp{~} and @samp{!~} matching operators can also match computed or dynamic regexps -(which are just ordinary strings or variables that contain a regexp). -@c ENDOFRANGE cnst +(which are typically just ordinary strings or variables that contain a regexp, +but could be more complex expressions). @node Using Constant Regexps @subsection Using Regular Expression Constants @@ -9412,7 +10226,7 @@ However, regexp constants (such as @code{/foo/}) may be used like simple expressions. When a regexp constant appears by itself, it has the same meaning as if it appeared -in a pattern, i.e., @samp{($0 ~ /foo/)} +in a pattern (i.e., @samp{($0 ~ /foo/)}). @value{DARKCORNER} @xref{Expression Patterns}. This means that the following two code segments: @@ -9433,7 +10247,7 @@ @noindent are exactly equivalent. One rather bizarre consequence of this rule is that the following -Boolean expression is valid, but does not do what the user probably +Boolean expression is valid, but does not do what its author probably intended: @example @@ -9473,16 +10287,15 @@ Constant regular expressions are also used as the first argument for the @code{gensub()}, @code{sub()}, and @code{gsub()} functions, as the second argument of the @code{match()} function, -and as the third argument of the @code{patsplit()} function +and as the third argument of the @code{split()} and @code{patsplit()} functions (@pxref{String Functions}). Modern implementations of @command{awk}, including @command{gawk}, allow the third argument of @code{split()} to be a regexp constant, but some older implementations do not. @value{DARKCORNER} -This can lead to confusion when attempting to use regexp constants -as arguments to user-defined functions -(@pxref{User-defined}). -For example: +Because some built-in functions accept regexp constants as arguments, +confusion can arise when attempting to use regexp constants as arguments +to user-defined functions (@pxref{User-defined}). For example: @example function mysub(pat, repl, str, global) @@ -9505,28 +10318,27 @@ @c @cindex automatic warnings @c @cindex warnings, automatic In this example, the programmer wants to pass a regexp constant to the -user-defined function @code{mysub}, which in turn passes it on to +user-defined function @code{mysub()}, which in turn passes it on to either @code{sub()} or @code{gsub()}. However, what really happens is that -the @code{pat} parameter is either one or zero, depending upon whether +the @code{pat} parameter is assigned a value of either one or zero, depending upon whether or not @code{$0} matches @code{/hi/}. @command{gawk} issues a warning when it sees a regexp constant used as -a parameter to a user-defined function, since passing a truth value in +a parameter to a user-defined function, because passing a truth value in this way is probably not what was intended. -@c ENDOFRANGE rec @node Variables @subsection Variables @cindex variables, user-defined @cindex user-defined, variables -Variables are ways of storing values at one point in your program for +@dfn{Variables} are ways of storing values at one point in your program for use later in another part of your program. They can be manipulated entirely within the program text, and they can also be assigned values on the @command{awk} command line. @menu * Using Variables:: Using variables in your programs. -* Assignment Options:: Setting variables on the command-line and a +* Assignment Options:: Setting variables on the command line and a summary of command-line syntax. This is an advanced method of input. @end menu @@ -9537,33 +10349,37 @@ Variables let you give names to values and refer to them later. Variables have already been used in many of the examples. The name of a variable must be a sequence of letters, digits, or underscores, and it may not begin -with a digit. Case is significant in variable names; @code{a} and @code{A} +with a digit. +Here, a @dfn{letter} is any one of the 52 upper- and lowercase +English letters. Other characters that may be defined as letters +in non-English locales are not valid in variable names. +Case is significant in variable names; @code{a} and @code{A} are distinct variables. A variable name is a valid expression by itself; it represents the variable's current value. Variables are given new values with @dfn{assignment operators}, @dfn{increment operators}, and -@dfn{decrement operators}. -@xref{Assignment Ops}. +@dfn{decrement operators} +(@pxref{Assignment Ops}). In addition, the @code{sub()} and @code{gsub()} functions can -change a variable's value, and the @code{match()}, @code{patsplit()} -and @code{split()} functions can change the contents of their -array parameters. @xref{String Functions}. +change a variable's value, and the @code{match()}, @code{split()}, +and @code{patsplit()} functions can change the contents of their +array parameters (@pxref{String Functions}). @cindex variables, built-in @cindex variables, initializing A few variables have special built-in meanings, such as @code{FS} (the -field separator), and @code{NF} (the number of fields in the current input -record). @xref{Built-in Variables}, for a list of the built-in variables. -These built-in variables can be used and assigned just like all other +field separator) and @code{NF} (the number of fields in the current input +record). @DBXREF{Built-in Variables} for a list of the predefined variables. +These predefined variables can be used and assigned just like all other variables, but their values are also used or changed automatically by -@command{awk}. All built-in variables' names are entirely uppercase. +@command{awk}. All predefined variables' names are entirely uppercase. Variables in @command{awk} can be assigned either numeric or string values. The kind of value a variable holds can change over the life of a program. By default, variables are initialized to the empty string, which is zero if converted to a number. There is no need to explicitly -``initialize'' a variable in @command{awk}, +initialize a variable in @command{awk}, which is what you would do in C and in most other traditional languages. @node Assignment Options @@ -9594,8 +10410,8 @@ @noindent the variable is set at the very beginning, even before the @code{BEGIN} rules execute. The @option{-v} option and its assignment -must precede all the file name arguments, as well as the program text. -(@xref{Options}, for more information about +must precede all the @value{FN} arguments, as well as the program text. +(@DBXREF{Options} for more information about the @option{-v} option.) Otherwise, the variable assignment is performed at a time determined by its position among the input file arguments---after the processing of the @@ -9635,6 +10451,19 @@ @node Conversion @subsection Conversion of Strings and Numbers +Number-to-string and string-to-number conversion are generally +straightforward. There can be subtleties to be aware of; +this @value{SECTION} discusses this important facet of @command{awk}. + +@menu +* Strings And Numbers:: How @command{awk} Converts Between Strings And + Numbers. +* Locale influences conversions:: How the locale may affect conversions. +@end menu + +@node Strings And Numbers +@subsubsection How @command{awk} Converts Between Strings and Numbers + @cindex converting, strings to numbers @cindex strings, converting @cindex numbers, converting @@ -9664,13 +10493,13 @@ To force a string to be converted to a number, add zero to that string. A string is converted to a number by interpreting any numeric prefix of the string as numerals: -@code{"2.5"} converts to 2.5, @code{"1e3"} converts to 1000, and @code{"25fix"} +@code{"2.5"} converts to 2.5, @code{"1e3"} converts to 1,000, and @code{"25fix"} has a numeric value of 25. Strings that can't be interpreted as valid numbers convert to zero. @cindex @code{CONVFMT} variable The exact manner in which numbers are converted into strings is controlled -by the @command{awk} built-in variable @code{CONVFMT} (@pxref{Built-in Variables}). +by the @command{awk} predefined variable @code{CONVFMT} (@pxref{Built-in Variables}). Numbers are converted using the @code{sprintf()} function with @code{CONVFMT} as the format specifier @@ -9704,6 +10533,7 @@ @code{b} has the value @code{"12"}, not @code{"12.00"}. @value{DARKCORNER} +@sidebar Pre-POSIX @command{awk} Used @code{OFMT} for String Conversion @cindex POSIX @command{awk}, @code{OFMT} variable and @cindex @code{OFMT} variable @cindex portability, new @command{awk} vs.@: old @command{awk} @@ -9715,32 +10545,32 @@ conversion from the semantics of printing. Both @code{CONVFMT} and @code{OFMT} have the same default value: @code{"%.6g"}. In the vast majority of cases, old @command{awk} programs do not change their behavior. -However, these semantics for @code{OFMT} are something to keep in mind if you must -port your new-style program to older implementations of @command{awk}. -We recommend -that instead of changing your programs, just port @command{gawk} itself. -@xref{Print}, -for more information on the @code{print} statement. - -And, once again, where you are can matter when it comes to converting -between numbers and strings. In @ref{Locales}, we mentioned that -the local character set and language (the locale) can affect how -@command{gawk} matches characters. The locale also affects numeric -formats. In particular, for @command{awk} programs, it affects the -decimal point character. The @code{"C"} locale, and most English-language -locales, use the period character (@samp{.}) as the decimal point. -However, many (if not most) European and non-English locales use the comma -(@samp{,}) as the decimal point character. +@DBXREF{Print} for more information on the @code{print} statement. +@end sidebar + +@node Locale influences conversions +@subsubsection Locales Can Influence Conversion + +Where you are can matter when it comes to converting between numbers and +strings. The local character set and language---the @dfn{locale}---can +affect numeric formats. In particular, for @command{awk} programs, +it affects the decimal point character and the thousands-separator +character. The @code{"C"} locale, and most English-language locales, +use the period character (@samp{.}) as the decimal point and don't +have a thousands separator. However, many (if not most) European and +non-English locales use the comma (@samp{,}) as the decimal point +character. European locales often use either a space or a period as +the thousands separator, if they have one. @cindex dark corner, locale's decimal point character The POSIX standard says that @command{awk} always uses the period as the decimal -point when reading the @command{awk} program source code, and for command-line -variable assignments (@pxref{Other Arguments}). -However, when interpreting input data, for @code{print} and @code{printf} output, -and for number to string conversion, the local decimal point character is used. -@value{DARKCORNER} -Here are some examples indicating the difference in behavior, -on a GNU/Linux system: +point when reading the @command{awk} program source code, and for +command-line variable assignments (@pxref{Other Arguments}). However, +when interpreting input data, for @code{print} and @code{printf} output, +and for number-to-string conversion, the local decimal point character +is used. @value{DARKCORNER} In all cases, numbers in source code and +in input data cannot have a thousands separator. Here are some examples +indicating the difference in behavior, on a GNU/Linux system: @example $ @kbd{export POSIXLY_CORRECT=1} @ii{Force POSIX behavior} @@ -9755,19 +10585,19 @@ @end example @noindent -The @samp{en_DK.utf-8} locale is for English in Denmark, where the comma acts as +The @code{en_DK.utf-8} locale is for English in Denmark, where the comma acts as the decimal point separator. In the normal @code{"C"} locale, @command{gawk} -treats @samp{4,321} as @samp{4}, while in the Danish locale, it's treated -as the full number, 4.321. +treats @samp{4,321} as 4, while in the Danish locale, it's treated +as the full number including the fractional part, 4.321. Some earlier versions of @command{gawk} fully complied with this aspect of the standard. However, many users in non-English locales complained -about this behavior, since their data used a period as the decimal +about this behavior, because their data used a period as the decimal point, so the default behavior was restored to use a period as the decimal point character. You can use the @option{--use-lc-numeric} option (@pxref{Options}) to force @command{gawk} to use the locale's decimal point character. (@command{gawk} also uses the locale's decimal -point character when in POSIX mode, either via @option{--posix}, or the +point character when in POSIX mode, either via @option{--posix} or the @env{POSIXLY_CORRECT} environment variable, as shown previously.) @ref{table-locale-affects} describes the cases in which the locale's decimal @@ -9775,7 +10605,7 @@ features have not been described yet. @float Table,table-locale-affects -@caption{Locale Decimal Point versus A Period} +@caption{Locale decimal point versus a period} @multitable @columnfractions .15 .20 .45 @headitem Feature @tab Default @tab @option{--posix} or @option{--use-lc-numeric} @item @code{%'g} @tab Use locale @tab Use locale @@ -9785,15 +10615,15 @@ @end multitable @end float -Finally, modern day formal standards and IEEE standard floating point +Finally, modern-day formal standards and the IEEE standard floating-point representation can have an unusual but important effect on the way @command{gawk} converts some special string values to numbers. The details are presented in @ref{POSIX Floating Point Problems}. @node All Operators -@section Operators: Doing Something With Values +@section Operators: Doing Something with Values -This @value{SECTION} introduces the @dfn{operators} which make use +This @value{SECTION} introduces the @dfn{operators} that make use of the values provided by constants and variables. @menu @@ -9870,7 +10700,7 @@ Division; because all numbers in @command{awk} are floating-point numbers, the result is @emph{not} rounded to an integer---@samp{3 / 4} has the value 0.75. (It is a common mistake, especially for C programmers, -to forget that @emph{all} numbers in @command{awk} are floating-point, +to forget that @emph{all} numbers in @command{awk} are floating point, and that division of integer-looking constants produces a real number, not an integer.) @@ -9902,7 +10732,7 @@ @end example One possibly undesirable effect of this definition of remainder is that -@code{@var{x} % @var{y}} is negative if @var{x} is negative. Thus: +@samp{@var{x} % @var{y}} is negative if @var{x} is negative. Thus: @example -17 % 8 = -1 @@ -9910,7 +10740,7 @@ In other @command{awk} implementations, the signedness of the remainder may be machine-dependent. -@c !!! what does posix say? +@c FIXME !!! what does posix say? @cindex portability, @code{**} operator and @cindex @code{*} (asterisk), @code{**} operator @@ -9955,7 +10785,7 @@ @cindex troubleshooting, string concatenation Because string concatenation does not have an explicit operator, it is -often necessary to insure that it happens at the right time by using +often necessary to ensure that it happens at the right time by using parentheses to enclose the items to concatenate. For example, you might expect that the following code fragment concatenates @code{file} and @code{name}: @@ -9970,8 +10800,8 @@ @cindex @command{mawk} utility @noindent This produces a syntax error with some versions of Unix -@command{awk}.@footnote{It happens that Brian Kernighan's -@command{awk}, @command{gawk} and @command{mawk} all ``get it right,'' +@command{awk}.@footnote{It happens that BWK +@command{awk}, @command{gawk}, and @command{mawk} all ``get it right,'' but you should not rely on this.} It is necessary to use the following: @@ -9996,7 +10826,7 @@ @end example @noindent -It is not defined whether the assignment to @code{a} happens +It is not defined whether the second assignment to @code{a} happens before or after the value of @code{a} is retrieved for producing the concatenated value. The result could be either @samp{don't panic}, or @samp{panic panic}. @@ -10055,16 +10885,13 @@ @end display As mentioned earlier, -when doing concatenation, @emph{parenthesize}. Otherwise, +when mixing concatenation with other operators, @emph{parenthesize}. Otherwise, you're never quite sure what you'll get. @node Assignment Ops @subsection Assignment Expressions -@c STARTOFRANGE asop @cindex assignment operators -@c STARTOFRANGE opas @cindex operators, assignment -@c STARTOFRANGE exas @cindex expressions, assignment @cindex @code{=} (equals sign), @code{=} operator @cindex equals sign (@code{=}), @code{=} operator @@ -10118,8 +10945,8 @@ @cindex variables, types of It is important to note that variables do @emph{not} have permanent types. -A variable's type is simply the type of whatever value it happens -to hold at the moment. In the following program fragment, the variable +A variable's type is simply the type of whatever value was last assigned +to it. In the following program fragment, the variable @code{foo} has a numeric value at first, and a string value later on: @example @@ -10217,9 +11044,17 @@ @code{rand()} returns different values each time it is called. (Arrays and the @code{rand()} function haven't been covered yet. @xref{Arrays}, -and see @ref{Numeric Functions}, for more information). +and +@ifnotdocbook +@DBPXREF{Numeric Functions} +@end ifnotdocbook +@ifdocbook +@DBREF{Numeric Functions} +@end ifdocbook +for more information.) This example illustrates an important fact about assignment operators: the lefthand expression is only evaluated @emph{once}. + It is up to the implementation as to which expression is evaluated first, the lefthand or the righthand. Consider this example: @@ -10249,20 +11084,20 @@ @cindex @code{*} (asterisk), @code{**=} operator @cindex asterisk (@code{*}), @code{**=} operator @float Table,table-assign-ops -@caption{Arithmetic Assignment Operators} +@caption{Arithmetic assignment operators} @multitable @columnfractions .30 .70 @headitem Operator @tab Effect -@item @var{lvalue} @code{+=} @var{increment} @tab Adds @var{increment} to the value of @var{lvalue}. -@item @var{lvalue} @code{-=} @var{decrement} @tab Subtracts @var{decrement} from the value of @var{lvalue}. -@item @var{lvalue} @code{*=} @var{coefficient} @tab Multiplies the value of @var{lvalue} by @var{coefficient}. -@item @var{lvalue} @code{/=} @var{divisor} @tab Divides the value of @var{lvalue} by @var{divisor}. -@item @var{lvalue} @code{%=} @var{modulus} @tab Sets @var{lvalue} to its remainder by @var{modulus}. +@item @var{lvalue} @code{+=} @var{increment} @tab Add @var{increment} to the value of @var{lvalue}. +@item @var{lvalue} @code{-=} @var{decrement} @tab Subtract @var{decrement} from the value of @var{lvalue}. +@item @var{lvalue} @code{*=} @var{coefficient} @tab Multiply the value of @var{lvalue} by @var{coefficient}. +@item @var{lvalue} @code{/=} @var{divisor} @tab Divide the value of @var{lvalue} by @var{divisor}. +@item @var{lvalue} @code{%=} @var{modulus} @tab Set @var{lvalue} to its remainder by @var{modulus}. @cindex common extensions, @code{**=} operator @cindex extensions, common@comma{} @code{**=} operator @cindex @command{awk} language, POSIX version @cindex POSIX @command{awk} -@item @var{lvalue} @code{^=} @var{power} @tab -@item @var{lvalue} @code{**=} @var{power} @tab Raises @var{lvalue} to the power @var{power}. @value{COMMONEXT} +@item @var{lvalue} @code{^=} @var{power} @tab Raise @var{lvalue} to the power @var{power}. +@item @var{lvalue} @code{**=} @var{power} @tab Raise @var{lvalue} to the power @var{power}. @value{COMMONEXT} @end multitable @end float @@ -10293,7 +11128,7 @@ For example: @example -$ awk /==/ /dev/null +$ @kbd{awk /==/ /dev/null} @error{} awk: syntax error at source line 1 @error{} context is @error{} >>> /= <<< @@ -10307,21 +11142,14 @@ awk '/[=]=/' /dev/null @end example -@command{gawk} does not have this problem, -nor do the other -freely available versions described in -@ref{Other Versions}. +@command{gawk} does not have this problem; BWK @command{awk} +and @command{mawk} also do not. @end sidebar -@c ENDOFRANGE exas -@c ENDOFRANGE opas -@c ENDOFRANGE asop @node Increment Ops @subsection Increment and Decrement Operators -@c STARTOFRANGE inop @cindex increment operators -@c STARTOFRANGE opde @cindex operators, decrement/increment @dfn{Increment} and @dfn{decrement operators} increase or decrease the value of a variable by one. An assignment operator can do the same thing, so @@ -10334,11 +11162,10 @@ @cindex side effects, decrement/increment operators The operator used for adding one is written @samp{++}. It can be used to increment a variable either before or after taking its value. -To pre-increment a variable @code{v}, write @samp{++v}. This adds +To @dfn{pre-increment} a variable @code{v}, write @samp{++v}. This adds one to the value of @code{v}---that new value is also the value of the -expression. (The assignment expression @samp{v += 1} is completely -equivalent.) -Writing the @samp{++} after the variable specifies post-increment. This +expression. (The assignment expression @samp{v += 1} is completely equivalent.) +Writing the @samp{++} after the variable specifies @dfn{post-increment}. This increments the variable value just the same; the difference is that the value of the increment expression itself is the variable's @emph{old} value. Thus, if @code{foo} has the value four, then the expression @samp{foo++} @@ -10346,11 +11173,23 @@ In other words, the operator returns the old value of the variable, but with the side effect of incrementing it. +@c FIXME: Use @sup here for superscript The post-increment @samp{foo++} is nearly the same as writing @samp{(foo += 1) - 1}. It is not perfectly equivalent because all numbers in -@command{awk} are floating-point---in floating-point, @samp{foo + 1 - 1} does +@command{awk} are floating point---in floating point, @samp{foo + 1 - 1} does not necessarily equal @code{foo}. But the difference is minute as -long as you stick to numbers that are fairly small (less than 10e12). +long as you stick to numbers that are fairly small (less than +@iftex +@math{10^{12}}). +@end iftex +@ifnottex +@ifnotdocbook +10e12). +@end ifnotdocbook +@end ifnottex +@docbook +1012). @c +@end docbook @cindex @code{$} (dollar sign), incrementing fields and arrays @cindex dollar sign (@code{$}), incrementing fields and arrays @@ -10359,7 +11198,6 @@ and a variable increment at the same time. The parentheses are necessary because of the precedence of the field reference operator @samp{$}.) -@c STARTOFRANGE deop @cindex decrement operators The decrement operator @samp{--} works just like @samp{++}, except that it subtracts one instead of adding it. As with @samp{++}, it can be used before @@ -10399,8 +11237,8 @@ @cindex evaluation order @cindex Marx, Groucho @quotation -@i{Doctor, doctor! It hurts when I do this!@* -So don't do that!} +@i{Doctor, it hurts when I do this!@* +Then don't do that!} @author Groucho Marx @end quotation @@ -10424,7 +11262,7 @@ @cindex side effects In other words, when do the various side effects prescribed by the postfix operators (@samp{b++}) take effect? -When side effects happen is @dfn{implementation defined}. +When side effects happen is @dfn{implementation-defined}. In other words, it is up to the particular version of @command{awk}. The result for the first example may be 12 or 13, and for the second, it may be 22 or 23. @@ -10435,14 +11273,11 @@ @c You'll sleep better at night and be able to look at yourself @c in the mirror in the morning. @end sidebar -@c ENDOFRANGE inop -@c ENDOFRANGE opde -@c ENDOFRANGE deop @node Truth Values and Conditions @section Truth Values and Conditions -In certain contexts, expression values also serve as ``truth values;'' i.e., +In certain contexts, expression values also serve as ``truth values''; i.e., they determine what should happen next as the program runs. This @value{SECTION} describes how @command{awk} defines ``true'' and ``false'' and how values are compared. @@ -10499,22 +11334,21 @@ @subsection Variable Typing and Comparison Expressions @quotation @i{The Guide is definitive. Reality is frequently inaccurate.} -@author The Hitchhiker's Guide to the Galaxy +@author Douglas Adams, @cite{The Hitchhiker's Guide to the Galaxy} @end quotation +@c 2/2015: Antonio Colombo points out that this is really from +@c The Restaurant at the End of the Universe. But I'm going to +@c leave it alone. -@c STARTOFRANGE comex @cindex comparison expressions -@c STARTOFRANGE excom @cindex expressions, comparison @cindex expressions, matching, See comparison expressions @cindex matching, expressions, See comparison expressions @cindex relational operators, See comparison operators @cindex operators, relational, See operators@comma{} comparison -@c STARTOFRANGE varting @cindex variable typing -@c STARTOFRANGE vartypc @cindex variables, types of, comparison expressions and -Unlike other programming languages, @command{awk} variables do not have a +Unlike in other programming languages, in @command{awk} variables do not have a fixed type. Instead, they can be either a number or a string, depending upon the value that is assigned to them. We look now at how variables are typed, and how @command{awk} @@ -10527,40 +11361,36 @@ @end menu @node Variable Typing -@subsubsection String Type Versus Numeric Type +@subsubsection String Type versus Numeric Type @cindex numeric, strings @cindex strings, numeric @cindex POSIX @command{awk}, numeric strings and -The 1992 POSIX standard introduced +The POSIX standard introduced the concept of a @dfn{numeric string}, which is simply a string that looks like a number---for example, @code{@w{" +2"}}. This concept is used for determining the type of a variable. The type of the variable is important because the types of two variables determine how they are compared. -The various versions of the POSIX standard did not get the rules -quite right for several editions. Fortunately, as of at least the -2008 standard (and possibly earlier), the standard has been fixed, -and variable typing follows these rules:@footnote{@command{gawk} has -followed these rules for many years, -and it is gratifying that the POSIX standard is also now correct.} +Variable typing follows these rules: -@itemize @bullet + +@itemize @value{BULLET} @item -A numeric constant or the result of a numeric operation has the @var{numeric} +A numeric constant or the result of a numeric operation has the @dfn{numeric} attribute. @item -A string constant or the result of a string operation has the @var{string} +A string constant or the result of a string operation has the @dfn{string} attribute. @item Fields, @code{getline} input, @code{FILENAME}, @code{ARGV} elements, @code{ENVIRON} elements, and the elements of an array created by -@code{patsplit()}, @code{split()} and @code{match()} that are numeric -strings have the @var{strnum} attribute. Otherwise, they have -the @var{string} attribute. Uninitialized variables also have the -@var{strnum} attribute. +@code{match()}, @code{split()}, and @code{patsplit()} that are numeric +strings have the @dfn{strnum} attribute. Otherwise, they have +the @dfn{string} attribute. Uninitialized variables also have the +@dfn{strnum} attribute. @item Attributes propagate across assignments but are not changed by @@ -10631,6 +11461,7 @@ }}} @end tex @ifnottex +@ifnotdocbook @display +---------------------------------------------- | STRING NUMERIC STRNUM @@ -10643,7 +11474,51 @@ STRNUM | string numeric numeric --------+---------------------------------------------- @end display +@end ifnotdocbook @end ifnottex +@docbook + + + + + + + + + +STRING +NUMERIC +STRNUM + + + + + +STRING +string +string +string + + + +NUMERIC +string +numeric +numeric + + + +STRNUM +string +numeric +numeric + + + + + + +@end docbook The basic idea is that user input that looks numeric---and @emph{only} user input---should be treated as numeric, even though it is actually @@ -10651,7 +11526,7 @@ Thus, for example, the string constant @w{@code{" +3.14"}}, when it appears in program source code, is a string---even though it looks numeric---and -is @emph{never} treated as number for comparison +is @emph{never} treated as a number for comparison purposes. In short, when one operand is a ``pure'' string, such as a string @@ -10659,30 +11534,31 @@ numeric comparison is performed. This point bears additional emphasis: All user input is made of characters, -and so is first and foremost of @var{string} type; input strings -that look numeric are additionally given the @var{strnum} attribute. +and so is first and foremost of string type; input strings +that look numeric are additionally given the strnum attribute. Thus, the six-character input string @w{@samp{ +3.14}} receives the -@var{strnum} attribute. In contrast, the eight-character literal -@w{@code{" +3.14"}} appearing in program text is a string constant. +strnum attribute. In contrast, the eight characters +@w{@code{" +3.14"}} appearing in program text comprise a string constant. The following examples print @samp{1} when the comparison between -the two different constants is true, @samp{0} otherwise: +the two different constants is true, and @samp{0} otherwise: +@c 22.9.2014: Tested with mawk and BWK awk, got same results. @example -$ @kbd{echo ' +3.14' | gawk '@{ print $0 == " +3.14" @}'} @ii{True} +$ @kbd{echo ' +3.14' | awk '@{ print($0 == " +3.14") @}'} @ii{True} @print{} 1 -$ @kbd{echo ' +3.14' | gawk '@{ print $0 == "+3.14" @}'} @ii{False} +$ @kbd{echo ' +3.14' | awk '@{ print($0 == "+3.14") @}'} @ii{False} @print{} 0 -$ @kbd{echo ' +3.14' | gawk '@{ print $0 == "3.14" @}'} @ii{False} +$ @kbd{echo ' +3.14' | awk '@{ print($0 == "3.14") @}'} @ii{False} @print{} 0 -$ @kbd{echo ' +3.14' | gawk '@{ print $0 == 3.14 @}'} @ii{True} +$ @kbd{echo ' +3.14' | awk '@{ print($0 == 3.14) @}'} @ii{True} @print{} 1 -$ @kbd{echo ' +3.14' | gawk '@{ print $1 == " +3.14" @}'} @ii{False} +$ @kbd{echo ' +3.14' | awk '@{ print($1 == " +3.14") @}'} @ii{False} @print{} 0 -$ @kbd{echo ' +3.14' | gawk '@{ print $1 == "+3.14" @}'} @ii{True} +$ @kbd{echo ' +3.14' | awk '@{ print($1 == "+3.14") @}'} @ii{True} @print{} 1 -$ @kbd{echo ' +3.14' | gawk '@{ print $1 == "3.14" @}'} @ii{False} +$ @kbd{echo ' +3.14' | awk '@{ print($1 == "3.14") @}'} @ii{False} @print{} 0 -$ @kbd{echo ' +3.14' | gawk '@{ print $1 == 3.14 @}'} @ii{True} +$ @kbd{echo ' +3.14' | awk '@{ print($1 == 3.14) @}'} @ii{True} @print{} 1 @end example @@ -10712,18 +11588,18 @@ @cindex exclamation point (@code{!}), @code{!~} operator @cindex @code{in} operator @float Table,table-relational-ops -@caption{Relational Operators} +@caption{Relational operators} @multitable @columnfractions .25 .75 @headitem Expression @tab Result -@item @var{x} @code{<} @var{y} @tab True if @var{x} is less than @var{y}. -@item @var{x} @code{<=} @var{y} @tab True if @var{x} is less than or equal to @var{y}. -@item @var{x} @code{>} @var{y} @tab True if @var{x} is greater than @var{y}. -@item @var{x} @code{>=} @var{y} @tab True if @var{x} is greater than or equal to @var{y}. -@item @var{x} @code{==} @var{y} @tab True if @var{x} is equal to @var{y}. -@item @var{x} @code{!=} @var{y} @tab True if @var{x} is not equal to @var{y}. -@item @var{x} @code{~} @var{y} @tab True if the string @var{x} matches the regexp denoted by @var{y}. -@item @var{x} @code{!~} @var{y} @tab True if the string @var{x} does not match the regexp denoted by @var{y}. -@item @var{subscript} @code{in} @var{array} @tab True if the array @var{array} has an element with the subscript @var{subscript}. +@item @var{x} @code{<} @var{y} @tab True if @var{x} is less than @var{y} +@item @var{x} @code{<=} @var{y} @tab True if @var{x} is less than or equal to @var{y} +@item @var{x} @code{>} @var{y} @tab True if @var{x} is greater than @var{y} +@item @var{x} @code{>=} @var{y} @tab True if @var{x} is greater than or equal to @var{y} +@item @var{x} @code{==} @var{y} @tab True if @var{x} is equal to @var{y} +@item @var{x} @code{!=} @var{y} @tab True if @var{x} is not equal to @var{y} +@item @var{x} @code{~} @var{y} @tab True if the string @var{x} matches the regexp denoted by @var{y} +@item @var{x} @code{!~} @var{y} @tab True if the string @var{x} does not match the regexp denoted by @var{y} +@item @var{subscript} @code{in} @var{array} @tab True if the array @var{array} has an element with the subscript @var{subscript} @end multitable @end float @@ -10756,30 +11632,29 @@ so similar, this kind of error is very difficult to spot when scanning the source code. -@cindex @command{gawk}, comparison operators and -The following table of expressions illustrates the kind of comparison -@command{gawk} performs, as well as what the result of the comparison is: +The following list of expressions illustrates the kinds of comparisons +@command{awk} performs, as well as what the result of each comparison is: @table @code @item 1.5 <= 2.0 -numeric comparison (true) +Numeric comparison (true) @item "abc" >= "xyz" -string comparison (false) +String comparison (false) @item 1.5 != " +2" -string comparison (true) +String comparison (true) @item "1e2" < "3" -string comparison (true) +String comparison (true) @item a = 2; b = "2" @itemx a == b -string comparison (true) +String comparison (true) @item a = 2; b = " +2" @itemx a == b -string comparison (false) +String comparison (false) @end table In this example: @@ -10795,7 +11670,7 @@ @noindent the result is @samp{false} because both @code{$1} and @code{$2} are user input. They are numeric strings---therefore both have -the @var{strnum} attribute, dictating a numeric comparison. +the strnum attribute, dictating a numeric comparison. The purpose of the comparison rules and the use of numeric strings is to attempt to produce the behavior that is ``least surprising,'' while still ``doing the right thing.'' @@ -10824,15 +11699,15 @@ @cindex @code{!} (exclamation point), @code{!~} operator @cindex exclamation point (@code{!}), @code{!~} operator The righthand operand of the @samp{~} and @samp{!~} operators may be -either a regexp constant (@code{/@dots{}/}) or an ordinary +either a regexp constant (@code{/}@dots{}@code{/}) or an ordinary expression. In the latter case, the value of the expression as a string is used as a dynamic regexp (@pxref{Regexp Usage}; also @pxref{Computed Regexps}). @cindex @command{awk}, regexp constants and @cindex regexp constants -In modern implementations of @command{awk}, a constant regular -expression in slashes by itself is also an expression. The regexp +A constant regular +expression in slashes by itself is also an expression. @code{/@var{regexp}/} is an abbreviation for the following comparison expression: @example @@ -10846,18 +11721,20 @@ where this is discussed in more detail. @node POSIX String Comparison -@subsubsection String Comparison With POSIX Rules +@subsubsection String Comparison with POSIX Rules The POSIX standard says that string comparison is performed based -on the locale's collating order. This is usually very different +on the locale's @dfn{collating order}. This is the order in which +characters sort, as defined by the locale (for more discussion, +@pxref{Locales}). This order is usually very different from the results obtained when doing straight character-by-character comparison.@footnote{Technically, string comparison is supposed -to behave the same way as if the strings are compared with the C +to behave the same way as if the strings were compared with the C @code{strcoll()} function.} Because this behavior differs considerably from existing practice, @command{gawk} only implements it when in POSIX mode (@pxref{Options}). -Here is an example to illustrate the difference, in an @samp{en_US.UTF-8} +Here is an example to illustrate the difference, in an @code{en_US.UTF-8} locale: @example @@ -10869,19 +11746,13 @@ @print{} ABC < abc = FALSE @end example -@c ENDOFRANGE comex -@c ENDOFRANGE excom -@c ENDOFRANGE vartypc -@c ENDOFRANGE varting @node Boolean Ops @subsection Boolean Expressions @cindex and Boolean-logic operator @cindex or Boolean-logic operator @cindex not Boolean-logic operator -@c STARTOFRANGE exbo @cindex expressions, Boolean -@c STARTOFRANGE boex @cindex Boolean expressions @cindex operators, Boolean, See Boolean expressions @cindex Boolean operators, See Boolean expressions @@ -10929,7 +11800,7 @@ True if at least one of @var{boolean1} or @var{boolean2} is true. For example, the following statement prints all records in the input that contain @emph{either} @samp{edu} or -@samp{li} or both: +@samp{li}: @example if ($0 ~ /edu/ || $0 ~ /li/) print @@ -10938,6 +11809,9 @@ The subexpression @var{boolean2} is evaluated only if @var{boolean1} is false. This can make a difference when @var{boolean2} contains expressions that have side effects. +(Thus, this test never really distinguishes records that contain both +@samp{edu} and @samp{li}---as soon as @samp{edu} is matched, +the full test succeeds.) @item ! @var{boolean} True if @var{boolean} is false. For example, @@ -10947,7 +11821,7 @@ @example BEGIN @{ if (! ("HOME" in ENVIRON)) - print "no home!" @} + print "no home!" @} @end example (The @code{in} operator is described in @@ -10962,11 +11836,11 @@ @cindex vertical bar (@code{|}), @code{||} operator The @samp{&&} and @samp{||} operators are called @dfn{short-circuit} operators because of the way they work. Evaluation of the full expression -is ``short-circuited'' if the result can be determined part way through +is ``short-circuited'' if the result can be determined partway through its evaluation. @cindex line continuations -Statements that use @samp{&&} or @samp{||} can be continued simply +Statements that end with @samp{&&} or @samp{||} can be continued simply by putting a newline after them. But you cannot put a newline in front of either of these operators without using backslash continuation (@pxref{Statements/Lines}). @@ -10985,7 +11859,7 @@ @example $1 == "START" @{ interested = ! interested; next @} -interested == 1 @{ print @} +interested @{ print @} $1 == "END" @{ interested = ! interested; next @} @end example @@ -11005,6 +11879,16 @@ so we'll leave well enough alone. @end ignore +Most commonly, the @samp{!} operator is used in the conditions of +@code{if} and @code{while} statements, where it often makes more +sense to phrase the logic in the negative: + +@example +if (! @var{some condition} || @var{some other condition}) @{ + @var{@dots{} do whatever processing @dots{}} +@} +@end example + @cindex @code{next} statement @quotation NOTE The @code{next} statement is discussed in @@ -11014,8 +11898,6 @@ The reason it's there is to avoid printing the bracketing @samp{START} and @samp{END} lines. @end quotation -@c ENDOFRANGE exbo -@c ENDOFRANGE boex @node Conditional Exp @subsection Conditional Expressions @@ -11026,8 +11908,8 @@ A @dfn{conditional expression} is a special kind of expression that has three operands. It allows you to use one expression's value to select one of two other expressions. -The conditional expression is the same as in the C language, -as shown here: +The conditional expression in @command{awk} is the same as in the C +language, as shown here: @example @var{selector} ? @var{if-true-exp} : @var{if-false-exp} @@ -11036,8 +11918,8 @@ @noindent There are three subexpressions. The first, @var{selector}, is always computed first. If it is ``true'' (not zero or not null), then -@var{if-true-exp} is computed next and its value becomes the value of -the whole expression. Otherwise, @var{if-false-exp} is computed next +@var{if-true-exp} is computed next, and its value becomes the value of +the whole expression. Otherwise, @var{if-false-exp} is computed next, and its value becomes the value of the whole expression. For example, the following expression produces the absolute value of @code{x}: @@ -11073,7 +11955,7 @@ of either character does not work without using backslash continuation (@pxref{Statements/Lines}). If @option{--posix} is specified -(@pxref{Options}), then this extension is disabled. +(@pxref{Options}), this extension is disabled. @node Function Calls @section Function Calls @@ -11085,13 +11967,15 @@ example, the function @code{sqrt()} computes the square root of a number. @cindex functions, built-in -A fixed set of functions are @dfn{built-in}, which means they are +A fixed set of functions are @dfn{built in}, which means they are available in every @command{awk} program. The @code{sqrt()} function is one -of these. @xref{Built-in}, for a list of built-in +of these. @DBXREF{Built-in} for a list of built-in functions and their descriptions. In addition, you can define functions for use in your program. -@xref{User-defined}, +@DBXREF{User-defined} for instructions on how to do this. +Finally, @command{gawk} lets you write functions in C or C++ +that may be called from your program (@pxref{Dynamic Extensions}). @cindex arguments, in function calls The way to use a function is with a @dfn{function call} expression, @@ -11110,7 +11994,7 @@ @cindex troubleshooting, function call syntax @quotation CAUTION -Do not put any space between the function name and the open-parenthesis! +Do not put any space between the function name and the opening parenthesis! A user-defined function name looks just like the name of a variable---a space would make the expression look like concatenation of a variable with an expression inside parentheses. @@ -11131,9 +12015,11 @@ more optional arguments. If those arguments are not supplied, the functions use a reasonable default value. -@xref{Built-in}, for full details. If arguments +@DBXREF{Built-in} for full details. If arguments are omitted in calls to user-defined functions, then those arguments are -treated as local variables and initialized to the empty string +treated as local variables. Such local variables act like the +empty string if referenced where a string value is required, +and like zero if referenced where a numeric value is required (@pxref{User-defined}). As an advanced feature, @command{gawk} provides indirect function calls, @@ -11142,12 +12028,12 @@ this feature until later; see @ref{Indirect Calls}. @cindex side effects, function calls -Like every other expression, the function call has a value, which is -computed by the function based on the arguments you give it. In this -example, the value of @samp{sqrt(@var{argument})} is the square root of -@var{argument}. -The following program reads numbers, one number per line, and prints the -square root of each one: +Like every other expression, the function call has a value, often +called the @dfn{return value}, which is computed by the function +based on the arguments you give it. In this example, the return value +of @samp{sqrt(@var{argument})} is the square root of @var{argument}. +The following program reads numbers, one number per line, and prints +the square root of each one: @example $ @kbd{awk '@{ print "The square root of", $1, "is", sqrt($1) @}'} @@ -11190,9 +12076,7 @@ @node Precedence @section Operator Precedence (How Operators Nest) -@c STARTOFRANGE prec @cindex precedence -@c STARTOFRANGE oppr @cindex operators, precedence @dfn{Operator precedence} determines how operators are grouped when @@ -11232,32 +12116,32 @@ @samp{++}; to avoid the problem the expression can be rewritten as @samp{$($0++)--}. -This table presents @command{awk}'s operators, in order of highest +This list presents @command{awk}'s operators, in order of highest to lowest precedence: -@c use @code in the items, looks better in TeX w/o all the quotes -@table @code -@item (@dots{}) +@c @asis for docbook to come out right +@table @asis +@item @code{(}@dots{}@code{)} Grouping. @cindex @code{$} (dollar sign), @code{$} field operator @cindex dollar sign (@code{$}), @code{$} field operator -@item $ +@item @code{$} Field reference. @cindex @code{+} (plus sign), @code{++} operator @cindex plus sign (@code{+}), @code{++} operator @cindex @code{-} (hyphen), @code{--} operator @cindex hyphen (@code{-}), @code{--} operator -@item ++ -- +@item @code{++ --} Increment, decrement. @cindex @code{^} (caret), @code{^} operator @cindex caret (@code{^}), @code{^} operator @cindex @code{*} (asterisk), @code{**} operator @cindex asterisk (@code{*}), @code{**} operator -@item ^ ** -Exponentiation. These operators group right-to-left. +@item @code{^ **} +Exponentiation. These operators group right to left. @cindex @code{+} (plus sign), @code{+} operator @cindex plus sign (@code{+}), @code{+} operator @@ -11265,7 +12149,7 @@ @cindex hyphen (@code{-}), @code{-} operator @cindex @code{!} (exclamation point), @code{!} operator @cindex exclamation point (@code{!}), @code{!} operator -@item + - ! +@item @code{+ - !} Unary plus, minus, logical ``not.'' @cindex @code{*} (asterisk), @code{*} operator, as multiplication operator @@ -11274,17 +12158,17 @@ @cindex forward slash (@code{/}), @code{/} operator @cindex @code{%} (percent sign), @code{%} operator @cindex percent sign (@code{%}), @code{%} operator -@item * / % +@item @code{* / %} Multiplication, division, remainder. @cindex @code{+} (plus sign), @code{+} operator @cindex plus sign (@code{+}), @code{+} operator @cindex @code{-} (hyphen), @code{-} operator @cindex hyphen (@code{-}), @code{-} operator -@item + - +@item @code{+ -} Addition, subtraction. -@item @r{String Concatenation} +@item String concatenation There is no special symbol for concatenation. The operands are simply written side by side (@pxref{Concatenation}). @@ -11310,7 +12194,7 @@ @cindex @code{|} (vertical bar), @code{|&} operator (I/O) @cindex vertical bar (@code{|}), @code{|&} operator (I/O) @cindex operators, input/output -@item < <= == != > >= >> | |& +@item @code{< <= == != > >= >> | |&} Relational and redirection. The relational operators and the redirections have the same precedence level. Characters such as @samp{>} serve both as relationals and as @@ -11323,7 +12207,7 @@ redirection does not produce an expression that could be the operand of another operator. As a result, it does not make sense to use a redirection operator near another operator of lower precedence without -parentheses. Such combinations (for example, @samp{print foo > a ? b : c}), +parentheses. Such combinations (e.g., @samp{print foo > a ? b : c}) result in syntax errors. The correct way to write this statement is @samp{print foo > (a ? b : c)}. @@ -11331,27 +12215,27 @@ @cindex tilde (@code{~}), @code{~} operator @cindex @code{!} (exclamation point), @code{!~} operator @cindex exclamation point (@code{!}), @code{!~} operator -@item ~ !~ +@item @code{~ !~} Matching, nonmatching. @cindex @code{in} operator -@item in +@item @code{in} Array membership. @cindex @code{&} (ampersand), @code{&&} operator @cindex ampersand (@code{&}), @code{&&} operator -@item && -Logical ``and''. +@item @code{&&} +Logical ``and.'' @cindex @code{|} (vertical bar), @code{||} operator @cindex vertical bar (@code{|}), @code{||} operator -@item || -Logical ``or''. +@item @code{||} +Logical ``or.'' @cindex @code{?} (question mark), @code{?:} operator @cindex question mark (@code{?}), @code{?:} operator -@item ?: -Conditional. This operator groups right-to-left. +@item @code{?:} +Conditional. This operator groups right to left. @cindex @code{+} (plus sign), @code{+=} operator @cindex plus sign (@code{+}), @code{+=} operator @@ -11367,8 +12251,8 @@ @cindex percent sign (@code{%}), @code{%=} operator @cindex @code{^} (caret), @code{^=} operator @cindex caret (@code{^}), @code{^=} operator -@item = += -= *= /= %= ^= **= -Assignment. These operators group right-to-left. +@item @code{= += -= *= /= %= ^= **=} +Assignment. These operators group right to left. @end table @cindex POSIX @command{awk}, @code{**} operator and @@ -11377,48 +12261,120 @@ The @samp{|&}, @samp{**}, and @samp{**=} operators are not specified by POSIX. For maximum portability, do not use them. @end quotation -@c ENDOFRANGE prec -@c ENDOFRANGE oppr @node Locales -@section Where You Are Makes A Difference +@section Where You Are Makes a Difference @cindex locale, definition of -Modern systems support the notion of @dfn{locales}: a way to tell -the system about the local character set and language. - -Once upon a time, the locale setting used to affect regexp matching -(@pxref{Ranges and Locales}), but this is no longer true. - -Locales can affect record splitting. -For the normal case of @samp{RS = "\n"}, the locale is largely irrelevant. -For other single-character record separators, setting @samp{LC_ALL=C} -in the environment -will give you much better performance when reading records. Otherwise, +Modern systems support the notion of @dfn{locales}: a way to tell the +system about the local character set and language. The ISO C standard +defines a default @code{"C"} locale, which is an environment that is +typical of what many C programmers are used to. + +Once upon a time, the locale setting used to affect regexp matching, +but this is no longer true (@pxref{Ranges and Locales}). + +Locales can affect record splitting. For the normal case of @samp{RS = +"\n"}, the locale is largely irrelevant. For other single-character +record separators, setting @samp{LC_ALL=C} in the environment will +give you much better performance when reading records. Otherwise, @command{gawk} has to make several function calls, @emph{per input character}, to find the record terminator. -According to POSIX, string comparison is also affected by locales -(similar to regular expressions). The details are presented in -@ref{POSIX String Comparison}. +Locales can affect how dates and times are formatted (@pxref{Time +Functions}). For example, a common way to abbreviate the date September +4, 2015, in the United States is ``9/4/15.'' In many countries in +Europe, however, it is abbreviated ``4.9.15.'' Thus, the @samp{%x} +specification in a @code{"US"} locale might produce @samp{9/4/15}, +while in a @code{"EUROPE"} locale, it might produce @samp{4.9.15}. + +According to POSIX, string comparison is also affected by locales (similar +to regular expressions). The details are presented in @ref{POSIX String +Comparison}. Finally, the locale affects the value of the decimal point character -used when @command{gawk} parses input data. This is discussed in -detail in @ref{Conversion}. +used when @command{gawk} parses input data. This is discussed in detail +in @ref{Conversion}. + +@node Expressions Summary +@section Summary + +@itemize @value{BULLET} +@item +Expressions are the basic elements of computation in programs. They are +built from constants, variables, function calls, and combinations of the +various kinds of values with operators. + +@item +@command{awk} supplies three kinds of constants: numeric, string, and +regexp. @command{gawk} lets you specify numeric constants in octal +and hexadecimal (bases 8 and 16) as well as decimal (base 10). +In certain contexts, a standalone regexp constant such as @code{/foo/} +has the same meaning as @samp{$0 ~ /foo/}. + +@item +Variables hold values between uses in computations. A number of built-in +variables provide information to your @command{awk} program, and a number +of others let you control how @command{awk} behaves. + +@item +Numbers are automatically converted to strings, and strings to numbers, +as needed by @command{awk}. Numeric values are converted as if they were +formatted with @code{sprintf()} using the format in @code{CONVFMT}. +Locales can influence the conversions. + +@item +@command{awk} provides the usual arithmetic operators (addition, +subtraction, multiplication, division, modulus), and unary plus and minus. +It also provides comparison operators, Boolean operators, an array membership +testing operator, and regexp +matching operators. String concatenation is accomplished by placing +two expressions next to each other; there is no explicit operator. +The three-operand @samp{?:} operator provides an ``if-else'' test within +expressions. + +@item +Assignment operators provide convenient shorthands for common arithmetic +operations. + +@item +In @command{awk}, a value is considered to be true if it is nonzero +@emph{or} non-null. Otherwise, the value is false. + +@item +A variable's type is set upon each assignment and may change over its +lifetime. The type determines how it behaves in comparisons (string +or numeric). + +@item +Function calls return a value that may be used as part of a larger +expression. Expressions used to pass parameter values are fully +evaluated before the function is called. @command{awk} provides +built-in and user-defined functions; this is described in +@ref{Functions}. + +@item +Operator precedence specifies the order in which operations are performed, +unless explicitly overridden by parentheses. @command{awk}'s operator +precedence is compatible with that of C. + +@item +Locales can affect the format of data as output by an @command{awk} +program, and occasionally the format for data read as input. + +@end itemize -@c ENDOFRANGE exps @node Patterns and Actions @chapter Patterns, Actions, and Variables -@c STARTOFRANGE pat @cindex patterns As you have already seen, each @command{awk} statement consists of a pattern with an associated action. This @value{CHAPTER} describes how you build patterns and actions, what kinds of things you can do within -actions, and @command{awk}'s built-in variables. +actions, and @command{awk}'s predefined variables. -The pattern-action rules and the statements available for use +The pattern--action rules and the statements available for use within actions form the core of @command{awk} programming. In a sense, everything covered up to here has been the foundation @@ -11431,7 +12387,8 @@ * Action Overview:: What goes into an action. * Statements:: Describes the various control statements in detail. -* Built-in Variables:: Summarizes the built-in variables. +* Built-in Variables:: Summarizes the predefined variables. +* Pattern Action Summary:: Patterns and Actions summary. @end menu @node Pattern Overview @@ -11462,10 +12419,10 @@ is nonzero (if a number) or non-null (if a string). (@xref{Expression Patterns}.) -@item @var{pat1}, @var{pat2} -A pair of patterns separated by a comma, specifying a range of records. -The range includes both the initial record that matches @var{pat1} and -the final record that matches @var{pat2}. +@item @var{begpat}, @var{endpat} +A pair of patterns separated by a comma, specifying a @dfn{range} of records. +The range includes both the initial record that matches @var{begpat} and +the final record that matches @var{endpat}. (@xref{Ranges}.) @item BEGIN @@ -11477,7 +12434,7 @@ @item BEGINFILE @itemx ENDFILE Special patterns for you to supply startup or cleanup actions to be -done on a per file basis. +done on a per-file basis. (@xref{BEGINFILE/ENDFILE}.) @item @var{empty} @@ -11545,7 +12502,7 @@ accepts any record with a first field that contains @samp{li}: @example -$ @kbd{awk '$1 ~ /foo/ @{ print $2 @}' mail-list} +$ @kbd{awk '$1 ~ /li/ @{ print $2 @}' mail-list} @print{} 555-5553 @print{} 555-6699 @end example @@ -11605,11 +12562,11 @@ expressions, comparisons, or any other @command{awk} expressions. Range patterns are not expressions, so they cannot appear inside Boolean patterns. Likewise, the special patterns @code{BEGIN}, @code{END}, -@code{BEGINFILE} and @code{ENDFILE}, +@code{BEGINFILE}, and @code{ENDFILE}, which never match any input record, are not expressions and cannot appear inside Boolean patterns. -The precedence of the different operators which can appear in +The precedence of the different operators that can appear in patterns is described in @ref{Precedence}. @node Ranges @@ -11635,10 +12592,10 @@ A range pattern starts out by matching @var{begpat} against every input record. When a record matches @var{begpat}, the range pattern is -@dfn{turned on} and the range pattern matches this record as well. As long as +@dfn{turned on}, and the range pattern matches this record as well. As long as the range pattern stays turned on, it automatically matches every input record read. The range pattern also matches @var{endpat} against every -input record; when this succeeds, the range pattern is turned off again +input record; when this succeeds, the range pattern is @dfn{turned off} again for the following record. Then the range pattern goes back to checking @var{begpat} against each record. @@ -11706,9 +12663,7 @@ @node BEGIN/END @subsection The @code{BEGIN} and @code{END} Special Patterns -@c STARTOFRANGE beg @cindex @code{BEGIN} pattern -@c STARTOFRANGE end @cindex @code{END} pattern All the patterns described so far are for matching input records. The @code{BEGIN} and @code{END} special patterns are different. @@ -11716,7 +12671,7 @@ @code{BEGIN} and @code{END} rules must have actions; there is no default action for these rules because there is no current record when they run. @code{BEGIN} and @code{END} rules are often referred to as -``@code{BEGIN} and @code{END} blocks'' by long-time @command{awk} +``@code{BEGIN} and @code{END} blocks'' by longtime @command{awk} programmers. @menu @@ -11736,7 +12691,7 @@ @example $ @kbd{awk '} > @kbd{BEGIN @{ print "Analysis of \"li\"" @}} -> @kbd{/li/ @{ ++n @}} +> @kbd{/li/ @{ ++n @}} > @kbd{END @{ print "\"li\" appears in", n, "records." @}' mail-list} @print{} Analysis of "li" @print{} "li" appears in 4 records. @@ -11747,7 +12702,7 @@ This program finds the number of records in the input file @file{mail-list} that contain the string @samp{li}. The @code{BEGIN} rule prints a title for the report. There is no need to use the @code{BEGIN} rule to -initialize the counter @code{n} to zero, since @command{awk} does this +initialize the counter @code{n} to zero, as @command{awk} does this automatically (@pxref{Variables}). The second rule increments the variable @code{n} every time a record containing the pattern @samp{li} is read. The @code{END} rule @@ -11775,13 +12730,13 @@ controls the order in which their @code{BEGIN} and @code{END} rules are executed. Therefore, you have to be careful when writing such rules in library files so that the order in which they are executed doesn't matter. -@xref{Options}, for more information on +@DBXREF{Options} for more information on using library functions. @xref{Library Functions}, for a number of useful library functions. If an @command{awk} program has only @code{BEGIN} rules and no -other rules, then the program exits after the @code{BEGIN} rule is +other rules, then the program exits after the @code{BEGIN} rules are run.@footnote{The original version of @command{awk} kept reading and ignoring input until the end of the file was seen.} However, if an @code{END} rule exists, then the input is read, even if there are @@ -11792,7 +12747,7 @@ @subsubsection Input/Output from @code{BEGIN} and @code{END} Rules @cindex input/output, from @code{BEGIN} and @code{END} -There are several (sometimes subtle) points to remember when doing I/O +There are several (sometimes subtle) points to be aware of when doing I/O from a @code{BEGIN} or @code{END} rule. The first has to do with the value of @code{$0} in a @code{BEGIN} rule. Because @code{BEGIN} rules are executed before any input is read, @@ -11809,25 +12764,26 @@ @cindex @code{print} statement, @code{BEGIN}/@code{END} patterns and @cindex @code{BEGIN} pattern, @code{print} statement and @cindex @code{END} pattern, @code{print} statement and -The second point is similar to the first but from the other direction. +The second point is similar to the first, but from the other direction. Traditionally, due largely to implementation issues, @code{$0} and @code{NF} were @emph{undefined} inside an @code{END} rule. The POSIX standard specifies that @code{NF} is available in an @code{END} rule. It contains the number of fields from the last input record. Most probably due to an oversight, the standard does not say that @code{$0} is also preserved, although logically one would think that it should be. -In fact, @command{gawk} does preserve the value of @code{$0} for use in -@code{END} rules. Be aware, however, that Brian Kernighan's @command{awk}, and possibly -other implementations, do not. +In fact, all of BWK @command{awk}, @command{mawk}, and @command{gawk} +preserve the value of @code{$0} for use in @code{END} rules. Be aware, +however, that some other implementations and many older versions +of Unix @command{awk} do not. The third point follows from the first two. The meaning of @samp{print} inside a @code{BEGIN} or @code{END} rule is the same as always: @samp{print $0}. If @code{$0} is the null string, then this prints an -empty record. Many long time @command{awk} programmers use an unadorned +empty record. Many longtime @command{awk} programmers use an unadorned @samp{print} in @code{BEGIN} and @code{END} rules, to mean @samp{@w{print ""}}, relying on @code{$0} being null. Although one might generally get away with this in @code{BEGIN} rules, it is a very bad idea in @code{END} rules, -at least in @command{gawk}. It is also poor style, since if an empty +at least in @command{gawk}. It is also poor style, because if an empty line is needed in the output, the program should print one explicitly. @cindex @code{next} statement, @code{BEGIN}/@code{END} patterns and @@ -11837,11 +12793,14 @@ Finally, the @code{next} and @code{nextfile} statements are not allowed in a @code{BEGIN} rule, because the implicit read-a-record-and-match-against-the-rules loop has not started yet. Similarly, those statements -are not valid in an @code{END} rule, since all the input has been read. -(@xref{Next Statement}, and see -@ref{Nextfile Statement}.) -@c ENDOFRANGE beg -@c ENDOFRANGE end +are not valid in an @code{END} rule, because all the input has been read. +(@DBXREF{Next Statement} and +@ifnotdocbook +@DBPXREF{Nextfile Statement}.) +@end ifnotdocbook +@ifdocbook +@DBREF{Nextfile Statement}.) +@end ifdocbook @node BEGINFILE/ENDFILE @subsection The @code{BEGINFILE} and @code{ENDFILE} Special Patterns @@ -11853,8 +12812,19 @@ Two special kinds of rule, @code{BEGINFILE} and @code{ENDFILE}, give you ``hooks'' into @command{gawk}'s command-line file processing loop. -As with the @code{BEGIN} and @code{END} rules (@pxref{BEGIN/END}), all -@code{BEGINFILE} rules in a program are merged, in the order they are +As with the @code{BEGIN} and @code{END} rules +@ifnottex +@ifnotdocbook +(@pxref{BEGIN/END}), +@end ifnotdocbook +@end ifnottex +@iftex +(see the previous section), +@end iftex +@ifdocbook +(see the previous section), +@end ifdocbook +all @code{BEGINFILE} rules in a program are merged, in the order they are read by @command{gawk}, and all @code{ENDFILE} rules are merged as well. The body of the @code{BEGINFILE} rules is executed just before @@ -11864,7 +12834,7 @@ The @code{BEGINFILE} rule provides you the opportunity to accomplish two tasks that would otherwise be difficult or impossible to perform: -@itemize @bullet +@itemize @value{BULLET} @item You can test if the file is readable. Normally, it is a fatal error if a file named on the command line cannot be opened for reading. However, @@ -11882,10 +12852,11 @@ fatal error. @item -If you have written extensions that modify the record handling (by inserting -an ``input parser''), you can invoke them at this point, before @command{gawk} -has started processing the file. (This is a @emph{very} advanced feature, -currently used only by the @uref{http://gawkextlib.sourceforge.net, @code{gawkextlib} project}.) +If you have written extensions that modify the record handling (by +inserting an ``input parser''; @pxref{Input Parsers}), you can invoke +them at this point, before @command{gawk} has started processing the file. +(This is a @emph{very} advanced feature, currently used only by the +@uref{http://sourceforge.net/projects/gawkextlib, @code{gawkextlib} project}.) @end itemize The @code{ENDFILE} rule is called when @command{gawk} has finished processing @@ -11893,22 +12864,22 @@ it will be called before any @code{END} rules. The @code{ENDFILE} rule is executed even for empty input files. -Normally, when an error occurs when reading input in the normal input -processing loop, the error is fatal. However, if an @code{ENDFILE} +Normally, when an error occurs when reading input in the normal +input-processing loop, the error is fatal. However, if an @code{ENDFILE} rule is present, the error becomes non-fatal, and instead @code{ERRNO} is set. This makes it possible to catch and process I/O errors at the level of the @command{awk} program. @cindex @code{next} statement, @code{BEGINFILE}/@code{ENDFILE} patterns and The @code{next} statement (@pxref{Next Statement}) is not allowed inside -either a @code{BEGINFILE} or and @code{ENDFILE} rule. The @code{nextfile} -statement (@pxref{Nextfile Statement}) is allowed only inside a -@code{BEGINFILE} rule, but not inside an @code{ENDFILE} rule. +either a @code{BEGINFILE} or an @code{ENDFILE} rule. The @code{nextfile} +statement is allowed only inside a +@code{BEGINFILE} rule, not inside an @code{ENDFILE} rule. @cindex @code{getline} statement, @code{BEGINFILE}/@code{ENDFILE} patterns and The @code{getline} statement (@pxref{Getline}) is restricted inside -both @code{BEGINFILE} and @code{ENDFILE}. Only the @samp{getline -@var{variable} < @var{file}} form is allowed. +both @code{BEGINFILE} and @code{ENDFILE}: only redirected +forms of @code{getline} are allowed. @code{BEGINFILE} and @code{ENDFILE} are @command{gawk} extensions. In most other @command{awk} implementations, or if @command{gawk} is in @@ -11950,7 +12921,6 @@ @noindent prints the first field of every record. -@c ENDOFRANGE pat @node Using Shell Variables @section Using Shell Variables in Programs @@ -11966,9 +12936,9 @@ into the body of the @command{awk} program. @cindex shells, quoting -The most common method is to use shell quoting to substitute +A common method is to use shell quoting to substitute the variable's value into the program inside the script. -For example, in the following program: +For example, consider the following program: @example printf "Enter search pattern: " @@ -11978,13 +12948,13 @@ @end example @noindent -the @command{awk} program consists of two pieces of quoted text +The @command{awk} program consists of two pieces of quoted text that are concatenated together to form the program. The first part is double-quoted, which allows substitution of the @code{pattern} shell variable inside the quotes. The second part is single-quoted. -Variable substitution via quoting works, but can be potentially +Variable substitution via quoting works, but can potentially be messy. It requires a good understanding of the shell's quoting rules (@pxref{Quoting}), and it's often difficult to correctly @@ -11992,8 +12962,8 @@ A better method is to use @command{awk}'s variable assignment feature (@pxref{Assignment Options}) -to assign the shell variable's value to an @command{awk} variable's -value. Then use dynamic regexps to match the pattern +to assign the shell variable's value to an @command{awk} variable. +Then use dynamic regexps to match the pattern (@pxref{Computed Regexps}). The following shows how to redo the previous example using this technique: @@ -12011,7 +12981,7 @@ in case there is whitespace in the value of @code{$pattern}. The @command{awk} variable @code{pat} could be named @code{pattern} too, but that would be more confusing. Using a variable also -provides more flexibility, since the variable can be used anywhere inside +provides more flexibility, as the variable can be used anywhere inside the program---for printing, as an array subscript, or for any other use---without requiring the quoting tricks at every point in the program. @@ -12031,13 +13001,13 @@ @command{awk} what to do once a match for the pattern is found. Thus, in outline, an @command{awk} program generally looks like this: -@example -@r{[}@var{pattern}@r{]} @{ @var{action} @} - @var{pattern} @r{[}@{ @var{action} @}@r{]} +@display +[@var{pattern}] @code{@{ @var{action} @}} + @var{pattern} [@code{@{ @var{action} @}}] @dots{} -function @var{name}(@var{args}) @{ @dots{} @} +@code{function @var{name}(@var{args}) @{ @dots{} @}} @dots{} -@end example +@end display @cindex @code{@{@}} (braces), actions and @cindex braces (@code{@{@}}), actions and @@ -12046,11 +13016,11 @@ @cindex @code{;} (semicolon), separating statements in actions @cindex semicolon (@code{;}), separating statements in actions An action consists of one or more @command{awk} @dfn{statements}, enclosed -in curly braces (@samp{@{@dots{}@}}). Each statement specifies one +in braces (@samp{@{@r{@dots{}}@}}). Each statement specifies one thing to do. The statements are separated by newlines or semicolons. -The curly braces around an action must be used even if the action +The braces around an action must be used even if the action contains only one statement, or if it contains no statements at -all. However, if you omit the action entirely, omit the curly braces as +all. However, if you omit the action entirely, omit the braces as well. An omitted action is equivalent to @samp{@{ print $0 @}}: @example @@ -12076,16 +13046,15 @@ special ones (@pxref{Statements}). @item Compound statements -Consist of one or more statements enclosed in -curly braces. A compound statement is used in order to put several -statements together in the body of an @code{if}, @code{while}, @code{do}, -or @code{for} statement. +Enclose one or more statements in braces. A compound statement +is used in order to put several statements together in the body of an +@code{if}, @code{while}, @code{do}, or @code{for} statement. @item Input statements Use the @code{getline} command (@pxref{Getline}). Also supplied in @command{awk} are the @code{next} -statement (@pxref{Next Statement}), +statement (@pxref{Next Statement}) and the @code{nextfile} statement (@pxref{Nextfile Statement}). @@ -12100,11 +13069,8 @@ @node Statements @section Control Statements in Actions -@c STARTOFRANGE csta @cindex control statements -@c STARTOFRANGE acs @cindex statements, control, in actions -@c STARTOFRANGE accs @cindex actions, control statements in @dfn{Control statements}, such as @code{if}, @code{while}, and so on, @@ -12125,7 +13091,7 @@ @code{if} statement contains another statement that may or may not be executed. The contained statement is called the @dfn{body}. To include more than one statement in the body, group them into a -single @dfn{compound statement} with curly braces, separating them with +single @dfn{compound statement} with braces, separating them with newlines or semicolons. @menu @@ -12153,9 +13119,9 @@ The @code{if}-@code{else} statement is @command{awk}'s decision-making statement. It looks like this: -@example -if (@var{condition}) @var{then-body} @r{[}else @var{else-body}@r{]} -@end example +@display +@code{if (@var{condition}) @var{then-body}} [@code{else @var{else-body}}] +@end display @noindent The @var{condition} is an expression that controls what the rest of the @@ -12173,13 +13139,13 @@ print "x is odd" @end example -In this example, if the expression @samp{x % 2 == 0} is true (that is, +In this example, if the expression @samp{x % 2 == 0} is true (i.e., if the value of @code{x} is evenly divisible by two), then the first @code{print} statement is executed; otherwise, the second @code{print} statement is executed. If the @code{else} keyword appears on the same line as @var{then-body} and @var{then-body} is not a compound statement (i.e., not surrounded by -curly braces), then a semicolon must separate @var{then-body} from +braces), then a semicolon must separate @var{then-body} from the @code{else}. To illustrate this, the previous example can be rewritten as: @@ -12224,20 +13190,21 @@ is not zero and not a null string.) @end ifinfo After @var{body} has been executed, -@var{condition} is tested again, and if it is still true, @var{body} is -executed again. This process repeats until the @var{condition} is no longer -true. If the @var{condition} is initially false, the body of the loop is -never executed and @command{awk} continues with the statement following +@var{condition} is tested again, and if it is still true, @var{body} +executes again. This process repeats until the @var{condition} is no longer +true. If the @var{condition} is initially false, the body of the loop +never executes and @command{awk} continues with the statement following the loop. This example prints the first three fields of each record, one per line: @example -awk '@{ - i = 1 - while (i <= 3) @{ - print $i - i++ - @} +awk ' +@{ + i = 1 + while (i <= 3) @{ + print $i + i++ + @} @}' inventory-shipped @end example @@ -12246,13 +13213,13 @@ containing two statements. The loop works in the following manner: first, the value of @code{i} is set to one. Then, the @code{while} statement tests whether @code{i} is less than or equal to -three. This is true when @code{i} equals one, so the @code{i}-th +three. This is true when @code{i} equals one, so the @code{i}th field is printed. Then the @samp{i++} increments the value of @code{i} and the loop repeats. The loop terminates when @code{i} reaches four. A newline is not required between the condition and the -body; however using one makes the program clearer unless the body is a -compound statement or else is very simple. The newline after the open-brace +body; however, using one makes the program clearer unless the body is a +compound statement or else is very simple. The newline after the open brace that begins the compound statement is not required either, but the program is harder to read without it. @@ -12271,34 +13238,34 @@ while (@var{condition}) @end example -Even if the @var{condition} is false at the start, the @var{body} is -executed at least once (and only once, unless executing @var{body} +Even if the @var{condition} is false at the start, the @var{body} +executes at least once (and only once, unless executing @var{body} makes @var{condition} true). Contrast this with the corresponding @code{while} statement: @example while (@var{condition}) - @var{body} + @var{body} @end example @noindent -This statement does not execute @var{body} even once if the @var{condition} -is false to begin with. -The following is an example of a @code{do} statement: +This statement does not execute the @var{body} even once if the +@var{condition} is false to begin with. The following is an example of +a @code{do} statement: @example @{ - i = 1 - do @{ - print $0 - i++ - @} while (i <= 10) + i = 1 + do @{ + print $0 + i++ + @} while (i <= 10) @} @end example @noindent This program prints each input record 10 times. However, it isn't a very -realistic example, since in this case an ordinary @code{while} would do +realistic example, because in this case an ordinary @code{while} would do just as well. This situation reflects actual experience; only occasionally is there a real use for a @code{do} statement. @@ -12329,9 +13296,10 @@ For example: @example -awk '@{ - for (i = 1; i <= 3; i++) - print $i +awk ' +@{ + for (i = 1; i <= 3; i++) + print $i @}' inventory-shipped @end example @@ -12350,7 +13318,7 @@ The same is true of the @var{increment} part. Incrementing additional variables requires separate statements at the end of the loop. The C compound expression, using C's comma operator, is useful in -this context but it is not supported in @command{awk}. +this context, but it is not supported in @command{awk}. Most often, @var{increment} is an increment expression, as in the previous example. But this is not required; it can be any expression @@ -12359,7 +13327,7 @@ @example for (i = 1; i <= 100; i *= 2) - print i + print i @end example If there is nothing to be done, any of the three expressions in the @@ -12394,7 +13362,7 @@ of looping rather than as something to do inside the loop. @cindex @code{in} operator -There is an alternate version of the @code{for} loop, for iterating over +There is an alternative version of the @code{for} loop, for iterating over all the indices of an array: @example @@ -12403,7 +13371,7 @@ @end example @noindent -@xref{Scanning an Array}, +@DBXREF{Scanning an Array} for more information on this version of the @code{for} loop. @node Switch Statement @@ -12413,6 +13381,8 @@ @cindex @code{default} keyword This @value{SECTION} describes a @command{gawk}-specific feature. +If @command{gawk} is in compatibility mode (@pxref{Options}), +it is not available. The @code{switch} statement allows the evaluation of an expression and the execution of statements based on a @code{case} match. Case statements @@ -12421,7 +13391,7 @@ Each @code{case} contains a single constant, be it numeric, string, or regexp. The @code{switch} expression is evaluated, and then each -@code{case}'s constant is compared against the result in turn. The type of constant +@code{case}'s constant is compared against the result in turn. The type of constant determines the comparison: numeric or string do the usual comparisons. A regexp constant does a regular expression match against the string value of the original expression. The general form of the @code{switch} @@ -12439,40 +13409,42 @@ Control flow in the @code{switch} statement works as it does in C. Once a match to a given case is made, the case statement bodies execute until a @code{break}, -@code{continue}, @code{next}, @code{nextfile} or @code{exit} is encountered, +@code{continue}, @code{next}, @code{nextfile}, or @code{exit} is encountered, or the end of the @code{switch} statement itself. For example: @example -switch (NR * 2 + 1) @{ -case 3: -case "11": - print NR - 1 - break - -case /2[[:digit:]]+/: - print NR - -default: - print NR + 1 - -case -1: - print NR * -1 +while ((c = getopt(ARGC, ARGV, "aksx")) != -1) @{ + switch (c) @{ + case "a": + # report size of all files + all_files = TRUE; + break + case "k": + BLOCK_SIZE = 1024 # 1K block size + break + case "s": + # do sums only + sum_only = TRUE + break + case "x": + # don't cross filesystems + fts_flags = or(fts_flags, FTS_XDEV) + break + case "?": + default: + usage() + break + @} @} @end example -Note that if none of the statements specified above halt execution +Note that if none of the statements specified here halt execution of a matched @code{case} statement, execution falls through to the -next @code{case} until execution halts. In the above example, for -any case value starting with @samp{2} followed by one or more digits, -the @code{print} statement is executed and then falls through into the -@code{default} section, executing its @code{print} statement. In turn, -the @minus{}1 case will also be executed since the @code{default} does -not halt execution. - -This @code{switch} statement is a @command{gawk} extension. -If @command{gawk} is in compatibility mode -(@pxref{Options}), -it is not available. +next @code{case} until execution halts. In this example, the +@code{case} for @code{"?"} falls through to the @code{default} +case, which is to call a function named @code{usage()}. +(The @code{getopt()} function being called here is +described in @ref{Getopt Function}.) @node Break Statement @subsection The @code{break} Statement @@ -12488,15 +13460,15 @@ @example # find smallest divisor of num @{ - num = $1 - for (div = 2; div * div <= num; div++) @{ - if (num % div == 0) - break - @} - if (num % div == 0) - printf "Smallest divisor of %d is %d\n", num, div - else - printf "%d is prime\n", num + num = $1 + for (divisor = 2; divisor * divisor <= num; divisor++) @{ + if (num % divisor == 0) + break + @} + if (num % divisor == 0) + printf "Smallest divisor of %d is %d\n", num, divisor + else + printf "%d is prime\n", num @} @end example @@ -12514,17 +13486,17 @@ @example # find smallest divisor of num @{ - num = $1 - for (div = 2; ; div++) @{ - if (num % div == 0) @{ - printf "Smallest divisor of %d is %d\n", num, div - break - @} - if (div * div > num) @{ - printf "%d is prime\n", num - break + num = $1 + for (divisor = 2; ; divisor++) @{ + if (num % divisor == 0) @{ + printf "Smallest divisor of %d is %d\n", num, divisor + break + @} + if (divisor * divisor > num) @{ + printf "%d is prime\n", num + break + @} @} - @} @} @end example @@ -12546,7 +13518,7 @@ statement outside of a loop as if it were a @code{next} statement (@pxref{Next Statement}). @value{DARKCORNER} -Recent versions of Brian Kernighan's @command{awk} no longer allow this usage, +Recent versions of BWK @command{awk} no longer allow this usage, nor does @command{gawk}. @node Continue Statement @@ -12595,7 +13567,8 @@ @end example @noindent -This program loops forever once @code{x} reaches 5. +This program loops forever once @code{x} reaches 5, because +the increment (@samp{x++}) is never reached. @c @cindex @code{continue}, outside of loops @c @cindex historical features @@ -12610,9 +13583,14 @@ statement outside a loop the same way they treated a @code{break} statement outside a loop: as if it were a @code{next} statement +@ifset FOR_PRINT +(discussed in the following section). +@end ifset +@ifclear FOR_PRINT (@pxref{Next Statement}). +@end ifclear @value{DARKCORNER} -Recent versions of Brian Kernighan's @command{awk} no longer work this way, nor +Recent versions of BWK @command{awk} no longer work this way, nor does @command{gawk}. @node Next Statement @@ -12645,9 +13623,8 @@ @example NF != 4 @{ - err = sprintf("%s:%d: skipped: NF != 4\n", FILENAME, FNR) - print err > "/dev/stderr" - next + printf("%s:%d: skipped: NF != 4\n", FILENAME, FNR) > "/dev/stderr" + next @} @end example @@ -12656,7 +13633,7 @@ the program's subsequent rules won't see the bad record. The error message is redirected to the standard error output stream, as error messages should be. -For more detail see +For more detail, see @ref{Special Files}. If the @code{next} statement causes the end of the input to be reached, @@ -12673,16 +13650,14 @@ @cindex POSIX @command{awk}, @code{next}/@code{nextfile} statements and @cindex @code{next} statement, user-defined functions and @cindex functions, user-defined, @code{next}/@code{nextfile} statements and -According to the POSIX standard, the behavior is undefined if -the @code{next} statement is used in a @code{BEGIN} or @code{END} rule. -@command{gawk} treats it as a syntax error. -Although POSIX permits it, -some other @command{awk} implementations don't allow the @code{next} -statement inside function bodies -(@pxref{User-defined}). -Just as with any other @code{next} statement, a @code{next} statement inside a -function body reads the next record and starts processing it with the -first rule in the program. +According to the POSIX standard, the behavior is undefined if the +@code{next} statement is used in a @code{BEGIN} or @code{END} rule. +@command{gawk} treats it as a syntax error. Although POSIX does not disallow it, +most other @command{awk} implementations don't allow the @code{next} +statement inside function bodies (@pxref{User-defined}). Just as with any +other @code{next} statement, a @code{next} statement inside a function +body reads the next record and starts processing it with the first rule +in the program. @node Nextfile Statement @subsection The @code{nextfile} Statement @@ -12692,41 +13667,39 @@ is similar to the @code{next} statement. However, instead of abandoning processing of the current record, the @code{nextfile} statement instructs @command{awk} to stop processing the -current data file. +current @value{DF}. Upon execution of the @code{nextfile} statement, @code{FILENAME} is -updated to the name of the next data file listed on the command line, +updated to the name of the next @value{DF} listed on the command line, @code{FNR} is reset to one, and processing starts over with the first rule in the program. If the @code{nextfile} statement causes the end of the input to be reached, then the code in any @code{END} rules is executed. An exception to this is when @code{nextfile} is invoked during execution of any statement in an -@code{END} rule; In this case, it causes the program to stop immediately. @xref{BEGIN/END}. +@code{END} rule; in this case, it causes the program to stop immediately. +@xref{BEGIN/END}. -The @code{nextfile} statement is useful when there are many data files +The @code{nextfile} statement is useful when there are many @value{DF}s to process but it isn't necessary to process every record in every file. Without @code{nextfile}, -in order to move on to the next data file, a program +in order to move on to the next @value{DF}, a program would have to continue scanning the unwanted records. The @code{nextfile} statement accomplishes this much more efficiently. In @command{gawk}, execution of @code{nextfile} causes additional things -to happen: -any @code{ENDFILE} rules are executed except in the case as -mentioned below, -@code{ARGIND} is incremented, -and -any @code{BEGINFILE} rules are executed. -(@code{ARGIND} hasn't been introduced yet. @xref{Built-in Variables}.) +to happen: any @code{ENDFILE} rules are executed if @command{gawk} is +not currently in an @code{END} or @code{BEGINFILE} rule, @code{ARGIND} is +incremented, and any @code{BEGINFILE} rules are executed. (@code{ARGIND} +hasn't been introduced yet. @xref{Built-in Variables}.) With @command{gawk}, @code{nextfile} is useful inside a @code{BEGINFILE} rule to skip over a file that would otherwise cause @command{gawk} to exit with a fatal error. In this case, @code{ENDFILE} rules are not executed. @xref{BEGINFILE/ENDFILE}. -While one might think that @samp{close(FILENAME)} would accomplish +Although it might seem that @samp{close(FILENAME)} would accomplish the same as @code{nextfile}, this isn't true. @code{close()} is reserved for closing files, pipes, and coprocesses that are opened with redirections. It is not related to the main processing that @@ -12734,7 +13707,7 @@ @quotation NOTE For many years, @code{nextfile} was a -@command{gawk} extension. As of September, 2012, it was accepted for +common extension. In September 2012, it was accepted for inclusion into the POSIX standard. See @uref{http://austingroupbugs.net/view.php?id=607, the Austin Group website}. @end quotation @@ -12743,8 +13716,8 @@ @cindex @code{nextfile} statement, user-defined functions and @cindex Brian Kernighan's @command{awk} @cindex @command{mawk} utility -The current version of the Brian Kernighan's @command{awk}, and @command{mawk} (@pxref{Other -Versions}) also support @code{nextfile}. However, they don't allow the +The current version of BWK @command{awk} and @command{mawk} +also support @code{nextfile}. However, they don't allow the @code{nextfile} statement inside function bodies (@pxref{User-defined}). @command{gawk} does; a @code{nextfile} inside a function body reads the next record and starts processing it with the first rule in the program, @@ -12758,9 +13731,9 @@ executing the current rule and to stop processing input; any remaining input is ignored. The @code{exit} statement is written as follows: -@example -exit @r{[}@var{return code}@r{]} -@end example +@display +@code{exit} [@var{return code}] +@end display @cindex @code{BEGIN} pattern, @code{exit} statement and @cindex @code{END} pattern, @code{exit} statement and @@ -12776,14 +13749,14 @@ An @code{exit} statement that is not part of a @code{BEGIN} or @code{END} rule stops the execution of any further automatic rules for the current record, skips reading any remaining input records, and executes the -@code{END} rule if there is one. -Any @code{ENDFILE} rules are also skipped; they are not executed. +@code{END} rule if there is one. @command{gawk} also skips +any @code{ENDFILE} rules; they do not execute. In such a case, if you don't want the @code{END} rule to do its job, set a variable -to nonzero before the @code{exit} statement and check that variable in +to a nonzero value before the @code{exit} statement and check that variable in the @code{END} rule. -@xref{Assert Function}, +@DBXREF{Assert Function} for an example that does this. @cindex dark corner, @code{exit} statement @@ -12793,9 +13766,8 @@ In the case where an argument is supplied to a first @code{exit} statement, and then @code{exit} is called a second time from an @code{END} rule with no argument, -@command{awk} uses the previously supplied exit value. -@value{DARKCORNER} -@xref{Exit Status}, for more information. +@command{awk} uses the previously supplied exit value. @value{DARKCORNER} +@DBXREF{Exit Status} for more information. @cindex programming conventions, @code{exit} statement For example, suppose an error condition occurs that is difficult or @@ -12806,12 +13778,12 @@ @example BEGIN @{ - if (("date" | getline date_now) <= 0) @{ - print "Can't get system date" > "/dev/stderr" - exit 1 - @} - print "current date is", date_now - close("date") + if (("date" | getline date_now) <= 0) @{ + print "Can't get system date" > "/dev/stderr" + exit 1 + @} + print "current date is", date_now + close("date") @} @end example @@ -12821,16 +13793,11 @@ results across different operating systems. @end quotation -@c ENDOFRANGE csta -@c ENDOFRANGE acs -@c ENDOFRANGE accs @node Built-in Variables -@section Built-in Variables -@c STARTOFRANGE bvar -@cindex built-in variables -@c STARTOFRANGE varb -@cindex variables, built-in +@section Predefined Variables +@cindex predefined variables +@cindex variables, predefined Most @command{awk} variables are available to use for your own purposes; they never change unless your program assigns values to @@ -12841,10 +13808,10 @@ automatically by @command{awk}, so that they carry information from the internal workings of @command{awk} to your program. -@cindex @command{gawk}, built-in variables and -This @value{SECTION} documents all the built-in variables of -@command{gawk}, most of which are also documented in the chapters -describing their areas of activity. +@cindex @command{gawk}, predefined variables and +This @value{SECTION} documents all of @command{gawk}'s predefined variables, +most of which are also documented in the @value{CHAPTER}s describing +their areas of activity. @menu * User-modified:: Built-in variables that you change to control @@ -12856,51 +13823,43 @@ @node User-modified @subsection Built-in Variables That Control @command{awk} -@c STARTOFRANGE bvaru -@cindex built-in variables, user-modifiable -@c STARTOFRANGE nmbv +@cindex predefined variables, user-modifiable @cindex user-modifiable variables The following is an alphabetical list of variables that you can change to -control how @command{awk} does certain things. The variables that are -specific to @command{gawk} are marked with a pound sign@w{ (@samp{#}).} +control how @command{awk} does certain things. + +The variables that are specific to @command{gawk} are marked with a pound +sign (@samp{#}). These variables are @command{gawk} extensions. In other +@command{awk} implementations or if @command{gawk} is in compatibility +mode (@pxref{Options}), they are not special. (Any exceptions are noted +in the description of each variable.) @table @code @cindex @code{BINMODE} variable @cindex binary input/output @cindex input/output, binary -@item BINMODE # -On non-POSIX systems, this variable specifies use of binary mode for all I/O. -Numeric values of one, two, or three specify that input files, output files, or -all files, respectively, should use binary I/O. -A numeric value less than zero is treated as zero, and a numeric value greater than -three is treated as three. -Alternatively, -string values of @code{"r"} or @code{"w"} specify that input files and -output files, respectively, should use binary I/O. -A string value of @code{"rw"} or @code{"wr"} indicates that all -files should use binary I/O. -Any other string value is treated the same as @code{"rw"}, -but causes @command{gawk} -to generate a warning message. -@code{BINMODE} is described in more detail in -@ref{PC Using}. - @cindex differences in @command{awk} and @command{gawk}, @code{BINMODE} variable -This variable is a @command{gawk} extension. -In other @command{awk} implementations -(except @command{mawk}, -@pxref{Other Versions}), -or if @command{gawk} is in compatibility mode -(@pxref{Options}), -it is not special. +@item BINMODE # +On non-POSIX systems, this variable specifies use of binary mode +for all I/O. Numeric values of one, two, or three specify that input +files, output files, or all files, respectively, should use binary I/O. +A numeric value less than zero is treated as zero, and a numeric value +greater than three is treated as three. Alternatively, string values +of @code{"r"} or @code{"w"} specify that input files and output files, +respectively, should use binary I/O. A string value of @code{"rw"} or +@code{"wr"} indicates that all files should use binary I/O. Any other +string value is treated the same as @code{"rw"}, but causes @command{gawk} +to generate a warning message. @code{BINMODE} is described in more +detail in @ref{PC Using}. @command{mawk} (@pxref{Other Versions}) +also supports this variable, but only using numeric values. @cindex @code{CONVFMT} variable @cindex POSIX @command{awk}, @code{CONVFMT} variable and @cindex numbers, converting, to strings @cindex strings, converting, numbers to -@item CONVFMT -This string controls conversion of numbers to +@item @code{CONVFMT} +A string that controls the conversion of numbers to strings (@pxref{Conversion}). It works by being passed, in effect, as the first argument to the @code{sprintf()} function @@ -12914,16 +13873,11 @@ @cindex field separators, @code{FIELDWIDTHS} variable and @cindex separators, field, @code{FIELDWIDTHS} variable and @item FIELDWIDTHS # -This is a space-separated list of columns that tells @command{gawk} +A space-separated list of columns that tells @command{gawk} how to split input with fixed columnar boundaries. Assigning a value to @code{FIELDWIDTHS} overrides the use of @code{FS} and @code{FPAT} for field splitting. -@xref{Constant Size}, for more information. - -If @command{gawk} is in compatibility mode -(@pxref{Options}), then @code{FIELDWIDTHS} -has no special meaning, and field-splitting operations occur based -exclusively on the value of @code{FS}. +@DBXREF{Constant Size} for more information. @cindex @command{gawk}, @code{FPAT} variable in @cindex @code{FPAT} variable @@ -12931,23 +13885,17 @@ @cindex field separators, @code{FPAT} variable and @cindex separators, field, @code{FPAT} variable and @item FPAT # -This is a regular expression (as a string) that tells @command{gawk} +A regular expression (as a string) that tells @command{gawk} to create the fields based on text that matches the regular expression. Assigning a value to @code{FPAT} overrides the use of @code{FS} and @code{FIELDWIDTHS} for field splitting. -@xref{Splitting By Content}, for more information. - -If @command{gawk} is in compatibility mode -(@pxref{Options}), then @code{FPAT} -has no special meaning, and field-splitting operations occur based -exclusively on the value of @code{FS}. +@DBXREF{Splitting By Content} for more information. @cindex @code{FS} variable @cindex separators, field @cindex field separators @item FS -This is the input field separator -(@pxref{Field Separators}). +The input field separator (@pxref{Field Separators}). The value is a single-character string or a multicharacter regular expression that matches the separations between fields in an input record. If the value is the null string (@code{""}), then each @@ -12986,29 +13934,25 @@ @cindex regular expressions, case sensitivity @item IGNORECASE # If @code{IGNORECASE} is nonzero or non-null, then all string comparisons -and all regular expression matching are case independent. Thus, regexp -matching with @samp{~} and @samp{!~}, as well as the @code{gensub()}, -@code{gsub()}, @code{index()}, @code{match()}, @code{patsplit()}, -@code{split()}, and @code{sub()} -functions, record termination with @code{RS}, and field splitting with -@code{FS} and @code{FPAT}, all ignore case when doing their particular regexp operations. +and all regular expression matching are case-independent. +This applies to +regexp matching with @samp{~} and @samp{!~}, +the @code{gensub()}, @code{gsub()}, @code{index()}, @code{match()}, +@code{patsplit()}, @code{split()}, and @code{sub()} functions, +record termination with @code{RS}, and field splitting with +@code{FS} and @code{FPAT}. However, the value of @code{IGNORECASE} does @emph{not} affect array subscripting and it does not affect field splitting when using a single-character field separator. @xref{Case-sensitivity}. -If @command{gawk} is in compatibility mode -(@pxref{Options}), -then @code{IGNORECASE} has no special meaning. Thus, string -and regexp operations are always case-sensitive. - @cindex @command{gawk}, @code{LINT} variable in @cindex @code{LINT} variable @cindex differences in @command{awk} and @command{gawk}, @code{LINT} variable @cindex lint checking @item LINT # When this variable is true (nonzero or non-null), @command{gawk} -behaves as if the @option{--lint} command-line option is in effect. +behaves as if the @option{--lint} command-line option is in effect (@pxref{Options}). With a value of @code{"fatal"}, lint warnings become fatal errors. With a value of @code{"invalid"}, only warnings about things that are @@ -13017,7 +13961,7 @@ Assigning a false value to @code{LINT} turns off the lint warnings. This variable is a @command{gawk} extension. It is not special -in other @command{awk} implementations. Unlike the other special variables, +in other @command{awk} implementations. Unlike with the other special variables, changing @code{LINT} does affect the production of lint warnings, even if @command{gawk} is in compatibility mode. Much as the @option{--lint} and @option{--traditional} options independently @@ -13029,13 +13973,13 @@ @cindex numbers, converting, to strings @cindex strings, converting, numbers to @item OFMT -This string controls conversion of numbers to +A string that controls conversion of numbers to strings (@pxref{Conversion}) for printing with the @code{print} statement. It works by being passed as the first argument to the @code{sprintf()} function (@pxref{String Functions}). Its default value is @code{"%.6g"}. Earlier versions of @command{awk} -also used @code{OFMT} to specify the format for converting numbers to +used @code{OFMT} to specify the format for converting numbers to strings in general expressions; this is now done by @code{CONVFMT}. @cindex @code{sprintf()} function, @code{OFMT} variable and @@ -13044,33 +13988,32 @@ @cindex separators, field @cindex field separators @item OFS -This is the output field separator (@pxref{Output Separators}). It is +The output field separator (@pxref{Output Separators}). It is output between the fields printed by a @code{print} statement. Its default value is @w{@code{" "}}, a string consisting of a single space. @cindex @code{ORS} variable @item ORS -This is the output record separator. It is output at the end of every +The output record separator. It is output at the end of every @code{print} statement. Its default value is @code{"\n"}, the newline character. (@xref{Output Separators}.) @cindex @code{PREC} variable @item PREC # -The working precision of arbitrary precision floating-point numbers, -53 bits by default (@pxref{Setting Precision}). +The working precision of arbitrary-precision floating-point numbers, +53 bits by default (@pxref{Setting precision}). @cindex @code{ROUNDMODE} variable @item ROUNDMODE # -The rounding mode to use for arbitrary precision arithmetic on -numbers, by default @code{"N"} (@samp{roundTiesToEven} in -the IEEE-754 standard) -(@pxref{Setting Rounding Mode}). +The rounding mode to use for arbitrary-precision arithmetic on +numbers, by default @code{"N"} (@code{roundTiesToEven} in +the IEEE 754 standard; @pxref{Setting the rounding mode}). @cindex @code{RS} variable @cindex separators, for records @cindex record separators -@item RS -This is @command{awk}'s input record separator. Its default value is a string +@item @code{RS} +The input record separator. Its default value is a string containing a single newline character, which means that an input record consists of a single line of text. It can also be the null string, in which case records are separated by @@ -13089,10 +14032,10 @@ @cindex @code{SUBSEP} variable @cindex separators, subscript @cindex subscript separators -@item SUBSEP -This is the subscript separator. It has the default value of +@item @code{SUBSEP} +The subscript separator. It has the default value of @code{"\034"} and is used to separate the parts of the indices of a -multidimensional array. Thus, the expression @code{@w{foo["A", "B"]}} +multidimensional array. Thus, the expression @samp{@w{foo["A", "B"]}} really accesses @code{foo["A\034B"]} (@pxref{Multidimensional}). @@ -13101,41 +14044,34 @@ @cindex differences in @command{awk} and @command{gawk}, @code{TEXTDOMAIN} variable @cindex internationalization, localization @item TEXTDOMAIN # -This variable is used for internationalization of programs at the +Used for internationalization of programs at the @command{awk} level. It sets the default text domain for specially marked string constants in the source text, as well as for the -@code{dcgettext()}, @code{dcngettext()} and @code{bindtextdomain()} functions +@code{dcgettext()}, @code{dcngettext()}, and @code{bindtextdomain()} functions (@pxref{Internationalization}). The default value of @code{TEXTDOMAIN} is @code{"messages"}. - -This variable is a @command{gawk} extension. -In other @command{awk} implementations, -or if @command{gawk} is in compatibility mode -(@pxref{Options}), -it is not special. @end table -@c ENDOFRANGE bvar -@c ENDOFRANGE varb -@c ENDOFRANGE bvaru -@c ENDOFRANGE nmbv @node Auto-set @subsection Built-in Variables That Convey Information -@c STARTOFRANGE bvconi -@cindex built-in variables, conveying information -@c STARTOFRANGE vbconi -@cindex variables, built-in, conveying information +@cindex predefined variables, conveying information +@cindex variables, predefined conveying information The following is an alphabetical list of variables that @command{awk} sets automatically on certain occasions in order to provide -information to your program. The variables that are specific to -@command{gawk} are marked with a pound sign@w{ (@samp{#}).} +information to your program. -@table @code +The variables that are specific to @command{gawk} are marked with a pound +sign (@samp{#}). These variables are @command{gawk} extensions. In other +@command{awk} implementations or if @command{gawk} is in compatibility +mode (@pxref{Options}), they are not special: + +@c @asis for docbook +@table @asis @cindex @code{ARGC}/@code{ARGV} variables @cindex arguments, command-line @cindex command line, arguments -@item ARGC@r{,} ARGV +@item @code{ARGC}, @code{ARGV} The command-line arguments available to @command{awk} programs are stored in an array called @code{ARGV}. @code{ARGC} is the number of command-line arguments present. @xref{Other Arguments}. @@ -13169,145 +14105,130 @@ The value of @code{ARGV[0]} can vary from system to system. Also, you should note that the program text is @emph{not} included in @code{ARGV}, nor are any of @command{awk}'s command-line options. -@xref{ARGC and ARGV}, for information +@DBXREF{ARGC and ARGV} for information about how @command{awk} uses these variables. @value{DARKCORNER} @cindex @code{ARGIND} variable @cindex differences in @command{awk} and @command{gawk}, @code{ARGIND} variable -@item ARGIND # +@item @code{ARGIND #} The index in @code{ARGV} of the current file being processed. -Every time @command{gawk} opens a new data file for processing, it sets -@code{ARGIND} to the index in @code{ARGV} of the file name. +Every time @command{gawk} opens a new @value{DF} for processing, it sets +@code{ARGIND} to the index in @code{ARGV} of the @value{FN}. When @command{gawk} is processing the input files, @samp{FILENAME == ARGV[ARGIND]} is always true. @cindex files, processing@comma{} @code{ARGIND} variable and This variable is useful in file processing; it allows you to tell how far -along you are in the list of data files as well as to distinguish between -successive instances of the same file name on the command line. +along you are in the list of @value{DF}s as well as to distinguish between +successive instances of the same @value{FN} on the command line. @cindex file names, distinguishing While you can change the value of @code{ARGIND} within your @command{awk} -program, @command{gawk} automatically sets it to a new value when the -next file is opened. - -This variable is a @command{gawk} extension. -In other @command{awk} implementations, -or if @command{gawk} is in compatibility mode -(@pxref{Options}), -it is not special. +program, @command{gawk} automatically sets it to a new value when it +opens the next file. @cindex @code{ENVIRON} array @cindex environment variables, in @code{ENVIRON} array -@item ENVIRON +@item @code{ENVIRON} An associative array containing the values of the environment. The array indices are the environment variable names; the elements are the values of the particular environment variables. For example, -@code{ENVIRON["HOME"]} might be @file{/home/arnold}. Changing this array +@code{ENVIRON["HOME"]} might be @code{"/home/arnold"}. Changing this array does not affect the environment passed on to any programs that @command{awk} may spawn via redirection or the @code{system()} function. -@c (In a future version of @command{gawk}, it may do so.) +(In a future version of @command{gawk}, it may do so.) Some operating systems may not have environment variables. On such systems, the @code{ENVIRON} array is empty (except for -@w{@code{ENVIRON["AWKPATH"]}}, -@pxref{AWKPATH Variable} and -@w{@code{ENVIRON["AWKLIBPATH"]}}, +@w{@code{ENVIRON["AWKPATH"]}} and +@w{@code{ENVIRON["AWKLIBPATH"]}}; +@DBPXREF{AWKPATH Variable} and +@ifdocbook +@DBREF{AWKLIBPATH Variable}). +@end ifdocbook +@ifnotdocbook @pxref{AWKLIBPATH Variable}). +@end ifnotdocbook @cindex @command{gawk}, @code{ERRNO} variable in @cindex @code{ERRNO} variable @cindex differences in @command{awk} and @command{gawk}, @code{ERRNO} variable @cindex error handling, @code{ERRNO} variable and -@item ERRNO # -If a system error occurs during a redirection for @code{getline}, -during a read for @code{getline}, or during a @code{close()} operation, -then @code{ERRNO} contains a string describing the error. - -In addition, @command{gawk} clears @code{ERRNO} -before opening each command-line input file. This enables checking if -the file is readable inside a @code{BEGINFILE} pattern (@pxref{BEGINFILE/ENDFILE}). - -Otherwise, -@code{ERRNO} works similarly to the C variable @code{errno}. -Except for the case just mentioned, -@command{gawk} @emph{never} clears it (sets it -to zero or @code{""}). Thus, you should only expect its value -to be meaningful when an I/O operation returns a failure -value, such as @code{getline} returning @minus{}1. -You are, of course, free to clear it yourself before doing an -I/O operation. - -This variable is a @command{gawk} extension. -In other @command{awk} implementations, -or if @command{gawk} is in compatibility mode -(@pxref{Options}), -it is not special. +@item @code{ERRNO #} +If a system error occurs during a redirection for @code{getline}, during +a read for @code{getline}, or during a @code{close()} operation, then +@code{ERRNO} contains a string describing the error. + +In addition, @command{gawk} clears @code{ERRNO} before opening each +command-line input file. This enables checking if the file is readable +inside a @code{BEGINFILE} pattern (@pxref{BEGINFILE/ENDFILE}). + +Otherwise, @code{ERRNO} works similarly to the C variable @code{errno}. +Except for the case just mentioned, @command{gawk} @emph{never} clears +it (sets it to zero or @code{""}). Thus, you should only expect its +value to be meaningful when an I/O operation returns a failure value, +such as @code{getline} returning @minus{}1. You are, of course, free +to clear it yourself before doing an I/O operation. @cindex @code{FILENAME} variable @cindex dark corner, @code{FILENAME} variable -@item FILENAME -The name of the file that @command{awk} is currently reading. -When no data files are listed on the command line, @command{awk} reads -from the standard input and @code{FILENAME} is set to @code{"-"}. -@code{FILENAME} is changed each time a new file is read -(@pxref{Reading Files}). -Inside a @code{BEGIN} rule, the value of @code{FILENAME} is -@code{""}, since there are no input files being processed -yet.@footnote{Some early implementations of Unix @command{awk} initialized -@code{FILENAME} to @code{"-"}, even if there were data files to be -processed. This behavior was incorrect and should not be relied -upon in your programs.} -@value{DARKCORNER} -Note, though, that using @code{getline} -(@pxref{Getline}) -inside a @code{BEGIN} rule can give -@code{FILENAME} a value. +@item @code{FILENAME} +The name of the current input file. When no @value{DF}s are listed +on the command line, @command{awk} reads from the standard input and +@code{FILENAME} is set to @code{"-"}. @code{FILENAME} changes each +time a new file is read (@pxref{Reading Files}). Inside a @code{BEGIN} +rule, the value of @code{FILENAME} is @code{""}, because there are no input +files being processed yet.@footnote{Some early implementations of Unix +@command{awk} initialized @code{FILENAME} to @code{"-"}, even if there +were @value{DF}s to be processed. This behavior was incorrect and should +not be relied upon in your programs.} @value{DARKCORNER} Note, though, +that using @code{getline} (@pxref{Getline}) inside a @code{BEGIN} rule +can give @code{FILENAME} a value. @cindex @code{FNR} variable -@item FNR -The current record number in the current file. @code{FNR} is -incremented each time a new record is read -(@pxref{Records}). It is reinitialized -to zero each time a new input file is started. +@item @code{FNR} +The current record number in the current file. @command{awk} increments +@code{FNR} each time it reads a new record (@pxref{Records}). +@command{awk} resets @code{FNR} to zero each time it starts a new +input file. @cindex @code{NF} variable -@item NF +@item @code{NF} The number of fields in the current input record. @code{NF} is set each time a new record is read, when a new field is -created or when @code{$0} changes (@pxref{Fields}). +created, or when @code{$0} changes (@pxref{Fields}). Unlike most of the variables described in this @value{SUBSECTION}, assigning a value to @code{NF} has the potential to affect @command{awk}'s internal workings. In particular, assignments -to @code{NF} can be used to create or remove fields from the +to @code{NF} can be used to create fields in or remove fields from the current record. @xref{Changing Fields}. @cindex @code{FUNCTAB} array @cindex @command{gawk}, @code{FUNCTAB} array in @cindex differences in @command{awk} and @command{gawk}, @code{FUNCTAB} variable -@item FUNCTAB # +@item @code{FUNCTAB #} An array whose indices and corresponding values are the names of all -the user-defined or extension functions in the program. +the built-in, user-defined, and extension functions in the program. @quotation NOTE Attempting to use the @code{delete} statement with the @code{FUNCTAB} -array will cause a fatal error. Any attempt to assign to an element of -the @code{FUNCTAB} array will also cause a fatal error. +array causes a fatal error. Any attempt to assign to an element of +@code{FUNCTAB} also causes a fatal error. @end quotation @cindex @code{NR} variable -@item NR +@item @code{NR} The number of input records @command{awk} has processed since the beginning of the program's execution (@pxref{Records}). -@code{NR} is incremented each time a new record is read. +@command{awk} increments @code{NR} each time it reads a new record. @cindex @command{gawk}, @code{PROCINFO} array in @cindex @code{PROCINFO} array @cindex differences in @command{awk} and @command{gawk}, @code{PROCINFO} array -@item PROCINFO # +@item @code{PROCINFO #} The elements of this array provide access to information about the running @command{awk} program. The following elements (listed alphabetically) @@ -13330,22 +14251,28 @@ @item PROCINFO["identifiers"] @cindex program identifiers -A subarray, indexed by the names of all identifiers used in the -text of the AWK program. For each identifier, the value of the element is one of the following: +A subarray, indexed by the names of all identifiers used in the text of +the @command{awk} program. An @dfn{identifier} is simply the name of a variable +(be it scalar or array), built-in function, user-defined function, or +extension function. For each identifier, the value of the element is +one of the following: @table @code @item "array" The identifier is an array. +@item "builtin" +The identifier is a built-in function. + @item "extension" The identifier is an extension function loaded via -@code{@@load}. +@code{@@load} or @option{-l}. @item "scalar" The identifier is a scalar. @item "untyped" -The identifier is untyped (could be used as a scalar or array, +The identifier is untyped (could be used as a scalar or an array; @command{gawk} doesn't know yet). @item "user" @@ -13362,7 +14289,7 @@ The value of the @code{getgid()} system call. @item PROCINFO["pgrpid"] -@cindex process group idIDof @command{gawk} process +@cindex process group ID of @command{gawk} process The process group ID of the current process. @item PROCINFO["pid"] @@ -13376,8 +14303,8 @@ @item PROCINFO["sorted_in"] If this element exists in @code{PROCINFO}, its value controls the order in which array indices will be processed by -@samp{for (index in array) @dots{}} loops. -Since this is an advanced feature, we defer the +@samp{for (@var{indx} in @var{array})} loops. +This is an advanced feature, so we defer the full description until later; see @ref{Scanning an Array}. @@ -13397,10 +14324,10 @@ The following additional elements in the array are available to provide information about the MPFR and GMP libraries -if your version of @command{gawk} supports arbitrary precision numbers -(@pxref{Gawk and MPFR}): +if your version of @command{gawk} supports arbitrary-precision arithmetic +(@pxref{Arbitrary Precision Arithmetic}): -@table @code +@table @code @cindex version of GNU MPFR library @item PROCINFO["mpfr_version"] The version of the GNU MPFR library. @@ -13414,7 +14341,7 @@ The maximum precision supported by MPFR. @item PROCINFO["prec_min"] -@cindex minimum precision supported by MPFR library +@cindex minimum precision required by MPFR library The minimum precision required by MPFR. @end table @@ -13444,27 +14371,20 @@ @cindex @code{PROCINFO} array, uses The @code{PROCINFO} array has the following additional uses: -@itemize @bullet -@item -It may be -used to cause coprocesses -to communicate over pseudo-ttys instead of through two-way pipes; -this is discussed further in @ref{Two-way I/O}. - +@itemize @value{BULLET} @item It may be used to provide a timeout when reading from any open input file, pipe, or coprocess. -@xref{Read Timeout}, for more information. -@end itemize +@DBXREF{Read Timeout} for more information. -This array is a @command{gawk} extension. -In other @command{awk} implementations, -or if @command{gawk} is in compatibility mode -(@pxref{Options}), -it is not special. +@item +It may be used to cause coprocesses to communicate over pseudo-ttys +instead of through two-way pipes; this is discussed further in +@ref{Two-way I/O}. +@end itemize @cindex @code{RLENGTH} variable -@item RLENGTH +@item @code{RLENGTH} The length of the substring matched by the @code{match()} function (@pxref{String Functions}). @@ -13472,8 +14392,8 @@ is the length of the matched string, or @minus{}1 if no match is found. @cindex @code{RSTART} variable -@item RSTART -The start-index in characters of the substring that is matched by the +@item @code{RSTART} +The start index in characters of the substring that is matched by the @code{match()} function (@pxref{String Functions}). @code{RSTART} is set by invoking the @code{match()} function. Its value @@ -13483,23 +14403,21 @@ @cindex @command{gawk}, @code{RT} variable in @cindex @code{RT} variable @cindex differences in @command{awk} and @command{gawk}, @code{RT} variable -@item RT # -This is set each time a record is read. It contains the input text -that matched the text denoted by @code{RS}, the record separator. - -This variable is a @command{gawk} extension. -In other @command{awk} implementations, -or if @command{gawk} is in compatibility mode -(@pxref{Options}), -it is not special. +@item @code{RT #} +The input text that matched the text denoted by @code{RS}, +the record separator. It is set every time a record is read. @cindex @command{gawk}, @code{SYMTAB} array in @cindex @code{SYMTAB} array @cindex differences in @command{awk} and @command{gawk}, @code{SYMTAB} variable -@item SYMTAB # -An array whose indices are the names of all currently defined -global variables and arrays in the program. The array may be used -for indirect access to read or write the value of a variable: +@item @code{SYMTAB #} +An array whose indices are the names of all defined global variables and +arrays in the program. @code{SYMTAB} makes @command{gawk}'s symbol table +visible to the @command{awk} programmer. It is built as @command{gawk} +parses the program and is complete before the program starts to run. + +The array may be used for indirect access to read or write the value of +a variable: @example foo = 5 @@ -13525,6 +14443,7 @@ a regular array. The only difference is that you can't then delete @code{SYMTAB["xxx"]}. +@cindex Schorr, Andrew The @code{SYMTAB} array is more interesting than it looks. Andrew Schorr points out that it effectively gives @command{awk} data pointers. Consider his example: @@ -13539,13 +14458,11 @@ @end example @quotation NOTE -In order to avoid severe time-travel paradoxes@footnote{Not to mention difficult -implementation issues.}, neither @code{FUNCTAB} nor @code{SYMTAB} -are available as elements within the @code{SYMTAB} array. +In order to avoid severe time-travel paradoxes,@footnote{Not to mention difficult +implementation issues.} neither @code{FUNCTAB} nor @code{SYMTAB} +is available as an element within the @code{SYMTAB} array. @end quotation @end table -@c ENDOFRANGE bvconi -@c ENDOFRANGE vbconi @sidebar Changing @code{NR} and @code{FNR} @cindex @code{NR} variable, changing @@ -13585,7 +14502,7 @@ @cindex arguments, command-line @cindex command line, arguments -@ref{Auto-set}, +@DBREF{Auto-set} presented the following program describing the information contained in @code{ARGC} and @code{ARGV}: @@ -13643,11 +14560,11 @@ If the value of @code{ARGC} is decreased, that eliminates input files from the end of the list. By recording the old value of @code{ARGC} elsewhere, a program can treat the eliminated arguments as -something other than file names. +something other than @value{FN}s. To eliminate a file from the middle of the list, store the null string (@code{""}) into @code{ARGV} in place of the file's name. As a -special feature, @command{awk} ignores file names that have been +special feature, @command{awk} ignores @value{FN}s that have been replaced with the null string. Another option is to use the @code{delete} statement to remove elements from @@ -13655,11 +14572,26 @@ All of these actions are typically done in the @code{BEGIN} rule, before actual processing of the input begins. -@xref{Split Program}, and see -@ref{Tee Program}, for examples +@DBXREF{Split Program} and +@ifnotdocbook +@DBPXREF{Tee Program} +@end ifnotdocbook +@ifdocbook +@DBREF{Tee Program} +@end ifdocbook +for examples of each way of removing elements from @code{ARGV}. + +To actually get options into an @command{awk} program, +end the @command{awk} options with @option{--} and then supply +the @command{awk} program's options, in the following manner: + +@example +awk -f myprog.awk -- -v -q file1 file2 @dots{} +@end example + The following fragment processes @code{ARGV} in order to examine, and -then remove, command-line options: +then remove, the previously mentioned command-line options: @example BEGIN @{ @@ -13679,36 +14611,104 @@ @} @end example -To actually get the options into the @command{awk} program, -end the @command{awk} options with @option{--} and then supply -the @command{awk} program's options, in the following manner: - -@example -awk -f myprog -- -v -q file1 file2 @dots{} -@end example - @cindex differences in @command{awk} and @command{gawk}, @code{ARGC}/@code{ARGV} variables -This is not necessary in @command{gawk}. Unless @option{--posix} has +Ending the @command{awk} options with @option{--} isn't +necessary in @command{gawk}. Unless @option{--posix} has been specified, @command{gawk} silently puts any unrecognized options into @code{ARGV} for the @command{awk} program to deal with. As soon as it sees an unknown option, @command{gawk} stops looking for other -options that it might otherwise recognize. The previous example with +options that it might otherwise recognize. The previous command line with @command{gawk} would be: @example -gawk -f myprog -q -v file1 file2 @dots{} +gawk -f myprog.awk -q -v file1 file2 @dots{} @end example @noindent -Because @option{-q} is not a valid @command{gawk} option, -it and the following @option{-v} -are passed on to the @command{awk} program. -(@xref{Getopt Function}, for an @command{awk} library function -that parses command-line options.) +Because @option{-q} is not a valid @command{gawk} option, it and the +following @option{-v} are passed on to the @command{awk} program. +(@DBXREF{Getopt Function} for an @command{awk} library function that +parses command-line options.) + +When designing your program, you should choose options that don't +conflict with @command{gawk}'s, because it will process any options +that it accepts before passing the rest of the command line on to +your program. Using @samp{#!} with the @option{-E} option may help +(@DBPXREF{Executable Scripts} +and +@ifnotdocbook +@DBPXREF{Options}). +@end ifnotdocbook +@ifdocbook +@DBREF{Options}). +@end ifdocbook + +@node Pattern Action Summary +@section Summary + +@itemize @value{BULLET} +@item +Pattern--action pairs make up the basic elements of an @command{awk} +program. Patterns are either normal expressions, range expressions, +or regexp constants; one of the special keywords @code{BEGIN}, @code{END}, +@code{BEGINFILE}, or @code{ENDFILE}; or empty. The action executes if +the current record matches the pattern. Empty (missing) patterns match +all records. + +@item +I/O from @code{BEGIN} and @code{END} rules has certain constraints. +This is also true, only more so, for @code{BEGINFILE} and @code{ENDFILE} +rules. The latter two give you ``hooks'' into @command{gawk}'s file +processing, allowing you to recover from a file that otherwise would +cause a fatal error (such as a file that cannot be opened). + +@item +Shell variables can be used in @command{awk} programs by careful +use of shell quoting. It is easier to pass a shell variable into +@command{awk} by using the @option{-v} option and an @command{awk} +variable. + +@item +Actions consist of statements enclosed in curly braces. Statements +are built up from expressions, control statements, compound statements, +input and output statements, and deletion statements. + +@item +The control statements in @command{awk} are @code{if}-@code{else}, +@code{while}, @code{for}, and @code{do}-@code{while}. @command{gawk} +adds the @code{switch} statement. There are two flavors of @code{for} +statement: one for performing general looping, and the other for iterating +through an array. + +@item +@code{break} and @code{continue} let you exit early or start the next +iteration of a loop (or get out of a @code{switch}). + +@item +@code{next} and @code{nextfile} let you read the next record and start +over at the top of your program or skip to the next input file and +start over, respectively. + +@item +The @code{exit} statement terminates your program. When executed +from an action (or function body), it transfers control to the +@code{END} statements. From an @code{END} statement body, it exits +immediately. You may pass an optional numeric value to be used +as @command{awk}'s exit status. + +@item +Some predefined variables provide control over @command{awk}, mainly for I/O. +Other variables convey information from @command{awk} to your program. + +@item +@code{ARGC} and @code{ARGV} make the command-line arguments available +to your program. Manipulating them from a @code{BEGIN} rule lets you +control how @command{awk} will process the provided @value{DF}s. + +@end itemize @node Arrays @chapter Arrays in @command{awk} -@c STARTOFRANGE arrs @cindex arrays An @dfn{array} is a table of values called @dfn{elements}. The @@ -13722,29 +14722,19 @@ arrays, as well as some of the less obvious points about array usage. The @value{CHAPTER} moves on to discuss @command{gawk}'s facility for sorting arrays, and ends with a brief description of @command{gawk}'s -ability to support true multidimensional arrays. - -@cindex variables, names of -@cindex functions, names of -@cindex arrays, names of, and names of functions/variables -@cindex names, arrays/variables -@cindex namespace issues -@command{awk} maintains a single set -of names that may be used for naming variables, arrays, and functions -(@pxref{User-defined}). -Thus, you cannot have a variable and an array with the same name in the -same @command{awk} program. +ability to support true arrays of arrays. @menu * Array Basics:: The basics of arrays. -* Delete:: The @code{delete} statement removes an element - from an array. * Numeric Array Subscripts:: How to use numbers as subscripts in @command{awk}. * Uninitialized Subscripts:: Using Uninitialized variables as subscripts. +* Delete:: The @code{delete} statement removes an element + from an array. * Multidimensional:: Emulating multidimensional arrays in @command{awk}. * Arrays of Arrays:: True multidimensional arrays. +* Arrays Summary:: Summary of arrays. @end menu @node Array Basics @@ -13786,14 +14776,14 @@ Arrays in @command{awk} superficially resemble arrays in other programming languages, but there are fundamental differences. In @command{awk}, it isn't necessary to specify the size of an array before starting to use it. -Additionally, any number or string in @command{awk}, not just consecutive integers, +Additionally, any number or string, not just consecutive integers, may be used as an array index. In most other languages, arrays must be @dfn{declared} before use, including a specification of how many elements or components they contain. In such languages, the declaration causes a contiguous block of memory to be allocated for that -many elements. Usually, an index in the array must be a positive integer. +many elements. Usually, an index in the array must be a nonnegative integer. For example, the index zero specifies the first element in the array, which is actually stored at the beginning of the block of memory. Index one specifies the second element, which is stored in memory right after the @@ -13804,74 +14794,167 @@ indices---e.g., @samp{15 .. 27}---but the size of the array is still fixed when the array is declared.) -A contiguous array of four elements might look like the following example, -conceptually, if the element values are 8, @code{"foo"}, -@code{""}, and 30: +@c 1/2015: Do not put the numeric values into @code. Array element +@c values are no different than scalar variable values. +A contiguous array of four elements might look like +@ifnotdocbook +@ref{figure-array-elements}, +@end ifnotdocbook +@ifdocbook +@inlineraw{docbook, }, +@end ifdocbook +conceptually, if the element values are eight, @code{"foo"}, +@code{""}, and 30. -@c @strong{FIXME: NEXT ED:} Use real images here, and an @float -@iftex -@c from Karl Berry, much thanks for the help. -@tex -\bigskip % space above the table (about 1 linespace) -\offinterlineskip -\newdimen\width \width = 1.5cm -\newdimen\hwidth \hwidth = 4\width \advance\hwidth by 2pt % 5 * 0.4pt -\centerline{\vbox{ -\halign{\strut\hfil\ignorespaces#&&\vrule#&\hbox to\width{\hfil#\unskip\hfil}\cr -\noalign{\hrule width\hwidth} - &&{\tt 8} &&{\tt "foo"} &&{\tt ""} &&{\tt 30} &&\quad Value\cr -\noalign{\hrule width\hwidth} -\noalign{\smallskip} - &\omit&0&\omit &1 &\omit&2 &\omit&3 &\omit&\quad Index\cr -} -}} -@end tex -@end iftex -@ifnottex -@example -+---------+---------+--------+---------+ -| 8 | "foo" | "" | 30 | @r{Value} -+---------+---------+--------+---------+ - 0 1 2 3 @r{Index} -@end example -@end ifnottex +@ifnotdocbook +@float Figure,figure-array-elements +@caption{A contiguous array} +@ifinfo +@center @image{array-elements, , , A Contiguous Array, txt} +@end ifinfo +@ifnotinfo +@center @image{array-elements, , , A Contiguous Array} +@end ifnotinfo +@end float +@end ifnotdocbook + +@docbook +
+A contiguous array + + + +
+@end docbook @noindent Only the values are stored; the indices are implicit from the order of -the values. Here, 8 is the value at index zero, because 8 appears in the +the values. Here, eight is the value at index zero, because eight appears in the position with zero elements before it. -@c STARTOFRANGE arrin @cindex arrays, indexing -@c STARTOFRANGE inarr @cindex indexing arrays @cindex associative arrays @cindex arrays, associative Arrays in @command{awk} are different---they are @dfn{associative}. This means -that each array is a collection of pairs: an index and its corresponding +that each array is a collection of pairs---an index and its corresponding array element value: -@example -@r{Index} 3 @r{Value} 30 -@r{Index} 1 @r{Value} "foo" -@r{Index} 0 @r{Value} 8 -@r{Index} 2 @r{Value} "" -@end example +@ifnotdocbook +@c extra empty column to indent it right +@multitable @columnfractions .1 .1 .1 +@headitem @tab Index @tab Value +@item @tab @code{3} @tab @code{30} +@item @tab @code{1} @tab @code{"foo"} +@item @tab @code{0} @tab @code{8} +@item @tab @code{2} @tab @code{""} +@end multitable +@end ifnotdocbook + +@docbook + + + + + + +Index +Value + + + + + +3 +30 + + + +1 +"foo" + + + +0 +8 + + + +2 +"" + + + + + + +@end docbook @noindent -The pairs are shown in jumbled order because their order is irrelevant. +The pairs are shown in jumbled order because their order is +irrelevant.@footnote{The ordering will vary among @command{awk} +implementations, which typically use hash tables to store array elements +and values.} One advantage of associative arrays is that new pairs can be added at any time. For example, suppose a tenth element is added to the array whose value is @w{@code{"number ten"}}. The result is: -@example -@r{Index} 10 @r{Value} "number ten" -@r{Index} 3 @r{Value} 30 -@r{Index} 1 @r{Value} "foo" -@r{Index} 0 @r{Value} 8 -@r{Index} 2 @r{Value} "" -@end example +@ifnotdocbook +@c extra empty column to indent it right +@multitable @columnfractions .1 .1 .2 +@headitem @tab Index @tab Value +@item @tab @code{10} @tab @code{"number ten"} +@item @tab @code{3} @tab @code{30} +@item @tab @code{1} @tab @code{"foo"} +@item @tab @code{0} @tab @code{8} +@item @tab @code{2} @tab @code{""} +@end multitable +@end ifnotdocbook + +@docbook + + + + + + +Index +Value + + + + + +10 +"number ten" + + + +3 +30 + + + +1 +"foo" + + + +0 +8 + + + +2 +"" + + + + + + +@end docbook @noindent @cindex sparse arrays @@ -13880,25 +14963,67 @@ It has elements 0--3 and 10, but doesn't have elements 4, 5, 6, 7, 8, or 9. Another consequence of associative arrays is that the indices don't -have to be positive integers. Any number, or even a string, can be +have to be nonnegative integers. Any number, or even a string, can be an index. For example, the following is an array that translates words from English to French: -@example -@r{Index} "dog" @r{Value} "chien" -@r{Index} "cat" @r{Value} "chat" -@r{Index} "one" @r{Value} "un" -@r{Index} 1 @r{Value} "un" -@end example +@ifnotdocbook +@multitable @columnfractions .1 .1 .1 +@headitem @tab Index @tab Value +@item @tab @code{"dog"} @tab @code{"chien"} +@item @tab @code{"cat"} @tab @code{"chat"} +@item @tab @code{"one"} @tab @code{"un"} +@item @tab @code{1} @tab @code{"un"} +@end multitable +@end ifnotdocbook + +@docbook + + + + + + +Index +Value + + + + +"dog" +"chien" + + + +"cat" +"chat" + + + +"one" +"un" + + + +1 +"un" + + + + + + +@end docbook @noindent Here we decided to translate the number one in both spelled-out and numeric form---thus illustrating that a single array can have both numbers and strings as indices. -In fact, array subscripts are always strings; this is discussed -in more detail in -@ref{Numeric Array Subscripts}. -Here, the number @code{1} isn't double-quoted, since @command{awk} +(In fact, array subscripts are always strings. +There are some subtleties to how numbers work when used as +array subscripts; this is discussed in more detail in +@ref{Numeric Array Subscripts}.) +Here, the number @code{1} isn't double-quoted, because @command{awk} automatically converts it to a string. @cindex @command{gawk}, @code{IGNORECASE} variable in @@ -13915,8 +15040,6 @@ @command{awk}'s arrays are efficient---the time to access an element is independent of the number of elements in the array. -@c ENDOFRANGE arrin -@c ENDOFRANGE inarr @node Reference to Elements @subsection Referring to an Array Element @@ -13925,7 +15048,7 @@ @cindex elements of arrays The principal way to use an array is to refer to one of its elements. -An array reference is an expression as follows: +An @dfn{array reference} is an expression as follows: @example @var{array}[@var{index-expression}] @@ -13935,8 +15058,11 @@ Here, @var{array} is the name of an array. The expression @var{index-expression} is the index of the desired element of the array. +@c 1/2015: Having the 4.3 in @samp is a little iffy. It's essentially +@c an expression though, so leave be. It's to early in the discussion +@c to mention that it's really a string. The value of the array reference is the current value of that array -element. For example, @code{foo[4.3]} is an expression for the element +element. For example, @code{foo[4.3]} is an expression referencing the element of array @code{foo} at index @samp{4.3}. @cindex arrays, unassigned elements @@ -13963,8 +15089,9 @@ @end example @noindent -This is incorrect, since this will @emph{create} @code{a["foo"]} -if it didn't exist before! +This is incorrect for two reasons. First, it @emph{creates} @code{a["foo"]} +if it didn't exist before! Second, it is valid (if a bit unusual) to set +an array element equal to the empty string. @end quotation @c @cindex arrays, @code{in} operator and @@ -13973,15 +15100,17 @@ the following expression: @example -@var{ind} in @var{array} +@var{indx} in @var{array} @end example @cindex side effects, array indexing @noindent -This expression tests whether the particular index @var{ind} exists, +This expression tests whether the particular index @var{indx} exists, without the side effect of creating that element if it is not present. -The expression has the value one (true) if @code{@var{array}[@var{ind}]} +The expression has the value one (true) if @code{@var{array}[@var{indx}]} exists and zero (false) if it does not exist. +(We use @var{indx} here, because @samp{index} is the name of a built-in +function.) For example, this statement tests whether the array @code{frequencies} contains the index @samp{2}: @@ -14025,7 +15154,7 @@ The following program takes a list of lines, each beginning with a line number, and prints them out in order of line number. The line numbers -are not in order when they are first read---instead they +are not in order when they are first read---instead, they are scrambled. This program sorts the lines by making an array using the line numbers as subscripts. The program then prints out the lines in sorted order of their numbers. It is a very simple program and gets @@ -14035,14 +15164,14 @@ @example @c file eg/misc/arraymax.awk @{ - if ($1 > max) - max = $1 - arr[$1] = $0 + if ($1 > max) + max = $1 + arr[$1] = $0 @} END @{ - for (x = 1; x <= max; x++) - print arr[x] + for (x = 1; x <= max; x++) + print arr[x] @} @c endfile @end example @@ -14082,9 +15211,9 @@ @example END @{ - for (x = 1; x <= max; x++) - if (x in arr) - print arr[x] + for (x = 1; x <= max; x++) + if (x in arr) + print arr[x] @} @end example @@ -14097,7 +15226,7 @@ In programs that use arrays, it is often necessary to use a loop that executes once for each element of an array. In other languages, where -arrays are contiguous and indices are limited to positive integers, +arrays are contiguous and indices are limited to nonnegative integers, this is easy: all the valid indices can be found by counting from the lowest index up to the highest. This technique won't do the job in @command{awk}, because any number or string can be an array index. @@ -14106,7 +15235,7 @@ @example for (@var{var} in @var{array}) - @var{body} + @var{body} @end example @noindent @@ -14119,11 +15248,11 @@ The following program uses this form of the @code{for} statement. The first rule scans the input records and notes which words appear (at least once) in the input, by storing a one into the array @code{used} with -the word as index. The second rule scans the elements of @code{used} to +the word as the index. The second rule scans the elements of @code{used} to find all the distinct words that appear in the input. It prints each word that is more than 10 characters long and also prints the number of such words. -@xref{String Functions}, +@DBXREF{String Functions} for more information on the built-in function @code{length()}. @example @@ -14146,7 +15275,7 @@ @end example @noindent -@xref{Word Sorting}, +@DBXREF{Word Sorting} for a more detailed example of this type. @cindex arrays, elements, order of access by @code{in} operator @@ -14154,29 +15283,71 @@ @cindex @code{in} operator, order of array access The order in which elements of the array are accessed by this statement is determined by the internal arrangement of the array elements within -@command{awk} and normally cannot be controlled or changed. This can lead to -problems if new elements are added to @var{array} by statements in -the loop body; it is not predictable whether the @code{for} loop will -reach them. Similarly, changing @var{var} inside the loop may produce -strange results. It is best to avoid such things. +@command{awk} and in standard @command{awk} cannot be controlled +or changed. This can lead to problems if new elements are added to +@var{array} by statements in the loop body; it is not predictable whether +the @code{for} loop will reach them. Similarly, changing @var{var} inside +the loop may produce strange results. It is best to avoid such things. + +As a point of information, @command{gawk} sets up the list of elements +to be iterated over before the loop starts, and does not change it. +But not all @command{awk} versions do so. Consider this program, named +@file{loopcheck.awk}: -@node Controlling Scanning -@subsection Using Predefined Array Scanning Orders +@example +BEGIN @{ + a["here"] = "here" + a["is"] = "is" + a["a"] = "a" + a["loop"] = "loop" + for (i in a) @{ + j++ + a[j] = j + print i + @} +@} +@end example -By default, when a @code{for} loop traverses an array, the order -is undefined, meaning that the @command{awk} implementation -determines the order in which the array is traversed. -This order is usually based on the internal implementation of arrays -and will vary from one version of @command{awk} to the next. +Here is what happens when run with @command{gawk} (and @command{mawk}): -@cindex array scanning order, controlling -@cindex controlling array scanning order -Often, though, you may wish to do something simple, such as -``traverse the array by comparing the indices in ascending order,'' -or ``traverse the array by comparing the values in descending order.'' -@command{gawk} provides two mechanisms which give you this control. +@example +$ @kbd{gawk -f loopcheck.awk} +@print{} here +@print{} loop +@print{} a +@print{} is +@end example + +Contrast this to BWK @command{awk}: + +@example +$ @kbd{nawk -f loopcheck.awk} +@print{} loop +@print{} here +@print{} is +@print{} a +@print{} 1 +@end example + +@node Controlling Scanning +@subsection Using Predefined Array Scanning Orders with @command{gawk} + +This @value{SUBSECTION} describes a feature that is specific to @command{gawk}. + +By default, when a @code{for} loop traverses an array, the order +is undefined, meaning that the @command{awk} implementation +determines the order in which the array is traversed. +This order is usually based on the internal implementation of arrays +and will vary from one version of @command{awk} to the next. + +@cindex array scanning order, controlling +@cindex controlling array scanning order +Often, though, you may wish to do something simple, such as +``traverse the array by comparing the indices in ascending order,'' +or ``traverse the array by comparing the values in descending order.'' +@command{gawk} provides two mechanisms that give you this control: -@itemize @bullet +@itemize @value{BULLET} @item Set @code{PROCINFO["sorted_in"]} to one of a set of predefined values. We describe this now. @@ -14184,7 +15355,7 @@ @item Set @code{PROCINFO["sorted_in"]} to the name of a user-defined function to use for comparison of array elements. This advanced feature -is described later, in @ref{Array Sorting}. +is described later in @ref{Array Sorting}. @end itemize @cindex @code{PROCINFO}, values of @code{sorted_in} @@ -14202,7 +15373,7 @@ @item "@@ind_num_asc" Order by indices in ascending order but force them to be treated as numbers in the process. -Any index with a non-numeric value will end up positioned as if it were zero. +Any index with a non-numeric value will end up positioned as if it were zero. @item "@@val_type_asc" Order by element values in ascending order (rather than by indices). @@ -14214,11 +15385,11 @@ @pxref{Arrays of Arrays}.) @item "@@val_str_asc" -Order by element values in ascending order (rather than by indices). Scalar values are +Order by element values in ascending order (rather than by indices). Scalar values are compared as strings. Subarrays, if present, come out last. @item "@@val_num_asc" -Order by element values in ascending order (rather than by indices). Scalar values are +Order by element values in ascending order (rather than by indices). Scalar values are compared as numbers. Subarrays, if present, come out last. When numeric values are equal, the string values are used to provide an ordering: this guarantees consistent results across different @@ -14231,21 +15402,26 @@ to perform the sorting. @item "@@ind_str_desc" -String indices ordered from high to low. +Like @code{"@@ind_str_asc"}, but the +string indices are ordered from high to low. @item "@@ind_num_desc" -Numeric indices ordered from high to low. +Like @code{"@@ind_num_asc"}, but the +numeric indices are ordered from high to low. @item "@@val_type_desc" -Element values, based on type, ordered from high to low. +Like @code{"@@val_type_asc"}, but the +element values, based on type, are ordered from high to low. Subarrays, if present, come out first. @item "@@val_str_desc" -Element values, treated as strings, ordered from high to low. +Like @code{"@@val_str_asc"}, but the +element values, treated as strings, are ordered from high to low. Subarrays, if present, come out first. @item "@@val_num_desc" -Element values, treated as numbers, ordered from high to low. +Like @code{"@@val_num_asc"}, but the +element values, treated as numbers, are ordered from high to low. Subarrays, if present, come out first. @end table @@ -14255,7 +15431,8 @@ For example: @example -$ @kbd{gawk 'BEGIN @{} +$ @kbd{gawk '} +> @kbd{BEGIN @{} > @kbd{ a[4] = 4} > @kbd{ a[3] = 3} > @kbd{ for (i in a)} @@ -14263,7 +15440,8 @@ > @kbd{@}'} @print{} 4 4 @print{} 3 3 -$ @kbd{gawk 'BEGIN @{} +$ @kbd{gawk '} +> @kbd{BEGIN @{} > @kbd{ PROCINFO["sorted_in"] = "@@ind_str_asc"} > @kbd{ a[4] = 4} > @kbd{ a[3] = 3} @@ -14277,13 +15455,13 @@ When sorting an array by element values, if a value happens to be a subarray then it is considered to be greater than any string or numeric value, regardless of what the subarray itself contains, -and all subarrays are treated as being equal to each other. Their +and all subarrays are treated as being equal to each other. Their order relative to each other is determined by their index strings. Here are some additional things to bear in mind about sorted -array traversal. +array traversal: -@itemize @bullet +@itemize @value{BULLET} @item The value of @code{PROCINFO["sorted_in"]} is global. That is, it affects all array traversal @code{for} loops. If you need to change it within your @@ -14301,7 +15479,7 @@ @end example @item -As mentioned, the default array traversal order is represented by +As already mentioned, the default array traversal order is represented by @code{"@@unsorted"}. You can also get the default behavior by assigning the null string to @code{PROCINFO["sorted_in"]} or by just deleting the @code{"sorted_in"} element from the @code{PROCINFO} array with @@ -14312,118 +15490,6 @@ In addition, @command{gawk} provides built-in functions for sorting arrays; see @ref{Array Sorting Functions}. -@node Delete -@section The @code{delete} Statement -@cindex @code{delete} statement -@cindex deleting elements in arrays -@cindex arrays, elements, deleting -@cindex elements in arrays, deleting - -To remove an individual element of an array, use the @code{delete} -statement: - -@example -delete @var{array}[@var{index-expression}] -@end example - -Once an array element has been deleted, any value the element once -had is no longer available. It is as if the element had never -been referred to or been given a value. -The following is an example of deleting elements in an array: - -@example -for (i in frequencies) - delete frequencies[i] -@end example - -@noindent -This example removes all the elements from the array @code{frequencies}. -Once an element is deleted, a subsequent @code{for} statement to scan the array -does not report that element and the @code{in} operator to check for -the presence of that element returns zero (i.e., false): - -@example -delete foo[4] -if (4 in foo) - print "This will never be printed" -@end example - -@cindex null strings, and deleting array elements -It is important to note that deleting an element is @emph{not} the -same as assigning it a null value (the empty string, @code{""}). -For example: - -@example -foo[4] = "" -if (4 in foo) - print "This is printed, even though foo[4] is empty" -@end example - -@cindex lint checking, array elements -It is not an error to delete an element that does not exist. -However, if @option{--lint} is provided on the command line -(@pxref{Options}), -@command{gawk} issues a warning message when an element that -is not in the array is deleted. - -@cindex common extensions, @code{delete} to delete entire arrays -@cindex extensions, common@comma{} @code{delete} to delete entire arrays -@cindex arrays, deleting entire contents -@cindex deleting entire arrays -@cindex @code{delete} @var{array} -@cindex differences in @command{awk} and @command{gawk}, array elements, deleting -All the elements of an array may be deleted with a single statement -by leaving off the subscript in the @code{delete} statement, -as follows: - - -@example -delete @var{array} -@end example - -Using this version of the @code{delete} statement is about three times -more efficient than the equivalent loop that deletes each element one -at a time. - -@cindex Brian Kernighan's @command{awk} -@quotation NOTE -For many years, -using @code{delete} without a subscript was a @command{gawk} extension. -As of September, 2012, it was accepted for -inclusion into the POSIX standard. See @uref{http://austingroupbugs.net/view.php?id=544, -the Austin Group website}. This form of the @code{delete} statement is also supported -by Brian Kernighan's @command{awk} and @command{mawk}, as well as -by a number of other implementations (@pxref{Other Versions}). -@end quotation - -@cindex portability, deleting array elements -@cindex Brennan, Michael -The following statement provides a portable but nonobvious way to clear -out an array:@footnote{Thanks to Michael Brennan for pointing this out.} - -@example -split("", array) -@end example - -@cindex @code{split()} function, array elements@comma{} deleting -The @code{split()} function -(@pxref{String Functions}) -clears out the target array first. This call asks it to split -apart the null string. Because there is no data to split out, the -function simply clears the array and then returns. - -@quotation CAUTION -Deleting an array does not change its type; you cannot -delete an array and then use the array's name as a scalar -(i.e., a regular variable). For example, the following does not work: - -@example -a[1] = 3 -delete a -a = 3 -@end example -@end quotation - @node Numeric Array Subscripts @section Using Numbers to Subscript Arrays @@ -14435,7 +15501,7 @@ are always strings}. When a numeric value is used as a subscript, it is converted to a string value before being used for subscripting (@pxref{Conversion}). -This means that the value of the built-in variable @code{CONVFMT} can +This means that the value of the predefined variable @code{CONVFMT} can affect how your program accesses elements of an array. For example: @example @@ -14458,13 +15524,13 @@ the value of @code{CONVFMT}. The test @samp{(xyz in data)} generates a new string value from @code{xyz}---this time @code{"12.15"}---because the value of @code{CONVFMT} only allows two significant digits. This test fails, -since @code{"12.15"} is different from @code{"12.153"}. +because @code{"12.15"} is different from @code{"12.153"}. @cindex converting integer array subscripts @cindex integer array indices According to the rules for conversions (@pxref{Conversion}), integer -values are always converted to strings as integers, no matter what the +values always convert to strings as integers, no matter what the value of @code{CONVFMT} may happen to be. So the usual case of the following works: @@ -14476,19 +15542,19 @@ The ``integer values always convert to strings as integers'' rule has an additional consequence for array indexing. Octal and hexadecimal constants +@ifnotdocbook (@pxref{Nondecimal-numbers}) +@end ifnotdocbook +@ifdocbook +(covered in @ref{Nondecimal-numbers}) +@end ifdocbook are converted internally into numbers, and their original form -is forgotten. -This means, for example, that -@code{array[17]}, -@code{array[021]}, -and -@code{array[0x11]} -all refer to the same element! +is forgotten. This means, for example, that @code{array[17]}, +@code{array[021]}, and @code{array[0x11]} all refer to the same element! As with many things in @command{awk}, the majority of the time -things work as one would expect them to. But it is useful to have a precise -knowledge of the actual rules since they can sometimes have a subtle +things work as you would expect them to. But it is useful to have a precise +knowledge of the actual rules, as they can sometimes have a subtle effect on your programs. @node Uninitialized Subscripts @@ -14508,14 +15574,14 @@ > @kbd{line 2} > @kbd{line 3' | awk '@{ l[lines] = $0; ++lines @}} > @kbd{END @{} -> @kbd{for (i = lines-1; i >= 0; --i)} +> @kbd{for (i = lines - 1; i >= 0; i--)} > @kbd{print l[i]} > @kbd{@}'} @print{} line 3 @print{} line 2 @end example -Unfortunately, the very first line of input data did not come out in the +Unfortunately, the very first line of input data did not appear in the output! Upon first glance, we would think that this program should have worked. @@ -14532,7 +15598,7 @@ @example @{ l[lines++] = $0 @} END @{ - for (i = lines - 1; i >= 0; --i) + for (i = lines - 1; i >= 0; i--) print l[i] @} @end example @@ -14551,6 +15617,119 @@ if @option{--lint} is provided on the command line (@pxref{Options}). +@node Delete +@section The @code{delete} Statement +@cindex @code{delete} statement +@cindex deleting elements in arrays +@cindex arrays, elements, deleting +@cindex elements in arrays, deleting + +To remove an individual element of an array, use the @code{delete} +statement: + +@example +delete @var{array}[@var{index-expression}] +@end example + +Once an array element has been deleted, any value the element once +had is no longer available. It is as if the element had never +been referred to or been given a value. +The following is an example of deleting elements in an array: + +@example +for (i in frequencies) + delete frequencies[i] +@end example + +@noindent +This example removes all the elements from the array @code{frequencies}. +Once an element is deleted, a subsequent @code{for} statement to scan the array +does not report that element and using the @code{in} operator to check for +the presence of that element returns zero (i.e., false): + +@example +delete foo[4] +if (4 in foo) + print "This will never be printed" +@end example + +@cindex null strings, and deleting array elements +It is important to note that deleting an element is @emph{not} the +same as assigning it a null value (the empty string, @code{""}). +For example: + +@example +foo[4] = "" +if (4 in foo) + print "This is printed, even though foo[4] is empty" +@end example + +@cindex lint checking, array elements +It is not an error to delete an element that does not exist. +However, if @option{--lint} is provided on the command line +(@pxref{Options}), +@command{gawk} issues a warning message when an element that +is not in the array is deleted. + +@cindex common extensions, @code{delete} to delete entire arrays +@cindex extensions, common@comma{} @code{delete} to delete entire arrays +@cindex arrays, deleting entire contents +@cindex deleting entire arrays +@cindex @code{delete} @var{array} +@cindex differences in @command{awk} and @command{gawk}, array elements, deleting +All the elements of an array may be deleted with a single statement +by leaving off the subscript in the @code{delete} statement, +as follows: + + +@example +delete @var{array} +@end example + +Using this version of the @code{delete} statement is about three times +more efficient than the equivalent loop that deletes each element one +at a time. + +This form of the @code{delete} statement is also supported +by BWK @command{awk} and @command{mawk}, as well as +by a number of other implementations. + +@cindex Brian Kernighan's @command{awk} +@quotation NOTE +For many years, using @code{delete} without a subscript was a common +extension. In September 2012, it was accepted for inclusion into the +POSIX standard. See @uref{http://austingroupbugs.net/view.php?id=544, +the Austin Group website}. +@end quotation + +@cindex portability, deleting array elements +@cindex Brennan, Michael +The following statement provides a portable but nonobvious way to clear +out an array:@footnote{Thanks to Michael Brennan for pointing this out.} + +@example +split("", array) +@end example + +@cindex @code{split()} function, array elements@comma{} deleting +The @code{split()} function +(@pxref{String Functions}) +clears out the target array first. This call asks it to split +apart the null string. Because there is no data to split out, the +function simply clears the array and then returns. + +@quotation CAUTION +Deleting all the elements from an array does not change its type; you cannot +clear an array and then use the array's name as a scalar +(i.e., a regular variable). For example, the following does not work: + +@example +a[1] = 3 +delete a +a = 3 +@end example +@end quotation + @node Multidimensional @section Multidimensional Arrays @@ -14560,9 +15739,9 @@ @cindex subscripts in arrays, multidimensional @cindex arrays, multidimensional -A multidimensional array is an array in which an element is identified +A @dfn{multidimensional array} is an array in which an element is identified by a sequence of indices instead of a single index. For example, a -two-dimensional array requires two indices. The usual way (in most +two-dimensional array requires two indices. The usual way (in many languages, including @command{awk}) to refer to an element of a two-dimensional array named @code{grid} is with @code{grid[@var{x},@var{y}]}. @@ -14602,14 +15781,15 @@ @cindex @code{in} operator, index existence in multidimensional arrays To test whether a particular index sequence exists in a multidimensional array, use the same operator (@code{in}) that is -used for single dimensional arrays. Write the whole sequence of indices +used for single-dimensional arrays. Write the whole sequence of indices in parentheses, separated by commas, as the left operand: @example -(@var{subscript1}, @var{subscript2}, @dots{}) in @var{array} +if ((@var{subscript1}, @var{subscript2}, @dots{}) in @var{array}) + @dots{} @end example -The following example treats its input as a two-dimensional array of +Here is an example that treats its input as a two-dimensional array of fields; it rotates this array 90 degrees clockwise and prints the result. It assumes that all lines have the same number of elements: @@ -14713,7 +15893,7 @@ array access and provides true arrays of arrays. Elements of a subarray are referred to by their own indices enclosed in square brackets, just like the elements of the main array. -For example, the following creates a two-element subarray at index @samp{1} +For example, the following creates a two-element subarray at index @code{1} of the main array @code{a}: @example @@ -14724,8 +15904,8 @@ This simulates a true two-dimensional array. Each subarray element can contain another subarray as a value, which in turn can hold other arrays as well. In this way, you can create arrays of three or more dimensions. -The indices can be any @command{awk} expression, including scalars -separated by commas (that is, a regular @command{awk} simulated +The indices can be any @command{awk} expressions, including scalars +separated by commas (i.e., a regular @command{awk} simulated multidimensional subscript). So the following is valid in @command{gawk}: @@ -14736,14 +15916,15 @@ Each subarray and the main array can be of different length. In fact, the elements of an array or its subarray do not all have to have the same type. This means that the main array and any of its subarrays can be -non-rectangular, or jagged in structure. One can assign a scalar value to -the index @samp{4} of the main array @code{a}: +nonrectangular, or jagged in structure. You can assign a scalar value to +the index @code{4} of the main array @code{a}, even though @code{a[1]} +is itself an array and not a scalar: @example a[4] = "An element in a jagged array" @end example - -The terms @dfn{dimension}, @dfn{row} and @dfn{column} are + +The terms @dfn{dimension}, @dfn{row}, and @dfn{column} are meaningless when applied to such an array, but we will use ``dimension'' henceforth to imply the maximum number of indices needed to refer to an existing element. The @@ -14758,8 +15939,9 @@ @end example @noindent -This removes the scalar value from index @samp{4} and then inserts a -subarray of subarray of subarray containing a scalar. You can also +This removes the scalar value from index @code{4} and then inserts a +three-level nested subarray +containing a scalar. You can also delete an entire subarray or subarray of subarrays: @example @@ -14770,7 +15952,7 @@ But recall that you can not delete the main array @code{a} and then use it as a scalar. -The built-in functions which take array arguments can also be used +The built-in functions that take array arguments can also be used with subarrays. For example, the following code fragment uses @code{length()} (@pxref{String Functions}) to determine the number of elements in the main array @code{a} and @@ -14799,14 +15981,14 @@ can be nested to scan all the elements of an array of arrays if it is rectangular in structure. In order to print the contents (scalar values) of a two-dimensional array of arrays -(i.e., in which each first-level element is itself an -array, not necessarily of the same length) +(i.e., in which each first-level element is itself an +array, not necessarily of the same length), you could use the following code: @example for (i in array) for (j in array[i]) - print array[i][j] + print array[i][j] @end example The @code{isarray()} function (@pxref{Type Functions}) @@ -14816,15 +15998,17 @@ for (i in array) @{ if (isarray(array[i]) @{ for (j in array[i]) @{ - print array[i][j] + print array[i][j] @} @} + else + print array[i] @} @end example If the structure of a jagged array of arrays is known in advance, you can often devise workarounds using control statements. For example, -the following code prints the elements of our main array @code{a}: +the following code prints the elements of our main array @code{a}: @example for (i in a) @{ @@ -14834,13 +16018,13 @@ print a[i][j][k] @} else print a[i][j] - @} + @} @} @end example @noindent -@xref{Walking Arrays}, for a user-defined function that ``walks'' an -arbitrarily-dimensioned array of arrays. +@DBXREF{Walking Arrays} for a user-defined function that ``walks'' an +arbitrarily dimensioned array of arrays. Recall that a reference to an uninitialized array element yields a value of @code{""}, the null string. This has one important implication when you @@ -14859,30 +16043,90 @@ $ @kbd{gawk 'BEGIN @{ b[1][1] = ""; split("a b c d", b[1]); print b[1][1] @}'} @print{} a @end example -@c ENDOFRANGE arrs + +@node Arrays Summary +@section Summary + +@itemize @value{BULLET} +@item +Standard @command{awk} provides one-dimensional associative arrays +(arrays indexed by string values). All arrays are associative; numeric +indices are converted automatically to strings. + +@item +Array elements are referenced as @code{@var{array}[@var{indx}]}. +Referencing an element creates it if it did not exist previously. + +@item +The proper way to see if an array has an element with a given index +is to use the @code{in} operator: @samp{@var{indx} in @var{array}}. + +@item +Use @samp{for (@var{indx} in @var{array}) @dots{}} to scan through all the +individual elements of an array. In the body of the loop, @var{indx} takes +on the value of each element's index in turn. + +@item +The order in which a @samp{for (@var{indx} in @var{array})} loop +traverses an array is undefined in POSIX @command{awk} and varies among +implementations. @command{gawk} lets you control the order by assigning +special predefined values to @code{PROCINFO["sorted_in"]}. + +@item +Use @samp{delete @var{array}[@var{indx}]} to delete an individual element. +To delete all of the elements in an array, +use @samp{delete @var{array}}. +This latter feature has been a common extension for many +years and is now standard, but may not be supported by all commercial +versions of @command{awk}. + +@item +Standard @command{awk} simulates multidimensional arrays by separating +subscript values with commas. The values are concatenated into a +single string, separated by the value of @code{SUBSEP}. The fact +that such a subscript was created in this way is not retained; thus, +changing @code{SUBSEP} may have unexpected consequences. You can use +@samp{(@var{sub1}, @var{sub2}, @dots{}) in @var{array}} to see if such +a multidimensional subscript exists in @var{array}. + +@item +@command{gawk} provides true arrays of arrays. You use a separate +set of square brackets for each dimension in such an array: +@code{data[row][col]}, for example. Array elements may thus be either +scalar values (number or string) or other arrays. + +@item +Use the @code{isarray()} built-in function to determine if an array +element is itself a subarray. + +@end itemize + @node Functions @chapter Functions -@c STARTOFRANGE funcbi @cindex functions, built-in -@c STARTOFRANGE bifunc @cindex built-in functions This @value{CHAPTER} describes @command{awk}'s built-in functions, which fall into three categories: numeric, string, and I/O. @command{gawk} provides additional groups of functions to work with values that represent time, do -bit manipulation, sort arrays, and internationalize and localize programs. +bit manipulation, sort arrays, +provide type information, and internationalize and localize programs. Besides the built-in functions, @command{awk} has provisions for writing new functions that the rest of a program can use. The second half of this @value{CHAPTER} describes these @dfn{user-defined} functions. +Finally, we explore indirect function calls, a @command{gawk}-specific +extension that lets you determine at runtime what function is to +be called. @menu * Built-in:: Summarizes the built-in functions. * User-defined:: Describes User-defined functions in detail. * Indirect Calls:: Choosing the function to call at runtime. +* Functions Summary:: Summary of functions. @end menu @node Built-in @@ -14919,7 +16163,7 @@ @cindex programming conventions, functions, calling @cindex whitespace, functions@comma{} calling Whitespace is ignored between the built-in function name and the -open parenthesis, but nonetheless it is good practice to avoid using whitespace +opening parenthesis, but nonetheless it is good practice to avoid using whitespace there. User-defined functions do not permit whitespace in this way, and it is easier to avoid mistakes by following a simple convention that always works---no whitespace after a function name. @@ -14956,11 +16200,11 @@ @example i = 5 -j = atan2(i++, i *= 2) +j = atan2(++i, i *= 2) @end example If the order of evaluation is left to right, then @code{i} first becomes -6, and then 12, and @code{atan2()} is called with the two arguments 6 +six, and then 12, and @code{atan2()} is called with the two arguments six and 12. But if the order of evaluation is right to left, @code{i} first becomes 10, then 11, and @code{atan2()} is called with the two arguments 11 and 10. @@ -14973,41 +16217,44 @@ the built-in functions that work with numbers. Optional parameters are enclosed in square brackets@w{ ([ ]):} -@table @code -@item atan2(@var{y}, @var{x}) +@c @asis for docbook +@table @asis +@item @code{atan2(@var{y}, @var{x})} @cindexawkfunc{atan2} @cindex arctangent Return the arctangent of @code{@var{y} / @var{x}} in radians. -You can use @samp{pi = atan2(0, -1)} to retrieve the value of @value{PI}. +You can use @samp{pi = atan2(0, -1)} to retrieve the value of +@value{PI}. -@item cos(@var{x}) +@item @code{cos(@var{x})} @cindexawkfunc{cos} @cindex cosine Return the cosine of @var{x}, with @var{x} in radians. -@item exp(@var{x}) +@item @code{exp(@var{x})} @cindexawkfunc{exp} @cindex exponent Return the exponential of @var{x} (@code{e ^ @var{x}}) or report an error if @var{x} is out of range. The range of values @var{x} can have depends on your machine's floating-point representation. -@item int(@var{x}) +@item @code{int(@var{x})} @cindexawkfunc{int} @cindex round to nearest integer Return the nearest integer to @var{x}, located between @var{x} and zero and truncated toward zero. - For example, @code{int(3)} is 3, @code{int(3.9)} is 3, @code{int(-3.9)} is @minus{}3, and @code{int(-3)} is @minus{}3 as well. -@item log(@var{x}) +@item @code{log(@var{x})} @cindexawkfunc{log} @cindex logarithm Return the natural logarithm of @var{x}, if @var{x} is positive; -otherwise, report an error. +otherwise, return @code{NaN} (``not a number'') on IEEE 754 systems. +Additionally, @command{gawk} prints a warning message when @code{x} +is negative. -@item rand() +@item @code{rand()} @cindexawkfunc{rand} @cindex random numbers, @code{rand()}/@code{srand()} functions Return a random number. The values of @code{rand()} are @@ -15021,17 +16268,18 @@ considerably better than @code{rand()}, to produce random numbers.} Often random integers are needed instead. Following is a user-defined function -that can be used to obtain a random non-negative integer less than @var{n}: +that can be used to obtain a random nonnegative integer less than @var{n}: @example -function randint(n) @{ - return int(n * rand()) +function randint(n) +@{ + return int(n * rand()) @} @end example @noindent -The multiplication produces a random number greater than zero and less -than @code{n}. Using @code{int()}, this result is made into +The multiplication produces a random number greater than or equal to +zero and less than @code{n}. Using @code{int()}, this result is made into an integer between zero and @code{n} @minus{} 1, inclusive. The following example uses a similar function to produce random integers @@ -15045,8 +16293,7 @@ # Roll 3 six-sided dice and # print total number of points. @{ - printf("%d points\n", - roll(6)+roll(6)+roll(6)) + printf("%d points\n", roll(6) + roll(6) + roll(6)) @} @end example @@ -15065,27 +16312,27 @@ use @code{srand()}. @end quotation -@item sin(@var{x}) +@item @code{sin(@var{x})} @cindexawkfunc{sin} @cindex sine Return the sine of @var{x}, with @var{x} in radians. -@item sqrt(@var{x}) +@item @code{sqrt(@var{x})} @cindexawkfunc{sqrt} @cindex square root Return the positive square root of @var{x}. @command{gawk} prints a warning message if @var{x} is negative. Thus, @code{sqrt(4)} is 2. -@item srand(@r{[}@var{x}@r{]}) +@item @code{srand(}[@var{x}]@code{)} @cindexawkfunc{srand} Set the starting point, or seed, for generating random numbers to the value @var{x}. Each seed value leads to a particular sequence of random numbers.@footnote{Computer-generated random numbers really are not truly -random. They are technically known as ``pseudorandom.'' This means -that while the numbers in a sequence appear to be random, you can in +random. They are technically known as @dfn{pseudorandom}. This means +that although the numbers in a sequence appear to be random, you can in fact generate the same sequence of random numbers over and over again.} Thus, if the seed is set to the same value a second time, the same sequence of random numbers is produced again. @@ -15104,6 +16351,9 @@ The return value of @code{srand()} is the previous seed. This makes it easy to keep track of the seeds in case you need to consistently reproduce sequences of random numbers. + +POSIX does not specify the initial seed; it differs among @command{awk} +implementations. @end table @node String Functions @@ -15113,7 +16363,7 @@ The functions in this @value{SECTION} look at or change the text of one or more strings. -@code{gawk} understands locales (@pxref{Locales}), and does all +@command{gawk} understands locales (@pxref{Locales}) and does all string processing in terms of @emph{characters}, not @emph{bytes}. This distinction is particularly important to understand for locales where one character may be represented by multiple bytes. Thus, for @@ -15121,12 +16371,23 @@ and not the number of bytes used to represent those characters. Similarly, @code{index()} works with character indices, and not byte indices. +@quotation CAUTION +A number of functions deal with indices into strings. For these +functions, the first character of a string is at position (index) one. +This is different from C and the languages descended from it, where the +first character is at position zero. You need to remember this when +doing index calculations, particularly if you are used to C. +@end quotation + In the following list, optional parameters are enclosed in square brackets@w{ ([ ]).} Several functions perform string substitution; the full discussion is provided in the description of the @code{sub()} function, which comes -towards the end since the list is presented in alphabetic order. +toward the end, because the list is presented alphabetically. + Those functions that are specific to @command{gawk} are marked with a -pound sign@w{ (@samp{#}):} +pound sign (@samp{#}). They are not available in compatibility mode +(@pxref{Options}): + @menu * Gory Details:: More than you want to know about @samp{\} and @@ -15134,9 +16395,10 @@ @code{gensub()}. @end menu -@table @code -@item asort(@var{source} @r{[}, @var{dest} @r{[}, @var{how} @r{]} @r{]}) # -@itemx asorti(@var{source} @r{[}, @var{dest} @r{[}, @var{how} @r{]} @r{]}) # +@c @asis for docbook +@table @asis +@item @code{asort(}@var{source} [@code{,} @var{dest} [@code{,} @var{how} ] ]@code{) #} +@itemx @code{asorti(}@var{source} [@code{,} @var{dest} [@code{,} @var{how} ] ]@code{) #} @cindexgawkfunc{asorti} @cindex sort array @cindex arrays, elements, retrieving number of @@ -15146,10 +16408,10 @@ together. @quotation NOTE -The following description ignores the third argument, @var{how}, since it +The following description ignores the third argument, @var{how}, as it requires understanding features that we have not discussed yet. Thus, the discussion here is a deliberate simplification. (We do provide all -the details later on: @xref{Array Sorting Functions}, for the full story.) +the details later on; see @DBREF{Array Sorting Functions} for the full story.) @end quotation Both functions return the number of elements in the array @var{source}. @@ -15164,6 +16426,7 @@ (@pxref{Array Sorting Functions}). If the @var{source} array contains subarrays as values (@pxref{Arrays of Arrays}), they will come last, after all scalar values. +Subarrays are @emph{not} recursively sorted. For example, if the contents of @code{a} are as follows: @@ -15189,7 +16452,7 @@ a[3] = "sac" @end example -The @code{asorti()} function works similarly to @code{asort()}, however, +The @code{asorti()} function works similarly to @code{asort()}; however, the @emph{indices} are sorted, instead of the values. Thus, in the previous example, starting with the same initial set of indices and values in @code{a}, calling @samp{asorti(a)} would yield: @@ -15200,10 +16463,7 @@ a[3] = "middle" @end example -@code{asort()} and @code{asorti()} are @command{gawk} extensions; they -are not available in compatibility mode (@pxref{Options}). - -@item gensub(@var{regexp}, @var{replacement}, @var{how} @r{[}, @var{target}@r{]}) # +@item @code{gensub(@var{regexp}, @var{replacement}, @var{how}} [@code{, @var{target}}]@code{) #} @cindexgawkfunc{gensub} @cindex search and replace in strings @cindex substitute in string @@ -15265,10 +16525,7 @@ If @var{regexp} does not match @var{target}, @code{gensub()}'s return value is the original unchanged value of @var{target}. -@code{gensub()} is a @command{gawk} extension; it is not available -in compatibility mode (@pxref{Options}). - -@item gsub(@var{regexp}, @var{replacement} @r{[}, @var{target}@r{]}) +@item @code{gsub(@var{regexp}, @var{replacement}} [@code{, @var{target}}]@code{)} @cindexawkfunc{gsub} Search @var{target} for @emph{all} of the longest, leftmost, @emph{nonoverlapping} matching @@ -15290,7 +16547,7 @@ As in @code{sub()}, the characters @samp{&} and @samp{\} are special, and the third argument must be assignable. -@item index(@var{in}, @var{find}) +@item @code{index(@var{in}, @var{find})} @cindexawkfunc{index} @cindex search in string @cindex find substring in string @@ -15305,19 +16562,33 @@ @noindent If @var{find} is not found, @code{index()} returns zero. -(Remember that string indices in @command{awk} start at one.) -It is a fatal error to use a regexp constant for @var{find}. +@cindex dark corner, regexp as second argument to @code{index()} +With BWK @command{awk} and @command{gawk}, +it is a fatal error to use a regexp constant for @var{find}. +Other implementations allow it, simply treating the regexp +constant as an expression meaning @samp{$0 ~ /regexp/}. @value{DARKCORNER} -@item length(@r{[}@var{string}@r{]}) +@item @code{length(}[@var{string}]@code{)} @cindexawkfunc{length} @cindex string length @cindex length of string Return the number of characters in @var{string}. If @var{string} is a number, the length of the digit string representing that number is returned. For example, @code{length("abcde")} is five. By -contrast, @code{length(15 * 35)} works out to three. In this example, 15 * 35 = -525, and 525 is then converted to the string @code{"525"}, which has +contrast, @code{length(15 * 35)} works out to three. In this example, +@iftex +@math{15 @cdot 35 = 525}, +@end iftex +@ifnottex +@ifnotdocbook +15 * 35 = 525, +@end ifnotdocbook +@end ifnottex +@docbook +15 ⋅ 35 = 525, @c +@end docbook +and 525 is then converted to the string @code{"525"}, which has three characters. @cindex length of input record @@ -15374,24 +16645,24 @@ If @option{--posix} is supplied, using an array argument is a fatal error (@pxref{Arrays}). -@item match(@var{string}, @var{regexp} @r{[}, @var{array}@r{]}) +@item @code{match(@var{string}, @var{regexp}} [@code{, @var{array}}]@code{)} @cindexawkfunc{match} @cindex string, regular expression match @cindex match regexp in string Search @var{string} for the -longest, leftmost substring matched by the regular expression, -@var{regexp} and return the character position, or @dfn{index}, +longest, leftmost substring matched by the regular expression +@var{regexp} and return the character position (index) at which that substring begins (one, if it starts at the beginning of @var{string}). If no match is found, return zero. The @var{regexp} argument may be either a regexp constant -(@code{/@dots{}/}) or a string constant (@code{"@dots{}"}). +(@code{/}@dots{}@code{/}) or a string constant (@code{"}@dots{}@code{"}). In the latter case, the string is treated as a regexp to be matched. -@xref{Computed Regexps}, for a +@DBXREF{Computed Regexps} for a discussion of the difference between the two forms, and the implications for writing your program correctly. -The order of the first two arguments is backwards from most other string +The order of the first two arguments is the opposite of most other string functions that work with regular expressions, such as @code{sub()} and @code{gsub()}. It might help to remember that for @code{match()}, the order is the same as for the @samp{~} operator: @@ -15400,8 +16671,8 @@ @cindex @code{RSTART} variable, @code{match()} function and @cindex @code{RLENGTH} variable, @code{match()} function and @cindex @code{match()} function, @code{RSTART}/@code{RLENGTH} variables -The @code{match()} function sets the built-in variable @code{RSTART} to -the index. It also sets the built-in variable @code{RLENGTH} to the +The @code{match()} function sets the predefined variable @code{RSTART} to +the index. It also sets the predefined variable @code{RLENGTH} to the length in characters of the matched substring. If no match is found, @code{RSTART} is set to zero, and @code{RLENGTH} to @minus{}1. @@ -15410,13 +16681,12 @@ @example @c file eg/misc/findpat.awk @{ - if ($1 == "FIND") - regex = $2 - else @{ - where = match($0, regex) - if (where != 0) - print "Match of", regex, "found at", - where, "in", $0 + if ($1 == "FIND") + regex = $2 + else @{ + where = match($0, regex) + if (where != 0) + print "Match of", regex, "found at", where, "in", $0 @} @} @c endfile @@ -15481,7 +16751,7 @@ @end example There may not be subscripts for the start and index for every parenthesized -subexpression, since they may not all have matched text; thus they +subexpression, because they may not all have matched text; thus, they should be tested for with the @code{in} operator (@pxref{Reference to Elements}). @@ -15491,7 +16761,7 @@ (@pxref{Options}), using a third argument is a fatal error. -@item patsplit(@var{string}, @var{array} @r{[}, @var{fieldpat} @r{[}, @var{seps} @r{]} @r{]}) # +@item @code{patsplit(@var{string}, @var{array}} [@code{, @var{fieldpat}} [@code{, @var{seps}} ] ]@code{) #} @cindexgawkfunc{patsplit} @cindex split string into array Divide @@ -15512,18 +16782,12 @@ The @code{patsplit()} function splits strings into pieces in a manner similar to the way input lines are split into fields using @code{FPAT} -(@pxref{Splitting By Content}. +(@pxref{Splitting By Content}). Before splitting the string, @code{patsplit()} deletes any previously existing elements in the arrays @var{array} and @var{seps}. -@cindex troubleshooting, @code{patsplit()} function -The @code{patsplit()} function is a -@command{gawk} extension. In compatibility mode -(@pxref{Options}), -it is not available. - -@item split(@var{string}, @var{array} @r{[}, @var{fieldsep} @r{[}, @var{seps} @r{]} @r{]}) +@item @code{split(@var{string}, @var{array}} [@code{, @var{fieldsep}} [@code{, @var{seps}} ] ]@code{)} @cindexawkfunc{split} Divide @var{string} into pieces separated by @var{fieldsep} and store the pieces in @var{array} and the separator strings in the @@ -15531,19 +16795,18 @@ @code{@var{array}[1]}, the second piece in @code{@var{array}[2]}, and so forth. The string value of the third argument, @var{fieldsep}, is a regexp describing where to split @var{string} (much as @code{FS} can -be a regexp describing where to split input records; -@pxref{Regexp Field Splitting}). +be a regexp describing where to split input records). If @var{fieldsep} is omitted, the value of @code{FS} is used. @code{split()} returns the number of elements created. -@var{seps} is a @command{gawk} extension with @code{@var{seps}[@var{i}]} +@var{seps} is a @command{gawk} extension, with @code{@var{seps}[@var{i}]} being the separator string -between @code{@var{array}[@var{i}]} and @code{@var{array}[@var{i}+1]}. +between @code{@var{array}[@var{i}]} and @code{@var{array}[@var{i}+1]}. If @var{fieldsep} is a single -space then any leading whitespace goes into @code{@var{seps}[0]} and +space, then any leading whitespace goes into @code{@var{seps}[0]} and any trailing -whitespace goes into @code{@var{seps}[@var{n}]} where @var{n} is the -return value of -@code{split()} (that is, the number of elements in @var{array}). +whitespace goes into @code{@var{seps}[@var{n}]}, where @var{n} is the +return value of +@code{split()} (i.e., the number of elements in @var{array}). The @code{split()} function splits strings into pieces in a manner similar to the way input lines are split into fields. For example: @@ -15554,7 +16817,7 @@ @noindent @cindex strings splitting, example -splits the string @samp{cul-de-sac} into three fields using @samp{-} as the +splits the string @code{"cul-de-sac"} into three fields using @samp{-} as the separator. It sets the contents of the array @code{a} as follows: @example @@ -15579,21 +16842,20 @@ the elements of @var{array} but not in @var{seps}, and the elements are separated by runs of whitespace. -Also as with input field-splitting, if @var{fieldsep} is the null string, each +Also, as with input field splitting, if @var{fieldsep} is the null string, each individual character in the string is split into its own array element. @value{COMMONEXT} Note, however, that @code{RS} has no effect on the way @code{split()} -works. Even though @samp{RS = ""} causes newline to also be an input +works. Even though @samp{RS = ""} causes the newline character to also be an input field separator, this does not affect how @code{split()} splits strings. @cindex dark corner, @code{split()} function Modern implementations of @command{awk}, including @command{gawk}, allow -the third argument to be a regexp constant (@code{/abc/}) as well as a -string. -@value{DARKCORNER} +the third argument to be a regexp constant (@w{@code{/}@dots{}@code{/}}) +as well as a string. @value{DARKCORNER} The POSIX standard allows this as well. -@xref{Computed Regexps}, for a +@DBXREF{Computed Regexps} for a discussion of the difference between using a string constant or a regexp constant, and the implications for writing your program correctly. @@ -15608,7 +16870,9 @@ @var{array} has one element only. The value of that element is the original @var{string}. -@item sprintf(@var{format}, @var{expression1}, @dots{}) +In POSIX mode (@pxref{Options}), the fourth argument is not allowed. + +@item @code{sprintf(@var{format}, @var{expression1}, @dots{})} @cindexawkfunc{sprintf} @cindex formatting strings Return (without printing) the string that @code{printf} would @@ -15625,7 +16889,7 @@ @cindexgawkfunc{strtonum} @cindex convert string to number -@item strtonum(@var{str}) # +@item @code{strtonum(@var{str}) #} Examine @var{str} and return its numeric value. If @var{str} begins with a leading @samp{0}, @code{strtonum()} assumes that @var{str} is an octal number. If @var{str} begins with a leading @samp{0x} or @@ -15642,15 +16906,12 @@ to a string value; the automatic coercion of strings to numbers works only for decimal data, not for octal or hexadecimal.@footnote{Unless you use the @option{--non-decimal-data} option, which isn't recommended. -@xref{Nondecimal Data}, for more information.} +@DBXREF{Nondecimal Data} for more information.} Note also that @code{strtonum()} uses the current locale's decimal point for recognizing numbers (@pxref{Locales}). -@code{strtonum()} is a @command{gawk} extension; it is not available -in compatibility mode (@pxref{Options}). - -@item sub(@var{regexp}, @var{replacement} @r{[}, @var{target}@r{]}) +@item @code{sub(@var{regexp}, @var{replacement}} [@code{, @var{target}}]@code{)} @cindexawkfunc{sub} @cindex replace in string Search @var{target}, which is treated as a string, for the @@ -15661,9 +16922,9 @@ Return the number of substitutions made (zero or one). The @var{regexp} argument may be either a regexp constant -(@code{/@dots{}/}) or a string constant (@code{"@dots{}"}). +(@code{/}@dots{}@code{/}) or a string constant (@code{"}@dots{}@code{"}). In the latter case, the string is treated as a regexp to be matched. -@xref{Computed Regexps}, for a +@DBXREF{Computed Regexps} for a discussion of the difference between the two forms, and the implications for writing your program correctly. @@ -15729,7 +16990,7 @@ @cindex @code{sub()} function, arguments of @cindex @code{gsub()} function, arguments of As mentioned, the third argument to @code{sub()} must -be a variable, field or array element. +be a variable, field, or array element. Some versions of @command{awk} allow the third argument to be an expression that is not an lvalue. In such a case, @code{sub()} still searches for the pattern and returns zero or one, but the result of @@ -15751,7 +17012,7 @@ Finally, if the @var{regexp} is not a regexp constant, it is converted into a string, and then the value of that string is treated as the regexp to match. -@item substr(@var{string}, @var{start} @r{[}, @var{length}@r{]}) +@item @code{substr(@var{string}, @var{start}} [@code{, @var{length}} ]@code{)} @cindexawkfunc{substr} @cindex substring Return a @var{length}-character-long substring of @var{string}, @@ -15770,7 +17031,7 @@ @cindex Brian Kernighan's @command{awk} If @var{start} is less than one, @code{substr()} treats it as if it was one. (POSIX doesn't specify what to do in this case: -Brian Kernighan's @command{awk} acts this way, and therefore @command{gawk} +BWK @command{awk} acts this way, and therefore @command{gawk} does too.) If @var{start} is greater than the number of characters in the string, @code{substr()} returns the null string. @@ -15811,7 +17072,7 @@ @cindex case sensitivity, converting case @cindex strings, converting letter case -@item tolower(@var{string}) +@item @code{tolower(@var{string})} @cindexawkfunc{tolower} @cindex convert string to lower case Return a copy of @var{string}, with each uppercase character @@ -15819,7 +17080,7 @@ Nonalphabetic characters are left unchanged. For example, @code{tolower("MiXeD cAsE 123")} returns @code{"mixed case 123"}. -@item toupper(@var{string}) +@item @code{toupper(@var{string})} @cindexawkfunc{toupper} @cindex convert string to upper case Return a copy of @var{string}, with each lowercase character @@ -15828,8 +17089,28 @@ @code{toupper("MiXeD cAsE 123")} returns @code{"MIXED CASE 123"}. @end table +@sidebar Matching the Null String +@cindex matching, null strings +@cindex null strings, matching +@cindex @code{*} (asterisk), @code{*} operator, null strings@comma{} matching +@cindex asterisk (@code{*}), @code{*} operator, null strings@comma{} matching + +In @command{awk}, the @samp{*} operator can match the null string. +This is particularly important for the @code{sub()}, @code{gsub()}, +and @code{gensub()} functions. For example: + +@example +$ @kbd{echo abc | awk '@{ gsub(/m*/, "X"); print @}'} +@print{} XaXbXcX +@end example + +@noindent +Although this makes a certain amount of sense, it can be surprising. +@end sidebar + + @node Gory Details -@subsubsection More About @samp{\} and @samp{&} with @code{sub()}, @code{gsub()}, and @code{gensub()} +@subsubsection More about @samp{\} and @samp{&} with @code{sub()}, @code{gsub()}, and @code{gensub()} @cindex escape processing, @code{gsub()}/@code{gensub()}/@code{sub()} functions @cindex @code{sub()} function, escape processing @@ -15839,13 +17120,19 @@ @cindex backslash (@code{\}), @code{gsub()}/@code{gensub()}/@code{sub()} functions and @cindex @code{&} (ampersand), @code{gsub()}/@code{gensub()}/@code{sub()} functions and @cindex ampersand (@code{&}), @code{gsub()}/@code{gensub()}/@code{sub()} functions and + +@quotation CAUTION +This subsubsection has been reported to cause headaches. +You might want to skip it upon first reading. +@end quotation + When using @code{sub()}, @code{gsub()}, or @code{gensub()}, and trying to get literal backslashes and ampersands into the replacement text, you need to remember that there are several levels of @dfn{escape processing} going on. First, there is the @dfn{lexical} level, which is when @command{awk} reads your program -and builds an internal copy of it that can be executed. +and builds an internal copy of it to execute. Then there is the runtime level, which is when @command{awk} actually scans the replacement string to determine what to generate. @@ -15856,21 +17143,21 @@ Thus, for every @samp{\} that @command{awk} processes at the runtime level, you must type two backslashes at the lexical level. When a character that is not valid for an escape sequence follows the -@samp{\}, Brian Kernighan's @command{awk} and @command{gawk} both simply remove the initial +@samp{\}, BWK @command{awk} and @command{gawk} both simply remove the initial @samp{\} and put the next character into the string. Thus, for example, @code{"a\qb"} is treated as @code{"aqb"}. At the runtime level, the various functions handle sequences of @samp{\} and @samp{&} differently. The situation is (sadly) somewhat complex. -Historically, the @code{sub()} and @code{gsub()} functions treated the two -character sequence @samp{\&} specially; this sequence was replaced in +Historically, the @code{sub()} and @code{gsub()} functions treated the +two-character sequence @samp{\&} specially; this sequence was replaced in the generated text with a single @samp{&}. Any other @samp{\} within the @var{replacement} string that did not precede an @samp{&} was passed through unchanged. This is illustrated in @ref{table-sub-escapes}. @c Thank to Karl Berry for help with the TeX stuff. @float Table,table-sub-escapes -@caption{Historical Escape Sequence Processing for @code{sub()} and @code{gsub()}} +@caption{Historical escape sequence processing for @code{sub()} and @code{gsub()}} @tex \vbox{\bigskip % We need more characters for escape and tab ... @@ -15881,26 +17168,26 @@ _halign{_hfil#!_qquad_hfil#!_qquad#_hfil_cr You type!@code{sub()} sees!@code{sub()} generates_cr _hrulefill!_hrulefill!_hrulefill_cr - @code{\&}! @code{&}!the matched text_cr - @code{\\&}! @code{\&}!a literal @samp{&}_cr - @code{\\\&}! @code{\&}!a literal @samp{&}_cr - @code{\\\\&}! @code{\\&}!a literal @samp{\&}_cr - @code{\\\\\&}! @code{\\&}!a literal @samp{\&}_cr -@code{\\\\\\&}! @code{\\\&}!a literal @samp{\\&}_cr - @code{\\q}! @code{\q}!a literal @samp{\q}_cr + @code{\&}! @code{&}!The matched text_cr + @code{\\&}! @code{\&}!A literal @samp{&}_cr + @code{\\\&}! @code{\&}!A literal @samp{&}_cr + @code{\\\\&}! @code{\\&}!A literal @samp{\&}_cr + @code{\\\\\&}! @code{\\&}!A literal @samp{\&}_cr +@code{\\\\\\&}! @code{\\\&}!A literal @samp{\\&}_cr + @code{\\q}! @code{\q}!A literal @samp{\q}_cr } _bigskip} @end tex @ifdocbook @multitable @columnfractions .20 .20 .60 @headitem You type @tab @code{sub()} sees @tab @code{sub()} generates -@item @code{\&} @tab @code{&} @tab the matched text -@item @code{\\&} @tab @code{\&} @tab a literal @samp{&} -@item @code{\\\&} @tab @code{\&} @tab a literal @samp{&} -@item @code{\\\\&} @tab @code{\\&} @tab a literal @samp{\&} -@item @code{\\\\\&} @tab @code{\\&} @tab a literal @samp{\&} -@item @code{\\\\\\&} @tab @code{\\\&} @tab a literal @samp{\\&} -@item @code{\\q} @tab @code{\q} @tab a literal @samp{\q} +@item @code{\&} @tab @code{&} @tab The matched text +@item @code{\\&} @tab @code{\&} @tab A literal @samp{&} +@item @code{\\\&} @tab @code{\&} @tab A literal @samp{&} +@item @code{\\\\&} @tab @code{\\&} @tab A literal @samp{\&} +@item @code{\\\\\&} @tab @code{\\&} @tab A literal @samp{\&} +@item @code{\\\\\\&} @tab @code{\\\&} @tab A literal @samp{\\&} +@item @code{\\q} @tab @code{\q} @tab A literal @samp{\q} @end multitable @end ifdocbook @ifnottex @@ -15908,20 +17195,20 @@ @display You type @code{sub()} sees @code{sub()} generates -------- ---------- --------------- - @code{\&} @code{&} the matched text - @code{\\&} @code{\&} a literal @samp{&} - @code{\\\&} @code{\&} a literal @samp{&} - @code{\\\\&} @code{\\&} a literal @samp{\&} - @code{\\\\\&} @code{\\&} a literal @samp{\&} -@code{\\\\\\&} @code{\\\&} a literal @samp{\\&} - @code{\\q} @code{\q} a literal @samp{\q} + @code{\&} @code{&} The matched text + @code{\\&} @code{\&} A literal @samp{&} + @code{\\\&} @code{\&} A literal @samp{&} + @code{\\\\&} @code{\\&} A literal @samp{\&} + @code{\\\\\&} @code{\\&} A literal @samp{\&} +@code{\\\\\\&} @code{\\\&} A literal @samp{\\&} + @code{\\q} @code{\q} A literal @samp{\q} @end display @end ifnotdocbook @end ifnottex @end float @noindent -This table shows both the lexical-level processing, where +This table shows the lexical-level processing, where an odd number of backslashes becomes an even number at the runtime level, as well as the runtime processing done by @code{sub()}. (For the sake of simplicity, the rest of the following tables only show the @@ -15930,86 +17217,19 @@ The problem with the historical approach is that there is no way to get a literal @samp{\} followed by the matched text. -@c @cindex @command{awk} language, POSIX version -@cindex POSIX @command{awk}, functions and, @code{gsub()}/@code{sub()} -The 1992 POSIX standard attempted to fix this problem. That standard -says that @code{sub()} and @code{gsub()} look for either a @samp{\} or an @samp{&} -after the @samp{\}. If either one follows a @samp{\}, that character is -output literally. The interpretation of @samp{\} and @samp{&} then becomes -as shown in @ref{table-sub-posix-92}. - -@float Table,table-sub-posix-92 -@caption{1992 POSIX Rules for @code{sub()} and @code{gsub()} Escape Sequence Processing} -@c thanks to Karl Berry for formatting this table -@tex -\vbox{\bigskip -% We need more characters for escape and tab ... -\catcode`_ = 0 -\catcode`! = 4 -% ... since this table has lots of &'s and \'s, so we unspecialize them. -\catcode`\& = \other \catcode`\\ = \other -_halign{_hfil#!_qquad_hfil#!_qquad#_hfil_cr - You type!@code{sub()} sees!@code{sub()} generates_cr -_hrulefill!_hrulefill!_hrulefill_cr - @code{&}! @code{&}!the matched text_cr - @code{\\&}! @code{\&}!a literal @samp{&}_cr -@code{\\\\&}! @code{\\&}!a literal @samp{\}, then the matched text_cr -@code{\\\\\\&}! @code{\\\&}!a literal @samp{\&}_cr -} -_bigskip} -@end tex -@ifdocbook -@multitable @columnfractions .20 .20 .60 -@headitem You type @tab @code{sub()} sees @tab @code{sub()} generates -@item @code{&} @tab @code{&} @tab the matched text -@item @code{\\&} @tab @code{\&} @tab a literal @samp{&} -@item @code{\\\\&} @tab @code{\\&} @tab a literal @samp{\}, then the matched text -@item @code{\\\\\\&} @tab @code{\\\&} @tab a literal @samp{\&} -@end multitable -@end ifdocbook -@ifnottex -@ifnotdocbook -@display - You type @code{sub()} sees @code{sub()} generates - -------- ---------- --------------- - @code{&} @code{&} the matched text - @code{\\&} @code{\&} a literal @samp{&} - @code{\\\\&} @code{\\&} a literal @samp{\}, then the matched text -@code{\\\\\\&} @code{\\\&} a literal @samp{\&} -@end display -@end ifnotdocbook -@end ifnottex -@end float - -@noindent -This appears to solve the problem. -Unfortunately, the phrasing of the standard is unusual. It -says, in effect, that @samp{\} turns off the special meaning of any -following character, but for anything other than @samp{\} and @samp{&}, -such special meaning is undefined. This wording leads to two problems: - -@itemize @bullet -@item -Backslashes must now be doubled in the @var{replacement} string, breaking -historical @command{awk} programs. - -@item -To make sure that an @command{awk} program is portable, @emph{every} character -in the @var{replacement} string must be preceded with a -backslash.@footnote{This consequence was certainly unintended.} -@c I can say that, 'cause I was involved in making this change -@end itemize +Several editions of the POSIX standard attempted to fix this problem +but weren't successful. The details are irrelevant at this point in time. -Because of the problems just listed, -in 1996, the @command{gawk} maintainer submitted +At one point, the @command{gawk} maintainer submitted proposed text for a revised standard that reverts to rules that correspond more closely to the original existing practice. The proposed rules have special cases that make it possible -to produce a @samp{\} preceding the matched text. This is shown in +to produce a @samp{\} preceding the matched text. +This is shown in @ref{table-sub-proposed}. @float Table,table-sub-proposed -@caption{Proposed Rules For @code{sub()} And Backslash} +@caption{@command{gawk} rules for @code{sub()} and backslash} @tex \vbox{\bigskip % We need more characters for escape and tab ... @@ -16020,10 +17240,10 @@ _halign{_hfil#!_qquad_hfil#!_qquad#_hfil_cr You type!@code{sub()} sees!@code{sub()} generates_cr _hrulefill!_hrulefill!_hrulefill_cr -@code{\\\\\\&}! @code{\\\&}!a literal @samp{\&}_cr -@code{\\\\&}! @code{\\&}!a literal @samp{\}, followed by the matched text_cr - @code{\\&}! @code{\&}!a literal @samp{&}_cr - @code{\\q}! @code{\q}!a literal @samp{\q}_cr +@code{\\\\\\&}! @code{\\\&}!A literal @samp{\&}_cr +@code{\\\\&}! @code{\\&}!A literal @samp{\}, followed by the matched text_cr + @code{\\&}! @code{\&}!A literal @samp{&}_cr + @code{\\q}! @code{\q}!A literal @samp{\q}_cr @code{\\\\}! @code{\\}!@code{\\}_cr } _bigskip} @@ -16031,10 +17251,10 @@ @ifdocbook @multitable @columnfractions .20 .20 .60 @headitem You type @tab @code{sub()} sees @tab @code{sub()} generates -@item @code{\\\\\\&} @tab @code{\\\&} @tab a literal @samp{\&} -@item @code{\\\\&} @tab @code{\\&} @tab a literal @samp{\}, followed by the matched text -@item @code{\\&} @tab @code{\&} @tab a literal @samp{&} -@item @code{\\q} @tab @code{\q} @tab a literal @samp{\q} +@item @code{\\\\\\&} @tab @code{\\\&} @tab A literal @samp{\&} +@item @code{\\\\&} @tab @code{\\&} @tab A literal @samp{\}, followed by the matched text +@item @code{\\&} @tab @code{\&} @tab A literal @samp{&} +@item @code{\\q} @tab @code{\q} @tab A literal @samp{\q} @item @code{\\\\} @tab @code{\\} @tab @code{\\} @end multitable @end ifdocbook @@ -16043,10 +17263,10 @@ @display You type @code{sub()} sees @code{sub()} generates -------- ---------- --------------- -@code{\\\\\\&} @code{\\\&} a literal @samp{\&} - @code{\\\\&} @code{\\&} a literal @samp{\}, followed by the matched text - @code{\\&} @code{\&} a literal @samp{&} - @code{\\q} @code{\q} a literal @samp{\q} +@code{\\\\\\&} @code{\\\&} A literal @samp{\&} + @code{\\\\&} @code{\\&} A literal @samp{\}, followed by the matched text + @code{\\&} @code{\&} A literal @samp{&} + @code{\\q} @code{\q} A literal @samp{\q} @code{\\\\} @code{\\} @code{\\} @end display @end ifnotdocbook @@ -16054,25 +17274,25 @@ @end float In a nutshell, at the runtime level, there are now three special sequences -of characters (@samp{\\\&}, @samp{\\&} and @samp{\&}) whereas historically +of characters (@samp{\\\&}, @samp{\\&}, and @samp{\&}) whereas historically there was only one. However, as in the historical case, any @samp{\} that is not part of one of these three sequences is not special and appears in the output literally. -@command{gawk} 3.0 and 3.1 follow these proposed POSIX rules for @code{sub()} and -@code{gsub()}. -@c As much as we think it's a lousy idea. You win some, you lose some. Sigh. -The POSIX standard took much longer to be revised than was expected in 1996. -The 2001 standard does not follow the above rules. Instead, the rules -there are somewhat simpler. The results are similar except for one case. +@command{gawk} 3.0 and 3.1 follow these rules for @code{sub()} and +@code{gsub()}. The POSIX standard took much longer to be revised than +was expected. In addition, the @command{gawk} maintainer's proposal was +lost during the standardization process. The final rules are +somewhat simpler. The results are similar except for one case. +@cindex POSIX @command{awk}, functions and, @code{gsub()}/@code{sub()} The POSIX rules state that @samp{\&} in the replacement string produces a literal @samp{&}, @samp{\\} produces a literal @samp{\}, and @samp{\} followed by anything else is not special; the @samp{\} is placed straight into the output. These rules are presented in @ref{table-posix-sub}. @float Table,table-posix-sub -@caption{POSIX Rules For @code{sub()} And @code{gsub()}} +@caption{POSIX rules for @code{sub()} and @code{gsub()}} @tex \vbox{\bigskip % We need more characters for escape and tab ... @@ -16083,10 +17303,10 @@ _halign{_hfil#!_qquad_hfil#!_qquad#_hfil_cr You type!@code{sub()} sees!@code{sub()} generates_cr _hrulefill!_hrulefill!_hrulefill_cr -@code{\\\\\\&}! @code{\\\&}!a literal @samp{\&}_cr -@code{\\\\&}! @code{\\&}!a literal @samp{\}, followed by the matched text_cr - @code{\\&}! @code{\&}!a literal @samp{&}_cr - @code{\\q}! @code{\q}!a literal @samp{\q}_cr +@code{\\\\\\&}! @code{\\\&}!A literal @samp{\&}_cr +@code{\\\\&}! @code{\\&}!A literal @samp{\}, followed by the matched text_cr + @code{\\&}! @code{\&}!A literal @samp{&}_cr + @code{\\q}! @code{\q}!A literal @samp{\q}_cr @code{\\\\}! @code{\\}!@code{\}_cr } _bigskip} @@ -16094,10 +17314,10 @@ @ifdocbook @multitable @columnfractions .20 .20 .60 @headitem You type @tab @code{sub()} sees @tab @code{sub()} generates -@item @code{\\\\\\&} @tab @code{\\\&} @tab a literal @samp{\&} -@item @code{\\\\&} @tab @code{\\&} @tab a literal @samp{\}, followed by the matched text -@item @code{\\&} @tab @code{\&} @tab a literal @samp{&} -@item @code{\\q} @tab @code{\q} @tab a literal @samp{\q} +@item @code{\\\\\\&} @tab @code{\\\&} @tab A literal @samp{\&} +@item @code{\\\\&} @tab @code{\\&} @tab A literal @samp{\}, followed by the matched text +@item @code{\\&} @tab @code{\&} @tab A literal @samp{&} +@item @code{\\q} @tab @code{\q} @tab A literal @samp{\q} @item @code{\\\\} @tab @code{\\} @tab @code{\} @end multitable @end ifdocbook @@ -16106,10 +17326,10 @@ @display You type @code{sub()} sees @code{sub()} generates -------- ---------- --------------- -@code{\\\\\\&} @code{\\\&} a literal @samp{\&} - @code{\\\\&} @code{\\&} a literal @samp{\}, followed by the matched text - @code{\\&} @code{\&} a literal @samp{&} - @code{\\q} @code{\q} a literal @samp{\q} +@code{\\\\\\&} @code{\\\&} A literal @samp{\&} + @code{\\\\&} @code{\\&} A literal @samp{\}, followed by the matched text + @code{\\&} @code{\&} A literal @samp{&} + @code{\\q} @code{\q} A literal @samp{\q} @code{\\\\} @code{\\} @code{\} @end display @end ifnotdocbook @@ -16119,17 +17339,17 @@ The only case where the difference is noticeable is the last one: @samp{\\\\} is seen as @samp{\\} and produces @samp{\} instead of @samp{\\}. -Starting with version 3.1.4, @command{gawk} followed the POSIX rules -when @option{--posix} is specified (@pxref{Options}). Otherwise, -it continued to follow the 1996 proposed rules, since +Starting with @value{PVERSION} 3.1.4, @command{gawk} followed the POSIX rules +when @option{--posix} was specified (@pxref{Options}). Otherwise, +it continued to follow the proposed rules, as that had been its behavior for many years. -When version 4.0.0 was released, the @command{gawk} maintainer +When @value{PVERSION} 4.0.0 was released, the @command{gawk} maintainer made the POSIX rules the default, breaking well over a decade's worth -of backwards compatibility.@footnote{This was rather naive of him, despite +of backward compatibility.@footnote{This was rather naive of him, despite there being a note in this section indicating that the next major version would move to the POSIX rules.} Needless to say, this was a bad idea, -and as of version 4.0.1, @command{gawk} resumed its historical +and as of @value{PVERSION} 4.0.1, @command{gawk} resumed its historical behavior, and only follows the POSIX rules when @option{--posix} is given. The rules for @code{gensub()} are considerably simpler. At the runtime @@ -16141,7 +17361,7 @@ as shown in @ref{table-gensub-escapes}. @float Table,table-gensub-escapes -@caption{Escape Sequence Processing For @code{gensub()}} +@caption{Escape sequence processing for @code{gensub()}} @tex \vbox{\bigskip % We need more characters for escape and tab ... @@ -16152,24 +17372,24 @@ _halign{_hfil#!_qquad_hfil#!_qquad#_hfil_cr You type!@code{gensub()} sees!@code{gensub()} generates_cr _hrulefill!_hrulefill!_hrulefill_cr - @code{&}! @code{&}!the matched text_cr - @code{\\&}! @code{\&}!a literal @samp{&}_cr - @code{\\\\}! @code{\\}!a literal @samp{\}_cr - @code{\\\\&}! @code{\\&}!a literal @samp{\}, then the matched text_cr -@code{\\\\\\&}! @code{\\\&}!a literal @samp{\&}_cr - @code{\\q}! @code{\q}!a literal @samp{q}_cr + @code{&}! @code{&}!The matched text_cr + @code{\\&}! @code{\&}!A literal @samp{&}_cr + @code{\\\\}! @code{\\}!A literal @samp{\}_cr + @code{\\\\&}! @code{\\&}!A literal @samp{\}, then the matched text_cr +@code{\\\\\\&}! @code{\\\&}!A literal @samp{\&}_cr + @code{\\q}! @code{\q}!A literal @samp{q}_cr } _bigskip} @end tex @ifdocbook @multitable @columnfractions .20 .20 .60 @headitem You type @tab @code{gensub()} sees @tab @code{gensub()} generates -@item @code{&} @tab @code{&} @tab the matched text -@item @code{\\&} @tab @code{\&} @tab a literal @samp{&} -@item @code{\\\\} @tab @code{\\} @tab a literal @samp{\} -@item @code{\\\\&} @tab @code{\\&} @tab a literal @samp{\}, then the matched text -@item @code{\\\\\\&} @tab @code{\\\&} @tab a literal @samp{\&} -@item @code{\\q} @tab @code{\q} @tab a literal @samp{q} +@item @code{&} @tab @code{&} @tab The matched text +@item @code{\\&} @tab @code{\&} @tab A literal @samp{&} +@item @code{\\\\} @tab @code{\\} @tab A literal @samp{\} +@item @code{\\\\&} @tab @code{\\&} @tab A literal @samp{\}, then the matched text +@item @code{\\\\\\&} @tab @code{\\\&} @tab A literal @samp{\&} +@item @code{\\q} @tab @code{\q} @tab A literal @samp{q} @end multitable @end ifdocbook @ifnottex @@ -16177,41 +17397,22 @@ @display You type @code{gensub()} sees @code{gensub()} generates -------- ------------- ------------------ - @code{&} @code{&} the matched text - @code{\\&} @code{\&} a literal @samp{&} - @code{\\\\} @code{\\} a literal @samp{\} - @code{\\\\&} @code{\\&} a literal @samp{\}, then the matched text -@code{\\\\\\&} @code{\\\&} a literal @samp{\&} - @code{\\q} @code{\q} a literal @samp{q} + @code{&} @code{&} The matched text + @code{\\&} @code{\&} A literal @samp{&} + @code{\\\\} @code{\\} A literal @samp{\} + @code{\\\\&} @code{\\&} A literal @samp{\}, then the matched text +@code{\\\\\\&} @code{\\\&} A literal @samp{\&} + @code{\\q} @code{\q} A literal @samp{q} @end display @end ifnotdocbook @end ifnottex @end float -Because of the complexity of the lexical and runtime level processing +Because of the complexity of the lexical- and runtime-level processing and the special cases for @code{sub()} and @code{gsub()}, we recommend the use of @command{gawk} and @code{gensub()} when you have to do substitutions. -@sidebar Matching the Null String -@cindex matching, null strings -@cindex null strings, matching -@cindex @code{*} (asterisk), @code{*} operator, null strings@comma{} matching -@cindex asterisk (@code{*}), @code{*} operator, null strings@comma{} matching - -In @command{awk}, the @samp{*} operator can match the null string. -This is particularly important for the @code{sub()}, @code{gsub()}, -and @code{gensub()} functions. For example: - -@example -$ @kbd{echo abc | awk '@{ gsub(/m*/, "X"); print @}'} -@print{} XaXbXcX -@end example - -@noindent -Although this makes a certain amount of sense, it can be surprising. -@end sidebar - @node I/O Functions @subsection Input/Output Functions @cindex input/output functions @@ -16219,27 +17420,31 @@ The following functions relate to input/output (I/O). Optional parameters are enclosed in square brackets ([ ]): -@table @code -@item close(@var{filename} @r{[}, @var{how}@r{]}) +@table @asis +@item @code{close(}@var{filename} [@code{,} @var{how}]@code{)} @cindexawkfunc{close} @cindex files, closing @cindex close file or coprocess Close the file @var{filename} for input or output. Alternatively, the argument may be a shell command that was used for creating a coprocess, or for redirecting to or from a pipe; then the coprocess or pipe is closed. -@xref{Close Files And Pipes}, +@DBXREF{Close Files And Pipes} for more information. When closing a coprocess, it is occasionally useful to first close one end of the two-way pipe and then to close the other. This is done by providing a second argument to @code{close()}. This second argument +(@var{how}) should be one of the two string values @code{"to"} or @code{"from"}, indicating which end of the pipe to close. Case in the string does not matter. @xref{Two-way I/O}, which discusses this feature in more detail and gives an example. -@item fflush(@r{[}@var{filename}@r{]}) +Note that the second argument to @code{close()} is a @command{gawk} +extension; it is not available in compatibility mode (@pxref{Options}). + +@item @code{fflush(}[@var{filename}]@code{)} @cindexawkfunc{fflush} @cindex flush buffered output Flush any buffered output associated with @var{filename}, which is either a @@ -16248,37 +17453,36 @@ @cindex buffers, flushing @cindex output, buffering -Many utility programs @dfn{buffer} their output; i.e., they save information +Many utility programs @dfn{buffer} their output (i.e., they save information to write to a disk file or the screen in memory until there is enough -for it to be worthwhile to send the data to the output device. +for it to be worthwhile to send the data to the output device). This is often more efficient than writing every little bit of information as soon as it is ready. However, sometimes -it is necessary to force a program to @dfn{flush} its buffers; that is, -write the information to its destination, even if a buffer is not full. +it is necessary to force a program to @dfn{flush} its buffers (i.e., +write the information to its destination, even if a buffer is not full). This is the purpose of the @code{fflush()} function---@command{gawk} also -buffers its output and the @code{fflush()} function forces +buffers its output, and the @code{fflush()} function forces @command{gawk} to flush its buffers. @cindex extensions, common@comma{} @code{fflush()} function @cindex Brian Kernighan's @command{awk} -@code{fflush()} was added to Brian Kernighan's version of @command{awk} in -April of 1992. For two decades, it was not part of the POSIX standard. -As of December, 2012, it was accepted for inclusion into the POSIX -standard. +Brian Kernighan added @code{fflush()} to his @command{awk} in April +1992. For two decades, it was a common extension. In December +2012, it was accepted for inclusion into the POSIX standard. See @uref{http://austingroupbugs.net/view.php?id=634, the Austin Group website}. -POSIX standardizes @code{fflush()} as follows: If there +POSIX standardizes @code{fflush()} as follows: if there is no argument, or if the argument is the null string (@w{@code{""}}), then @command{awk} flushes the buffers for @emph{all} open output files and pipes. @quotation NOTE -Prior to version 4.0.2, @command{gawk} +Prior to @value{PVERSION} 4.0.2, @command{gawk} would flush only the standard output if there was no argument, and flush all output files and pipes if the argument was the null string. This was changed in order to be compatible with Brian Kernighan's @command{awk}, in the hope that standardizing this -feature in POSIX would then be easier (which indeed helped). +feature in POSIX would then be easier (which indeed proved to be the case). With @command{gawk}, you can use @samp{fflush("/dev/stdout")} if you wish to flush @@ -16289,7 +17493,7 @@ @c @cindex warnings, automatic @cindex troubleshooting, @code{fflush()} function @code{fflush()} returns zero if the buffer is successfully flushed; -otherwise, it returns non-zero (@command{gawk} returns @minus{}1). +otherwise, it returns a nonzero value. (@command{gawk} returns @minus{}1.) In the case where all buffers are flushed, the return value is zero only if all buffers were flushed successfully. Otherwise, it is @minus{}1, and @command{gawk} warns about the problem @var{filename}. @@ -16299,11 +17503,54 @@ or if @var{filename} is not an open file, pipe, or coprocess. In such a case, @code{fflush()} returns @minus{}1, as well. -@item system(@var{command}) +@sidebar Interactive Versus Noninteractive Buffering +@cindex buffering, interactive vs.@: noninteractive + +As a side point, buffering issues can be even more confusing if +your program is @dfn{interactive} (i.e., communicating +with a user sitting at a keyboard).@footnote{A program is interactive +if the standard output is connected to a terminal device. On modern +systems, this means your keyboard and screen.} + +@c Thanks to Walter.Mecky@dresdnerbank.de for this example, and for +@c motivating me to write this section. +Interactive programs generally @dfn{line buffer} their output (i.e., they +write out every line). Noninteractive programs wait until they have +a full buffer, which may be many lines of output. +Here is an example of the difference: + +@example +$ @kbd{awk '@{ print $1 + $2 @}'} +@kbd{1 1} +@print{} 2 +@kbd{2 3} +@print{} 5 +@kbd{Ctrl-d} +@end example + +@noindent +Each line of output is printed immediately. Compare that behavior +with this example: + +@example +$ @kbd{awk '@{ print $1 + $2 @}' | cat} +@kbd{1 1} +@kbd{2 3} +@kbd{Ctrl-d} +@print{} 2 +@print{} 5 +@end example + +@noindent +Here, no output is printed until after the @kbd{Ctrl-d} is typed, because +it is all buffered and sent down the pipe to @command{cat} in one shot. +@end sidebar + +@item @code{system(@var{command})} @cindexawkfunc{system} @cindex invoke shell command @cindex interacting with other programs -Execute the operating-system +Execute the operating system command @var{command} and then return to the @command{awk} program. Return @var{command}'s exit status. @@ -16346,49 +17593,6 @@ @end table -@sidebar Interactive Versus Noninteractive Buffering -@cindex buffering, interactive vs.@: noninteractive - -As a side point, buffering issues can be even more confusing, depending -upon whether your program is @dfn{interactive}, i.e., communicating -with a user sitting at a keyboard.@footnote{A program is interactive -if the standard output is connected to a terminal device. On modern -systems, this means your keyboard and screen.} - -@c Thanks to Walter.Mecky@dresdnerbank.de for this example, and for -@c motivating me to write this section. -Interactive programs generally @dfn{line buffer} their output; i.e., they -write out every line. Noninteractive programs wait until they have -a full buffer, which may be many lines of output. -Here is an example of the difference: - -@example -$ @kbd{awk '@{ print $1 + $2 @}'} -@kbd{1 1} -@print{} 2 -@kbd{2 3} -@print{} 5 -@kbd{Ctrl-d} -@end example - -@noindent -Each line of output is printed immediately. Compare that behavior -with this example: - -@example -$ @kbd{awk '@{ print $1 + $2 @}' | cat} -@kbd{1 1} -@kbd{2 3} -@kbd{Ctrl-d} -@print{} 2 -@print{} 5 -@end example - -@noindent -Here, no output is printed until after the @kbd{Ctrl-d} is typed, because -it is all buffered and sent down the pipe to @command{cat} in one shot. -@end sidebar - @sidebar Controlling Output Buffering with @code{system()} @cindex buffers, flushing @cindex buffering, input/output @@ -16407,7 +17611,7 @@ @command{gawk} treats this use of the @code{system()} function as a special case and is smart enough not to run a shell (or other command interpreter) with the empty command. Therefore, with @command{gawk}, this -idiom is not only useful, it is also efficient. While this method should work +idiom is not only useful, it is also efficient. Although this method should work with other @command{awk} implementations, it does not necessarily avoid starting an unnecessary shell. (Other implementations may only flush the buffer associated with the standard output and not necessarily @@ -16450,23 +17654,24 @@ @subsection Time Functions @cindex time functions -@c STARTOFRANGE tst @cindex timestamps -@c STARTOFRANGE logftst @cindex log files, timestamps in -@c STARTOFRANGE filogtst @cindex files, log@comma{} timestamps in -@c STARTOFRANGE gawtst @cindex @command{gawk}, timestamps @cindex POSIX @command{awk}, timestamps and -@code{awk} programs are commonly used to process log files +@command{awk} programs are commonly used to process log files containing timestamp information, indicating when a -particular log record was written. Many programs log their timestamp +particular log record was written. Many programs log their timestamps in the form returned by the @code{time()} system call, which is the number of seconds since a particular epoch. On POSIX-compliant systems, it is the number of seconds since -1970-01-01 00:00:00 UTC, not counting leap seconds.@footnote{@xref{Glossary}, -especially the entries ``Epoch'' and ``UTC.''} +1970-01-01 00:00:00 UTC, not counting leap +@ifclear FOR_PRINT +seconds.@footnote{@xref{Glossary}, especially the entries ``Epoch'' and ``UTC.''} +@end ifclear +@ifset FOR_PRINT +seconds. +@end ifset All known POSIX-compliant systems support timestamps from 0 through @iftex @math{2^{31} - 1}, @@ -16483,6 +17688,7 @@ 2038-01-19 03:14:07 UTC. Many systems support a wider range of timestamps, including negative timestamps that represent times before the epoch. +@c FIXME: Use @sup here for superscript @cindex @command{date} utility, GNU @cindex time, retrieving @@ -16496,8 +17702,9 @@ of @command{mawk} (@pxref{Other Versions}) also support these functions. Optional parameters are enclosed in square brackets ([ ]): -@table @code -@item mktime(@var{datespec}) +@c @asis for docbook +@table @asis +@item @code{mktime(@var{datespec})} @cindexgawkfunc{mktime} @cindex generate time values Turn @var{datespec} into a timestamp in the same form @@ -16516,7 +17723,7 @@ for example, an hour of @minus{}1 means 1 hour before midnight. The origin-zero Gregorian calendar is assumed, with year 0 preceding year 1 and year @minus{}1 preceding year 0. -The time is assumed to be in the local timezone. +The time is assumed to be in the local time zone. If the daylight-savings flag is positive, the time is assumed to be daylight savings time; if zero, the time is assumed to be standard time; and if negative (the default), @code{mktime()} attempts to determine @@ -16527,8 +17734,7 @@ @cindex @command{gawk}, @code{PROCINFO} array in @cindex @code{PROCINFO} array -@item strftime(@r{[}@var{format} @r{[}, @var{timestamp} @r{[}, @var{utc-flag}@r{]]]}) -@c STARTOFRANGE strf +@item @code{strftime(}[@var{format} [@code{,} @var{timestamp} [@code{,} @var{utc-flag}] ] ]@code{)} @cindexgawkfunc{strftime} @cindex format time string Format the time specified by @var{timestamp} @@ -16540,16 +17746,16 @@ The @var{timestamp} is in the same format as the value returned by the @code{systime()} function. If no @var{timestamp} argument is supplied, @command{gawk} uses the current time of day as the timestamp. -If no @var{format} argument is supplied, @code{strftime()} uses +Without a @var{format} argument, @code{strftime()} uses the value of @code{PROCINFO["strftime"]} as the format string (@pxref{Built-in Variables}). The default string value is @code{@w{"%a %b %e %H:%M:%S %Z %Y"}}. This format string produces output that is equivalent to that of the @command{date} utility. You can assign a new value to @code{PROCINFO["strftime"]} to -change the default format; see below for the various format directives. +change the default format; see the following list for the various format directives. -@item systime() +@item @code{systime()} @cindexgawkfunc{systime} @cindex timestamps @cindex current system time @@ -16624,10 +17830,10 @@ @item %g The year modulo 100 of the ISO 8601 week number, as a decimal number (00--99). -For example, January 1, 1993 is in week 53 of 1992. Thus, the year -of its ISO 8601 week number is 1992, even though its year is 1993. -Similarly, December 31, 1973 is in week 1 of 1974. Thus, the year -of its ISO week number is 1974, even though its year is 1973. +For example, January 1, 2012, is in week 53 of 2011. Thus, the year +of its ISO 8601 week number is 2011, even though its year is 2012. +Similarly, December 31, 2012, is in week 1 of 2013. Thus, the year +of its ISO week number is 2013, even though its year is 2012. @item %G The full year of the ISO week number, as a decimal number. @@ -16677,12 +17883,12 @@ The weekday as a decimal number (1--7). Monday is day one. @item %U -The week number of the year (the first Sunday as the first day of week one) +The week number of the year (with the first Sunday as the first day of week one) as a decimal number (00--53). @c @cindex ISO 8601 @item %V -The week number of the year (the first Monday as the first +The week number of the year (with the first Monday as the first day of week one) as a decimal number (01--53). The method for determining the week number is as specified by ISO 8601. (To wit: if the week containing January 1 has four or more days in the @@ -16693,7 +17899,7 @@ The weekday as a decimal number (0--6). Sunday is day zero. @item %W -The week number of the year (the first Monday as the first day of week one) +The week number of the year (with the first Monday as the first day of week one) as a decimal number (00--53). @item %x @@ -16708,13 +17914,13 @@ The year modulo 100 as a decimal number (00--99). @item %Y -The full year as a decimal number (e.g., 2011). +The full year as a decimal number (e.g., 2015). @c @cindex RFC 822 @c @cindex RFC 1036 @item %z -The timezone offset in a +HHMM format (e.g., the format necessary to -produce RFC 822/RFC 1036 date headers). +The time zone offset in a @samp{+@var{HHMM}} format (e.g., the format +necessary to produce RFC 822/RFC 1036 date headers). @item %Z The time zone name or abbreviation; no characters if @@ -16722,7 +17928,7 @@ @item %Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH @itemx %OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy -``Alternate representations'' for the specifications +``Alternative representations'' for the specifications that use only the second letter (@samp{%c}, @samp{%C}, and so on).@footnote{If you don't understand any of this, don't worry about it; these facilities are meant to make it easier to ``internationalize'' @@ -16735,24 +17941,13 @@ A literal @samp{%}. @end table -If a conversion specifier is not one of the above, the behavior is +If a conversion specifier is not one of those just listed, the behavior is undefined.@footnote{This is because ISO C leaves the behavior of the C version of @code{strftime()} undefined and @command{gawk} uses the system's version of @code{strftime()} if it's there. Typically, the conversion specifier either does not appear in the returned string or appears literally.} -@c @cindex locale, definition of -Informally, a @dfn{locale} is the geographic place in which a program -is meant to run. For example, a common way to abbreviate the date -September 4, 2012 in the United States is ``9/4/12.'' -In many countries in Europe, however, it is abbreviated ``4.9.12.'' -Thus, the @samp{%x} specification in a @code{"US"} locale might produce -@samp{9/4/12}, while in a @code{"EUROPE"} locale, it might produce -@samp{4.9.12}. The ISO C standard defines a default @code{"C"} -locale, which is an environment that is typical of what many C programmers -are used to. - For systems that are not yet fully standards-compliant, @command{gawk} supplies a copy of @code{strftime()} from the GNU C Library. @@ -16773,11 +17968,11 @@ @ignore @item %N The ``Emperor/Era'' name. -Equivalent to @code{%C}. +Equivalent to @samp{%C}. @item %o The ``Emperor/Era'' year. -Equivalent to @code{%y}. +Equivalent to @samp{%y}. @end ignore @item %s @@ -16788,9 +17983,8 @@ The date in VMS format (e.g., @samp{20-JUN-1991}). @end ignore @end table -@c ENDOFRANGE strf -Additionally, the alternate representations are recognized but their +Additionally, the alternative representations are recognized but their normal representations are used. @cindex @code{date} utility, POSIX @@ -16804,8 +17998,8 @@ the string. For example: @example -$ date '+Today is %A, %B %d, %Y.' -@print{} Today is Wednesday, March 30, 2011. +$ @kbd{date '+Today is %A, %B %d, %Y.'} +@print{} Today is Monday, September 22, 2014. @end example Here is the @command{gawk} version of the @command{date} utility. @@ -16825,7 +18019,7 @@ esac gawk 'BEGIN @{ - format = "%a %b %e %H:%M:%S %Z %Y" + format = PROCINFO["strftime"] exitval = 0 if (ARGC > 2) @@ -16839,23 +18033,14 @@ exit exitval @}' "$@@" @end example -@c ENDOFRANGE tst -@c ENDOFRANGE logftst -@c ENDOFRANGE filogtst -@c ENDOFRANGE gawtst @node Bitwise Functions @subsection Bit-Manipulation Functions @cindex bit-manipulation functions -@c STARTOFRANGE bit @cindex bitwise, operations -@c STARTOFRANGE and @cindex AND bitwise operation -@c STARTOFRANGE oro @cindex OR bitwise operation -@c STARTOFRANGE xor @cindex XOR bitwise operation -@c STARTOFRANGE opbit @cindex operations, bitwise @quotation @i{I can explain it for you, but I can't understand it for you.} @@ -16868,12 +18053,14 @@ Three common operations are bitwise AND, OR, and XOR. The operations are described in @ref{table-bitwise-ops}. +@c 11/2014: Postprocessing turns the docbook informaltable +@c into a table. Hurray for scripting! @float Table,table-bitwise-ops -@caption{Bitwise Operations} +@caption{Bitwise operations} @ifnottex @ifnotdocbook @display - Bit Operator + Bit operator | AND | OR | XOR |---+---+---+---+---+--- Operands | 0 | 1 | 0 | 1 | 0 | 1 @@ -16913,9 +18100,7 @@ @end tex @docbook - - -Bitwise Operations + @@ -16933,7 +18118,7 @@ -Bit Operator +Bit operator @@ -16975,7 +18160,7 @@ -
+ @end docbook @end float @@ -16997,50 +18182,48 @@ Finally, two other common operations are to shift the bits left or right. For example, if you have a bit string @samp{10111001} and you shift it right by three bits, you end up with @samp{00010111}.@footnote{This example -shows that 0's come in on the left side. For @command{gawk}, this is +shows that zeros come in on the left side. For @command{gawk}, this is always true, but in some languages, it's possible to have the left side -fill with 1's. Caveat emptor.} -@c Purposely decided to use 0's and 1's here. 2/2001. -If you start over -again with @samp{10111001} and shift it left by three bits, you end up -with @samp{11001000}. -@command{gawk} provides built-in functions that implement the -bitwise operations just described. They are: +fill with ones.} +If you start over again with @samp{10111001} and shift it left by three +bits, you end up with @samp{11001000}. The following list describes +@command{gawk}'s built-in functions that implement the bitwise operations. +Optional parameters are enclosed in square brackets ([ ]): @cindex @command{gawk}, bitwise operations in @table @code @cindexgawkfunc{and} @cindex bitwise AND -@item and(@var{v1}, @var{v2} @r{[}, @r{@dots{}]}) +@item @code{and(}@var{v1}@code{,} @var{v2} [@code{,} @dots{}]@code{)} Return the bitwise AND of the arguments. There must be at least two. @cindexgawkfunc{compl} @cindex bitwise complement -@item compl(@var{val}) +@item @code{compl(@var{val})} Return the bitwise complement of @var{val}. @cindexgawkfunc{lshift} @cindex left shift -@item lshift(@var{val}, @var{count}) +@item @code{lshift(@var{val}, @var{count})} Return the value of @var{val}, shifted left by @var{count} bits. @cindexgawkfunc{or} @cindex bitwise OR -@item or(@var{v1}, @var{v2} @r{[}, @r{@dots{}]}) +@item @code{or(}@var{v1}@code{,} @var{v2} [@code{,} @dots{}]@code{)} Return the bitwise OR of the arguments. There must be at least two. @cindexgawkfunc{rshift} @cindex right shift -@item rshift(@var{val}, @var{count}) +@item @code{rshift(@var{val}, @var{count})} Return the value of @var{val}, shifted right by @var{count} bits. @cindexgawkfunc{xor} @cindex bitwise XOR -@item xor(@var{v1}, @var{v2} @r{[}, @r{@dots{}]}) +@item @code{xor(}@var{v1}@code{,} @var{v2} [@code{,} @dots{}]@code{)} Return the bitwise XOR of the arguments. There must be at least two. @end table -For all of these functions, first the double precision floating-point value is +For all of these functions, first the double-precision floating-point value is converted to the widest C unsigned integer type, then the bitwise operation is performed. If the result cannot be represented exactly as a C @code{double}, leading nonzero bits are removed one by one until it can be represented @@ -17055,7 +18238,7 @@ @example @group @c file eg/lib/bits2str.awk -# bits2str --- turn a byte into readable 1's and 0's +# bits2str --- turn a byte into readable ones and zeros function bits2str(bits, data, mask) @{ @@ -17129,17 +18312,18 @@ @cindex converting, numbers to strings @cindex number as string of bits The @code{bits2str()} function turns a binary number into a string. -The number @code{1} represents a binary value where the rightmost bit -is set to 1. Using this mask, +Initializing @code{mask} to one creates +a binary value where the rightmost bit +is set to one. Using this mask, the function repeatedly checks the rightmost bit. ANDing the mask with the value indicates whether the -rightmost bit is 1 or not. If so, a @code{"1"} is concatenated onto the front +rightmost bit is one or not. If so, a @code{"1"} is concatenated onto the front of the string. Otherwise, a @code{"0"} is added. The value is then shifted right by one bit and the loop continues -until there are no more 1 bits. +until there are no more one bits. -If the initial value is zero it returns a simple @code{"0"}. +If the initial value is zero, it returns a simple @code{"0"}. Otherwise, at the end, it pads the value with zeros to represent multiples of 8-bit quantities. This is typical in modern computers. @@ -17148,25 +18332,20 @@ (@pxref{Nondecimal-numbers}), and then demonstrates the results of the @code{compl()}, @code{lshift()}, and @code{rshift()} functions. -@c ENDOFRANGE bit -@c ENDOFRANGE and -@c ENDOFRANGE oro -@c ENDOFRANGE xor -@c ENDOFRANGE opbit @node Type Functions @subsection Getting Type Information @command{gawk} provides a single function that lets you distinguish an array from a scalar variable. This is necessary for writing code -that traverses every element of a true multidimensional array +that traverses every element of an array of arrays (@pxref{Arrays of Arrays}). @table @code @cindexgawkfunc{isarray} @cindex scalar or array @item isarray(@var{x}) -Return a true value if @var{x} is an array. Otherwise return false. +Return a true value if @var{x} is an array. Otherwise, return false. @end table @code{isarray()} is meant for use in two circumstances. The first is when @@ -17175,12 +18354,14 @@ (not discussed yet; @pxref{User-defined}), to test if a parameter is an array or not. -Note, however, that using @code{isarray()} at the global level to test -variables makes no sense. Since you are the one writing the program, you +@quotation NOTE +Using @code{isarray()} at the global level to test +variables makes no sense. Because you are the one writing the program, you are supposed to know if your variables are arrays or not. And in fact, due to the way @command{gawk} works, if you pass the name of a variable that has not been previously used to @code{isarray()}, @command{gawk} -will end up turning it into a scalar. +ends up turning it into a scalar. +@end quotation @node I18N Functions @subsection String-Translation Functions @@ -17197,10 +18378,10 @@ for the full story. Optional parameters are enclosed in square brackets ([ ]): -@table @code +@table @asis @cindexgawkfunc{bindtextdomain} @cindex set directory of message catalogs -@item bindtextdomain(@var{directory} @r{[}, @var{domain}@r{]}) +@item @code{bindtextdomain(@var{directory}} [@code{,} @var{domain}]@code{)} Set the directory in which @command{gawk} will look for message translation files, in case they will not or cannot be placed in the ``standard'' locations @@ -17214,36 +18395,32 @@ @cindexgawkfunc{dcgettext} @cindex translate string -@item dcgettext(@var{string} @r{[}, @var{domain} @r{[}, @var{category}@r{]]}) +@item @code{dcgettext(@var{string}} [@code{,} @var{domain} [@code{,} @var{category}] ]@code{)} Return the translation of @var{string} in text domain @var{domain} for locale category @var{category}. The default value for @var{domain} is the current value of @code{TEXTDOMAIN}. The default value for @var{category} is @code{"LC_MESSAGES"}. @cindexgawkfunc{dcngettext} -@item dcngettext(@var{string1}, @var{string2}, @var{number} @r{[}, @var{domain} @r{[}, @var{category}@r{]]}) +@item @code{dcngettext(@var{string1}, @var{string2}, @var{number}} [@code{,} @var{domain} [@code{,} @var{category}] ]@code{)} Return the plural form used for @var{number} of the translation of @var{string1} and @var{string2} in text domain @var{domain} for locale category @var{category}. @var{string1} is the -English singular variant of a message, and @var{string2} the English plural +English singular variant of a message, and @var{string2} is the English plural variant of the same message. The default value for @var{domain} is the current value of @code{TEXTDOMAIN}. The default value for @var{category} is @code{"LC_MESSAGES"}. @end table -@c ENDOFRANGE funcbi -@c ENDOFRANGE bifunc @node User-defined @section User-Defined Functions -@c STARTOFRANGE udfunc @cindex user-defined functions -@c STARTOFRANGE funcud @cindex functions, user-defined Complicated @command{awk} programs can often be simplified by defining your own functions. User-defined functions can be called just like built-in ones (@pxref{Function Calls}), but it is up to you to define -them, i.e., to tell @command{awk} what they should do. +them (i.e., to tell @command{awk} what they should do). @menu * Definition Syntax:: How to write definitions and what they mean. @@ -17257,7 +18434,12 @@ @node Definition Syntax @subsection Function Definition Syntax -@c STARTOFRANGE fdef +@quotation +@i{It's entirely fair to say that the awk syntax for local +variable definitions is appallingly awful.} +@author Brian Kernighan +@end quotation + @cindex functions, defining Definitions of functions can appear anywhere between the rules of an @command{awk} program. Thus, the general form of an @command{awk} program is @@ -17269,12 +18451,12 @@ The definition of a function named @var{name} looks like this: -@example -function @var{name}(@r{[}@var{parameter-list}@r{]}) -@{ +@display +@code{function} @var{name}@code{(}[@var{parameter-list}]@code{)} +@code{@{} @var{body-of-function} -@} -@end example +@code{@}} +@end display @cindex names, functions @cindex functions, names of @@ -17283,20 +18465,37 @@ Here, @var{name} is the name of the function to define. A valid function name is like a valid variable name: a sequence of letters, digits, and underscores that doesn't start with a digit. +Here too, only the 52 upper- and lowercase English letters may +be used in a function name. Within a single @command{awk} program, any particular name can only be used as a variable, array, or function. @var{parameter-list} is an optional list of the function's arguments and local variable names, separated by commas. When the function is called, the argument names are used to hold the argument values given in -the call. The local variables are initialized to the empty string. +the call. + A function cannot have two parameters with the same name, nor may it have a parameter with the same name as the function itself. -In addition, according to the POSIX standard, function parameters cannot have the same -name as one of the special built-in variables -(@pxref{Built-in Variables}. Not all versions of @command{awk} -enforce this restriction.) +@quotation CAUTION +According to the POSIX standard, function parameters +cannot have the same name as one of the special predefined variables +(@pxref{Built-in Variables}), nor may a function parameter have the +same name as another function. + +Not all versions of @command{awk} enforce +these restrictions. +@command{gawk} always enforces the first restriction. +With @option{--posix} (@pxref{Options}), +it also enforces the second restriction. +@end quotation + +Local variables act like the empty string if referenced where a string +value is required, and like zero if referenced where a numeric value +is required. This is the same as the behavior of regular variables that have never been +assigned a value. (There is more to understand about local variables; +@pxref{Dynamic Typing}.) The @var{body-of-function} consists of @command{awk} statements. It is the most important part of the definition, because it says what the function @@ -17328,7 +18527,7 @@ values hide, or @dfn{shadow}, any variables of the same names used in the rest of the program. The shadowed variables are not accessible in the function definition, because there is no way to name them while their -names have been taken away for the local variables. All other variables +names have been taken away for the arguments and local variables. All other variables used in the @command{awk} program can be referenced or set normally in the function's body. @@ -17368,13 +18567,13 @@ @end example @noindent -Instead it defines a rule that, for each record, concatenates the value +Instead, it defines a rule that, for each record, concatenates the value of the variable @samp{func} with the return value of the function @samp{foo}. If the resulting string is non-null, the action is executed. This is probably not what is desired. (@command{awk} accepts this input as syntactically valid, because functions may be used before they are defined in @command{awk} programs.@footnote{This program won't actually run, -since @code{foo()} is undefined.}) +because @code{foo()} is undefined.}) @cindex portability, functions@comma{} defining To ensure that your @command{awk} programs are portable, always use the @@ -17395,7 +18594,7 @@ @end example @noindent -To illustrate, here is an @command{awk} rule that uses our @code{myprint} +To illustrate, here is an @command{awk} rule that uses our @code{myprint()} function: @example @@ -17420,13 +18619,14 @@ 21.2 @end example -This function deletes all the elements in an array: +This function deletes all the elements in an array (recall that the +extra whitespace signifies the start of the local variable list): @example function delarray(a, i) @{ for (i in a) - delete a[i] + delete a[i] @} @end example @@ -17435,25 +18635,26 @@ (@pxref{Delete}). Instead of having to repeat this loop everywhere that you need to clear out -an array, your program can just call @code{delarray}. +an array, your program can just call @code{delarray()}. (This guarantees portability. The use of @samp{delete @var{array}} to delete -the contents of an entire array is a recent@footnote{Late in 2012.} +the contents of an entire array is a relatively recent@footnote{Late in 2012.} addition to the POSIX standard.) The following is an example of a recursive function. It takes a string -as an input parameter and returns the string in backwards order. +as an input parameter and returns the string in reverse order. Recursive functions must always have a test that stops the recursion. -In this case, the recursion terminates when the starting position -is zero, i.e., when there are no more characters left in the string. +In this case, the recursion terminates when the input string is +already empty: +@c 8/2014: Thanks to Mike Brennan for the improved formulation @cindex @code{rev()} user-defined function @example -function rev(str, start) +function rev(str) @{ - if (start == 0) + if (str == "") return "" - return (substr(str, start, 1) rev(str, start - 1)) + return (rev(substr(str, 2)) substr(str, 1, 1)) @} @end example @@ -17462,11 +18663,11 @@ @example $ @kbd{echo "Don't Panic!" |} -> @kbd{gawk --source '@{ print rev($0, length($0)) @}' -f rev.awk} +> @kbd{gawk -e '@{ print rev($0) @}' -f rev.awk} @print{} !cinaP t'noD @end example -The C @code{ctime()} function takes a timestamp and returns it in a string, +The C @code{ctime()} function takes a timestamp and returns it as a string, formatted in a well-known fashion. The following example uses the built-in @code{strftime()} function (@pxref{Time Functions}) @@ -17482,18 +18683,22 @@ function ctime(ts, format) @{ format = "%a %b %e %H:%M:%S %Z %Y" + if (ts == 0) ts = systime() # use current time as default return strftime(format, ts) @} @c endfile @end example -@c ENDOFRANGE fdef + +You might think that @code{ctime()} could use @code{PROCINFO["strftime"]} +for its format string. That would be a mistake, because @code{ctime()} is +supposed to return the time formatted in a standard fashion, and user-level +code could have changed @code{PROCINFO["strftime"]}. @node Function Caveats @subsection Calling User-Defined Functions -@c STARTOFRANGE fudc @cindex functions, user-defined, calling @dfn{Calling a function} means causing the function to run and do its job. A function call is an expression and its value is the value returned by @@ -17506,7 +18711,7 @@ @end menu @node Calling A Function -@subsubsection Writing A Function Call +@subsubsection Writing a Function Call A function call consists of the function name followed by the arguments in parentheses. @command{awk} expressions are what you write in the @@ -17521,7 +18726,7 @@ @quotation CAUTION Whitespace characters (spaces and TABs) are not allowed -between the function name and the open-parenthesis of the argument list. +between the function name and the opening parenthesis of the argument list. If you write whitespace by mistake, @command{awk} might think that you mean to concatenate a variable with an expression in parentheses. However, it notices that you used a function name and not a variable name, and reports @@ -17533,7 +18738,8 @@ @cindex local variables, in a function @cindex variables, local to a function -There is no way to make a variable local to a @code{@{ @dots{} @}} block in +Unlike in many languages, +there is no way to make a variable local to a @code{@{} @dots{} @code{@}} block in @command{awk}, but you can make a variable local to a function. It is good practice to do so whenever a variable is needed only in that function. @@ -17541,7 +18747,7 @@ To make a variable local to a function, simply declare the variable as an argument after the actual function arguments (@pxref{Definition Syntax}). -Look at the following example where variable +Look at the following example, where variable @code{i} is a global variable used by both functions @code{foo()} and @code{bar()}: @@ -17560,7 +18766,7 @@ print "foo's i=" i @} -BEGIN @{ +BEGIN @{ i = 10 print "top's i=" i foo(0) @@ -17582,14 +18788,14 @@ top's i=3 @end example -If you want @code{i} to be local to both @code{foo()} and @code{bar()} do as -follows (the extra-space before @code{i} is a coding convention to +If you want @code{i} to be local to both @code{foo()} and @code{bar()}, do as +follows (the extra space before @code{i} is a coding convention to indicate that @code{i} is a local variable, not an argument): @example function bar( i) @{ - for (i = 0; i < 3; i++) + for (i = 0; i < 3; i++) print "bar's i=" i @} @@ -17601,10 +18807,10 @@ print "foo's i=" i @} -BEGIN @{ +BEGIN @{ i = 10 print "top's i=" i - foo(0) + foo(0) print "top's i=" i @} @end example @@ -17663,21 +18869,16 @@ @end example @node Pass By Value/Reference -@subsubsection Passing Function Arguments By Value Or By Reference +@subsubsection Passing Function Arguments by Value Or by Reference In @command{awk}, when you declare a function, there is no way to declare explicitly whether the arguments are passed @dfn{by value} or @dfn{by reference}. -Instead the passing convention is determined at runtime when -the function is called according to the following rule: - -@itemize -@item -If the argument is an array variable, then it is passed by reference, -@item -Otherwise the argument is passed by value. -@end itemize +Instead, the passing convention is determined at runtime when +the function is called, according to the following rule: +if the argument is an array variable, then it is passed by reference. +Otherwise, the argument is passed by value. @cindex call by value Passing an argument by value means that when a function is called, it @@ -17746,13 +18947,13 @@ @noindent prints @samp{a[1] = 1, a[2] = two, a[3] = 3}, because -@code{changeit} stores @code{"two"} in the second element of @code{a}. +@code{changeit()} stores @code{"two"} in the second element of @code{a}. @end quotation @cindex undefined functions @cindex functions, undefined Some @command{awk} implementations allow you to call a function that -has not been defined. They only report a problem at runtime when the +has not been defined. They only report a problem at runtime, when the program actually tries to call the function. For example: @example @@ -17780,10 +18981,15 @@ Some @command{awk} implementations generate a runtime error if you use either the @code{next} statement or the @code{nextfile} statement -(@pxref{Next Statement}, also @pxref{Nextfile Statement}) +(@pxref{Next Statement}, and +@ifdocbook +@ref{Nextfile Statement}) +@end ifdocbook +@ifnotdocbook +@pxref{Nextfile Statement}) +@end ifnotdocbook inside a user-defined function. @command{gawk} does not have this limitation. -@c ENDOFRANGE fudc @node Return Statement @subsection The @code{return} Statement @@ -17795,26 +19001,26 @@ can also be used to return a value for use in the rest of the @command{awk} program. It looks like this: -@example -return @r{[}@var{expression}@r{]} -@end example +@display +@code{return} [@var{expression}] +@end display The @var{expression} part is optional. Due most likely to an oversight, POSIX does not define what the return value is if you omit the @var{expression}. Technically speaking, this -make the returned value undefined, and therefore, unpredictable. +makes the returned value undefined, and therefore, unpredictable. In practice, though, all versions of @command{awk} simply return the null string, which acts like zero if used in a numeric context. -A @code{return} statement with no value expression is assumed at the end of -every function definition. So if control reaches the end of the function -body, then technically, the function returns an unpredictable value. +A @code{return} statement without an @var{expression} is assumed at the end of +every function definition. So, if control reaches the end of the function +body, then technically the function returns an unpredictable value. In practice, it returns the empty string. @command{awk} does @emph{not} warn you if you use the return value of such a function. Sometimes, you want to write a function for what it does, not for what it returns. Such a function corresponds to a @code{void} function -in C, C++ or Java, or to a @code{procedure} in Ada. Thus, it may be appropriate to not +in C, C++, or Java, or to a @code{procedure} in Ada. Thus, it may be appropriate to not return any value; simply bear in mind that you should not be using the return value of such a function. @@ -17836,8 +19042,8 @@ @noindent You call @code{maxelt()} with one argument, which is an array name. The local variables @code{i} and @code{ret} are not intended to be arguments; -while there is nothing to stop you from passing more than one argument -to @code{maxelt()}, the results would be strange. The extra space before +there is nothing to stop you from passing more than one argument +to @code{maxelt()} but the results would be strange. The extra space before @code{i} in the function parameter list indicates that @code{i} and @code{ret} are local variables. You should follow this convention when defining functions. @@ -17905,13 +19111,12 @@ @end example In this example, the first call to @code{foo()} generates -a fatal error, so @command{gawk} will not report the second -error. If you comment out that call, though, then @command{gawk} -will report the second error. +a fatal error, so @command{awk} will not report the second +error. If you comment out that call, though, then @command{awk} +does report the second error. Usually, such things aren't a big issue, but it's worth being aware of them. -@c ENDOFRANGE udfunc @node Indirect Calls @section Indirect Function Calls @@ -17922,7 +19127,7 @@ @cindex pointers to functions @cindex differences in @command{awk} and @command{gawk}, indirect function calls -This section describes a @command{gawk}-specific extension. +This section describes an advanced, @command{gawk}-specific extension. Often, you may wish to defer the choice of function to call until runtime. For example, you may have different kinds of records, each of which @@ -17934,13 +19139,15 @@ string variable, and then call the function. Let's look at an example. Suppose you have a file with your test scores for the classes you -are taking. The first field is the class name. The following fields +are taking, and +you wish to get the sum and the average of +your test scores. +The first field is the class name. The following fields are the functions to call to process the data, up to a ``marker'' field @samp{data:}. Following the marker, to the end of the record, are the various numeric test scores. -Here is the initial file; you wish to get the sum and the average of -your test scores: +Here is the initial file: @example @c file eg/data/class_data1 @@ -17968,11 +19175,14 @@ @noindent This style of programming works, but can be awkward. With @dfn{indirect} function calls, you tell @command{gawk} to use the @emph{value} of a -variable as the name of the function to call. +variable as the @emph{name} of the function to call. +@cindex @code{@@}-notation for indirect function calls +@cindex indirect function calls, @code{@@}-notation +@cindex function calls, indirect, @code{@@}-notation for The syntax is similar to that of a regular function call: an identifier -immediately followed by a left parenthesis, any arguments, and then -a closing right parenthesis, with the addition of a leading @samp{@@} +immediately followed by an opening parenthesis, any arguments, and then +a closing parenthesis, with the addition of a leading @samp{@@} character: @example @@ -17981,7 +19191,7 @@ @end example Here is a full program that processes the previously shown data, -using indirect function calls. +using indirect function calls: @example @c file eg/prog/indirectcall.awk @@ -18020,14 +19230,13 @@ @c endfile @end example -These two functions expect to work on fields; thus the parameters +These two functions expect to work on fields; thus, the parameters @code{first} and @code{last} indicate where in the fields to start and end. -Otherwise they perform the expected computations and are not unusual. +Otherwise, they perform the expected computations and are not unusual: @example @c file eg/prog/indirectcall.awk # For each record, print the class name and the requested statistics - @{ class_name = $1 gsub(/_/, " ", class_name) # Replace _ with spaces @@ -18068,11 +19277,11 @@ @print{} Biology 101: @print{} sum: <352.8> @print{} average: <88.2> -@print{} +@print{} @print{} Chemistry 305: @print{} sum: <356.4> @print{} average: <89.1> -@print{} +@print{} @print{} English 401: @print{} sum: <376.1> @print{} average: <94.025> @@ -18082,8 +19291,8 @@ think at first. The C and C++ languages provide ``function pointers,'' which are a mechanism for calling a function chosen at runtime. One of the most well-known uses of this ability is the C @code{qsort()} function, which sorts -an array using the famous ``quick sort'' algorithm -(see @uref{http://en.wikipedia.org/wiki/Quick_sort, the Wikipedia article} +an array using the famous ``quicksort'' algorithm +(see @uref{http://en.wikipedia.org/wiki/Quicksort, the Wikipedia article} for more information). To use this function, you supply a pointer to a comparison function. This mechanism allows you to sort arbitrary data in an arbitrary fashion. @@ -18102,11 +19311,11 @@ # January 2009 @c endfile - @end ignore @c file eg/lib/quicksort.awk -# quicksort --- C.A.R. Hoare's quick sort algorithm. See Wikipedia -# or almost any algorithms or computer science text + +# quicksort --- C.A.R. Hoare's quicksort algorithm. See Wikipedia +# or almost any algorithms or computer science text. @c endfile @ignore @c file eg/lib/quicksort.awk @@ -18133,7 +19342,7 @@ # quicksort_swap --- helper function for quicksort, should really be inline -function quicksort_swap(data, i, j, temp) +function quicksort_swap(data, i, j, temp) @{ temp = data[i] data[i] = data[j] @@ -18144,7 +19353,7 @@ The @code{quicksort()} function receives the @code{data} array, the starting and ending indices to sort (@code{left} and @code{right}), and the name of a function that -performs a ``less than'' comparison. It then implements the quick sort algorithm. +performs a ``less than'' comparison. It then implements the quicksort algorithm. To make use of the sorting function, we return to our previous example. The first thing to do is write some comparison functions: @@ -18194,7 +19403,7 @@ retval = data[1] for (i = 2; i in data; i++) retval = retval " " data[i] - + return retval @} @c endfile @@ -18221,7 +19430,7 @@ @c endfile @end example -Here is an extended version of the data file: +Here is an extended version of the @value{DF}: @example @c file eg/data/class_data2 @@ -18240,13 +19449,13 @@ @print{} average: <88.2> @print{} sort: <78.5 87.0 92.4 94.9> @print{} rsort: <94.9 92.4 87.0 78.5> -@print{} +@print{} @print{} Chemistry 305: @print{} sum: <356.4> @print{} average: <89.1> @print{} sort: <75.2 88.2 94.7 98.3> @print{} rsort: <98.3 94.7 88.2 75.2> -@print{} +@print{} @print{} English 401: @print{} sum: <376.1> @print{} average: <94.025> @@ -18254,12 +19463,30 @@ @print{} rsort: <100.0 95.6 93.4 87.1> @end example +Another example where indirect functions calls are useful can be found in +processing arrays. This is described in @ref{Walking Arrays}. + Remember that you must supply a leading @samp{@@} in front of an indirect function call. -Unfortunately, indirect function calls cannot be used with the built-in functions. However, -you can generally write ``wrapper'' functions which call the built-in ones, and those can -be called indirectly. (Other than, perhaps, the mathematical functions, there is not a lot -of reason to try to call the built-in functions indirectly.) +Starting with @value{PVERSION} 4.1.2 of @command{gawk}, indirect function +calls may also be used with built-in functions and with extension functions +(@pxref{Dynamic Extensions}). There are some limitations when calling +built-in functions indirectly, as follows. + +@itemize @value{BULLET} +@item +You cannot pass a regular expression constant to a built-in function +through an indirect function call.@footnote{This may change in a future +version; recheck the documentation that comes with your version of +@command{gawk} to see if it has.} This applies to the @code{sub()}, +@code{gsub()}, @code{gensub()}, @code{match()}, @code{split()} and +@code{patsplit()} functions. + +@item +If calling @code{sub()} or @code{gsub()}, you may only pass two arguments, +since those functions are unusual in that they update their third argument. +This means that @code{$0} will be updated. +@end itemize @command{gawk} does its best to make indirect function calls efficient. For example, in the following case: @@ -18270,46 +19497,103 @@ @end example @noindent -@code{gawk} will look up the actual function to call only once. +@command{gawk} looks up the actual function to call only once. -@c ENDOFRANGE funcud +@node Functions Summary +@section Summary -@iftex -@part Part II:@* Problem Solving With @command{awk} -@end iftex +@itemize @value{BULLET} +@item +@command{awk} provides built-in functions and lets you define your own +functions. -@ignore -@ifdocbook -@part Part II:@* Problem Solving With @command{awk} +@item +POSIX @command{awk} provides three kinds of built-in functions: numeric, +string, and I/O. @command{gawk} provides functions that sort arrays, work +with values representing time, do bit manipulation, determine variable +type (array versus scalar), and internationalize and localize programs. +@command{gawk} also provides several extensions to some of standard +functions, typically in the form of additional arguments. + +@item +Functions accept zero or more arguments and return a value. The +expressions that provide the argument values are completely evaluated +before the function is called. Order of evaluation is not defined. +The return value can be ignored. + +@item +The handling of backslash in @code{sub()} and @code{gsub()} is not simple. +It is more straightforward in @command{gawk}'s @code{gensub()} function, +but that function still requires care in its use. + +@item +User-defined functions provide important capabilities but come with +some syntactic inelegancies. In a function call, there cannot be any +space between the function name and the opening left parenthesis of the +argument list. Also, there is no provision for local variables, so the +convention is to add extra parameters, and to separate them visually +from the real parameters by extra whitespace. + +@item +User-defined functions may call other user-defined (and built-in) +functions and may call themselves recursively. Function parameters +``hide'' any global variables of the same names. +You cannot use the name of a reserved variable (such as @code{ARGC}) +as the name of a parameter in user-defined functions. + +@item +Scalar values are passed to user-defined functions by value. Array +parameters are passed by reference; any changes made by the function to +array parameters are thus visible after the function has returned. + +@item +Use the @code{return} statement to return from a user-defined function. +An optional expression becomes the function's return value. Only scalar +values may be returned by a function. + +@item +If a variable that has never been used is passed to a user-defined +function, how that function treats the variable can set its nature: +either scalar or array. + +@item +@command{gawk} provides indirect function calls using a special syntax. +By setting a variable to the name of a function, you can +determine at runtime what function will be called at that point in the +program. This is equivalent to function pointers in C and C++. + +@end itemize + + +@ifnotinfo +@part @value{PART2}Problem Solving with @command{awk} +@end ifnotinfo +@ifdocbook Part II shows how to use @command{awk} and @command{gawk} for problem solving. There is lots of code here for you to read and learn from. It contains the following chapters: -@itemize @bullet +@itemize @value{BULLET} @item -@ref{Library Functions}. +@ref{Library Functions} @item -@ref{Sample Programs}. +@ref{Sample Programs} @end itemize @end ifdocbook -@end ignore @node Library Functions @chapter A Library of @command{awk} Functions -@c STARTOFRANGE libf @cindex libraries of @command{awk} functions -@c STARTOFRANGE flib @cindex functions, library -@c STARTOFRANGE fudlib @cindex functions, user-defined, library of -@ref{User-defined}, describes how to write +@DBREF{User-defined} describes how to write your own @command{awk} functions. Writing functions is important, because it allows you to encapsulate algorithms and program tasks in a single place. It simplifies programming, making program development more -manageable, and making programs more readable. +manageable and making programs more readable. @cindex Kernighan, Brian @cindex Plauger, P.J.@: @@ -18329,34 +19613,35 @@ In fact, they felt this idea was so important that they placed this statement on the cover of their book. Because we believe strongly that their statement is correct, this @value{CHAPTER} and @ref{Sample -Programs}, provide a good-sized body of code for you to read, and we hope, +Programs}, provide a good-sized body of code for you to read and, we hope, to learn from. -@c 2e: USE TEXINFO-2 FUNCTION DEFINITION STUFF!!!!!!!!!!!!! This @value{CHAPTER} presents a library of useful @command{awk} functions. Many of the sample programs presented later in this @value{DOCUMENT} use these functions. The functions are presented here in a progression from simple to complex. @cindex Texinfo -@ref{Extract Program}, +@DBREF{Extract Program} presents a program that you can use to extract the source code for these example library functions and programs from the Texinfo source for this @value{DOCUMENT}. (This has already been done as part of the @command{gawk} distribution.) +@ifclear FOR_PRINT If you have written one or more useful, general-purpose @command{awk} functions and would like to contribute them to the @command{awk} user community, see @ref{How To Contribute}, for more information. +@end ifclear @cindex portability, example programs The programs in this @value{CHAPTER} and in @ref{Sample Programs}, -freely use features that are @command{gawk}-specific. +freely use @command{gawk}-specific features. Rewriting these programs for different implementations of @command{awk} -is pretty straightforward. +is pretty straightforward: -@itemize @bullet +@itemize @value{BULLET} @item Diagnostic error messages are sent to @file{/dev/stderr}. Use @samp{| "cat 1>&2"} instead of @samp{> "/dev/stderr"} if your system @@ -18400,6 +19685,8 @@ * Passwd Functions:: Functions for getting user information. * Group Functions:: Functions for getting group information. * Walking Arrays:: A function to walk arrays of arrays. +* Library Functions Summary:: Summary of library functions. +* Library Exercises:: Exercises. @end menu @node Library Names @@ -18422,7 +19709,7 @@ preserve state information between calls to the function---for example, @code{getopt()}'s variable @code{_opti} (@pxref{Getopt Function}). -Such variables are called @dfn{private}, since the only functions that need to +Such variables are called @dfn{private}, as the only functions that need to use them are the ones in the library. When writing a library function, you should try to choose names for your @@ -18435,7 +19722,7 @@ The example programs shown in this @value{CHAPTER} all start the names of their private variables with an underscore (@samp{_}). Users generally don't use leading underscores in their variable names, so this convention immediately -decreases the chances that the variable name will be accidentally shared +decreases the chances that the variable names will be accidentally shared with the user's program. @cindex @code{_} (underscore), in names of private variables @@ -18444,28 +19731,28 @@ indicate what function or set of functions use the variables---for example, @code{_pw_byname()} in the user database routines (@pxref{Passwd Functions}). -This convention is recommended, since it even further decreases the +This convention is recommended, as it even further decreases the chance of inadvertent conflict among variable names. Note that this convention is used equally well for variable names and for private -function names.@footnote{While all the library routines could have +function names.@footnote{Although all the library routines could have been rewritten to use this convention, this was not done, in order to show how our own @command{awk} programming style has evolved and to provide some basis for this discussion.} As a final note on variable naming, if a function makes global variables -available for use by a main program, it is a good convention to start that -variable's name with a capital letter---for +available for use by a main program, it is a good convention to start those +variables' names with a capital letter---for example, @code{getopt()}'s @code{Opterr} and @code{Optind} variables (@pxref{Getopt Function}). The leading capital letter indicates that it is global, while the fact that the variable name is not all capital letters indicates that the variable is -not one of @command{awk}'s built-in variables, such as @code{FS}. +not one of @command{awk}'s predefined variables, such as @code{FS}. @cindex @option{--dump-variables} option, using for library functions It is also important that @emph{all} variables in library functions that do not need to save state are, in fact, declared local.@footnote{@command{gawk}'s @option{--dump-variables} command-line -option is useful for verifying this.} If this is not done, the variable +option is useful for verifying this.} If this is not done, the variables could accidentally be used in the user's program, leading to bugs that are very difficult to track down: @@ -18473,8 +19760,9 @@ function lib_func(x, y, l1, l2) @{ @dots{} - @var{use variable} some_var # some_var should be local - @dots{} # but is not by oversight + # some_var should be local but by oversight is not + @var{use variable} some_var + @dots{} @} @end example @@ -18486,7 +19774,7 @@ associative array to hold the values needed by the library function(s), or ``package.'' This significantly decreases the number of actual global names in use. For example, the functions described in -@ref{Passwd Functions}, +@DBREF{Passwd Functions} might have used array elements @code{@w{PW_data["inited"]}}, @code{@w{PW_data["total"]}}, @code{@w{PW_data["count"]}}, and @code{@w{PW_data["awklib"]}}, instead of @code{@w{_pw_inited}}, @code{@w{_pw_awklib}}, @code{@w{_pw_total}}, @@ -18515,10 +19803,11 @@ * Join Function:: A function to join an array into a string. * Getlocaltime Function:: A function to get formatted times. * Readfile Function:: A function to read an entire file at once. +* Shell Quoting:: A function to quote strings for the shell. @end menu @node Strtonum Function -@subsection Converting Strings To Numbers +@subsection Converting Strings to Numbers The @code{strtonum()} function (@pxref{String Functions}) is a @command{gawk} extension. The following function @@ -18534,11 +19823,12 @@ # # Arnold Robbins, arnold@@skeeve.com, Public Domain # February, 2004 +# Revised June, 2014 @c endfile @end ignore @c file eg/lib/strtonum.awk -function mystrtonum(str, ret, chars, n, i, k, c) +function mystrtonum(str, ret, n, i, k, c) @{ if (str ~ /^0[0-7]*$/) @{ # octal @@ -18546,12 +19836,13 @@ ret = 0 for (i = 1; i <= n; i++) @{ c = substr(str, i, 1) - if ((k = index("01234567", c)) > 0) - k-- # adjust for 1-basing in awk + # index() returns 0 if c not in string, + # includes c == "0" + k = index("1234567", c) ret = ret * 8 + k @} - @} else if (str ~ /^0[xX][[:xdigit:]]+/) @{ + @} else if (str ~ /^0[xX][[:xdigit:]]+$/) @{ # hexadecimal str = substr(str, 3) # lop off leading 0x n = length(str) @@ -18559,10 +19850,9 @@ for (i = 1; i <= n; i++) @{ c = substr(str, i, 1) c = tolower(c) - if ((k = index("0123456789", c)) > 0) - k-- # adjust for 1-basing in awk - else if ((k = index("abcdef", c)) > 0) - k += 9 + # index() returns 0 if c not in string, + # includes c == "0" + k = index("123456789abcdef", c) ret = ret * 16 + k @} @@ -18584,8 +19874,8 @@ # a[5] = "123.45" # a[6] = "1.e3" # a[7] = "1.32" -# a[7] = "1.32E2" -# +# a[8] = "1.32E2" +# # for (i = 1; i in a; i++) # print a[i], strtonum(a[i]), mystrtonum(a[i]) # @} @@ -18595,9 +19885,12 @@ The function first looks for C-style octal numbers (base 8). If the input string matches a regular expression describing octal numbers, then @code{mystrtonum()} loops through each character in the -string. It sets @code{k} to the index in @code{"01234567"} of the current -octal digit. Since the return value is one-based, the @samp{k--} -adjusts @code{k} so it can be used in computing the return value. +string. It sets @code{k} to the index in @code{"1234567"} of the current +octal digit. +The return value will either be the same number as the digit, or zero +if the character is not there, which will be true for a @samp{0}. +This is safe, because the regexp test in the @code{if} ensures that +only octal values are converted. Similar logic applies to the code that checks for and converts a hexadecimal value, which starts with @samp{0x} or @samp{0X}. @@ -18616,13 +19909,9 @@ @node Assert Function @subsection Assertions -@c STARTOFRANGE asse @cindex assertions -@c STARTOFRANGE assef @cindex @code{assert()} function (C library) -@c STARTOFRANGE libfass @cindex libraries of @command{awk} functions, assertions -@c STARTOFRANGE flibass @cindex functions, library, assertions @cindex @command{awk} programs, lengthy, assertions When writing large programs, it is often useful to know @@ -18630,7 +19919,7 @@ particular computation, you make a statement about what you believe to be the case. Such a statement is known as an @dfn{assertion}. The C language provides an @code{} header file -and corresponding @code{assert()} macro that the programmer can use to make +and corresponding @code{assert()} macro that a programmer can use to make assertions. If an assertion fails, the @code{assert()} macro arranges to print a diagnostic message describing the condition that should have been true but was not, and then it kills the program. In C, using @@ -18661,7 +19950,7 @@ @example @c file eg/lib/assert.awk -# assert --- assert that a condition is true. Otherwise exit. +# assert --- assert that a condition is true. Otherwise, exit. @c endfile @ignore @@ -18697,7 +19986,7 @@ parameter to describe the failed condition. It then sets the variable @code{_assert_exit} to one and executes the @code{exit} statement. The @code{exit} statement jumps to the @code{END} rule. If the @code{END} -rules finds @code{_assert_exit} to be true, it exits immediately. +rule finds @code{_assert_exit} to be true, it exits immediately. The purpose of the test in the @code{END} rule is to keep any other @code{END} rules from running. When an assertion fails, the @@ -18730,7 +20019,7 @@ to the program calling @code{assert()}. Normally, if a program consists of just a @code{BEGIN} rule, the input files and/or standard input are not read. However, now that the program has an @code{END} rule, @command{awk} -attempts to read the input data files or standard input +attempts to read the input @value{DF}s or standard input (@pxref{Using BEGIN/END}), most likely causing the program to hang as it waits for input. @@ -18738,10 +20027,6 @@ There is a simple workaround to this: make sure that such a @code{BEGIN} rule always ends with an @code{exit} statement. -@c ENDOFRANGE asse -@c ENDOFRANGE assef -@c ENDOFRANGE flibass -@c ENDOFRANGE libfass @node Round Function @subsection Rounding Numbers @@ -18943,7 +20228,7 @@ have numeric values from 128 to 255. Finally, large mainframe systems use the EBCDIC character set, which uses all 256 values. -While there are other character sets in use on some older systems, +There are other character sets in use on some older systems, but they are not really worth worrying about: @example @@ -18963,8 +20248,7 @@ @c endfile #### test code #### -# BEGIN \ -# @{ +# BEGIN @{ # for (;;) @{ # printf("enter a character: ") # if (getline var <= 0) @@ -18994,11 +20278,11 @@ the application programs (@pxref{Sample Programs}). -Good function design is important; this function needs to be general but it +Good function design is important; this function needs to be general, but it should also have a reasonable default behavior. It is called with an array as well as the beginning and ending indices of the elements in the array to be merged. This assumes that the array indices are numeric---a reasonable -assumption since the array was likely created with @code{split()} +assumption, as the array was likely created with @code{split()} (@pxref{String Functions}): @cindex @code{join()} user-defined function @@ -19049,9 +20333,9 @@ @cindex timestamps, formatted @cindex time, managing The @code{systime()} and @code{strftime()} functions described in -@ref{Time Functions}, +@DBREF{Time Functions} provide the minimum functionality necessary for dealing with the time of day -in human readable form. While @code{strftime()} is extensive, the control +in human-readable form. Although @code{strftime()} is extensive, the control formats are not necessarily easy to remember or intuitively obvious when reading a program. @@ -19135,14 +20419,14 @@ The string indices are easier to use and read than the various formats required by @code{strftime()}. The @code{alarm} program presented in -@ref{Alarm Program}, +@DBREF{Alarm Program} uses this function. A more general design for the @code{getlocaltime()} function would have allowed the user to supply an optional timestamp value to use instead of the current time. @node Readfile Function -@subsection Reading A Whole File At Once +@subsection Reading a Whole File at Once Often, it is convenient to have the entire contents of a file available in memory as a single string. A straightforward but naive way to @@ -19199,13 +20483,13 @@ It works by setting @code{RS} to @samp{^$}, a regular expression that will never match if the file has contents. @command{gawk} reads data from -the file into @code{tmp} attempting to match @code{RS}. The match fails +the file into @code{tmp}, attempting to match @code{RS}. The match fails after each read, but fails quickly, such that @command{gawk} fills @code{tmp} with the entire contents of the file. -(@xref{Records}, for information on @code{RT} and @code{RS}.) +(@DBXREF{Records} for information on @code{RT} and @code{RS}.) In the case that @code{file} is empty, the return value is the null -string. Thus calling code may use something like: +string. Thus, calling code may use something like: @example contents = readfile("/some/path") @@ -19216,17 +20500,95 @@ This tests the result to see if it is empty or not. An equivalent test would be @samp{contents == ""}. +@DBXREF{Extension Sample Readfile} for an extension function that +also reads an entire file into memory. + +@node Shell Quoting +@subsection Quoting Strings to Pass to the Shell + +@c included by permission +@ignore +Date: Sun, 27 Jul 2014 17:16:16 -0700 +Message-ID: +Subject: Useful awk function +From: Mike Brennan +To: Arnold Robbins +@end ignore + +Michael Brennan offers the following programming pattern, +which he uses frequently: + +@example +#! /bin/sh + +awkp=' + @dots{} + ' + +@var{input_program} | awk "$awkp" | /bin/sh +@end example + +For example, a program of his named @command{flac-edit} has this form: + +@example +$ @kbd{flac-edit -song="Whoope! That's Great" file.flac} +@end example + +It generates the following output, which is to be piped to +the shell (@file{/bin/sh}): + +@example +chmod +w file.flac +metaflac --remove-tag=TITLE file.flac +LANG=en_US.88591 metaflac --set-tag=TITLE='Whoope! That'"'"'s Great' file.flac +chmod -w file.flac +@end example + +Note the need for shell quoting. The function @code{shell_quote()} +does it. @code{SINGLE} is the one-character string @code{"'"} and +@code{QSINGLE} is the three-character string @code{"\"'\""}: + +@example +@c file eg/lib/shellquote.awk +# shell_quote --- quote an argument for passing to the shell +@c endfile +@ignore +@c file eg/lib/shellquote.awk +# +# Michael Brennan +# brennan@@madronabluff.com +# September 2014 +@c endfile +@end ignore +@c file eg/lib/shellquote.awk + +function shell_quote(s, # parameter + SINGLE, QSINGLE, i, X, n, ret) # locals +@{ + if (s == "") + return "\"\"" + + SINGLE = "\x27" # single quote + QSINGLE = "\"\x27\"" + n = split(s, X, SINGLE) + + ret = SINGLE X[1] SINGLE + for (i = 2; i <= n; i++) + ret = ret QSINGLE SINGLE X[i] SINGLE + + return ret +@} +@c endfile +@end example + @node Data File Management -@section Data File Management +@section @value{DDF} Management -@c STARTOFRANGE dataf @cindex files, managing -@c STARTOFRANGE libfdataf @cindex libraries of @command{awk} functions, managing, data files -@c STARTOFRANGE flibdataf @cindex functions, library, managing data files This @value{SECTION} presents functions that are useful for managing -command-line data files. +command-line @value{DF}s. @menu * Filetrans Function:: A function for handling data file transitions. @@ -19237,16 +20599,16 @@ @end menu @node Filetrans Function -@subsection Noting Data File Boundaries +@subsection Noting @value{DDF} Boundaries @cindex files, managing, data file boundaries @cindex files, initialization and cleanup -The @code{BEGIN} and @code{END} rules are each executed exactly once at +The @code{BEGIN} and @code{END} rules are each executed exactly once, at the beginning and end of your @command{awk} program, respectively (@pxref{BEGIN/END}). We (the @command{gawk} authors) once had a user who mistakenly thought that the -@code{BEGIN} rule is executed at the beginning of each data file and the -@code{END} rule is executed at the end of each data file. +@code{BEGIN} rules were executed at the beginning of each @value{DF} and the +@code{END} rules were executed at the end of each @value{DF}. When informed that this was not the case, the user requested that we add new special @@ -19257,7 +20619,7 @@ the job can be done cleanly in @command{awk} itself, as illustrated by the following library program. It arranges to call two user-supplied functions, @code{beginfile()} and -@code{endfile()}, at the beginning and end of each data file. +@code{endfile()}, at the beginning and end of each @value{DF}. Besides solving the problem in only nine(!) lines of code, it does so @emph{portably}; this works with any implementation of @command{awk}: @@ -19273,48 +20635,47 @@ @c # Arnold Robbins, arnold@@skeeve.com, Public Domain @c # January 1992 -FILENAME != _oldfilename \ -@{ +FILENAME != _oldfilename @{ if (_oldfilename != "") endfile(_oldfilename) _oldfilename = FILENAME beginfile(FILENAME) @} -END @{ endfile(FILENAME) @} +END @{ endfile(FILENAME) @} @end example This file must be loaded before the user's ``main'' program, so that the rule it supplies is executed first. -This rule relies on @command{awk}'s @code{FILENAME} variable that -automatically changes for each new data file. The current file name is +This rule relies on @command{awk}'s @code{FILENAME} variable, which +automatically changes for each new @value{DF}. The current @value{FN} is saved in a private variable, @code{_oldfilename}. If @code{FILENAME} does -not equal @code{_oldfilename}, then a new data file is being processed and +not equal @code{_oldfilename}, then a new @value{DF} is being processed and it is necessary to call @code{endfile()} for the old file. Because @code{endfile()} should only be called if a file has been processed, the program first checks to make sure that @code{_oldfilename} is not the null -string. The program then assigns the current file name to +string. The program then assigns the current @value{FN} to @code{_oldfilename} and calls @code{beginfile()} for the file. Because, like all @command{awk} variables, @code{_oldfilename} is initialized to the null string, this rule executes correctly even for the -first data file. +first @value{DF}. The program also supplies an @code{END} rule to do the final processing for the last file. Because this @code{END} rule comes before any @code{END} rules supplied in the ``main'' program, @code{endfile()} is called first. Once -again the value of multiple @code{BEGIN} and @code{END} rules should be clear. +again, the value of multiple @code{BEGIN} and @code{END} rules should be clear. @cindex @code{beginfile()} user-defined function @cindex @code{endfile()} user-defined function -If the same data file occurs twice in a row on the command line, then +If the same @value{DF} occurs twice in a row on the command line, then @code{endfile()} and @code{beginfile()} are not executed at the end of the first pass and at the beginning of the second pass. The following version solves the problem: @example @c file eg/lib/ftrans.awk -# ftrans.awk --- handle data file transitions +# ftrans.awk --- handle datafile transitions # # user supplies beginfile() and endfile() functions @c endfile @@ -19334,34 +20695,35 @@ beginfile(FILENAME) @} -END @{ endfile(_filename_) @} +END @{ endfile(_filename_) @} @c endfile @end example -@ref{Wc Program}, +@DBREF{Wc Program} shows how this library function can be used and how it simplifies writing the main program. -@sidebar So Why Does @command{gawk} have @code{BEGINFILE} and @code{ENDFILE}? +@sidebar So Why Does @command{gawk} Have @code{BEGINFILE} and @code{ENDFILE}? You are probably wondering, if @code{beginfile()} and @code{endfile()} functions can do the job, why does @command{gawk} have -@code{BEGINFILE} and @code{ENDFILE} patterns (@pxref{BEGINFILE/ENDFILE})? +@code{BEGINFILE} and @code{ENDFILE} patterns? Good question. Normally, if @command{awk} cannot open a file, this causes an immediate fatal error. In this case, there is no way for a -user-defined function to deal with the problem, since the mechanism for +user-defined function to deal with the problem, as the mechanism for calling it relies on the file being open and at the first record. Thus, the main reason for @code{BEGINFILE} is to give you a ``hook'' to catch files that cannot be processed. @code{ENDFILE} exists for symmetry, and because it provides an easy way to do per-file cleanup processing. +For more information, refer to @ref{BEGINFILE/ENDFILE}. @end sidebar @node Rewind Function @subsection Rereading the Current File @cindex files, reading -Another request for a new built-in function was for a @code{rewind()} +Another request for a new built-in function was for a function that would make it possible to reread the current file. The requesting user didn't want to have to use @code{getline} (@pxref{Getline}) @@ -19370,7 +20732,7 @@ However, as long as you are not in the @code{END} rule, it is quite easy to arrange to immediately close the current input file and then start over with it from the top. -For lack of a better name, we'll call it @code{rewind()}: +For lack of a better name, we'll call the function @code{rewind()}: @cindex @code{rewind()} user-defined function @example @@ -19404,34 +20766,26 @@ @c endfile @end example -This code relies on the @code{ARGIND} variable -(@pxref{Auto-set}), -which is specific to @command{gawk}. -If you are not using -@command{gawk}, you can use ideas presented in -@ifnotinfo -the previous @value{SECTION} -@end ifnotinfo -@ifinfo -@ref{Filetrans Function}, -@end ifinfo -to either update @code{ARGIND} on your own -or modify this code as appropriate. - -The @code{rewind()} function also relies on the @code{nextfile} keyword -(@pxref{Nextfile Statement}). +The @code{rewind()} function relies on the @code{ARGIND} variable +(@pxref{Auto-set}), which is specific to @command{gawk}. It also +relies on the @code{nextfile} keyword (@pxref{Nextfile Statement}). +Because of this, you should not call it from an @code{ENDFILE} rule. +(This isn't necessary anyway, because @command{gawk} goes to the next +file as soon as an @code{ENDFILE} rule finishes!) @node File Checking -@subsection Checking for Readable Data Files +@subsection Checking for Readable @value{DDF}s @cindex troubleshooting, readable data files @cindex readable data files@comma{} checking @cindex files, skipping -Normally, if you give @command{awk} a data file that isn't readable, -it stops with a fatal error. There are times when you -might want to just ignore such files and keep going. You can -do this by prepending the following program to your @command{awk} -program: +Normally, if you give @command{awk} a @value{DF} that isn't readable, +it stops with a fatal error. There are times when you might want to +just ignore such files and keep going.@footnote{The @code{BEGINFILE} +special pattern (@pxref{BEGINFILE/ENDFILE}) provides an alternative +mechanism for dealing with files that can't be opened. However, the +code here provides a portable solution.} You can do this by prepending +the following program to your @command{awk} program: @cindex @code{readable.awk} program @example @@ -19450,7 +20804,7 @@ BEGIN @{ for (i = 1; i < ARGC; i++) @{ - if (ARGV[i] ~ /^[[:alpha:]_][[:alnum:]_]*=.*/ \ + if (ARGV[i] ~ /^[a-zA-Z_][a-zA-Z0-9_]*=.*/ \ || ARGV[i] == "-" || ARGV[i] == "/dev/stdin") continue # assignment or standard input else if ((getline junk < ARGV[i]) < 0) # unreadable @@ -19465,26 +20819,31 @@ @cindex troubleshooting, @code{getline} function This works, because the @code{getline} won't be fatal. Removing the element from @code{ARGV} with @code{delete} -skips the file (since it's no longer in the list). +skips the file (because it's no longer in the list). See also @ref{ARGC and ARGV}. +Because @command{awk} variable names only allow the English letters, +the regular expression check purposely does not use character classes +such as @samp{[:alpha:]} and @samp{[:alnum:]} +(@pxref{Bracket Expressions}). + @node Empty Files -@subsection Checking For Zero-length Files +@subsection Checking for Zero-Length Files All known @command{awk} implementations silently skip over zero-length files. -This is a by-product of @command{awk}'s implicit +This is a by-product of @command{awk}'s implicit read-a-record-and-match-against-the-rules loop: when @command{awk} tries to read a record from an empty file, it immediately receives an -end of file indication, closes the file, and proceeds on to the next -command-line data file, @emph{without} executing any user-level +end-of-file indication, closes the file, and proceeds on to the next +command-line @value{DF}, @emph{without} executing any user-level @command{awk} program code. Using @command{gawk}'s @code{ARGIND} variable (@pxref{Built-in Variables}), it is possible to detect when an empty -data file has been skipped. Similar to the library file presented +@value{DF} has been skipped. Similar to the library file presented in @ref{Filetrans Function}, the following library file calls a function named @code{zerofile()} that the user must provide. The arguments passed are -the file name and the position in @code{ARGV} where it was found: +the @value{FN} and the position in @code{ARGV} where it was found: @cindex @code{zerofile.awk} program @example @@ -19531,56 +20890,16 @@ condition of the @code{for} loop uses the @samp{<=} operator, not @samp{<}. -As an exercise, you might consider whether this same problem can -be solved without relying on @command{gawk}'s @code{ARGIND} variable. - -As a second exercise, revise this code to handle the case where -an intervening value in @code{ARGV} is a variable assignment. - -@ignore -# zerofile2.awk --- same thing, portably - -BEGIN @{ - ARGIND = Argind = 0 - for (i = 1; i < ARGC; i++) - Fnames[ARGV[i]]++ - -@} -FNR == 1 @{ - while (ARGV[ARGIND] != FILENAME) - ARGIND++ - Seen[FILENAME]++ - if (Seen[FILENAME] == Fnames[FILENAME]) - do - ARGIND++ - while (ARGV[ARGIND] != FILENAME) -@} -ARGIND > Argind + 1 @{ - for (Argind++; Argind < ARGIND; Argind++) - zerofile(ARGV[Argind], Argind) -@} -ARGIND != Argind @{ - Argind = ARGIND -@} -END @{ - if (ARGIND < ARGC - 1) - ARGIND = ARGC - 1 - if (ARGIND > Argind) - for (Argind++; Argind <= ARGIND; Argind++) - zerofile(ARGV[Argind], Argind) -@} -@end ignore - @node Ignoring Assigns -@subsection Treating Assignments as File Names +@subsection Treating Assignments as @value{FFN}s @cindex assignments as filenames @cindex filenames, assignments as Occasionally, you might not want @command{awk} to process command-line variable assignments (@pxref{Assignment Options}). -In particular, if you have a file name that contains an @samp{=} character, -@command{awk} treats the file name as an assignment, and does not process it. +In particular, if you have a @value{FN} that contains an @samp{=} character, +@command{awk} treats the @value{FN} as an assignment and does not process it. Some users have suggested an additional command-line option for @command{gawk} to disable command-line assignments. However, some simple programming with @@ -19604,7 +20923,7 @@ function disable_assigns(argc, argv, i) @{ for (i = 1; i < argc; i++) - if (argv[i] ~ /^[[:alpha:]_][[:alnum:]_]*=.*/) + if (argv[i] ~ /^[a-zA-Z_][a-zA-Z0-9_]*=.*/) argv[i] = ("./" argv[i]) @} @@ -19624,36 +20943,28 @@ The function works by looping through the arguments. It prepends @samp{./} to any argument that matches the form -of a variable assignment, turning that argument into a file name. +of a variable assignment, turning that argument into a @value{FN}. The use of @code{No_command_assign} allows you to disable command-line assignments at invocation time, by giving the variable a true value. When not set, it is initially zero (i.e., false), so the command-line arguments are left alone. -@c ENDOFRANGE dataf -@c ENDOFRANGE flibdataf -@c ENDOFRANGE libfdataf @node Getopt Function @section Processing Command-Line Options -@c STARTOFRANGE libfclo @cindex libraries of @command{awk} functions, command-line options -@c STARTOFRANGE flibclo @cindex functions, library, command-line options -@c STARTOFRANGE clop @cindex command-line options, processing -@c STARTOFRANGE oclp @cindex options, command-line, processing -@c STARTOFRANGE clibf @cindex functions, library, C library @cindex arguments, processing -Most utilities on POSIX compatible systems take options on +Most utilities on POSIX-compatible systems take options on the command line that can be used to change the way a program behaves. @command{awk} is an example of such a program (@pxref{Options}). -Often, options take @dfn{arguments}; i.e., data that the program needs to -correctly obey the command-line option. For example, @command{awk}'s +Often, options take @dfn{arguments} (i.e., data that the program needs to +correctly obey the command-line option). For example, @command{awk}'s @option{-F} option requires a string to use as the field separator. The first occurrence on the command line of either @option{--} or a string that does not begin with @samp{-} ends the options. @@ -19708,7 +21019,6 @@ @item optopt The letter representing the command-line option. -@c While not usually documented, most versions supply this variable. @end table The following C fragment shows how @code{getopt()} might process command-line @@ -19758,8 +21068,7 @@ (@pxref{String Functions}).@footnote{This function was written before @command{gawk} acquired the ability to split strings into single characters using @code{""} as the separator. -We have left it alone, since using @code{substr()} is more portable.} -@c FIXME: could use split(str, a, "") to do it more easily. +We have left it alone, as using @code{substr()} is more portable.} The discussion that follows walks through the code a bit at a time: @@ -19847,8 +21156,7 @@ i = index(options, thisopt) if (i == 0) @{ if (Opterr) - printf("%c -- invalid option\n", - thisopt) > "/dev/stderr" + printf("%c -- invalid option\n", thisopt) > "/dev/stderr" if (_opti >= length(argv[Optind])) @{ Optind++ _opti = 0 @@ -19928,9 +21236,9 @@ on the next call to @code{getopt()}. The @code{BEGIN} rule initializes both @code{Opterr} and @code{Optind} to one. -@code{Opterr} is set to one, since the default behavior is for @code{getopt()} +@code{Opterr} is set to one, because the default behavior is for @code{getopt()} to print a diagnostic message upon seeing an invalid option. @code{Optind} -is set to one, since there's no reason to look at the program name, which is +is set to one, because there's no reason to look at the program name, which is in @code{ARGV[0]}: @example @@ -19942,7 +21250,7 @@ # test program if (_getopt_test) @{ while ((_go_c = getopt(ARGC, ARGV, "ab:cd")) != -1) - printf("c = <%c>, optarg = <%s>\n", + printf("c = <%c>, Optarg = <%s>\n", _go_c, Optarg) printf("non-option arguments:\n") for (; Optind < ARGC; Optind++) @@ -19953,68 +21261,71 @@ @c endfile @end example -The rest of the @code{BEGIN} rule is a simple test program. Here is the -result of two sample runs of the test program: +The rest of the @code{BEGIN} rule is a simple test program. Here are the +results of two sample runs of the test program: @example $ @kbd{awk -f getopt.awk -v _getopt_test=1 -- -a -cbARG bax -x} -@print{} c =
, optarg = <> -@print{} c = , optarg = <> -@print{} c = , optarg = +@print{} c = , Optarg = <> +@print{} c = , Optarg = <> +@print{} c = , Optarg = @print{} non-option arguments: @print{} ARGV[3] = @print{} ARGV[4] = <-x> $ @kbd{awk -f getopt.awk -v _getopt_test=1 -- -a -x -- xyz abc} -@print{} c = , optarg = <> +@print{} c = , Optarg = <> @error{} x -- invalid option -@print{} c = , optarg = <> +@print{} c = , Optarg = <> @print{} non-option arguments: @print{} ARGV[4] = @print{} ARGV[5] = @end example -In both runs, -the first @option{--} terminates the arguments to @command{awk}, so that it does -not try to interpret the @option{-a}, etc., as its own options. +In both runs, the first @option{--} terminates the arguments to +@command{awk}, so that it does not try to interpret the @option{-a}, +etc., as its own options. @quotation NOTE -After @code{getopt()} is through, it is the responsibility of the user level -code to -clear out all the elements of @code{ARGV} from 1 to @code{Optind}, -so that @command{awk} does not try to process the command-line options -as file names. +After @code{getopt()} is through, +user-level code must clear out all the elements of @code{ARGV} from 1 +to @code{Optind}, so that @command{awk} does not try to process the +command-line options as @value{FN}s. @end quotation +Using @samp{#!} with the @option{-E} option may help avoid +conflicts between your program's options and @command{gawk}'s options, +as @option{-E} causes @command{gawk} to abandon processing of +further options +(@DBPXREF{Executable Scripts} and +@ifnotdocbook +@pxref{Options}). +@end ifnotdocbook +@ifdocbook +@ref{Options}). +@end ifdocbook + Several of the sample programs presented in @ref{Sample Programs}, use @code{getopt()} to process their arguments. -@c ENDOFRANGE libfclo -@c ENDOFRANGE flibclo -@c ENDOFRANGE clop -@c ENDOFRANGE oclp @node Passwd Functions @section Reading the User Database -@c STARTOFRANGE libfudata @cindex libraries of @command{awk} functions, user database, reading -@c STARTOFRANGE flibudata @cindex functions, library, user database@comma{} reading -@c STARTOFRANGE udatar @cindex user database@comma{} reading -@c STARTOFRANGE dataur @cindex database, users@comma{} reading @cindex @code{PROCINFO} array The @code{PROCINFO} array (@pxref{Built-in Variables}) provides access to the current user's real and effective user and group ID -numbers, and if available, the user's supplementary group set. +numbers, and, if available, the user's supplementary group set. However, because these are numbers, they do not provide very useful information to the average user. There needs to be some way to find the user information associated with the user and group ID numbers. This @value{SECTION} presents a suite of functions for retrieving information from the -user database. @xref{Group Functions}, +user database. @DBXREF{Group Functions} for a similar suite that retrieves information from the group database. @cindex @code{getpwent()} function (C library) @@ -20029,11 +21340,11 @@ and several C language subroutines for obtaining user information. The primary function is @code{getpwent()}, for ``get password entry.'' The ``password'' comes from the original user database file, -@file{/etc/passwd}, which stores user information, along with the +@file{/etc/passwd}, which stores user information along with the encrypted passwords (hence the name). @cindex @command{pwcat} program -While an @command{awk} program could simply read @file{/etc/passwd} +Although an @command{awk} program could simply read @file{/etc/passwd} directly, this file may not contain complete information about the system's set of users.@footnote{It is often the case that password information is stored in a network database.} To be sure you are able to @@ -20045,14 +21356,12 @@ happens, the C program should call @code{endpwent()} to close the database. Following is @command{pwcat}, a C program that ``cats'' the password database: -@c Use old style function header for portability to old systems (SunOS, HP/UX). - @example @c file eg/lib/pwcat.c /* * pwcat.c * - * Generate a printable version of the password database + * Generate a printable version of the password database. */ @c endfile @ignore @@ -20130,12 +21439,12 @@ @item User-ID The user's numeric user ID number. -(On some systems it's a C @code{long}, and not an @code{int}. Thus +(On some systems, it's a C @code{long}, and not an @code{int}. Thus, we cast it to @code{long} for all cases.) @item Group-ID The user's numeric group ID number. -(Similar comments about @code{long} vs.@: @code{int} apply here.) +(Similar comments about @code{long} versus @code{int} apply here.) @item Full name The user's full name, and perhaps other information associated with the @@ -20157,7 +21466,7 @@ @cindex Robbins, Miriam @example $ @kbd{pwcat} -@print{} root:3Ov02d5VaUPB6:0:1:Operator:/:/bin/sh +@print{} root:x:0:1:Operator:/:/bin/sh @print{} nobody:*:65534:65534::/: @print{} daemon:*:1:1::/: @print{} sys:*:2:2::/:/bin/csh @@ -20232,27 +21541,23 @@ routine, we have chosen to put it in @file{/usr/local/libexec/awk}; however, you might want it to be in a different directory on your system. -The function @code{_pw_init()} keeps three copies of the user information -in three associative arrays. The arrays are indexed by username +The function @code{_pw_init()} fills three copies of the user information +into three associative arrays. The arrays are indexed by username (@code{_pw_byname}), by user ID number (@code{_pw_byuid}), and by order of occurrence (@code{_pw_bycount}). -The variable @code{_pw_inited} is used for efficiency, since @code{_pw_init()} +The variable @code{_pw_inited} is used for efficiency, as @code{_pw_init()} needs to be called only once. +@cindex @code{PROCINFO} array, testing the field splitting @cindex @code{getline} command, @code{_pw_init()} function Because this function uses @code{getline} to read information from @command{pwcat}, it first saves the values of @code{FS}, @code{RS}, and @code{$0}. It notes in the variable @code{using_fw} whether field splitting with @code{FIELDWIDTHS} is in effect or not. -Doing so is necessary, since these functions could be called +Doing so is necessary, as these functions could be called from anywhere within a user's program, and the user may have his -or her -own way of splitting records and fields. - -@cindex @code{PROCINFO} array, testing the field splitting -The @code{using_fw} variable checks @code{PROCINFO["FS"]}, which -is @code{"FIELDWIDTHS"} if field splitting is being done with -@code{FIELDWIDTHS}. This makes it possible to restore the correct +or her own way of splitting records and fields. +This makes it possible to restore the correct field-splitting mechanism later. The test can only be true for @command{gawk}. It is false if using @code{FS} or @code{FPAT}, or on some other @command{awk} implementation. @@ -20261,7 +21566,7 @@ and @code{PROCINFO["FS"]}, is similar. The main part of the function uses a loop to read database lines, split -the line into fields, and then store the line into each array as necessary. +the lines into fields, and then store the lines into each array as necessary. When the loop is done, @code{@w{_pw_init()}} cleans up by closing the pipeline, setting @code{@w{_pw_inited}} to one, and restoring @code{FS} (and @code{FIELDWIDTHS} or @code{FPAT} @@ -20351,26 +21656,18 @@ once. If you are worried about squeezing every last cycle out of your @command{awk} program, the check of @code{_pw_inited} could be moved out of @code{_pw_init()} and duplicated in all the other functions. In practice, -this is not necessary, since most @command{awk} programs are I/O-bound, +this is not necessary, as most @command{awk} programs are I/O-bound, and such a change would clutter up the code. -The @command{id} program in @ref{Id Program}, +The @command{id} program in @DBREF{Id Program} uses these functions. -@c ENDOFRANGE libfudata -@c ENDOFRANGE flibudata -@c ENDOFRANGE udatar -@c ENDOFRANGE dataur @node Group Functions @section Reading the Group Database -@c STARTOFRANGE libfgdata @cindex libraries of @command{awk} functions, group database, reading -@c STARTOFRANGE flibgdata @cindex functions, library, group database@comma{} reading -@c STARTOFRANGE gdatar @cindex group database, reading -@c STARTOFRANGE datagr @cindex database, group, reading @cindex @code{PROCINFO} array, and group membership @cindex @code{getgrent()} function (C library) @@ -20380,7 +21677,7 @@ @cindex group file @cindex files, group Much of the discussion presented in -@ref{Passwd Functions}, +@DBREF{Passwd Functions} applies to the group database as well. Although there has traditionally been a well-known file (@file{/etc/group}) in a well-known format, the POSIX standard only provides a set of C library routines @@ -20398,7 +21695,7 @@ /* * grcat.c * - * Generate a printable version of the group database + * Generate a printable version of the group database. */ @c endfile @ignore @@ -20485,12 +21782,12 @@ @item Group ID Number The group's numeric group ID number; -this number must be unique within the file. -(On some systems it's a C @code{long}, and not an @code{int}. Thus +the association of name to number must be unique within the file. +(On some systems it's a C @code{long}, and not an @code{int}. Thus, we cast it to @code{long} for all cases.) @item Group Member List -A comma-separated list of user names. These users are members of the group. +A comma-separated list of usernames. These users are members of the group. Modern Unix systems allow users to be members of several groups simultaneously. If your system does, then there are elements @code{"group1"} through @code{"group@var{N}"} in @code{PROCINFO} @@ -20533,8 +21830,7 @@ @c line break on _gr_init for smallbook @c file eg/lib/groupawk.in -BEGIN \ -@{ +BEGIN @{ # Change to suit your system _gr_awklib = "/usr/local/libexec/awk/" @} @@ -20567,8 +21863,7 @@ n = split($4, a, "[ \t]*,[ \t]*") for (i = 1; i <= n; i++) if (a[i] in _gr_groupsbyuser) - _gr_groupsbyuser[a[i]] = \ - _gr_groupsbyuser[a[i]] " " $1 + _gr_groupsbyuser[a[i]] = gr_groupsbyuser[a[i]] " " $1 else _gr_groupsbyuser[a[i]] = $1 @@ -20602,15 +21897,15 @@ @code{$0}, and then sets @code{FS} and @code{RS} to the correct values for scanning the group information. It also takes care to note whether @code{FIELDWIDTHS} or @code{FPAT} -is being used, and to restore the appropriate field splitting mechanism. +is being used, and to restore the appropriate field-splitting mechanism. -The group information is stored is several associative arrays. +The group information is stored in several associative arrays. The arrays are indexed by group name (@code{@w{_gr_byname}}), by group ID number (@code{@w{_gr_bygid}}), and by position in the database (@code{@w{_gr_bycount}}). -There is an additional array indexed by user name (@code{@w{_gr_groupsbyuser}}), +There is an additional array indexed by username (@code{@w{_gr_groupsbyuser}}), which is a space-separated list of groups to which each user belongs. -Unlike the user database, it is possible to have multiple records in the +Unlike in the user database, it is possible to have multiple records in the database for the same group. This is common when a group has a large number of members. A pair of such entries might look like the following: @@ -20620,14 +21915,14 @@ @end example For this reason, @code{_gr_init()} looks to see if a group name or -group ID number is already seen. If it is, then the user names are -simply concatenated onto the previous list of users. (There is actually a +group ID number is already seen. If so, the usernames are +simply concatenated onto the previous list of users.@footnote{There is a subtle problem with the code just presented. Suppose that the first time there were no names. This code adds the names with -a leading comma. It also doesn't check that there is a @code{$4}.) +a leading comma. It also doesn't check that there is a @code{$4}.} Finally, @code{_gr_init()} closes the pipeline to @command{grcat}, restores -@code{FS} (and @code{FIELDWIDTHS} or @code{FPAT} if necessary), @code{RS}, and @code{$0}, +@code{FS} (and @code{FIELDWIDTHS} or @code{FPAT}, if necessary), @code{RS}, and @code{$0}, initializes @code{_gr_count} to zero (it is used later), and makes @code{_gr_inited} nonzero. @@ -20666,7 +21961,7 @@ @cindex @code{getgruser()} function (C library) The @code{getgruser()} function does not have a C counterpart. It takes a -user name and returns the list of groups that have the user as a member: +username and returns the list of groups that have the user as a member: @cindex @code{getgruser()} function, user-defined @example @@ -20695,7 +21990,6 @@ @} @c endfile @end example -@c ENDOFRANGE clibf @cindex @code{endgrent()} function (C library) The @code{endgrent()} function resets @code{_gr_count} to zero so that @code{getgrent()} can @@ -20720,20 +22014,20 @@ associative arrays. The functions that the user calls are themselves very simple, relying on @command{awk}'s associative arrays to do work. -The @command{id} program in @ref{Id Program}, +The @command{id} program in @DBREF{Id Program} uses these functions. @node Walking Arrays @section Traversing Arrays of Arrays -@ref{Arrays of Arrays}, described how @command{gawk} +@DBREF{Arrays of Arrays} described how @command{gawk} provides arrays of arrays. In particular, any element of -an array may be either a scalar, or another array. The +an array may be either a scalar or another array. The @code{isarray()} function (@pxref{Type Functions}) lets you distinguish an array from a scalar. The following function, @code{walk_array()}, recursively traverses -an array, printing each element's indices and value. +an array, printing the element indices and values. You call it with the array and a string representing the name of the array: @@ -20776,46 +22070,199 @@ @example $ @kbd{gawk -f walk_array.awk} -@print{} a[4][1][1] = 411 -@print{} a[4][2] = 42 @print{} a[1] = 1 @print{} a[2][1] = 21 @print{} a[2][2] = 22 @print{} a[3] = 3 +@print{} a[4][1][1] = 411 +@print{} a[4][2] = 42 +@end example + +The function just presented simply prints the +name and value of each scalar array element. However, it is easy to +generalize it, by passing in the name of a function to call +when walking an array. The modified function looks like this: + +@example +@c file eg/lib/processarray.awk +function process_array(arr, name, process, do_arrays, i, new_name) +@{ + for (i in arr) @{ + new_name = (name "[" i "]") + if (isarray(arr[i])) @{ + if (do_arrays) + @@process(new_name, arr[i]) + process_array(arr[i], new_name, process, do_arrays) + @} else + @@process(new_name, arr[i]) + @} +@} +@c endfile +@end example + +The arguments are as follows: + +@table @code +@item arr +The array. + +@item name +The name of the array (a string). + +@item process +The name of the function to call. + +@item do_arrays +If this is true, the function can handle elements that are subarrays. +@end table + +If subarrays are to be processed, that is done before walking them further. + +When run with the following scaffolding, the function produces the same +results as does the earlier version of @code{walk_array()}: + +@example +BEGIN @{ + a[1] = 1 + a[2][1] = 21 + a[2][2] = 22 + a[3] = 3 + a[4][1][1] = 411 + a[4][2] = 42 + + process_array(a, "a", "do_print", 0) +@} + +function do_print(name, element) +@{ + printf "%s = %s\n", name, element +@} @end example -Walking an array and processing each element is a general-purpose -operation. You might want to consider generalizing the @code{walk_array()} -function by adding an additional parameter named @code{process}. - -Then, inside the loop, instead of simply printing the array element's -index and value, use the indirect function call syntax -(@pxref{Indirect Calls}) on @code{process}, passing it the index -and the value. - -When calling @code{walk_array()}, you would pass the name of a user-defined -function that expects to receive an index and a value, and then processes -the element. - - -@c ENDOFRANGE libfgdata -@c ENDOFRANGE flibgdata -@c ENDOFRANGE gdatar -@c ENDOFRANGE libf -@c ENDOFRANGE flib -@c ENDOFRANGE fudlib -@c ENDOFRANGE datagr +@node Library Functions Summary +@section Summary + +@itemize @value{BULLET} +@item +Reading programs is an excellent way to learn Good Programming. +The functions and programs provided in this @value{CHAPTER} and the next +are intended to serve that purpose. + +@item +When writing general-purpose library functions, put some thought into how +to name any global variables so that they won't conflict with variables +from a user's program. + +@item +The functions presented here fit into the following categories: + +@c nested list +@table @asis +@item General problems +Number-to-string conversion, testing assertions, rounding, random number +generation, converting characters to numbers, joining strings, getting +easily usable time-of-day information, and reading a whole file in +one shot + +@item Managing @value{DF}s +Noting @value{DF} boundaries, rereading the current file, checking for +readable files, checking for zero-length files, and treating assignments +as @value{FN}s + +@item Processing command-line options +An @command{awk} version of the standard C @code{getopt()} function + +@item Reading the user and group databases +Two sets of routines that parallel the C library versions + +@item Traversing arrays of arrays +Two functions that traverse an array of arrays to any depth +@end table +@c end nested list + +@end itemize + +@c EXCLUDE START +@node Library Exercises +@section Exercises + +@enumerate +@item +In @ref{Empty Files}, we presented the @file{zerofile.awk} program, +which made use of @command{gawk}'s @code{ARGIND} variable. Can this +problem be solved without relying on @code{ARGIND}? If so, how? + +@ignore +# zerofile2.awk --- same thing, portably + +BEGIN @{ + ARGIND = Argind = 0 + for (i = 1; i < ARGC; i++) + Fnames[ARGV[i]]++ + +@} +FNR == 1 @{ + while (ARGV[ARGIND] != FILENAME) + ARGIND++ + Seen[FILENAME]++ + if (Seen[FILENAME] == Fnames[FILENAME]) + do + ARGIND++ + while (ARGV[ARGIND] != FILENAME) +@} +ARGIND > Argind + 1 @{ + for (Argind++; Argind < ARGIND; Argind++) + zerofile(ARGV[Argind], Argind) +@} +ARGIND != Argind @{ + Argind = ARGIND +@} +END @{ + if (ARGIND < ARGC - 1) + ARGIND = ARGC - 1 + if (ARGIND > Argind) + for (Argind++; Argind <= ARGIND; Argind++) + zerofile(ARGV[Argind], Argind) +@} +@end ignore + +@item +As a related challenge, revise that code to handle the case where +an intervening value in @code{ARGV} is a variable assignment. + +@item +@DBREF{Walking Arrays} presented a function that walked a multidimensional +array to print it out. However, walking an array and processing +each element is a general-purpose operation. Generalize the +@code{walk_array()} function by adding an additional parameter named +@code{process}. + +Then, inside the loop, instead of printing the array element's index and +value, use the indirect function call syntax (@pxref{Indirect Calls}) +on @code{process}, passing it the index and the value. + +When calling @code{walk_array()}, you would pass the name of a +user-defined function that expects to receive an index and a value, +and then processes the element. + +Test your new version by printing the array; you should end up with +output identical to that of the original version. + +@end enumerate +@c EXCLUDE END + @node Sample Programs @chapter Practical @command{awk} Programs -@c STARTOFRANGE awkpex @cindex @command{awk} programs, examples of +@c FULLXREF ON @ref{Library Functions}, presents the idea that reading programs in a language contributes to learning that language. This @value{CHAPTER} continues that theme, presenting a potpourri of @command{awk} programs for your reading enjoyment. +@c FULLXREF OFF @ifnotinfo There are three sections. The first describes how to run the programs presented @@ -20824,10 +22271,10 @@ The second presents @command{awk} versions of several common POSIX utilities. These are programs that you are hopefully already familiar with, -and therefore, whose problems are understood. +and therefore whose problems are understood. By reimplementing these programs in @command{awk}, you can focus on the @command{awk}-related aspects of solving -the programming problem. +the programming problems. The third is a grab bag of interesting programs. These solve a number of different data-manipulation and management @@ -20842,6 +22289,8 @@ * Running Examples:: How to run these examples. * Clones:: Clones of common utilities. * Miscellaneous Programs:: Some interesting @command{awk} programs. +* Programs Summary:: Summary of programs. +* Programs Exercises:: Exercises. @end menu @node Running Examples @@ -20856,7 +22305,7 @@ @noindent Here, @var{program} is the name of the @command{awk} program (such as @file{cut.awk}), @var{options} are any command-line options for the -program that start with a @samp{-}, and @var{files} are the actual data files. +program that start with a @samp{-}, and @var{files} are the actual @value{DF}s. If your system supports the @samp{#!} executable interpreter mechanism (@pxref{Executable Scripts}), @@ -20874,7 +22323,6 @@ @node Clones @section Reinventing Wheels for Fun and Profit -@c STARTOFRANGE posimawk @cindex POSIX, programs@comma{} implementing in @command{awk} This @value{SECTION} presents a number of POSIX utilities implemented in @@ -20886,7 +22334,7 @@ replace the installed versions on your system. Nor may all of these programs be fully compliant with the most recent POSIX standard. This is not a problem; their -purpose is to illustrate @command{awk} language programming for ``real world'' +purpose is to illustrate @command{awk} language programming for ``real-world'' tasks. The programs are presented in alphabetical order. @@ -20902,14 +22350,11 @@ @end menu @node Cut Program -@subsection Cutting out Fields and Columns +@subsection Cutting Out Fields and Columns @cindex @command{cut} utility -@c STARTOFRANGE cut @cindex @command{cut} utility -@c STARTOFRANGE ficut @cindex fields, cutting -@c STARTOFRANGE colcut @cindex columns, cutting The @command{cut} utility selects, or ``cuts,'' characters or fields from its standard input and sends them to its standard output. @@ -20918,7 +22363,7 @@ @dfn{delimiter} (i.e., the field-separator character). @command{cut}'s definition of fields is less general than @command{awk}'s. -A common use of @command{cut} might be to pull out just the login name of +A common use of @command{cut} might be to pull out just the login names of logged-on users from the output of @command{who}. For example, the following pipeline generates a sorted, unique list of the logged-on users: @@ -20980,28 +22425,16 @@ # Requires getopt() and join() library functions @group -function usage( e1, e2) +function usage() @{ - e1 = "usage: cut [-f list] [-d c] [-s] [files...]" - e2 = "usage: cut [-c list] [files...]" - print e1 > "/dev/stderr" - print e2 > "/dev/stderr" + print("usage: cut [-f list] [-d c] [-s] [files...]") > "/dev/stderr" + print("usage: cut [-c list] [files...]") > "/dev/stderr" exit 1 @} @end group @c endfile @end example -@noindent -The variables @code{e1} and @code{e2} are used so that the function -fits nicely on the -@ifnotinfo -page. -@end ifnotinfo -@ifnottex -screen. -@end ifnottex - @cindex @code{BEGIN} pattern, running @command{awk} programs and @cindex @code{FS} variable, running @command{awk} programs and Next comes a @code{BEGIN} rule that parses the command-line options. @@ -21016,8 +22449,7 @@ @example @c file eg/prog/cut.awk -BEGIN \ -@{ +BEGIN @{ FS = "\t" # default OFS = FS while ((c = getopt(ARGC, ARGV, "sf:c:d:")) != -1) @{ @@ -21030,7 +22462,7 @@ OFS = "" @} else if (c == "d") @{ if (length(Optarg) > 1) @{ - printf("Using first character of %s" \ + printf("cut: using first character of %s" \ " for delimiter\n", Optarg) > "/dev/stderr" Optarg = substr(Optarg, 1, 1) @} @@ -21039,7 +22471,7 @@ if (FS == " ") # defeat awk semantics FS = "[ ]" @} else if (c == "s") - suppress++ + suppress = 1 else usage() @} @@ -21061,7 +22493,7 @@ we have to clear out all the elements of @code{ARGV} from 1 to @code{Optind}, so that @command{awk} does not try to process the command-line options -as file names. +as @value{FN}s. After dealing with the command-line options, the program verifies that the options make sense. Only one or the other of @option{-c} and @option{-f} @@ -21111,7 +22543,7 @@ m = split(f[i], g, "-") @group if (m != 2 || g[1] >= g[2]) @{ - printf("bad field list: %s\n", + printf("cut: bad field list: %s\n", f[i]) > "/dev/stderr" exit 1 @} @@ -21158,7 +22590,7 @@ if (index(f[i], "-") != 0) @{ # range m = split(f[i], g, "-") if (m != 2 || g[1] >= g[2]) @{ - printf("bad character list: %s\n", + printf("cut: bad character list: %s\n", f[i]) > "/dev/stderr" exit 1 @} @@ -21192,7 +22624,7 @@ @c endfile @end example -Next is the rule that actually processes the data. If the @option{-s} option +Next is the rule that processes the data. If the @option{-s} option is given, then @code{suppress} is true. The first @code{if} statement makes sure that the input record does have the field separator. If @command{cut} is processing fields, @code{suppress} is true, and the field @@ -21224,42 +22656,34 @@ @end example This version of @command{cut} relies on @command{gawk}'s @code{FIELDWIDTHS} -variable to do the character-based cutting. While it is possible in +variable to do the character-based cutting. It is possible in other @command{awk} implementations to use @code{substr()} -(@pxref{String Functions}), +(@pxref{String Functions}), but it is also extremely painful. The @code{FIELDWIDTHS} variable supplies an elegant solution to the problem of picking the input line apart by characters. -@c ENDOFRANGE cut -@c ENDOFRANGE ficut -@c ENDOFRANGE colcut -@c Exercise: Rewrite using split with "". @node Egrep Program @subsection Searching for Regular Expressions in Files -@c STARTOFRANGE regexps @cindex regular expressions, searching for -@c STARTOFRANGE sfregexp @cindex searching, files for regular expressions -@c STARTOFRANGE fsregexp @cindex files, searching for regular expressions -@c STARTOFRANGE egrep @cindex @command{egrep} utility The @command{egrep} utility searches files for patterns. It uses regular expressions that are almost identical to those available in @command{awk} (@pxref{Regexp}). You invoke it as follows: -@example -egrep @r{[} @var{options} @r{]} '@var{pattern}' @var{files} @dots{} -@end example +@display +@command{egrep} [@var{options}] @code{'@var{pattern}'} @var{files} @dots{} +@end display The @var{pattern} is a regular expression. In typical usage, the regular expression is quoted to prevent the shell from expanding any of the -special characters as file name wildcards. Normally, @command{egrep} -prints the lines that matched. If multiple file names are provided on +special characters as @value{FN} wildcards. Normally, @command{egrep} +prints the lines that matched. If multiple @value{FN}s are provided on the command line, each output line is preceded by the name of the file and a colon. @@ -21298,7 +22722,7 @@ The program begins with a descriptive comment and then a @code{BEGIN} rule that processes the command-line arguments with @code{getopt()}. The @option{-i} (ignore case) option is particularly easy with @command{gawk}; we just use the -@code{IGNORECASE} built-in variable +@code{IGNORECASE} predefined variable (@pxref{Built-in Variables}): @cindex @code{egrep.awk} program @@ -21350,7 +22774,7 @@ command line is used. The @command{awk} command-line arguments up to @code{ARGV[Optind]} are cleared, so that @command{awk} won't try to process them as files. If no files are specified, the standard input is used, and if multiple files are -specified, we make sure to note this so that the file names can precede the +specified, we make sure to note this so that the @value{FN}s can precede the matched lines in the output: @example @@ -21372,7 +22796,7 @@ @c endfile @end example -The last two lines are commented out, since they are not needed in +The last two lines are commented out, as they are not needed in @command{gawk}. They should be uncommented if you have to use another version of @command{awk}. @@ -21382,9 +22806,7 @@ also introduces a subtle bug; if a match happens, we output the translated line, not the original.} The rule is -commented out since it is not necessary with @command{gawk}: - -@c Exercise: Fix this, w/array and new line as key to original line +commented out as it is not necessary with @command{gawk}: @example @c file eg/prog/egrep.awk @@ -21436,6 +22858,11 @@ @c endfile @end example +The @code{BEGINFILE} and @code{ENDFILE} special patterns +(@pxref{BEGINFILE/ENDFILE}) could be used, but then the program would be +@command{gawk}-specific. Additionally, this example was written before +@command{gawk} acquired @code{BEGINFILE} and @code{ENDFILE}. + The following rule does most of the work of matching lines. The variable @code{matches} is true if the line matched the pattern. If the user wants lines that did not match, the sense of @code{matches} is inverted @@ -21445,12 +22872,12 @@ @code{next} statement just moves on to the next record. A number of additional tests are made, but they are only done if we -are not counting lines. First, if the user only wants exit status +are not counting lines. First, if the user only wants the exit status (@code{no_print} is true), then it is enough to know that @emph{one} line in this file matched, and we can skip on to the next file with -@code{nextfile}. Similarly, if we are only printing file names, we can -print the file name, and then skip to the next file with @code{nextfile}. -Finally, each line is printed, with a leading file name and colon +@code{nextfile}. Similarly, if we are only printing @value{FN}s, we can +print the @value{FN}, and then skip to the next file with @code{nextfile}. +Finally, each line is printed, with a leading @value{FN} and colon if necessary: @cindex @code{!} (exclamation point), @code{!} operator @@ -21486,15 +22913,12 @@ @end example The @code{END} rule takes care of producing the correct exit status. If -there are no matches, the exit status is one; otherwise it is zero: +there are no matches, the exit status is one; otherwise, it is zero: @example @c file eg/prog/egrep.awk -END \ -@{ - if (total == 0) - exit 1 - exit 0 +END @{ + exit (total == 0) @} @c endfile @end example @@ -21504,41 +22928,21 @@ @example @c file eg/prog/egrep.awk -function usage( e) +function usage() @{ - e = "Usage: egrep [-csvil] [-e pat] [files ...]" - e = e "\n\tegrep [-csvil] pat [files ...]" - print e > "/dev/stderr" + print("Usage: egrep [-csvil] [-e pat] [files ...]") > "/dev/stderr" + print("\n\tegrep [-csvil] pat [files ...]") > "/dev/stderr" exit 1 @} @c endfile @end example -The variable @code{e} is used so that the function fits nicely -on the printed page. - -@cindex @code{END} pattern, backslash continuation and -@cindex @code{\} (backslash), continuing lines and -@cindex backslash (@code{\}), continuing lines and -Just a note on programming style: you may have noticed that the @code{END} -rule uses backslash continuation, with the open brace on a line by -itself. This is so that it more closely resembles the way functions -are written. Many of the examples -in this @value{CHAPTER} -use this style. You can decide for yourself if you like writing -your @code{BEGIN} and @code{END} rules this way -or not. -@c ENDOFRANGE regexps -@c ENDOFRANGE sfregexp -@c ENDOFRANGE fsregexp -@c ENDOFRANGE egrep @node Id Program -@subsection Printing out User Information +@subsection Printing Out User Information @cindex printing, user information @cindex users, information about, printing -@c STARTOFRANGE id @cindex @command{id} utility The @command{id} utility lists a user's real and effective user ID numbers, real and effective group ID numbers, and the user's group set, if any. @@ -21548,7 +22952,7 @@ @example $ @kbd{id} -@print{} uid=500(arnold) gid=500(arnold) groups=6(disk),7(lp),19(floppy) +@print{} uid=1000(arnold) gid=1000(arnold) groups=1000(arnold),4(adm),7(lp),27(sudo) @end example @cindex @code{PROCINFO} array, and user and group ID numbers @@ -21561,7 +22965,8 @@ It uses the user database library functions (@pxref{Passwd Functions}) and the group database library functions -(@pxref{Group Functions}): +(@pxref{Group Functions}) +from @ref{Library Functions}. The program is fairly straightforward. All the work is done in the @code{BEGIN} rule. The user and group ID numbers are obtained from @@ -21584,6 +22989,8 @@ # Arnold Robbins, arnold@@skeeve.com, Public Domain # May 1993 # Revised February 1996 +# Revised May 2014 +# Revised September 2014 @c endfile @end ignore @@ -21593,8 +23000,7 @@ # egid=5(blat) groups=9(nine),2(two),1(one) @group -BEGIN \ -@{ +BEGIN @{ uid = PROCINFO["uid"] euid = PROCINFO["euid"] gid = PROCINFO["gid"] @@ -21603,34 +23009,22 @@ printf("uid=%d", uid) pw = getpwuid(uid) - if (pw != "") @{ - split(pw, a, ":") - printf("(%s)", a[1]) - @} + pr_first_field(pw) if (euid != uid) @{ printf(" euid=%d", euid) pw = getpwuid(euid) - if (pw != "") @{ - split(pw, a, ":") - printf("(%s)", a[1]) - @} + pr_first_field(pw) @} printf(" gid=%d", gid) pw = getgrgid(gid) - if (pw != "") @{ - split(pw, a, ":") - printf("(%s)", a[1]) - @} + pr_first_field(pw) if (egid != gid) @{ printf(" egid=%d", egid) pw = getgrgid(egid) - if (pw != "") @{ - split(pw, a, ":") - printf("(%s)", a[1]) - @} + pr_first_field(pw) @} for (i = 1; ("group" i) in PROCINFO; i++) @{ @@ -21639,23 +23033,28 @@ group = PROCINFO["group" i] printf("%d", group) pw = getgrgid(group) - if (pw != "") @{ - split(pw, a, ":") - printf("(%s)", a[1]) - @} + pr_first_field(pw) if (("group" (i+1)) in PROCINFO) printf(",") @} print "" @} + +function pr_first_field(str, a) +@{ + if (str != "") @{ + split(str, a, ":") + printf("(%s)", a[1]) + @} +@} @c endfile @end example The test in the @code{for} loop is worth noting. Any supplementary groups in the @code{PROCINFO} array have the indices @code{"group1"} through @code{"group@var{N}"} for some -@var{N}, i.e., the total number of supplementary groups. +@var{N} (i.e., the total number of supplementary groups). However, we don't know in advance how many of these groups there are. @@ -21668,40 +23067,36 @@ groups; then the condition is false the first time it's tested, and the loop body never executes. -@c exercise!!! -@ignore -The POSIX version of @command{id} takes arguments that control which -information is printed. Modify this version to accept the same -arguments and perform in the same way. -@end ignore -@c ENDOFRANGE id +The @code{pr_first_field()} function simply isolates out some +code that is used repeatedly, making the whole program +shorter and cleaner. In particular, moving the check for +the empty string into this function saves several lines of code. + @node Split Program @subsection Splitting a Large File into Pieces @c FIXME: One day, update to current POSIX version of split -@c STARTOFRANGE filspl @cindex files, splitting -@c STARTOFRANGE split @cindex @code{split} utility The @command{split} program splits large text files into smaller pieces. Usage is as follows:@footnote{This is the traditional usage. The POSIX usage is different, but not relevant for what the program aims to demonstrate.} -@example -split @r{[}-@var{count}@r{]} file @r{[} @var{prefix} @r{]} -@end example +@display +@command{split} [@code{-@var{count}}] [@var{file}] [@var{prefix}] +@end display By default, the output files are named @file{xaa}, @file{xab}, and so on. Each file has -1000 lines in it, with the likely exception of the last file. To change the +1,000 lines in it, with the likely exception of the last file. To change the number of lines in each file, supply a number on the command line -preceded with a minus; e.g., @samp{-500} for files with 500 lines in them -instead of 1000. To change the name of the output files to something like +preceded with a minus sign (e.g., @samp{-500} for files with 500 lines in them +instead of 1,000). To change the names of the output files to something like @file{myfileaa}, @file{myfileab}, and so on, supply an additional -argument that specifies the file name prefix. +argument that specifies the @value{FN} prefix. Here is a version of @command{split} in @command{awk}. It uses the @code{ord()} and @code{chr()} functions presented in @@ -21711,8 +23106,8 @@ not too many arguments. It then looks at each argument in turn. The first argument could be a minus sign followed by a number. If it is, this happens to look like a negative number, so it is made positive, and that is the -count of lines. The data file name is skipped over and the final argument -is used as the prefix for the output file names: +count of lines. The @value{DF} name is skipped over and the final argument +is used as the prefix for the output @value{FN}s: @cindex @code{split.awk} program @example @@ -21726,11 +23121,12 @@ # # Arnold Robbins, arnold@@skeeve.com, Public Domain # May 1993 +# Revised slightly, May 2014 @c endfile @end ignore @c file eg/prog/split.awk -# usage: split [-num] [file] [outname] +# usage: split [-count] [file] [outname] BEGIN @{ outfile = "x" # default @@ -21739,14 +23135,14 @@ usage() i = 1 - if (ARGV[i] ~ /^-[[:digit:]]+$/) @{ + if (i in ARGV && ARGV[i] ~ /^-[[:digit:]]+$/) @{ count = -ARGV[i] ARGV[i] = "" i++ @} # test argv in case reading from stdin instead of file if (i in ARGV) - i++ # skip data file name + i++ # skip datafile name if (i in ARGV) @{ outfile = ARGV[i] ARGV[i] = "" @@ -21761,7 +23157,7 @@ The next rule does most of the work. @code{tcount} (temporary count) tracks how many lines have been printed to the output file so far. If it is greater than @code{count}, it is time to close the current file and start a new one. -@code{s1} and @code{s2} track the current suffixes for the file name. If +@code{s1} and @code{s2} track the current suffixes for the @value{FN}. If they are both @samp{z}, the file is just too big. Otherwise, @code{s1} moves to the next letter in the alphabet and @code{s2} starts over again at @samp{a}: @@ -21793,71 +23189,59 @@ @c endfile @end example -@c Exercise: do this with just awk builtin functions, index("abc..."), substr, etc. - @noindent The @code{usage()} function simply prints an error message and exits: @example @c file eg/prog/split.awk -function usage( e) +function usage() @{ - e = "usage: split [-num] [file] [outname]" - print e > "/dev/stderr" + print("usage: split [-num] [file] [outname]") > "/dev/stderr" exit 1 @} @c endfile @end example -@noindent -The variable @code{e} is used so that the function -fits nicely on the -@ifinfo -screen. -@end ifinfo -@ifnotinfo -page. -@end ifnotinfo - This program is a bit sloppy; it relies on @command{awk} to automatically close the last file instead of doing it in an @code{END} rule. It also assumes that letters are contiguous in the character set, which isn't true for EBCDIC systems. -@c Exercise: Fix these problems. -@c BFD... -@c ENDOFRANGE filspl -@c ENDOFRANGE split +@ifset FOR_PRINT +You might want to consider how to eliminate the use of +@code{ord()} and @code{chr()}; this can be done in such a +way as to solve the EBCDIC issue as well. +@end ifset + @node Tee Program @subsection Duplicating Output into Multiple Files @cindex files, multiple@comma{} duplicating output into @cindex output, duplicating into files -@c STARTOFRANGE tee @cindex @code{tee} utility The @code{tee} program is known as a ``pipe fitting.'' @code{tee} copies its standard input to its standard output and also duplicates it to the files named on the command line. Its usage is as follows: -@example -tee @r{[}-a@r{]} file @dots{} -@end example +@display +@command{tee} [@option{-a}] @var{file} @dots{} +@end display The @option{-a} option tells @code{tee} to append to the named files, instead of truncating them and starting over. The @code{BEGIN} rule first makes a copy of all the command-line arguments into an array named @code{copy}. -@code{ARGV[0]} is not copied, since it is not needed. -@code{tee} cannot use @code{ARGV} directly, since @command{awk} attempts to -process each file name in @code{ARGV} as input data. +@code{ARGV[0]} is not needed, so it is not copied. +@code{tee} cannot use @code{ARGV} directly, because @command{awk} attempts to +process each @value{FN} in @code{ARGV} as input data. @cindex flag variables If the first argument is @option{-a}, then the flag variable @code{append} is set to true, and both @code{ARGV[1]} and @code{copy[1]} are deleted. If @code{ARGC} is less than two, then no -file names were supplied and @code{tee} prints a usage message and exits. +@value{FN}s were supplied and @code{tee} prints a usage message and exits. Finally, @command{awk} is forced to read the standard input by setting @code{ARGV[1]} to @code{"-"} and @code{ARGC} to two: @@ -21879,8 +23263,7 @@ @c endfile @end ignore @c file eg/prog/tee.awk -BEGIN \ -@{ +BEGIN @{ for (i = 1; i < ARGC; i++) copy[i] = ARGV[i] @@ -21900,7 +23283,7 @@ @c endfile @end example -The following single rule does all the work. Since there is no pattern, it is +The following single rule does all the work. Because there is no pattern, it is executed for each line of input. The body of the rule simply prints the line into each file on the command line, and then to the standard output: @@ -21931,7 +23314,7 @@ @end example @noindent -This is more concise but it is also less efficient. The @samp{if} is +This is more concise, but it is also less efficient. The @samp{if} is tested for each record and for each output file. By duplicating the loop body, the @samp{if} is only tested once for each input record. If there are @var{N} input records and @var{M} output files, the first method only @@ -21942,43 +23325,38 @@ @example @c file eg/prog/tee.awk -END \ -@{ +END @{ for (i in copy) close(copy[i]) @} @c endfile @end example -@c ENDOFRANGE tee @node Uniq Program @subsection Printing Nonduplicated Lines of Text @c FIXME: One day, update to current POSIX version of uniq -@c STARTOFRANGE prunt @cindex printing, unduplicated lines of text -@c STARTOFRANGE tpul @cindex text@comma{} printing, unduplicated lines of -@c STARTOFRANGE uniq @cindex @command{uniq} utility The @command{uniq} utility reads sorted lines of data on its standard input, and by default removes duplicate lines. In other words, it only prints unique lines---hence the name. @command{uniq} has a number of options. The usage is as follows: -@example -uniq @r{[}-udc @r{[}-@var{n}@r{]]} @r{[}+@var{n}@r{]} @r{[} @var{input file} @r{[} @var{output file} @r{]]} -@end example +@display +@command{uniq} [@option{-udc} [@code{-@var{n}}]] [@code{+@var{n}}] [@var{inputfile} [@var{outputfile}]] +@end display The options for @command{uniq} are: @table @code @item -d -Print only repeated lines. +Print only repeated (duplicated) lines. @item -u -Print only nonrepeated lines. +Print only nonrepeated (unique) lines. @item -c Count lines. This option overrides @option{-d} and @option{-u}. Both repeated @@ -21993,11 +23371,11 @@ Skip @var{n} characters before comparing lines. Any fields specified with @samp{-@var{n}} are skipped first. -@item @var{input file} +@item @var{inputfile} Data is read from the input file named on the command line, instead of from the standard input. -@item @var{output file} +@item @var{outputfile} The generated output is sent to the named output file, instead of to the standard output. @end table @@ -22047,10 +23425,9 @@ @end ignore @c file eg/prog/uniq.awk -function usage( e) +function usage() @{ - e = "Usage: uniq [-udc [-n]] [+n] [ in [ out ]]" - print e > "/dev/stderr" + print("Usage: uniq [-udc [-n]] [+n] [ in [ out ]]") > "/dev/stderr" exit 1 @} @@ -22060,8 +23437,7 @@ # -n skip n fields # +n skip n characters, skip fields first -BEGIN \ -@{ +BEGIN @{ count = 1 outputfile = "/dev/stdout" opts = "udc0:1:2:3:4:5:6:7:8:9:" @@ -22073,7 +23449,7 @@ else if (c == "c") do_count++ else if (index("0123456789", c) != 0) @{ - # getopt requires args to options + # getopt() requires args to options # this messes us up for things like -5 if (Optarg ~ /^[[:digit:]]+$/) fcount = (c Optarg) + 0 @@ -22105,22 +23481,20 @@ @end example The following function, @code{are_equal()}, compares the current line, -@code{$0}, to the -previous line, @code{last}. It handles skipping fields and characters. -If no field count and no character count are specified, @code{are_equal()} -simply returns one or zero depending upon the result of a simple string -comparison of @code{last} and @code{$0}. Otherwise, things get more -complicated. -If fields have to be skipped, each line is broken into an array using -@code{split()} -(@pxref{String Functions}); -the desired fields are then joined back into a line using @code{join()}. -The joined lines are stored in @code{clast} and @code{cline}. -If no fields are skipped, @code{clast} and @code{cline} are set to -@code{last} and @code{$0}, respectively. -Finally, if characters are skipped, @code{substr()} is used to strip off the -leading @code{charcount} characters in @code{clast} and @code{cline}. The -two strings are then compared and @code{are_equal()} returns the result: +@code{$0}, to the previous line, @code{last}. It handles skipping fields +and characters. If no field count and no character count are specified, +@code{are_equal()} returns one or zero depending upon the result of a +simple string comparison of @code{last} and @code{$0}. + +Otherwise, things get more complicated. If fields have to be skipped, +each line is broken into an array using @code{split()} (@pxref{String +Functions}); the desired fields are then joined back into a line +using @code{join()}. The joined lines are stored in @code{clast} and +@code{cline}. If no fields are skipped, @code{clast} and @code{cline} +are set to @code{last} and @code{$0}, respectively. Finally, if +characters are skipped, @code{substr()} is used to strip off the leading +@code{charcount} characters in @code{clast} and @code{cline}. The two +strings are then compared and @code{are_equal()} returns the result: @example @c file eg/prog/uniq.awk @@ -22156,10 +23530,10 @@ depending upon the results of @code{are_equal()}'s comparison. If @command{uniq} is counting repeated lines, and the lines are equal, then it increments the @code{count} variable. Otherwise, it prints the line and resets @code{count}, -since the two lines are not equal. +because the two lines are not equal. If @command{uniq} is not counting, and if the lines are equal, @code{count} is incremented. -Nothing is printed, since the point is to remove duplicates. +Nothing is printed, as the point is to remove duplicates. Otherwise, if @command{uniq} is counting repeated lines and more than one line is seen, or if @command{uniq} is counting nonrepeated lines and only one line is seen, then the line is printed, and @code{count} @@ -22210,37 +23584,51 @@ @} @c endfile @end example -@c ENDOFRANGE prunt -@c ENDOFRANGE tpul -@c ENDOFRANGE uniq + +@c FIXME: Include this? +@ignore +This program does not follow our recommended convention of naming +global variables with a leading capital letter. Doing that would +make the program a little easier to follow. +@end ignore + +@ifset FOR_PRINT +The logic for choosing which lines to print represents a @dfn{state +machine}, which is ``a device that can be in one of a set number of stable +conditions depending on its previous condition and on the present values +of its inputs.''@footnote{This is the definition returned from entering +@code{define: state machine} into Google.} +Brian Kernighan suggests that +``an alternative approach to state machines is to just read +the input into an array, then use indexing. It's almost always +easier code, and for most inputs where you would use this, just +as fast.'' Consider how to rewrite the logic to follow this +suggestion. +@end ifset + + @node Wc Program @subsection Counting Things @c FIXME: One day, update to current POSIX version of wc -@c STARTOFRANGE count @cindex counting -@c STARTOFRANGE infco @cindex input files, counting elements in -@c STARTOFRANGE woco @cindex words, counting -@c STARTOFRANGE chco @cindex characters, counting -@c STARTOFRANGE lico @cindex lines, counting -@c STARTOFRANGE wc @cindex @command{wc} utility The @command{wc} (word count) utility counts lines, words, and characters in one or more input files. Its usage is as follows: -@example -wc @r{[}-lwc@r{]} @r{[} @var{files} @dots{} @r{]} -@end example +@display +@command{wc} [@option{-lwc}] [@var{files} @dots{}] +@end display If no files are specified on the command line, @command{wc} reads its standard input. If there are multiple files, it also prints total counts for all -the files. The options and their meanings are shown in the following list: +the files. The options and their meanings are as follows: @table @code @item -l @@ -22257,7 +23645,7 @@ @end table Implementing @command{wc} in @command{awk} is particularly elegant, -since @command{awk} does a lot of the work for us; it splits lines into +because @command{awk} does a lot of the work for us; it splits lines into words (i.e., fields) and counts them, it counts lines (i.e., records), and it can easily tell us how long a line is. @@ -22323,7 +23711,7 @@ @end example The @code{beginfile()} function is simple; it just resets the counts of lines, -words, and characters to zero, and saves the current file name in +words, and characters to zero, and saves the current @value{FN} in @code{fname}: @example @@ -22336,18 +23724,10 @@ @c endfile @end example -The @code{endfile()} function adds the current file's numbers to the running -totals of lines, words, and characters.@footnote{@command{wc} can't just use the value of -@code{FNR} in @code{endfile()}. If you examine -the code in -@ref{Filetrans Function}, -you will see that -@code{FNR} has already been reset by the time -@code{endfile()} is called.} It then prints out those numbers -for the file that was just read. It relies on @code{beginfile()} to reset the -numbers for the following data file: -@c FIXME: ONE DAY: make the above footnote an exercise, -@c instead of giving away the answer. +The @code{endfile()} function adds the current file's numbers to the +running totals of lines, words, and characters. It then prints out those +numbers for the file that was just read. It relies on @code{beginfile()} +to reset the numbers for the following @value{DF}: @example @c file eg/prog/wc.awk @@ -22370,7 +23750,7 @@ @end example There is one rule that is executed for each line. It adds the length of -the record, plus one, to @code{chars}.@footnote{Since @command{gawk} +the record, plus one, to @code{chars}.@footnote{Because @command{gawk} understands multibyte locales, this code counts characters, not bytes.} Adding one plus the record length is needed because the newline character separating records (the value @@ -22407,13 +23787,6 @@ @} @c endfile @end example -@c ENDOFRANGE count -@c ENDOFRANGE infco -@c ENDOFRANGE lico -@c ENDOFRANGE woco -@c ENDOFRANGE chco -@c ENDOFRANGE wc -@c ENDOFRANGE posimawk @node Miscellaneous Programs @section A Grab Bag of @command{awk} Programs @@ -22544,9 +23917,7 @@ @author Erik Quanstrom @end quotation -@c STARTOFRANGE tialarm @cindex time, alarm clock example program -@c STARTOFRANGE alaex @cindex alarm clock example program The following program is a simple ``alarm clock'' program. You give it a time of day and an optional message. At the specified time, @@ -22562,7 +23933,7 @@ print. If the user supplied a message without the ASCII BEL character (known as the ``alert'' character, @code{"\a"}), then it is added to the message. (On many systems, printing the ASCII BEL generates an -audible alert. Thus when the alarm goes off, the system calls attention +audible alert. Thus, when the alarm goes off, the system calls attention to itself in case the user is not looking at the computer.) Just for a change, this program uses a @code{switch} statement (@pxref{Switch Statement}), but the processing could be done with a series of @@ -22588,8 +23959,7 @@ @c file eg/prog/alarm.awk # usage: alarm time [ "message" [ count [ delay ] ] ] -BEGIN \ -@{ +BEGIN @{ # Initial argument sanity checking usage1 = "usage: alarm time ['message' [count [delay]]]" usage2 = sprintf("\t(%s) time ::= hh:mm", ARGV[1]) @@ -22664,7 +24034,7 @@ # how long to sleep for naptime = target - current if (naptime <= 0) @{ - print "time is in the past!" > "/dev/stderr" + print "alarm: time is in the past!" > "/dev/stderr" exit 1 @} @c endfile @@ -22699,15 +24069,11 @@ @} @c endfile @end example -@c ENDOFRANGE tialarm -@c ENDOFRANGE alaex @node Translate Program @subsection Transliterating Characters -@c STARTOFRANGE chtra @cindex characters, transliterating -@c STARTOFRANGE tr @cindex @command{tr} utility The system @command{tr} utility transliterates characters. For example, it is often used to map uppercase letters into lowercase for further processing: @@ -22717,49 +24083,44 @@ @end example @command{tr} requires two lists of characters.@footnote{On some older -systems, -including Solaris, -@command{tr} may require that the lists be written as -range expressions enclosed in square brackets (@samp{[a-z]}) and quoted, -to prevent the shell from attempting a file name expansion. This is -not a feature.} When processing the input, the first character in the -first list is replaced with the first character in the second list, -the second character in the first list is replaced with the second -character in the second list, and so on. If there are more characters -in the ``from'' list than in the ``to'' list, the last character of the -``to'' list is used for the remaining characters in the ``from'' list. +systems, including Solaris, the system version of @command{tr} may require +that the lists be written as range expressions enclosed in square brackets +(@samp{[a-z]}) and quoted, to prevent the shell from attempting a +@value{FN} expansion. This is not a feature.} When processing the input, the +first character in the first list is replaced with the first character +in the second list, the second character in the first list is replaced +with the second character in the second list, and so on. If there are +more characters in the ``from'' list than in the ``to'' list, the last +character of the ``to'' list is used for the remaining characters in the +``from'' list. -Some time ago, +Once upon a time, @c early or mid-1989! -a user proposed that a transliteration function should -be added to @command{gawk}. +a user proposed adding a transliteration function +to @command{gawk}. @c Wishing to avoid gratuitous new features, @c at least theoretically The following program was written to prove that character transliteration could be done with a user-level -function. This program is not as complete as the system @command{tr} utility +function. This program is not as complete as the system @command{tr} utility, but it does most of the job. -The @command{translate} program demonstrates one of the few weaknesses -of standard @command{awk}: dealing with individual characters is very -painful, requiring repeated use of the @code{substr()}, @code{index()}, -and @code{gsub()} built-in functions -(@pxref{String Functions}).@footnote{This -program was written before @command{gawk} acquired the ability to -split each character in a string into separate array elements.} -@c Exercise: How might you use this new feature to simplify the program? -There are two functions. The first, @code{stranslate()}, takes three -arguments: +The @command{translate} program was written long before @command{gawk} +acquired the ability to split each character in a string into separate +array elements. Thus, it makes repeated use of the @code{substr()}, +@code{index()}, and @code{gsub()} built-in functions (@pxref{String +Functions}). There are two functions. The first, @code{stranslate()}, +takes three arguments: @table @code @item from -A list of characters from which to translate. +A list of characters from which to translate @item to -A list of characters to which to translate. +A list of characters to which to translate @item target -The string on which to do the translation. +The string on which to do the translation @end table Associative arrays make the translation part fairly easy. @code{t_ar} holds @@ -22768,7 +24129,7 @@ in @code{from}, if the character appears in @code{target}, it is replaced with the corresponding @code{to} character. -The @code{translate()} function simply calls @code{stranslate()} using @code{$0} +The @code{translate()} function calls @code{stranslate()}, using @code{$0} as the target. The main program sets two global variables, @code{FROM} and @code{TO}, from the command line, and then changes @code{ARGV} so that @command{awk} reads from the standard input. @@ -22790,7 +24151,7 @@ @c endfile @end ignore @c file eg/prog/translate.awk -# Bugs: does not handle things like: tr A-Z a-z, it has +# Bugs: does not handle things like tr A-Z a-z; it has # to be spelled out. However, if `to' is shorter than `from', # the last character in `to' is used for the rest of `from'. @@ -22840,32 +24201,33 @@ @c endfile @end example -While it is possible to do character transliteration in a user-level -function, it is not necessarily efficient, and we (the @command{gawk} -authors) started to consider adding a built-in function. However, -shortly after writing this program, we learned that the System V Release 4 -@command{awk} had added the @code{toupper()} and @code{tolower()} functions -(@pxref{String Functions}). -These functions handle the vast majority of the -cases where character transliteration is necessary, and so we chose to -simply add those functions to @command{gawk} as well and then leave well -enough alone. +It is possible to do character transliteration in a user-level +function, but it is not necessarily efficient, and we (the @command{gawk} +developers) started to consider adding a built-in function. However, +shortly after writing this program, we learned that Brian Kernighan +had added the @code{toupper()} and @code{tolower()} functions to his +@command{awk} (@pxref{String Functions}). These functions handle the +vast majority of the cases where character transliteration is necessary, +and so we chose to simply add those functions to @command{gawk} as well +and then leave well enough alone. An obvious improvement to this program would be to set up the @code{t_ar} array only once, in a @code{BEGIN} rule. However, this assumes that the ``from'' and ``to'' lists will never change throughout the lifetime of the program. -@c ENDOFRANGE chtra -@c ENDOFRANGE tr + +Another obvious improvement is to enable the use of ranges, +such as @samp{a-z}, as allowed by the @command{tr} utility. +Look at the code for @file{cut.awk} (@pxref{Cut Program}) +for inspiration. + @node Labels Program @subsection Printing Mailing Labels -@c STARTOFRANGE prml @cindex printing, mailing labels -@c STARTOFRANGE mlprint @cindex mailing labels@comma{} printing -Here is a ``real world''@footnote{``Real world'' is defined as +Here is a ``real-world''@footnote{``Real world'' is defined as ``a program actually used to get something done.''} program. This script reads lists of names and @@ -22874,24 +24236,35 @@ than five lines of data. Each address is separated from the next by a blank line. -The basic idea is to read 20 labels worth of data. Each line of each label +The basic idea is to read 20 labels' worth of data. Each line of each label is stored in the @code{line} array. The single rule takes care of filling the @code{line} array and printing the page when 20 labels have been read. The @code{BEGIN} rule simply sets @code{RS} to the empty string, so that @command{awk} splits records at blank lines (@pxref{Records}). -It sets @code{MAXLINES} to 100, since 100 is the maximum number -of lines on the page (20 * 5 = 100). +It sets @code{MAXLINES} to 100, because 100 is the maximum number +of lines on the page +@iftex +(@math{20 @cdot 5 = 100}). +@end iftex +@ifnottex +@ifnotdocbook +(20 * 5 = 100). +@end ifnotdocbook +@end ifnottex +@docbook +(20 ⋅ 5 = 100). @c +@end docbook Most of the work is done in the @code{printpage()} function. The label lines are stored sequentially in the @code{line} array. But they -have to print horizontally; @code{line[1]} next to @code{line[6]}, -@code{line[2]} next to @code{line[7]}, and so on. Two loops are used to +have to print horizontally: @code{line[1]} next to @code{line[6]}, +@code{line[2]} next to @code{line[7]}, and so on. Two loops accomplish this. The outer loop, controlled by @code{i}, steps through every 10 lines of data; this is each row of labels. The inner loop, controlled by @code{j}, goes through the lines within the row. -As @code{j} goes from 0 to 4, @samp{i+j} is the @code{j}-th line in +As @code{j} goes from 0 to 4, @samp{i+j} is the @code{j}th line in the row, and @samp{i+j+5} is the entry next to it. The output ends up looking something like this: @@ -22916,7 +24289,6 @@ The @code{END} rule arranges to flush the final page of labels; there may not have been an even multiple of 20 labels in the data: -@c STARTOFRANGE labels @cindex @code{labels.awk} program @example @c file eg/prog/labels.awk @@ -22976,25 +24348,20 @@ Count++ @} -END \ -@{ +END @{ printpage() @} @c endfile @end example -@c ENDOFRANGE prml -@c ENDOFRANGE mlprint -@c ENDOFRANGE labels @node Word Sorting @subsection Generating Word-Usage Counts -@c STARTOFRANGE worus @cindex words, usage counts@comma{} generating When working with large amounts of text, it can be interesting to know how often different words appear. For example, an author may overuse -certain words, in which case she might wish to find synonyms to substitute +certain words, in which case he or she might wish to find synonyms to substitute for words that appear too often. This @value{SUBSECTION} develops a program for counting words and presenting the frequency information in a useful format. @@ -23002,7 +24369,7 @@ At first glance, a program like this would seem to do the job: @example -# Print list of word frequencies +# wordfreq-first-try.awk --- print list of word frequencies @{ for (i = 1; i <= NF; i++) @@ -23015,8 +24382,8 @@ @} @end example -The program relies on @command{awk}'s default field splitting -mechanism to break each line up into ``words,'' and uses an +The program relies on @command{awk}'s default field-splitting +mechanism to break each line up into ``words'' and uses an associative array named @code{freq}, indexed by each word, to count the number of times the word occurs. In the @code{END} rule, it prints the counts. @@ -23024,13 +24391,13 @@ This program has several problems that prevent it from being useful on real text files: -@itemize @bullet +@itemize @value{BULLET} @item The @command{awk} language considers upper- and lowercase characters to be distinct. Therefore, ``bartender'' and ``Bartender'' are not treated -as the same word. This is undesirable, since in normal text, words -are capitalized if they begin sentences, and a frequency analyzer should not -be sensitive to capitalization. +as the same word. This is undesirable, because words are capitalized +if they begin sentences in normal text, and a frequency analyzer should +not be sensitive to capitalization. @item Words are detected using the @command{awk} convention that fields are @@ -23051,7 +24418,6 @@ by using the system @command{sort} utility to process the output of the @command{awk} script. Here is the new version of the program: -@c STARTOFRANGE wordfreq @cindex @code{wordfreq.awk} program @example @c file eg/prog/wordfreq.awk @@ -23072,6 +24438,10 @@ @} @end example +The regexp @code{/[^[:alnum:]_[:blank:]]/} might have been written +@code{/[[:punct:]]/}, but then underscores would also be removed, +and we want to keep them. + Assuming we have saved this program in a file named @file{wordfreq.awk}, and that the data is in @file{file1}, the following pipeline: @@ -23112,19 +24482,16 @@ have true pipes at the command-line (or batch-file) level. See the general operating system documentation for more information on how to use the @command{sort} program. -@c ENDOFRANGE worus -@c ENDOFRANGE wordfreq @node History Sorting @subsection Removing Duplicates from Unsorted Text -@c STARTOFRANGE lidu @cindex lines, duplicate@comma{} removing The @command{uniq} program -(@pxref{Uniq Program}), +(@pxref{Uniq Program}) removes duplicate lines from @emph{sorted} data. -Suppose, however, you need to remove duplicate lines from a data file but +Suppose, however, you need to remove duplicate lines from a @value{DF} but that you want to preserve the order the lines are in. A good example of this might be a shell history file. The history file keeps a copy of all the commands you have entered, and it is not unusual to repeat a command @@ -23143,7 +24510,6 @@ The @code{END} rule simply prints out the lines, in order: @cindex Rakitzis, Byron -@c STARTOFRANGE histsort @cindex @code{histsort.awk} program @example @c file eg/prog/histsort.awk @@ -23183,17 +24549,14 @@ print data[lines[i]], lines[i] @end example +@noindent This works because @code{data[$0]} is incremented each time a line is seen. -@c ENDOFRANGE lidu -@c ENDOFRANGE histsort @node Extract Program @subsection Extracting Programs from Texinfo Source Files -@c STARTOFRANGE texse @cindex Texinfo, extracting programs from source files -@c STARTOFRANGE fitex @cindex files, Texinfo@comma{} extracting programs from @ifnotinfo Both this chapter and the previous chapter @@ -23206,30 +24569,30 @@ and @ref{Sample Programs}, are the top level nodes for a large number of @command{awk} programs. @end ifinfo -If you want to experiment with these programs, it is tedious to have to type +If you want to experiment with these programs, it is tedious to type them in by hand. Here we present a program that can extract parts of a Texinfo input file into separate files. @cindex Texinfo This @value{DOCUMENT} is written in @uref{http://www.gnu.org/software/texinfo/, Texinfo}, -the GNU project's document formatting language. +the GNU Project's document formatting language. A single Texinfo source file can be used to produce both -printed and online documentation. +printed documentation, with @TeX{}, and online documentation. @ifnotinfo -Texinfo is fully documented in the book +(Texinfo is fully documented in the book @cite{Texinfo---The GNU Documentation Format}, available from the Free Software Foundation, -and also available @uref{http://www.gnu.org/software/texinfo/manual/texinfo/, online}. +and also available @uref{http://www.gnu.org/software/texinfo/manual/texinfo/, online}.) @end ifnotinfo @ifinfo -The Texinfo language is described fully, starting with -@inforef{Top, , Texinfo, texinfo,Texinfo---The GNU Documentation Format}. +(The Texinfo language is described fully, starting with +@inforef{Top, , Texinfo, texinfo,Texinfo---The GNU Documentation Format}.) @end ifinfo For our purposes, it is enough to know three things about Texinfo input files: -@itemize @bullet +@itemize @value{BULLET} @item The ``at'' symbol (@samp{@@}) is special in Texinfo, much as the backslash (@samp{\}) is in C @@ -23271,7 +24634,7 @@ @example @dots{} -This program has a @@code@{BEGIN@} rule, +This program has a @@code@{BEGIN@} rule that prints a nice message: @@example @@ -23284,7 +24647,7 @@ @@example @@c file examples/messages.awk -END @@@{ print "Always avoid bored archeologists!" @@@} +END @@@{ print "Always avoid bored archaeologists!" @@@} @@c end file @@end example @dots{} @@ -23297,12 +24660,10 @@ given (@code{NF} is at least three) and also checking that the command exits with a zero exit status, signifying OK: -@c STARTOFRANGE extract @cindex @code{extract.awk} program @example @c file eg/prog/extract.awk -# extract.awk --- extract files and run programs -# from texinfo files +# extract.awk --- extract files and run programs from Texinfo files @c endfile @ignore @c file eg/prog/extract.awk @@ -23316,10 +24677,9 @@ BEGIN @{ IGNORECASE = 1 @} -/^@@c(omment)?[ \t]+system/ \ -@{ +/^@@c(omment)?[ \t]+system/ @{ if (NF < 3) @{ - e = (FILENAME ":" FNR) + e = ("extract: " FILENAME ":" FNR) e = (e ": badly formed `system' line") print e > "/dev/stderr" next @@ -23328,7 +24688,7 @@ $2 = "" stat = system($0) if (stat != 0) @{ - e = (FILENAME ":" FNR) + e = ("extract: " FILENAME ":" FNR) e = (e ": warning: system returned " stat) print e > "/dev/stderr" @} @@ -23338,24 +24698,18 @@ @noindent The variable @code{e} is used so that the rule -fits nicely on the -@ifnotinfo -page. -@end ifnotinfo -@ifnottex -screen. -@end ifnottex +fits nicely on the @value{PAGE}. The second rule handles moving data into files. It verifies that a -file name is given in the directive. If the file named is not the +@value{FN} is given in the directive. If the file named is not the current file, then the current file is closed. Keeping the current file open until a new file is encountered allows the use of the @samp{>} -redirection for printing the contents, keeping open file management +redirection for printing the contents, keeping open-file management simple. The @code{for} loop does the work. It reads lines using @code{getline} (@pxref{Getline}). -For an unexpected end of file, it calls the @code{@w{unexpected_eof()}} +For an unexpected end-of-file, it calls the @code{@w{unexpected_eof()}} function. If the line is an ``endfile'' line, then it breaks out of the loop. If the line is an @samp{@@group} or @samp{@@end group} line, then it @@ -23371,20 +24725,18 @@ The @samp{@@} symbol is used as the separator character. Each element of @code{a} that is empty indicates two successive @samp{@@} symbols in the original line. For each two empty elements (@samp{@@@@} in -the original file), we have to add a single @samp{@@} symbol back -in.@footnote{This program was written before @command{gawk} had the -@code{gensub()} function. Consider how you might use it to simplify the code.} +the original file), we have to add a single @samp{@@} symbol back in. When the processing of the array is finished, @code{join()} is called with the -value of @code{SUBSEP}, to rejoin the pieces back into a single +value of @code{SUBSEP} (@pxref{Multidimensional}), +to rejoin the pieces back into a single line. That line is then printed to the output file: @example @c file eg/prog/extract.awk -/^@@c(omment)?[ \t]+file/ \ -@{ +/^@@c(omment)?[ \t]+file/ @{ if (NF != 3) @{ - e = (FILENAME ":" FNR ": badly formed `file' line") + e = ("extract: " FILENAME ":" FNR ": badly formed `file' line") print e > "/dev/stderr" next @} @@ -23429,21 +24781,20 @@ (@pxref{Redirection}). This makes it easy to mix program text and explanatory prose for the same sample source file (as has been done here!) without any hassle. The file is -only closed when a new data file name is encountered or at the end of the +only closed when a new @value{DF} name is encountered or at the end of the input file. Finally, the function @code{@w{unexpected_eof()}} prints an appropriate error message and then exits. The @code{END} rule handles the final cleanup, closing the open file: -@c function lb put on same line for page breaking. sigh @example @c file eg/prog/extract.awk @group function unexpected_eof() @{ - printf("%s:%d: unexpected EOF or error\n", - FILENAME, FNR) > "/dev/stderr" + printf("extract: %s:%d: unexpected EOF or error\n", + FILENAME, FNR) > "/dev/stderr" exit 1 @} @end group @@ -23454,39 +24805,35 @@ @} @c endfile @end example -@c ENDOFRANGE texse -@c ENDOFRANGE fitex -@c ENDOFRANGE extract @node Simple Sed @subsection A Simple Stream Editor @cindex @command{sed} utility @cindex stream editors -The @command{sed} utility is a stream editor, a program that reads a +The @command{sed} utility is a @dfn{stream editor}, a program that reads a stream of data, makes changes to it, and passes it on. It is often used to make global changes to a large file or to a stream of data generated by a pipeline of commands. -While @command{sed} is a complicated program in its own right, its most common +Although @command{sed} is a complicated program in its own right, its most common use is to perform global substitutions in the middle of a pipeline: @example -command1 < orig.data | sed 's/old/new/g' | command2 > result +@var{command1} < orig.data | sed 's/old/new/g' | @var{command2} > result @end example Here, @samp{s/old/new/g} tells @command{sed} to look for the regexp @samp{old} on each input line and globally replace it with the text -@samp{new}, i.e., all the occurrences on a line. This is similar to +@samp{new} (i.e., all the occurrences on a line). This is similar to @command{awk}'s @code{gsub()} function (@pxref{String Functions}). The following program, @file{awksed.awk}, accepts at least two command-line arguments: the pattern to look for and the text to replace it with. Any -additional arguments are treated as data file names to process. If none +additional arguments are treated as @value{DF} names to process. If none are provided, the standard input is used: @cindex Brennan, Michael -@c STARTOFRANGE awksed @cindex @command{awksed.awk} program @c @cindex simple stream editor @c @cindex stream editor, simple @@ -23556,41 +24903,18 @@ of arguments and calling @code{usage()} if there is a problem. Then it sets @code{RS} and @code{ORS} from the command-line arguments and sets @code{ARGV[1]} and @code{ARGV[2]} to the null string, so that they are -not treated as file names +not treated as @value{FN}s (@pxref{ARGC and ARGV}). The @code{usage()} function prints an error message and exits. -Finally, the single rule handles the printing scheme outlined above, +Finally, the single rule handles the printing scheme outlined earlier, using @code{print} or @code{printf} as appropriate, depending upon the value of @code{RT}. -@ignore -Exercise, compare the performance of this version with the more -straightforward: - -BEGIN { - pat = ARGV[1] - repl = ARGV[2] - ARGV[1] = ARGV[2] = "" -} - -{ gsub(pat, repl); print } - -Exercise: what are the advantages and disadvantages of this version versus sed? - Advantage: egrep regexps - speed (?) - Disadvantage: no & in replacement text - -Others? -@end ignore -@c ENDOFRANGE awksed - @node Igawk Program @subsection An Easy Way to Use Library Functions -@c STARTOFRANGE libfex @cindex libraries of @command{awk} functions, example program for using -@c STARTOFRANGE flibex @cindex functions, library, example program for using In @ref{Include Files}, we saw how @command{gawk} provides a built-in file-inclusion capability. However, this is a @command{gawk} extension. @@ -23624,15 +24948,15 @@ The following program, @file{igawk.sh}, provides this service. It simulates @command{gawk}'s searching of the @env{AWKPATH} variable -and also allows @dfn{nested} includes; i.e., a file that is included -with @samp{@@include} can contain further @samp{@@include} statements. +and also allows @dfn{nested} includes (i.e., a file that is included +with @code{@@include} can contain further @code{@@include} statements). @command{igawk} makes an effort to only include files once, so that nested includes don't accidentally include a library function twice. @command{igawk} should behave just like @command{gawk} externally. This means it should accept all of @command{gawk}'s command-line arguments, including the ability to have multiple source files specified via -@option{-f}, and the ability to mix command-line and library source files. +@option{-f} and the ability to mix command-line and library source files. The program is written using the POSIX Shell (@command{sh}) command language.@footnote{Fully explaining the @command{sh} language is beyond @@ -23651,27 +24975,27 @@ @enumerate a @item -Literal text, provided with @option{--source} or @option{--source=}. This +Literal text, provided with @option{-e} or @option{--source}. This text is just appended directly. @item -Source file names, provided with @option{-f}. We use a neat trick and append -@samp{@@include @var{filename}} to the shell variable's contents. Since the file-inclusion -program works the way @command{gawk} does, this gets the text -of the file included into the program at the correct point. +Source @value{FN}s, provided with @option{-f}. We use a neat trick and +append @samp{@@include @var{filename}} to the shell variable's contents. +Because the file-inclusion program works the way @command{gawk} does, this +gets the text of the file included in the program at the correct point. @end enumerate @item Run an @command{awk} program (naturally) over the shell variable's contents to expand -@samp{@@include} statements. The expanded program is placed in a second +@code{@@include} statements. The expanded program is placed in a second shell variable. @item Run the expanded program with @command{gawk} and any other original command-line -arguments that the user supplied (such as the data file names). +arguments that the user supplied (such as the @value{DF} names). @end enumerate -This program uses shell variables extensively: for storing command-line arguments, +This program uses shell variables extensively: for storing command-line arguments and the text of the @command{awk} program that will expand the user's program, for the user's original program, and for the expanded program. Doing so removes some potential problems that might arise were we to use temporary files instead, @@ -23683,24 +25007,25 @@ The next part loops through all the command-line arguments. There are several cases of interest: -@table @code -@item -- +@c @asis for docbook +@table @asis +@item @option{--} This ends the arguments to @command{igawk}. Anything else should be passed on to the user's @command{awk} program without being evaluated. -@item -W +@item @option{-W} This indicates that the next option is specific to @command{gawk}. To make argument processing easier, the @option{-W} is appended to the front of the remaining arguments and the loop continues. (This is an @command{sh} programming trick. Don't worry about it if you are not familiar with @command{sh}.) -@item -v@r{,} -F +@item @option{-v}, @option{-F} These are saved and passed on to @command{gawk}. -@item -f@r{,} --file@r{,} --file=@r{,} -Wfile= -The file name is appended to the shell variable @code{program} with an -@samp{@@include} statement. +@item @option{-f}, @option{--file}, @option{--file=}, @option{-Wfile=} +The @value{FN} is appended to the shell variable @code{program} with an +@code{@@include} statement. The @command{expr} utility is used to remove the leading option part of the argument (e.g., @samp{--file=}). (Typical @command{sh} usage would be to use the @command{echo} and @command{sed} @@ -23708,10 +25033,10 @@ escape sequences in their arguments, possibly mangling the program text. Using @command{expr} avoids this problem.) -@item --source@r{,} --source=@r{,} -Wsource= +@item @option{--source}, @option{--source=}, @option{-Wsource=} The source text is appended to @code{program}. -@item --version@r{,} -Wversion +@item @option{--version}, @option{-Wversion} @command{igawk} prints its version number, runs @samp{gawk --version} to get the @command{gawk} version information, and then exits. @end table @@ -23722,12 +25047,12 @@ arguments left, @command{igawk} prints an error message and exits. Otherwise, the first argument is appended to @code{program}. In any case, after the arguments have been processed, +the shell variable @code{program} contains the complete text of the original @command{awk} program. The program is as follows: -@c STARTOFRANGE igawk @cindex @code{igawk.sh} program @example @c file eg/prog/igawk.sh @@ -23819,15 +25144,15 @@ @c endfile @end example -The @command{awk} program to process @samp{@@include} directives +The @command{awk} program to process @code{@@include} directives is stored in the shell variable @code{expand_prog}. Doing this keeps the shell script readable. The @command{awk} program reads through the user's program, one line at a time, using @code{getline} (@pxref{Getline}). The input -file names and @samp{@@include} statements are managed using a stack. -As each @samp{@@include} is encountered, the current file name is -``pushed'' onto the stack and the file named in the @samp{@@include} -directive becomes the current file name. As each file is finished, +@value{FN}s and @code{@@include} statements are managed using a stack. +As each @code{@@include} is encountered, the current @value{FN} is +``pushed'' onto the stack and the file named in the @code{@@include} +directive becomes the current @value{FN}. As each file is finished, the stack is ``popped,'' and the previous input file becomes the current input file again. The process is started by making the original file the first one on the stack. @@ -23836,16 +25161,16 @@ a file. It simulates @command{gawk}'s behavior when searching the @env{AWKPATH} environment variable (@pxref{AWKPATH Variable}). -If a file name has a @samp{/} in it, no path search is done. -Similarly, if the file name is @code{"-"}, then that string is +If a @value{FN} has a @samp{/} in it, no path search is done. +Similarly, if the @value{FN} is @code{"-"}, then that string is used as-is. Otherwise, -the file name is concatenated with the name of each directory in -the path, and an attempt is made to open the generated file name. +the @value{FN} is concatenated with the name of each directory in +the path, and an attempt is made to open the generated @value{FN}. The only way to test if a file can be read in @command{awk} is to go ahead and try to read it with @code{getline}; this is what @code{pathto()} does.@footnote{On some very old versions of @command{awk}, the test -@samp{getline junk < t} can loop forever if the file exists but is empty. -Caveat emptor.} If the file can be read, it is closed and the file name +@samp{getline junk < t} can loop forever if the file exists but is empty.} +If the file can be read, it is closed and the @value{FN} is returned: @ignore @@ -23900,17 +25225,17 @@ @c endfile @end example -The stack is initialized with @code{ARGV[1]}, which will be @samp{/dev/stdin}. +The stack is initialized with @code{ARGV[1]}, which will be @code{"/dev/stdin"}. The main loop comes next. Input lines are read in succession. Lines that -do not start with @samp{@@include} are printed verbatim. -If the line does start with @samp{@@include}, the file name is in @code{$2}. +do not start with @code{@@include} are printed verbatim. +If the line does start with @code{@@include}, the @value{FN} is in @code{$2}. @code{pathto()} is called to generate the full path. If it cannot, then the program prints an error message and continues. The next thing to check is if the file is included already. The -@code{processed} array is indexed by the full file name of each included +@code{processed} array is indexed by the full @value{FN} of each included file and it tracks this information for us. If the file is -seen again, a warning message is printed. Otherwise, the new file name is +seen again, a warning message is printed. Otherwise, the new @value{FN} is pushed onto the stack and processing continues. Finally, when @code{getline} encounters the end of the input file, the file @@ -23931,7 +25256,7 @@ fpath = pathto($2) @group if (fpath == "") @{ - printf("igawk:%s:%d: cannot find %s\n", + printf("igawk: %s:%d: cannot find %s\n", input[stackptr], FNR, $2) > "/dev/stderr" continue @} @@ -23955,9 +25280,10 @@ @c endfile @end example -The shell construct @samp{@var{command} << @var{marker}} is called a @dfn{here document}. -Everything in the shell script up to the @var{marker} is fed to @var{command} as input. -The shell processes the contents of the here document for variable and command substitution +The shell construct @samp{@var{command} << @var{marker}} is called +a @dfn{here document}. Everything in the shell script up to the +@var{marker} is fed to @var{command} as input. The shell processes +the contents of the here document for variable and command substitution (and possibly other things as well, depending upon the shell). The shell construct @samp{$(@dots{})} is called @dfn{command substitution}. @@ -23971,35 +25297,22 @@ @enumerate @item -Run @command{gawk} with the @samp{@@include}-processing program (the -value of the @code{expand_prog} shell variable) on standard input. +Run @command{gawk} with the @code{@@include}-processing program (the +value of the @code{expand_prog} shell variable) reading standard input. @item -Standard input is the contents of the user's program, from the shell variable @code{program}. -Its contents are fed to @command{gawk} via a here document. +Standard input is the contents of the user's program, +from the shell variable @code{program}. +Feed its contents to @command{gawk} via a here document. @item -The results of this processing are saved in the shell variable @code{processed_program} by using command substitution. +Save the results of this processing in the shell variable +@code{processed_program} by using command substitution. @end enumerate The last step is to call @command{gawk} with the expanded program, along with the original -options and command-line arguments that the user supplied. - -@c this causes more problems than it solves, so leave it out. -@ignore -The special file @file{/dev/null} is passed as a data file to @command{gawk} -to handle an interesting case. Suppose that the user's program only has -a @code{BEGIN} rule and there are no data files to read. -The program should exit without reading any data files. -However, suppose that an included library file defines an @code{END} -rule of its own. In this case, @command{gawk} will hang, reading standard -input. In order to avoid this, @file{/dev/null} is explicitly added to the -command-line. Reading from @file{/dev/null} always returns an immediate -end of file indication. - -@c Hmm. Add /dev/null if $# is 0? Still messes up ARGV. Sigh. -@end ignore +options and command-line arguments that the user supplied: @example @c file eg/prog/igawk.sh @@ -24010,27 +25323,25 @@ The @command{eval} command is a shell construct that reruns the shell's parsing process. This keeps things properly quoted. -This version of @command{igawk} represents my fifth version of this program. +This version of @command{igawk} represents the fifth version of this program. There are four key simplifications that make the program work better: -@itemize @bullet +@itemize @value{BULLET} @item -Using @samp{@@include} even for the files named with @option{-f} makes building +Using @code{@@include} even for the files named with @option{-f} makes building the initial collected @command{awk} program much simpler; all the -@samp{@@include} processing can be done once. +@code{@@include} processing can be done once. @item Not trying to save the line read with @code{getline} in the @code{pathto()} function when testing for the file's accessibility for use with the main program simplifies things considerably. -@c what problem does this engender though - exercise -@c answer, reading from "-" or /dev/stdin @item Using a @code{getline} loop in the @code{BEGIN} rule does it all in one place. It is not necessary to call out to a separate loop for processing -nested @samp{@@include} statements. +nested @code{@@include} statements. @item Instead of saving the expanded program in a temporary file, putting it in a shell variable @@ -24047,50 +25358,13 @@ and argument manipulation using the shell than it is in @command{awk}. Finally, @command{igawk} shows that it is not always necessary to add new -features to a program; they can often be layered on top. -@ignore -With @command{igawk}, -there is no real reason to build @samp{@@include} processing into -@command{gawk} itself. -@end ignore - -@cindex search paths -@cindex search paths, for source files -@cindex source files@comma{} search path for -@cindex files, source@comma{} search path for -@cindex directories, searching -As an additional example of this, consider the idea of having two -files in a directory in the search path: - -@table @file -@item default.awk -This file contains a set of default library functions, such -as @code{getopt()} and @code{assert()}. - -@item site.awk -This file contains library functions that are specific to a site or -installation; i.e., locally developed functions. -Having a separate file allows @file{default.awk} to change with -new @command{gawk} releases, without requiring the system administrator to -update it each time by adding the local functions. -@end table - -One user -@c Karl Berry, karl@ileaf.com, 10/95 -suggested that @command{gawk} be modified to automatically read these files -upon startup. Instead, it would be very simple to modify @command{igawk} -to do this. Since @command{igawk} can process nested @samp{@@include} -directives, @file{default.awk} could simply contain @samp{@@include} -statements for the desired library functions. +features to a program; they can often be layered on top.@footnote{@command{gawk} +does @code{@@include} processing itself in order to support the use +of @command{awk} programs as Web CGI scripts.} -@c Exercise: make this change -@c ENDOFRANGE libfex -@c ENDOFRANGE flibex -@c ENDOFRANGE awkpex -@c ENDOFRANGE igawk @node Anagram Program -@subsection Finding Anagrams From A Dictionary +@subsection Finding Anagrams from a Dictionary @cindex anagrams, finding An interesting programming challenge is to @@ -24099,25 +25373,23 @@ @file{/usr/share/dict/words} on many GNU/Linux systems). One word is an anagram of another if both words contain the same letters -(for example, ``babbling'' and ``blabbing''). +(e.g., ``babbling'' and ``blabbing''). -An elegant algorithm is presented in Column 2, Problem C of -Jon Bentley's @cite{Programming Pearls}, second edition. -The idea is to give words that are anagrams a common signature, -sort all the words together by their signature, and then print them. -Dr.@: Bentley observes that taking the letters in each word and -sorting them produces that common signature. +Column 2, Problem C, of Jon Bentley's @cite{Programming Pearls}, Second +Edition, presents an elegant algorithm. The idea is to give words that +are anagrams a common signature, sort all the words together by their +signatures, and then print them. Dr.@: Bentley observes that taking the +letters in each word and sorting them produces those common signatures. The following program uses arrays of arrays to bring together words with the same signature and array sorting to print the words -in sorted order. +in sorted order: -@c STARTOFRANGE anagram @cindex @code{anagram.awk} program @example @c file eg/prog/anagram.awk -# anagram.awk --- An implementation of the anagram finding algorithm -# from Jon Bentley's "Programming Pearls", 2nd edition. +# anagram.awk --- An implementation of the anagram-finding algorithm +# from Jon Bentley's "Programming Pearls," 2nd edition. # Addison Wesley, 2000, ISBN 0-201-65788-0. # Column 2, Problem C, section 2.8, pp 18-20. @c endfile @@ -24165,7 +25437,7 @@ @example @c file eg/prog/anagram.awk -# word2key --- split word apart into letters, sort, joining back together +# word2key --- split word apart into letters, sort, and join back together function word2key(word, a, i, n, result) @{ @@ -24182,7 +25454,7 @@ Finally, the @code{END} rule traverses the array and prints out the anagram lists. It sends the output -to the system @command{sort} command, since otherwise +to the system @command{sort} command because otherwise the anagrams would appear in arbitrary order: @example @@ -24210,20 +25482,20 @@ @example $ @kbd{gawk -f anagram.awk /usr/share/dict/words | grep '^b'} @dots{} -babbled blabbed -babbler blabber brabble -babblers blabbers brabbles -babbling blabbing -babbly blabby -babel bable -babels beslab -babery yabber +babbled blabbed +babbler blabber brabble +babblers blabbers brabbles +babbling blabbing +babbly blabby +babel bable +babels beslab +babery yabber @dots{} @end example -@c ENDOFRANGE anagram + @node Signature Program -@subsection And Now For Something Completely Different +@subsection And Now for Something Completely Different @cindex signature program @cindex Brini, Davide @@ -24251,7 +25523,10 @@ O+X*(o*(o+O)+O),+x+O+X*o,x*(x-o),(o+X+x)*o*o-(x-O-O),O+(X-x)*(X+O),x-O@}' @end example -We leave it to you to determine what the program does. +@cindex Johansen, Chris +We leave it to you to determine what the program does. (If you are +truly desperate to understand it, see Chris Johansen's explanation, +which is embedded in the Texinfo source file for this @value{DOCUMENT}.) @ignore To: "Arnold Robbins" @@ -24260,28 +25535,28 @@ From: "Chris Johansen" Message-ID: -Arnold, you don't know me, but we have a tenuous connection. My wife is +Arnold, you don't know me, but we have a tenuous connection. My wife is Barbara A. Field, FAIA, GIT '65 (B. Arch.). -I have had a couple of paper copies of "Effective Awk Programming" for -years, and now I'm going through a Kindle version of "The GNU Awk User's -Guide" again. When I got to section 13.3.11, I reformatted and lightly +I have had a couple of paper copies of "Effective Awk Programming" for +years, and now I'm going through a Kindle version of "The GNU Awk User's +Guide" again. When I got to section 13.3.11, I reformatted and lightly commented Davide Brin's signature script to understand its workings. -It occurs to me that this might have pedagogical value as an example -(although imperfect) of the value of whitespace and comments, and a -starting point for that discussion. It certainly helped _me_ understand -what's going on. You are welcome to it, as-is or modified (subject to +It occurs to me that this might have pedagogical value as an example +(although imperfect) of the value of whitespace and comments, and a +starting point for that discussion. It certainly helped _me_ understand +what's going on. You are welcome to it, as-is or modified (subject to Davide's constraints, of course, which I think I have met). -If I were to include it in a future edition, I would put it at some -distance from section 13.3.11, say, as a note or an appendix, so as not to +If I were to include it in a future edition, I would put it at some +distance from section 13.3.11, say, as a note or an appendix, so as not to be a "spoiler" to the puzzle. Best regards, --- +-- Chris Johansen {johansen at main dot nc dot us} - . . . collapsing the probability wave function, sending ripples of + . . . collapsing the probability wave function, sending ripples of certainty through the space-time continuum. @@ -24290,7 +25565,7 @@ # From "13.3.11 And Now For Something Completely Different" # http://www.gnu.org/software/gawk/manual/html_node/Signature-Program.html#Signature-Program -# Copyright © 2008 Davide Brini +# Copyright © 2008 Davide Brini # Copying and distribution of the code published in this page, with # or without modification, are permitted in any medium without @@ -24331,45 +25606,214 @@ } @end ignore -@iftex -@part Part III:@* Moving Beyond Standard @command{awk} With @command{gawk} -@end iftex +@node Programs Summary +@section Summary + +@itemize @value{BULLET} +@item +The programs provided in this @value{CHAPTER} +continue on the theme that reading programs is an excellent way to learn +Good Programming. + +@item +Using @samp{#!} to make @command{awk} programs directly runnable makes +them easier to use. Otherwise, invoke the program using @samp{awk +-f @dots{}}. + +@item +Reimplementing standard POSIX programs in @command{awk} is a pleasant +exercise; @command{awk}'s expressive power lets you write such programs +in relatively few lines of code, yet they are functionally complete +and usable. + +@item +One of standard @command{awk}'s weaknesses is working with individual +characters. The ability to use @code{split()} with the empty string as +the separator can considerably simplify such tasks. + +@item +The examples here demonstrate the usefulness of the library +functions from @DBREF{Library Functions} +for a number of real (if small) programs. + +@item +Besides reinventing POSIX wheels, other programs solved a selection of +interesting problems, such as finding duplicate words in text, printing +mailing labels, and finding anagrams. + +@end itemize + +@c EXCLUDE START +@node Programs Exercises +@section Exercises + +@enumerate +@item +Rewrite @file{cut.awk} (@pxref{Cut Program}) +using @code{split()} with @code{""} as the separator. + +@item +In @ref{Egrep Program}, we mentioned that @samp{egrep -i} could be +simulated in versions of @command{awk} without @code{IGNORECASE} by +using @code{tolower()} on the line and the pattern. In a footnote there, +we also mentioned that this solution has a bug: the translated line is +output, and not the original one. Fix this problem. +@c Exercise: Fix this, w/array and new line as key to original line + +@item +The POSIX version of @command{id} takes options that control which +information is printed. Modify the @command{awk} version +(@pxref{Id Program}) to accept the same arguments and perform in the +same way. + +@item +The @code{split.awk} program (@pxref{Split Program}) assumes +that letters are contiguous in the character set, +which isn't true for EBCDIC systems. +Fix this problem. +(Hint: Consider a different way to work through the alphabet, +without relying on @code{ord()} and @code{chr()}.) + +@item +In @file{uniq.awk} (@pxref{Uniq Program}, the +logic for choosing which lines to print represents a @dfn{state +machine}, which is ``a device that can be in one of a set number of stable +conditions depending on its previous condition and on the present values +of its inputs.''@footnote{This is the definition returned from entering +@code{define: state machine} into Google.} +Brian Kernighan suggests that +``an alternative approach to state machines is to just read +the input into an array, then use indexing. It's almost always +easier code, and for most inputs where you would use this, just +as fast.'' Rewrite the logic to follow this +suggestion. + + +@item +Why can't the @file{wc.awk} program (@pxref{Wc Program}) just +use the value of @code{FNR} in @code{endfile()}? +Hint: Examine the code in @ref{Filetrans Function}. @ignore -@ifdocbook +@command{wc} can't just use the value of @code{FNR} in +@code{endfile()}. If you examine the code in @ref{Filetrans Function}, +you will see that @code{FNR} has already been reset by the time +@code{endfile()} is called. +@end ignore + +@item +Manipulation of individual characters in the @command{translate} program +(@pxref{Translate Program}) is painful using standard @command{awk} +functions. Given that @command{gawk} can split strings into individual +characters using @code{""} as the separator, how might you use this +feature to simplify the program? + +@item +The @file{extract.awk} program (@pxref{Extract Program}) was written +before @command{gawk} had the @code{gensub()} function. Use it +to simplify the code. + +@item +Compare the performance of the @file{awksed.awk} program +(@pxref{Simple Sed}) with the more straightforward: + +@example +BEGIN @{ + pat = ARGV[1] + repl = ARGV[2] + ARGV[1] = ARGV[2] = "" +@} + +@{ gsub(pat, repl); print @} +@end example + +@item +What are the advantages and disadvantages of @file{awksed.awk} versus +the real @command{sed} utility? -@part Part III:@* Moving Beyond Standard @command{awk} With @command{gawk} +@ignore + Advantage: egrep regexps + speed (?) + Disadvantage: no & in replacement text + +Others? +@end ignore + +@item +In @ref{Igawk Program}, we mentioned that not trying to save the line +read with @code{getline} in the @code{pathto()} function when testing +for the file's accessibility for use with the main program simplifies +things considerably. What problem does this engender though? +@c answer, reading from "-" or /dev/stdin + +@cindex search paths +@cindex search paths, for source files +@cindex source files@comma{} search path for +@cindex files, source@comma{} search path for +@cindex directories, searching +@item +As an additional example of the idea that it is not always necessary to +add new features to a program, consider the idea of having two files in +a directory in the search path: + +@table @file +@item default.awk +This file contains a set of default library functions, such +as @code{getopt()} and @code{assert()}. + +@item site.awk +This file contains library functions that are specific to a site or +installation; i.e., locally developed functions. +Having a separate file allows @file{default.awk} to change with +new @command{gawk} releases, without requiring the system administrator to +update it each time by adding the local functions. +@end table + +One user +@c Karl Berry, karl@ileaf.com, 10/95 +suggested that @command{gawk} be modified to automatically read these files +upon startup. Instead, it would be very simple to modify @command{igawk} +to do this. Since @command{igawk} can process nested @code{@@include} +directives, @file{default.awk} could simply contain @code{@@include} +statements for the desired library functions. +Make this change. + +@item +Modify @file{anagram.awk} (@pxref{Anagram Program}), to avoid +the use of the external @command{sort} utility. + +@end enumerate +@c EXCLUDE END +@ifnotinfo +@part @value{PART3}Moving Beyond Standard @command{awk} with @command{gawk} +@end ifnotinfo + +@ifdocbook Part III focuses on features specific to @command{gawk}. It contains the following chapters: -@itemize @bullet +@itemize @value{BULLET} @item -@ref{Advanced Features}. +@ref{Advanced Features} @item -@ref{Internationalization}. +@ref{Internationalization} @item -@ref{Debugger}. +@ref{Debugger} @item -@ref{Arbitrary Precision Arithmetic}. +@ref{Arbitrary Precision Arithmetic} @item -@ref{Dynamic Extensions}. +@ref{Dynamic Extensions} @end itemize @end ifdocbook -@end ignore @node Advanced Features @chapter Advanced Features of @command{gawk} -@ifset WITH_NETWORK_CHAPTER -@cindex advanced features, network connections, See Also networks@comma{} connections -@end ifset -@c STARTOFRANGE gawadv @cindex @command{gawk}, features, advanced -@c STARTOFRANGE advgaw @cindex advanced features, @command{gawk} @ignore Contributed by: Peter Langston @@ -24379,6 +25823,8 @@ "Write documentation as if whoever reads it is a violent psychopath who knows where you live." @end ignore +@cindex Langston, Peter +@cindex English, Steve @quotation @i{Write documentation as if whoever reads it is a violent psychopath who knows where you live.} @@ -24388,20 +25834,21 @@ This @value{CHAPTER} discusses advanced features in @command{gawk}. It's a bit of a ``grab bag'' of items that are otherwise unrelated to each other. -First, a command-line option allows @command{gawk} to recognize +First, we look at a command-line option that allows @command{gawk} to recognize nondecimal numbers in input data, not just in @command{awk} programs. Then, @command{gawk}'s special features for sorting arrays are presented. Next, two-way I/O, discussed briefly in earlier parts of this @value{DOCUMENT}, is described in full detail, along with the basics -of TCP/IP networking. Finally, @command{gawk} +of TCP/IP networking. Finally, we see how @command{gawk} can @dfn{profile} an @command{awk} program, making it possible to tune it for performance. -A number of advanced features require separate @value{CHAPTER}s of their +@c FULLXREF ON +Additional advanced features are discussed in separate @value{CHAPTER}s of their own: -@itemize @bullet +@itemize @value{BULLET} @item @ref{Internationalization}, discusses how to internationalize your @command{awk} programs, so that they can speak multiple @@ -24420,6 +25867,7 @@ discusses the ability to dynamically add new built-in functions to @command{gawk}. @end itemize +@c FULLXREF OFF @menu * Nondecimal Data:: Allowing nondecimal input data. @@ -24428,6 +25876,7 @@ * Two-way I/O:: Two-way communications with another process. * TCP/IP Networking:: Using @command{gawk} for network programming. * Profiling:: Profiling your @command{awk} programs. +* Advanced Features Summary:: Summary of advanced features. @end menu @node Nondecimal Data @@ -24438,13 +25887,11 @@ @cindex constants, nondecimal If you run @command{gawk} with the @option{--non-decimal-data} option, -you can have nondecimal constants in your input data: +you can have nondecimal values in your input data: -@c line break here for small book format @example $ @kbd{echo 0123 123 0x123 |} -> @kbd{gawk --non-decimal-data '@{ printf "%d, %d, %d\n",} -> @kbd{$1, $2, $3 @}'} +> @kbd{gawk --non-decimal-data '@{ printf "%d, %d, %d\n", $1, $2, $3 @}'} @print{} 83, 123, 291 @end example @@ -24460,7 +25907,7 @@ The @code{print} statement treats its expressions as strings. Although the fields can act as numbers when necessary, they are still strings, so @code{print} does not try to treat them -numerically. You may need to add zero to a field to force it to +numerically. You need to add zero to a field to force it to be treated as a number. For example: @example @@ -24482,15 +25929,18 @@ @emph{Use of this option is not recommended.} It can break old programs very badly. Instead, use the @code{strtonum()} function to convert your data -(@pxref{Nondecimal-numbers}). +(@pxref{String Functions}). This makes your programs easier to write and easier to read, and leads to less surprising results. + +This option may disappear in a future version of @command{gawk}. @end quotation @node Array Sorting @section Controlling Array Traversal and Array Sorting -@command{gawk} lets you control the order in which a @samp{for (i in array)} +@command{gawk} lets you control the order in which a +@samp{for (@var{indx} in @var{array})} loop traverses an array. In addition, two built-in functions, @code{asort()} and @code{asorti()}, @@ -24506,7 +25956,7 @@ @node Controlling Array Traversal @subsection Controlling Array Traversal -By default, the order in which a @samp{for (i in array)} loop +By default, the order in which a @samp{for (@var{indx} in @var{array})} loop scans an array is not defined; it is generally based upon the internal implementation of arrays inside @command{awk}. @@ -24514,12 +25964,14 @@ in a particular order that you, the programmer, choose. @command{gawk} lets you do this. -@ref{Controlling Scanning}, describes how you can assign special, -pre-defined values to @code{PROCINFO["sorted_in"]} in order to -control the order in which @command{gawk} will traverse an array +@DBREF{Controlling Scanning} describes how you can assign special, +predefined values to @code{PROCINFO["sorted_in"]} in order to +control the order in which @command{gawk} traverses an array during a @code{for} loop. -In addition, the value of @code{PROCINFO["sorted_in"]} can be a function name. +In addition, the value of @code{PROCINFO["sorted_in"]} can be a +function name.@footnote{This is why the predefined sorting orders +start with an @samp{@@} character, which cannot be part of an identifier.} This lets you traverse an array based on any custom criterion. The array elements are ordered according to the return value of this function. The comparison function should be defined with at least @@ -24533,23 +25985,23 @@ @} @end example -Here, @var{i1} and @var{i2} are the indices, and @var{v1} and @var{v2} +Here, @code{i1} and @code{i2} are the indices, and @code{v1} and @code{v2} are the corresponding values of the two elements being compared. -Either @var{v1} or @var{v2}, or both, can be arrays if the array being +Either @code{v1} or @code{v2}, or both, can be arrays if the array being traversed contains subarrays as values. -(@xref{Arrays of Arrays}, for more information about subarrays.) +(@DBXREF{Arrays of Arrays} for more information about subarrays.) The three possible return values are interpreted as follows: @table @code @item comp_func(i1, v1, i2, v2) < 0 -Index @var{i1} comes before index @var{i2} during loop traversal. +Index @code{i1} comes before index @code{i2} during loop traversal. @item comp_func(i1, v1, i2, v2) == 0 -Indices @var{i1} and @var{i2} -come together but the relative order with respect to each other is undefined. +Indices @code{i1} and @code{i2} +come together, but the relative order with respect to each other is undefined. @item comp_func(i1, v1, i2, v2) > 0 -Index @var{i1} comes after index @var{i2} during loop traversal. +Index @code{i1} comes after index @code{i2} during loop traversal. @end table Our first comparison function can be used to scan an array in @@ -24580,7 +26032,7 @@ The third comparison function makes all numbers, and numeric strings without -any leading or trailing spaces, come out first during loop traversal: +any leading or trailing spaces, come out first during loop traversal: @example function cmp_num_str_val(i1, v1, i2, v2, n1, n2) @@ -24588,10 +26040,10 @@ # numbers before string value comparison, ascending order n1 = v1 + 0 n2 = v2 + 0 - if (n1 == v1) + if (n1 == v1) return (n2 == v2) ? (n1 - n2) : -1 else if (n2 == v2) - return 1 + return 1 return (v1 < v2) ? -1 : (v1 != v2) @} @end example @@ -24606,7 +26058,7 @@ data[10] = "one" data[100] = 100 data[20] = "two" - + f[1] = "cmp_num_idx" f[2] = "cmp_str_val" f[3] = "cmp_num_str_val" @@ -24630,14 +26082,14 @@ @print{} data[10] = one @print{} data[20] = two @print{} data[100] = 100 -@print{} +@print{} @print{} Sort function: cmp_str_val @ii{Sort by element values as strings} @print{} data[one] = 10 @print{} data[100] = 100 @ii{String 100 is less than string 20} @print{} data[two] = 20 @print{} data[10] = one @print{} data[20] = two -@print{} +@print{} @print{} Sort function: cmp_num_str_val @ii{Sort all numeric values before all strings} @print{} data[one] = 10 @print{} data[two] = 20 @@ -24648,10 +26100,10 @@ Consider sorting the entries of a GNU/Linux system password file according to login name. The following program sorts records -by a specific field position and can be used for this purpose: +by a specific field position and can be used for this purpose: @example -# sort.awk --- simple program to sort by field position +# passwd-sort.awk --- simple program to sort by field position # field position is specified by the global variable POS function cmp_field(i1, v1, i2, v2) @@ -24694,7 +26146,7 @@ The comparison should normally always return the same value when given a specific pair of array elements as its arguments. If inconsistent -results are returned then the order is undefined. This behavior can be +results are returned, then the order is undefined. This behavior can be exploited to introduce random order into otherwise seemingly ordered data: @@ -24706,11 +26158,11 @@ @} @end example -As mentioned above, the order of the indices is arbitrary if two +As already mentioned, the order of the indices is arbitrary if two elements compare equal. This is usually not a problem, but letting the tied elements come out in arbitrary order can be an issue, especially when comparing item values. The partial ordering of the equal elements -may change during the next loop traversal, if other elements are added or +may change the next time the array is traversed, if other elements are added to or removed from the array. One way to resolve ties when comparing elements with otherwise equal values is to include the indices in the comparison rules. Note that doing this may make the loop traversal less efficient, @@ -24747,21 +26199,21 @@ values where one or both aren't numbers, or for element indices handled as strings, the value of @code{IGNORECASE} (@pxref{Built-in Variables}) controls whether -the comparisons treat corresponding uppercase and lowercase letters as +the comparisons treat corresponding upper- and lowercase letters as equivalent or distinct. -Another point to keep in mind is that in the case of subarrays +Another point to keep in mind is that in the case of subarrays, the element values can themselves be arrays; a production comparison function should use the @code{isarray()} function -(@pxref{Type Functions}), +(@pxref{Type Functions}) to check for this, and choose a defined sorting order for subarrays. All sorting based on @code{PROCINFO["sorted_in"]} is disabled in POSIX mode, -since the @code{PROCINFO} array is not special in that case. +because the @code{PROCINFO} array is not special in that case. As a side note, sorting the array indices before traversing -the array has been reported to add 15% to 20% overhead to the +the array has been reported to add a 15% to 20% overhead to the execution time of @command{awk} programs. For this reason, sorted array traversal is not the default. @@ -24779,8 +26231,8 @@ @cindex @code{asorti()} function (@command{gawk}), arrays@comma{} sorting @cindex sort function, arrays, sorting In most @command{awk} implementations, sorting an array requires writing -a @code{sort()} function. While this can be educational for exploring -different sorting algorithms, usually that's not the point of the program. +a @code{sort()} function. This can be educational for exploring +different sorting algorithms, but usually that's not the point of the program. @command{gawk} provides the built-in @code{asort()} and @code{asorti()} functions (@pxref{String Functions}) for sorting arrays. For example: @@ -24820,7 +26272,7 @@ Often, what's needed is to sort on the values of the @emph{indices} instead of the values of the elements. To do that, use the @code{asorti()} function. The interface and behavior are identical to -that of @code{asort()}, except that the index values are used for sorting, +that of @code{asort()}, except that the index values are used for sorting and become the values of the result array: @example @@ -24840,9 +26292,9 @@ So far, so good. Now it starts to get interesting. Both @code{asort()} and @code{asorti()} accept a third string argument to control comparison -of array elements. In @ref{String Functions}, we ignored this third -argument; however, the time has now come to describe how this argument -affects these two functions. +of array elements. When we introduced @code{asort()} and @code{asorti()} +in @ref{String Functions}, we ignored this third argument; however, +now is the time to describe how this argument affects these two functions. Basically, the third argument specifies how the array is to be sorted. There are two possibilities. As with @code{PROCINFO["sorted_in"]}, @@ -24855,8 +26307,8 @@ or both. This is extremely powerful. Once the array is sorted, @code{asort()} takes the @emph{values} in -their final order, and uses them to fill in the result array, whereas -@code{asorti()} takes the @emph{indices} in their final order, and uses +their final order and uses them to fill in the result array, whereas +@code{asorti()} takes the @emph{indices} in their final order and uses them to fill in the result array. @cindex reference counting, sorting arrays @@ -24876,13 +26328,15 @@ of @code{IGNORECASE} also affects sorting for both @code{asort()} and @code{asorti()}. Note also that the locale's sorting order does @emph{not} come into play; comparisons are based on character values only.@footnote{This -is true because locale-based comparison occurs only when in POSIX -compatibility mode, and since @code{asort()} and @code{asorti()} are +is true because locale-based comparison occurs only when in +POSIX-compatibility mode, and because @code{asort()} and @code{asorti()} are @command{gawk} extensions, they are not available in that case.} -Caveat Emptor. @node Two-way I/O @section Two-Way Communications with Another Process + +@c 8/2014. Neither Mike nor BWK saw this as relevant. Commenting it out. +@ignore @cindex Brennan, Michael @cindex programmers, attractiveness of @smallexample @@ -24912,6 +26366,7 @@ Mike Brennan @c brennan@@whidbey.com @end smallexample +@end ignore @cindex advanced features, processes@comma{} communicating with @cindex processes, two-way communications with @@ -24938,7 +26393,10 @@ This works, but not elegantly. Among other things, it requires that the program be run in a directory that cannot be shared among users; for example, @file{/tmp} will not do, as another user might happen -to be using a temporary file with the same name. +to be using a temporary file with the same name.@footnote{Michael +Brennan suggests the use of @command{rand()} to generate unique +@value{FN}s. This is a valid point; nevertheless, temporary files +remain more difficult to use than two-way pipes.} @c 8/2014 @cindex coprocesses @cindex input/output, two-way @@ -24947,7 +26405,7 @@ @cindex @command{csh} utility, @code{|&} operator, comparison with However, with @command{gawk}, it is possible to open a @emph{two-way} pipe to another process. The second process is -termed a @dfn{coprocess}, since it runs in parallel with @command{gawk}. +termed a @dfn{coprocess}, as it runs in parallel with @command{gawk}. The two-way connection is created using the @samp{|&} operator (borrowed from the Korn shell, @command{ksh}):@footnote{This is very different from the same operator in the C shell and in Bash.} @@ -24972,7 +26430,7 @@ There are some cautionary items to be aware of: -@itemize @bullet +@itemize @value{BULLET} @item As the code inside @command{gawk} currently stands, the coprocess's standard error goes to the same place that the parent @command{gawk}'s @@ -25038,6 +26496,7 @@ As a side note, the assignment @samp{LC_ALL=C} in the @command{sort} command ensures traditional Unix (ASCII) sorting from @command{sort}. +This is not strictly necessary here, but it's good to know how to do this. @cindex @command{gawk}, @code{PROCINFO} array in @cindex @code{PROCINFO} array, and communications via ptys @@ -25051,12 +26510,12 @@ @example command = "sort -nr" # command, save in convenience variable PROCINFO[command, "pty"] = 1 # update PROCINFO -print @dots{} |& command # start two-way pipe +print @dots{} |& command # start two-way pipe @dots{} @end example @noindent -Using ptys avoids the buffer deadlock issues described earlier, at some +Using ptys usually avoids the buffer deadlock issues described earlier, at some loss in performance. If your system does not have ptys, or if all the system's ptys are in use, @command{gawk} automatically falls back to using regular pipes. @@ -25065,7 +26524,6 @@ @section Using @command{gawk} for Network Programming @cindex advanced features, network programming @cindex networks, programming -@c STARTOFRANGE tcpip @cindex TCP/IP @cindex @code{/inet/@dots{}} special files (@command{gawk}) @cindex files, @code{/inet/@dots{}} (@command{gawk}) @@ -25074,13 +26532,27 @@ @cindex @code{/inet6/@dots{}} special files (@command{gawk}) @cindex files, @code{/inet6/@dots{}} (@command{gawk}) @cindex @code{EMISTERED} +@ifnotdocbook @quotation -@code{EMISTERED}:@* +@code{EMRED}:@* @ @ @ @ @i{A host is a host from coast to coast,@* -@ @ @ @ and no-one can talk to host that's close,@* +@ @ @ @ and nobody talks to a host that's close,@* @ @ @ @ unless the host that isn't close@* -@ @ @ @ is busy hung or dead.} +@ @ @ @ is busy, hung, or dead.} +@author Mike O'Brien (aka Mr.@: Protocol) @end quotation +@end ifnotdocbook + +@docbook +
+Mike O'Brien (aka Mr. Protocol) +EMISTERED: +    A host is a host from coast to coast, +    and no-one can talk to host that's close, +    unless the host that isn't close +    is busy, hung, or dead. +
+@end docbook In addition to being able to open a two-way pipeline to a coprocess on the same system @@ -25091,10 +26563,10 @@ You can think of this as just a @emph{very long} two-way pipeline to a coprocess. The way @command{gawk} decides that you want to use TCP/IP networking is -by recognizing special file names that begin with one of @samp{/inet/}, -@samp{/inet4/} or @samp{/inet6}. +by recognizing special @value{FN}s that begin with one of @samp{/inet/}, +@samp{/inet4/}, or @samp{/inet6/}. -The full syntax of the special file name is +The full syntax of the special @value{FN} is @file{/@var{net-type}/@var{protocol}/@var{local-port}/@var{remote-host}/@var{remote-port}}. The components are: @@ -25109,7 +26581,7 @@ @item protocol The protocol to use over IP. This must be either @samp{tcp}, or @samp{udp}, for a TCP or UDP IP connection, -respectively. The use of TCP is recommended for most applications. +respectively. TCP should be used for most applications. @item local-port @cindex @code{getaddrinfo()} function (C library) @@ -25121,7 +26593,7 @@ the predefined port number using the C @code{getaddrinfo()} function. @item remote-host -The IP address or fully-qualified domain name of the Internet +The IP address or fully qualified domain name of the Internet host to which you want to connect. @item remote-port @@ -25133,7 +26605,7 @@ @cindex @command{gawk}, @code{ERRNO} variable in @cindex @code{ERRNO} variable @quotation NOTE -Failure in opening a two-way socket will result in a non-fatal error +Failure in opening a two-way socket will result in a nonfatal error being returned to the calling code. The value of @code{ERRNO} indicates the error (@pxref{Auto-set}). @end quotation @@ -25142,37 +26614,36 @@ @example BEGIN @{ - Service = "/inet/tcp/0/localhost/daytime" - Service |& getline - print $0 - close(Service) + Service = "/inet/tcp/0/localhost/daytime" + Service |& getline + print $0 + close(Service) @} @end example This program reads the current date and time from the local system's -TCP @samp{daytime} server. +TCP @code{daytime} server. It then prints the results and closes the connection. Because this topic is extensive, the use of @command{gawk} for TCP/IP programming is documented separately. @ifinfo See -@inforef{Top, , General Introduction, gawkinet, TCP/IP Internetworking with @command{gawk}}, +@inforef{Top, , General Introduction, gawkinet, @value{GAWKINETTITLE}}, @end ifinfo @ifnotinfo -See @cite{TCP/IP Internetworking with @command{gawk}}, +See +@uref{http://www.gnu.org/software/gawk/manual/gawkinet/, +@cite{@value{GAWKINETTITLE}}}, which comes as part of the @command{gawk} distribution, @end ifnotinfo for a much more complete introduction and discussion, as well as extensive examples. -@c ENDOFRANGE tcpip @node Profiling @section Profiling Your @command{awk} Programs -@c STARTOFRANGE awkp @cindex @command{awk} programs, profiling -@c STARTOFRANGE proawk @cindex profiling @command{awk} programs @cindex @code{awkprof.out} file @cindex files, @code{awkprof.out} @@ -25193,12 +26664,12 @@ @end example @noindent -In the above example, @command{gawk} places the profile in +In the preceding example, @command{gawk} places the profile in @file{myprog.prof} instead of in @file{awkprof.out}. -Here is a sample session showing a simple @command{awk} program, its input data, and the -results from running @command{gawk} with the @option{--profile} option. -First, the @command{awk} program: +Here is a sample session showing a simple @command{awk} program, +its input data, and the results from running @command{gawk} with the +@option{--profile} option. First, the @command{awk} program: @example BEGIN @{ print "First BEGIN rule" @} @@ -25239,16 +26710,16 @@ @end example Here is the @file{awkprof.out} that results from running the -@command{gawk} profiler on this program and data. (This example also +@command{gawk} profiler on this program and data (this example also illustrates that @command{awk} programmers sometimes get up very early -in the morning to work.) +in the morning to work): @cindex @code{BEGIN} pattern, and profiling @cindex @code{END} pattern, and profiling @example - # gawk profile, created Thu Feb 27 05:16:21 2014 + # gawk profile, created Mon Sep 29 05:16:21 2014 - # BEGIN block(s) + # BEGIN rule(s) BEGIN @{ 1 print "First BEGIN rule" @@ -25275,7 +26746,7 @@ @} @} - # END block(s) + # END rule(s) END @{ 1 print "First END rule" @@ -25297,12 +26768,12 @@ This example illustrates many of the basic features of profiling output. They are as follows: -@itemize @bullet +@itemize @value{BULLET} @item The program is printed in the order @code{BEGIN} rules, @code{BEGINFILE} rules, -pattern/action rules, -@code{ENDFILE} rules, @code{END} rules and functions, listed +pattern--action rules, +@code{ENDFILE} rules, @code{END} rules, and functions, listed alphabetically. Multiple @code{BEGIN} and @code{END} rules retain their separate identities, as do @@ -25310,7 +26781,7 @@ @cindex patterns, counts, in a profile @item -Pattern-action rules have two counts. +Pattern--action rules have two counts. The first count, to the left of the rule, shows how many times the rule's pattern was @emph{tested}. The second count, to the right of the rule's opening left brace @@ -25356,8 +26827,7 @@ @item Parentheses are used only where needed, as indicated by the structure of the program and the precedence rules. -@c extra verbiage here satisfies the copyeditor. ugh. -For example, @samp{(3 + 5) * 4} means add three plus five, then multiply +For example, @samp{(3 + 5) * 4} means add three and five, then multiply the total by four. However, @samp{3 + 5 * 4} has no parentheses, and means @samp{3 + (5 * 4)}. @@ -25378,15 +26848,15 @@ @command{gawk} supplies leading comments in front of the @code{BEGIN} and @code{END} rules, the @code{BEGINFILE} and @code{ENDFILE} rules, -the pattern/action rules, and the functions. +the pattern--action rules, and the functions. @end itemize The profiled version of your program may not look exactly like what you typed when you wrote it. This is because @command{gawk} creates the -profiled version by ``pretty printing'' its internal representation of +profiled version by ``pretty-printing'' its internal representation of the program. The advantage to this is that @command{gawk} can produce -a standard representation. The disadvantage is that all source-code +a standard representation. The disadvantage is that all source code comments are lost. Also, things such as: @@ -25404,7 +26874,7 @@ @end example @noindent -which is correct, but possibly surprising. +which is correct, but possibly unexpected. @cindex profiling @command{awk} programs, dynamically @cindex @command{gawk} program, dynamic profiling @@ -25436,10 +26906,10 @@ @noindent As usual, the profiled version of the program is written to -@file{awkprof.out}, or to a different file if one specified with +@file{awkprof.out}, or to a different file if one was specified with the @option{--profile} option. -Along with the regular profile, as shown earlier, the profile +Along with the regular profile, as shown earlier, the profile file includes a trace of any active functions: @example @@ -25468,29 +26938,71 @@ @cindex @code{SIGQUIT} signal (MS-Windows) @cindex signals, @code{QUIT}/@code{SIGQUIT} (MS-Windows) When @command{gawk} runs on MS-Windows systems, it uses the -@code{INT} and @code{QUIT} signals for producing the profile and, in +@code{INT} and @code{QUIT} signals for producing the profile, and in the case of the @code{INT} signal, @command{gawk} exits. This is because these systems don't support the @command{kill} command, so the only signals you can deliver to a program are those generated by the keyboard. The @code{INT} signal is generated by the -@kbd{Ctrl-@key{C}} or @kbd{Ctrl-@key{BREAK}} key, while the -@code{QUIT} signal is generated by the @kbd{Ctrl-@key{\}} key. +@kbd{Ctrl-c} or @kbd{Ctrl-BREAK} key, while the +@code{QUIT} signal is generated by the @kbd{Ctrl-\} key. Finally, @command{gawk} also accepts another option, @option{--pretty-print}. -When called this way, @command{gawk} ``pretty prints'' the program into +When called this way, @command{gawk} ``pretty-prints'' the program into @file{awkprof.out}, without any execution counts. @quotation NOTE The @option{--pretty-print} option still runs your program. This will change in the next major release. @end quotation -@c ENDOFRANGE advgaw -@c ENDOFRANGE gawadv -@c ENDOFRANGE awkp -@c ENDOFRANGE proawk -@node Internationalization -@chapter Internationalization with @command{gawk} +@node Advanced Features Summary +@section Summary + +@itemize @value{BULLET} +@item +The @option{--non-decimal-data} option causes @command{gawk} to treat +octal- and hexadecimal-looking input data as octal and hexadecimal. +This option should be used with caution or not at all; use of @code{strtonum()} +is preferable. +Note that this option may disappear in a future version of @command{gawk}. + +@item +You can take over complete control of sorting in @samp{for (@var{indx} in @var{array})} +array traversal by setting @code{PROCINFO["sorted_in"]} to the name of a user-defined +function that does the comparison of array elements based on index and value. + +@item +Similarly, you can supply the name of a user-defined comparison function as the +third argument to either @code{asort()} or @command{asorti()} to control how +those functions sort arrays. Or you may provide one of the predefined control +strings that work for @code{PROCINFO["sorted_in"]}. + +@item +You can use the @samp{|&} operator to create a two-way pipe to a coprocess. +You read from the coprocess with @code{getline} and write to it with @code{print} +or @code{printf}. Use @code{close()} to close off the coprocess completely, or +optionally, close off one side of the two-way communications. + +@item +By using special @value{FN}s with the @samp{|&} operator, you can open a +TCP/IP (or UDP/IP) connection to remote hosts on the Internet. @command{gawk} +supports both IPv4 and IPv6. + +@item +You can generate statement count profiles of your program. This can help you +determine which parts of your program may be taking the most time and let +you tune them more easily. Sending the @code{USR1} signal while profiling causes +@command{gawk} to dump the profile and keep going, including a function call stack. + +@item +You can also just ``pretty-print'' the program. This currently also runs +the program, but that will change in the next major release. + +@end itemize + + +@node Internationalization +@chapter Internationalization with @command{gawk} Once upon a time, computer makers wrote software that worked only in English. @@ -25500,7 +27012,6 @@ As a result, internationalization and localization of programs and software systems became a common practice. -@c STARTOFRANGE inloc @cindex internationalization, localization @cindex @command{gawk}, internationalization and, See internationalization @cindex internationalization, localization, @command{gawk} and @@ -25517,11 +27028,12 @@ @menu * I18N and L10N:: Internationalization and Localization. -* Explaining gettext:: How GNU @code{gettext} works. +* Explaining gettext:: How GNU @command{gettext} works. * Programmer i18n:: Features for the programmer. * Translator i18n:: Features for the translator. * I18N Example:: A simple i18n example. * Gawk I18N:: @command{gawk} is also internationalized. +* I18N Summary:: Summary of I18N stuff. @end menu @node I18N and L10N @@ -25532,7 +27044,7 @@ @cindex localization @dfn{Internationalization} means writing (or modifying) a program once, in such a way that it can use multiple languages without requiring -further source-code changes. +further source code changes. @dfn{Localization} means providing the data necessary for an internationalized program to work in a particular language. Most typically, these terms refer to features such as the language @@ -25541,20 +27053,21 @@ monetary values are printed and read. @node Explaining gettext -@section GNU @code{gettext} +@section GNU @command{gettext} @cindex internationalizing a program -@c STARTOFRANGE gettex -@cindex @code{gettext} library -The facilities in GNU @code{gettext} focus on messages; strings printed +@cindex @command{gettext} library +@command{gawk} uses GNU @command{gettext} to provide its internationalization +features. +The facilities in GNU @command{gettext} focus on messages: strings printed by a program, either directly or via formatting with @code{printf} or @code{sprintf()}.@footnote{For some operating systems, the @command{gawk} -port doesn't support GNU @code{gettext}. +port doesn't support GNU @command{gettext}. Therefore, these features are not available if you are using one of those operating systems. Sorry.} -@cindex portability, @code{gettext} library and -When using GNU @code{gettext}, each application has its own +@cindex portability, @command{gettext} library and +When using GNU @command{gettext}, each application has its own @dfn{text domain}. This is a unique name, such as @samp{kpilot} or @samp{gawk}, that identifies the application. A complete application may have multiple components---programs written @@ -25567,8 +27080,7 @@ @enumerate @item -The programmer goes -through the source for all of @command{guide}'s components +The programmer reviews the source for all of @command{guide}'s components and marks each string that is a candidate for translation. For example, @code{"`-F': option required"} is a good candidate for translation. A table with strings of option names is not (e.g., @command{gawk}'s @@ -25578,7 +27090,7 @@ @cindex @code{textdomain()} function (C library) @item The programmer indicates the application's text domain -(@code{"guide"}) to the @code{gettext} library, +(@command{"guide"}) to the @command{gettext} library, by calling the @code{textdomain()} function. @cindex @code{.pot} files @@ -25595,7 +27107,6 @@ @cindex @code{.po} files @cindex files, @code{.po} -@c STARTOFRANGE portobfi @cindex portable object files @cindex files, portable object @item @@ -25607,7 +27118,6 @@ @cindex @code{.gmo} files @cindex files, @code{.gmo} @cindex message object files -@c STARTOFRANGE portmsgfi @cindex files, message object @item Each language's @file{.po} file is converted into a binary @@ -25622,7 +27132,7 @@ @cindex @code{bindtextdomain()} function (C library) @item -For testing and development, it is possible to tell @code{gettext} +For testing and development, it is possible to tell @command{gettext} to use @file{.gmo} files in a different directory than the standard one by using the @code{bindtextdomain()} function. @@ -25655,7 +27165,7 @@ @cindex @code{_} (underscore), C macro @cindex underscore (@code{_}), C macro -The GNU @code{gettext} developers, recognizing that typing +The GNU @command{gettext} developers, recognizing that typing @samp{gettext(@dots{})} over and over again is both painful and ugly to look at, use the macro @samp{_} (an underscore) to make things easier: @@ -25668,7 +27178,7 @@ @end example @cindex internationalization, localization, locale categories -@cindex @code{gettext} library, locale categories +@cindex @command{gettext} library, locale categories @cindex locale categories @noindent This reduces the typing overhead to just three extra characters per string @@ -25676,29 +27186,38 @@ There are locale @dfn{categories} for different types of locale-related information. -The defined locale categories that @code{gettext} knows about are: +The defined locale categories that @command{gettext} knows about are: @table @code @cindex @code{LC_MESSAGES} locale category @item LC_MESSAGES -Text messages. This is the default category for @code{gettext} +Text messages. This is the default category for @command{gettext} operations, but it is possible to supply a different one explicitly, if necessary. (It is almost never necessary to supply a different category.) @cindex sorting characters in different languages @cindex @code{LC_COLLATE} locale category @item LC_COLLATE -Text-collation information; i.e., how different characters -and/or groups of characters sort in a given language. +Text-collation information (i.e., how different characters +and/or groups of characters sort in a given language). @cindex @code{LC_CTYPE} locale category @item LC_CTYPE Character-type information (alphabetic, digit, upper- or lowercase, and -so on). +so on) as well as character encoding. +@ignore +In June 2001 Bruno Haible wrote: +- Description of LC_CTYPE: It determines both + 1. character encoding, + 2. character type information. + (For example, in both KOI8-R and ISO-8859-5 the character type information + is the same - cyrillic letters could as 'alpha' - but the encoding is + different.) +@end ignore This information is accessed via the POSIX character classes in regular expressions, such as @code{/[[:alnum:]]/} -(@pxref{Regexp Operators}). +(@pxref{Bracket Expressions}). @cindex monetary information, localization @cindex currency symbols, localization @@ -25715,11 +27234,6 @@ point, while many Europeans do exactly the opposite: 1,234.56 versus 1.234,56.} -@cindex @code{LC_RESPONSE} locale category -@item LC_RESPONSE -Response information, such as how ``yes'' and ``no'' appear in the -local language, and possibly other information as well. - @cindex time, localization and @cindex dates, information related to@comma{} localization @cindex @code{LC_TIME} locale category @@ -25729,23 +27243,21 @@ @cindex @code{LC_ALL} locale category @item LC_ALL -All of the above. (Not too useful in the context of @code{gettext}.) +All of the above. (Not too useful in the context of @command{gettext}.) @end table -@c ENDOFRANGE gettex @node Programmer i18n @section Internationalizing @command{awk} Programs -@c STARTOFRANGE inap @cindex @command{awk} programs, internationalizing -@command{gawk} provides the following variables and functions for +@command{gawk} provides the following variables for internationalization: @table @code @cindex @code{TEXTDOMAIN} variable @item TEXTDOMAIN This variable indicates the application's text domain. -For compatibility with GNU @code{gettext}, the default +For compatibility with GNU @command{gettext}, the default value is @code{"messages"}. @cindex internationalization, localization, marked strings @@ -25754,9 +27266,14 @@ String constants marked with a leading underscore are candidates for translation at runtime. String constants without a leading underscore are not translated. +@end table +@command{gawk} provides the following functions for +internationalization: + +@table @code @cindexgawkfunc{dcgettext} -@item dcgettext(@var{string} @r{[}, @var{domain} @r{[}, @var{category}@r{]]}) +@item @code{dcgettext(@var{string}} [@code{,} @var{domain} [@code{,} @var{category}]]@code{)} Return the translation of @var{string} in text domain @var{domain} for locale category @var{category}. The default value for @var{domain} is the current value of @code{TEXTDOMAIN}. @@ -25782,11 +27299,11 @@ @end quotation @cindexgawkfunc{dcngettext} -@item dcngettext(@var{string1}, @var{string2}, @var{number} @r{[}, @var{domain} @r{[}, @var{category}@r{]]}) +@item @code{dcngettext(@var{string1}, @var{string2}, @var{number}} [@code{,} @var{domain} [@code{,} @var{category}]]@code{)} Return the plural form used for @var{number} of the translation of @var{string1} and @var{string2} in text domain @var{domain} for locale category @var{category}. @var{string1} is the -English singular variant of a message, and @var{string2} the English plural +English singular variant of a message, and @var{string2} is the English plural variant of the same message. The default value for @var{domain} is the current value of @code{TEXTDOMAIN}. The default value for @var{category} is @code{"LC_MESSAGES"}. @@ -25798,9 +27315,9 @@ @cindex message object files, specifying directory of @cindex files, message object, specifying directory of @cindexgawkfunc{bindtextdomain} -@item bindtextdomain(@var{directory} @r{[}, @var{domain}@r{]}) +@item @code{bindtextdomain(@var{directory}} [@code{,} @var{domain} ]@code{)} Change the directory in which -@code{gettext} looks for @file{.gmo} files, in case they +@command{gettext} looks for @file{.gmo} files, in case they will not or cannot be placed in the standard locations (e.g., during testing). Return the directory in which @var{domain} is ``bound.'' @@ -25811,15 +27328,7 @@ given @var{domain}. @end table -To use these facilities in your @command{awk} program, follow the steps -outlined in -@ifnotinfo -the previous @value{SECTION}, -@end ifnotinfo -@ifinfo -@ref{Explaining gettext}, -@end ifinfo -like so: +To use these facilities in your @command{awk} program, follow these steps: @enumerate @cindex @code{BEGIN} pattern, @code{TEXTDOMAIN} variable and @@ -25854,18 +27363,35 @@ @item If you are creating strings dynamically, you can still translate them, using the @code{dcgettext()} -built-in function: +built-in function:@footnote{Thanks to Bruno Haible for this +example.} @example -message = nusers " users logged in" -message = dcgettext(message, "adminprog") -print message +if (groggy) + message = dcgettext("%d customers disturbing me\n", "adminprog") +else + message = dcgettext("enjoying %d customers\n", "adminprog") +printf(message, ncustomers) @end example Here, the call to @code{dcgettext()} supplies a different text domain (@code{"adminprog"}) in which to find the message, but it uses the default @code{"LC_MESSAGES"} category. +The previous example only works if @code{ncustomers} is greater than one. +This example would be better done with @code{dcngettext()}: + +@example +if (groggy) + message = dcngettext("%d customer disturbing me\n", + "%d customers disturbing me\n", "adminprog") +else + message = dcngettext("enjoying %d customer\n", + "enjoying %d customers\n", "adminprog") +printf(message, ncustomers) +@end example + + @cindex @code{LC_MESSAGES} locale category, @code{bindtextdomain()} function (@command{gawk}) @item During development, you might want to put the @file{.gmo} @@ -25887,7 +27413,7 @@ @end enumerate -@xref{I18N Example}, +@DBXREF{I18N Example} for an example program showing the steps to create and use translations from @command{awk}. @@ -25933,23 +27459,24 @@ the initial @file{.pot} file: @example -$ @kbd{gawk --gen-pot -f guide.awk > guide.pot} +gawk --gen-pot -f guide.awk > guide.pot @end example @cindex @code{xgettext} utility When run with @option{--gen-pot}, @command{gawk} does not execute your program. Instead, it parses it as usual and prints all marked strings -to standard output in the format of a GNU @code{gettext} Portable Object +to standard output in the format of a GNU @command{gettext} Portable Object file. Also included in the output are any constant strings that appear as the first argument to @code{dcgettext()} or as the first and second argument to @code{dcngettext()}.@footnote{The @command{xgettext} utility that comes with GNU -@code{gettext} can handle @file{.awk} files.} -@xref{I18N Example}, +@command{gettext} can handle @file{.awk} files.} +You should distribute the generated @file{.pot} file with +your @command{awk} program; translators will eventually use it +to provide you translations that you can also then distribute. +@DBXREF{I18N Example} for the full list of steps to go through to create and test translations for @command{guide}. -@c ENDOFRANGE portobfi -@c ENDOFRANGE portmsgfi @node Printf Ordering @subsection Rearranging @code{printf} Arguments @@ -25960,9 +27487,8 @@ (@pxref{Printf}) present a special problem for translation. Consider the following:@footnote{This example is borrowed -from the GNU @code{gettext} manual.} +from the GNU @command{gettext} manual.} -@c line broken here only for smallbook format @example printf(_"String `%s' has %d characters\n", string, length(string))) @@ -25995,11 +27521,11 @@ @example $ @kbd{gawk 'BEGIN @{} -> @kbd{string = "Dont Panic"} +> @kbd{string = "Don\47t Panic"} > @kbd{printf "%2$d characters live in \"%1$s\"\n",} > @kbd{string, length(string)} > @kbd{@}'} -@print{} 10 characters live in "Dont Panic" +@print{} 11 characters live in "Don't Panic" @end example If present, positional specifiers come first in the format specification, @@ -26070,11 +27596,11 @@ However, it is actually almost portable, requiring very little change: -@itemize @bullet +@itemize @value{BULLET} @cindex @code{TEXTDOMAIN} variable, portability and @item Assignments to @code{TEXTDOMAIN} won't have any effect, -since @code{TEXTDOMAIN} is not special in other @command{awk} implementations. +because @code{TEXTDOMAIN} is not special in other @command{awk} implementations. @item Non-GNU versions of @command{awk} treat marked strings @@ -26085,7 +27611,7 @@ the result. @item -By defining ``dummy'' functions to replace @code{dcgettext()}, @code{dcngettext()} +By defining ``dummy'' functions to replace @code{dcgettext()}, @code{dcngettext()}, and @code{bindtextdomain()}, the @command{awk} program can be made to run, but all the messages are output in the original language. For example: @@ -26122,11 +27648,10 @@ underlying C library version of @code{sprintf()}, but only one format and argument at a time. What happens if a positional specification is used is anybody's guess. -However, since the positional specifications are primarily for use in -@emph{translated} format strings, and since non-GNU @command{awk}s never +However, because the positional specifications are primarily for use in +@emph{translated} format strings, and because non-GNU @command{awk}s never retrieve the translated string, this should not be a problem in practice. @end itemize -@c ENDOFRANGE inap @node I18N Example @section A Simple Internationalization Example @@ -26186,7 +27711,7 @@ @example @group -$ cp guide.pot guide-mellow.po +$ @kbd{cp guide.pot guide-mellow.po} @var{Add translations to} guide-mellow.po @dots{} @end group @end example @@ -26210,33 +27735,34 @@ @cindex Linux @cindex GNU/Linux The next step is to make the directory to hold the binary message object -file and then to create the @file{guide.gmo} file. -The directory layout shown here is standard for GNU @code{gettext} on -GNU/Linux systems. Other versions of @code{gettext} may use a different +file and then to create the @file{guide.mo} file. +We pretend that our file is to be used in the @code{en_US.UTF-8} locale, +because we have to use a locale name known to the C @command{gettext} routines. +The directory layout shown here is standard for GNU @command{gettext} on +GNU/Linux systems. Other versions of @command{gettext} may use a different layout: @example -$ @kbd{mkdir en_US en_US/LC_MESSAGES} +$ @kbd{mkdir en_US.UTF-8 en_US.UTF-8/LC_MESSAGES} @end example -@cindex @code{.po} files, converting to @code{.gmo} -@cindex files, @code{.po}, converting to @code{.gmo} -@cindex @code{.gmo} files, converting from @code{.po} -@cindex files, @code{.gmo}, converting from @code{.po} +@cindex @code{.po} files, converting to @code{.mo} +@cindex files, @code{.po}, converting to @code{.mo} +@cindex @code{.mo} files, converting from @code{.po} +@cindex files, @code{.mo}, converting from @code{.po} @cindex portable object files, converting to message object files @cindex files, portable object, converting to message object files @cindex message object files, converting from portable object files @cindex files, message object, converting from portable object files @cindex @command{msgfmt} utility The @command{msgfmt} utility does the conversion from human-readable -@file{.po} file to machine-readable @file{.gmo} file. +@file{.po} file to machine-readable @file{.mo} file. By default, @command{msgfmt} creates a file named @file{messages}. -This file must be renamed and placed in the proper directory so that -@command{gawk} can find it: +This file must be renamed and placed in the proper directory (using +the @option{-o} option) so that @command{gawk} can find it: @example -$ @kbd{msgfmt guide-mellow.po} -$ @kbd{mv messages en_US/LC_MESSAGES/guide.gmo} +$ @kbd{msgfmt guide-mellow.po -o en_US.UTF-8/LC_MESSAGES/guide.mo} @end example Finally, we run the program to test it: @@ -26248,7 +27774,7 @@ @print{} Pardon me, Zaphod who? @end example -If the three replacement functions for @code{dcgettext()}, @code{dcngettext()} +If the three replacement functions for @code{dcgettext()}, @code{dcngettext()}, and @code{bindtextdomain()} (@pxref{I18N Portability}) are in a file named @file{libintl.awk}, @@ -26265,30 +27791,70 @@ @section @command{gawk} Can Speak Your Language @command{gawk} itself has been internationalized -using the GNU @code{gettext} package. -(GNU @code{gettext} is described in +using the GNU @command{gettext} package. +(GNU @command{gettext} is described in complete detail in @ifinfo -@inforef{Top, , GNU @code{gettext} utilities, gettext, GNU gettext tools}.) +@inforef{Top, , GNU @command{gettext} utilities, gettext, GNU @command{gettext} utilities}.) @end ifinfo @ifnotinfo -@cite{GNU gettext tools}.) +@uref{http://www.gnu.org/software/gettext/manual/, +@cite{GNU @command{gettext} utilities}}.) @end ifnotinfo -As of this writing, the latest version of GNU @code{gettext} is -@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.18.2.1.tar.gz, version 0.18.2.1}. +As of this writing, the latest version of GNU @command{gettext} is +@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.4.tar.gz, +@value{PVERSION} 0.19.4}. If a translation of @command{gawk}'s messages exists, then @command{gawk} produces usage messages, warnings, and fatal errors in the local language. -@c ENDOFRANGE inloc -@c The original text for this chapter was contributed by Efraim Yawitz. -@c FIXME: Add more indexing. +@node I18N Summary +@section Summary + +@itemize @value{BULLET} +@item +Internationalization means writing a program such that it can use multiple +languages without requiring source code changes. Localization means +providing the data necessary for an internationalized program to work +in a particular language. + +@item +@command{gawk} uses GNU @command{gettext} to let you internationalize +and localize @command{awk} programs. A program's text domain identifies +the program for grouping all messages and other data together. + +@item +You mark a program's strings for translation by preceding them with +an underscore. Once that is done, the strings are extracted into a +@file{.pot} file. This file is copied for each language into a @file{.po} +file, and the @file{.po} files are compiled into @file{.gmo} files for +use at runtime. + +@item +You can use positional specifications with @code{sprintf()} and +@code{printf} to rearrange the placement of argument values in formatted +strings and output. This is useful for the translation of format +control strings. + +@item +The internationalization features have been designed so that they +can be easily worked around in a standard @command{awk}. + +@item +@command{gawk} itself has been internationalized and ships with +a number of translations for its messages. + +@end itemize + @node Debugger @chapter Debugging @command{awk} Programs @cindex debugging @command{awk} programs +@c The original text for this chapter was contributed by Efraim Yawitz. +@c FIXME: Add more indexing. + It would be nice if computer programs worked perfectly the first time they were run, but in real life, this rarely happens for programs of any complexity. Thus, most programming languages have facilities available @@ -26305,10 +27871,11 @@ * List of Debugger Commands:: Main debugger commands. * Readline Support:: Readline support. * Limitations:: Limitations and future plans. +* Debugging Summary:: Debugging summary. @end menu @node Debugging -@section Introduction to @command{gawk} Debugger +@section Introduction to the @command{gawk} Debugger This @value{SECTION} introduces debugging in general and begins the discussion of debugging in @command{gawk}. @@ -26323,17 +27890,16 @@ @subsection Debugging in General (If you have used debuggers in other languages, you may want to skip -ahead to the next section on the specific features of the @command{awk} -debugger.) +ahead to @ref{Awk Debugging}.) -Of course, a debugging program cannot remove bugs for you, since it has -no way of knowing what you or your users consider a ``bug'' and what is a +Of course, a debugging program cannot remove bugs for you, because it has +no way of knowing what you or your users consider a ``bug'' versus a ``feature.'' (Sometimes, we humans have a hard time with this ourselves.) In that case, what can you expect from such a tool? The answer to that depends on the language being debugged, but in general, you can expect at least the following: -@itemize @bullet +@itemize @value{BULLET} @item The ability to watch a program execute its instructions one by one, giving you, the programmer, the opportunity to think about what is happening @@ -26348,7 +27914,7 @@ @item The chance to see the values of data in the program at any point in execution, and also to change that data on the fly, to see how that -affects what happens afterwards. (This often includes the ability +affects what happens afterward. (This often includes the ability to look at internal data structures besides the variables you actually defined in your code.) @@ -26363,16 +27929,16 @@ functional program that you or someone else wrote). @node Debugging Terms -@subsection Additional Debugging Concepts +@subsection Debugging Concepts Before diving in to the details, we need to introduce several important concepts that apply to just about all debuggers. The following list defines terms used throughout the rest of -this @value{CHAPTER}. +this @value{CHAPTER}: @table @dfn @cindex stack frame -@item Stack Frame +@item Stack frame Programs generally call functions during the course of their execution. One function can call another, or a function can call itself (recursion). You can view the chain of called functions (main program calls A, which @@ -26407,7 +27973,7 @@ A watchpoint is similar to a breakpoint. The difference is that breakpoints are oriented around the code: stop when a certain point in the code is reached. A watchpoint, however, specifies that program execution -should stop when a @emph{data value} is changed. This is useful, since +should stop when a @emph{data value} is changed. This is useful, as sometimes it happens that a variable receives an erroneous value, and it's hard to track down where this happens just by looking at the code. By using a watchpoint, you can stop whenever a variable is assigned to, @@ -26415,26 +27981,26 @@ @end table @node Awk Debugging -@subsection Awk Debugging +@subsection @command{awk} Debugging Debugging an @command{awk} program has some specific aspects that are -not shared with other programming languages. +not shared with programs written in other languages. First of all, the fact that @command{awk} programs usually take input -line-by-line from a file or files and operate on those lines using specific +line by line from a file or files and operate on those lines using specific rules makes it especially useful to organize viewing the execution of the program in terms of these rules. As we will see, each @command{awk} rule is treated almost like a function call, with its own specific block of instructions. -In addition, since @command{awk} is by design a very concise language, +In addition, because @command{awk} is by design a very concise language, it is easy to lose sight of everything that is going on ``inside'' each line of @command{awk} code. The debugger provides the opportunity to look at the individual primitive instructions carried out by the higher-level @command{awk} commands. @node Sample Debugging Session -@section Sample Debugging Session +@section Sample @command{gawk} Debugging Session @cindex sample debugging session In order to illustrate the use of @command{gawk} as a debugger, let's look at a sample @@ -26452,25 +28018,26 @@ @cindex starting the debugger @cindex debugger, how to start -Starting the debugger is almost exactly like running @command{gawk}, -except you have to pass an additional option @option{--debug} or the -corresponding short option @option{-D}. The file(s) containing the +Starting the debugger is almost exactly like running @command{gawk} normally, +except you have to pass an additional option, @option{--debug}, or the +corresponding short option, @option{-D}. The file(s) containing the program and any supporting code are given on the command line as arguments to one or more @option{-f} options. (@command{gawk} is not designed to debug command-line programs, only programs contained in files.) In our case, we invoke the debugger like this: @example -$ @kbd{gawk -D -f getopt.awk -f join.awk -f uniq.awk inputfile} +$ @kbd{gawk -D -f getopt.awk -f join.awk -f uniq.awk -1 inputfile} @end example @noindent where both @file{getopt.awk} and @file{uniq.awk} are in @env{$AWKPATH}. (Experienced users of GDB or similar debuggers should note that -this syntax is slightly different from what they are used to. +this syntax is slightly different from what you are used to. With the @command{gawk} debugger, you give the arguments for running the program in the command line to the debugger rather than as part of the @code{run} command at the debugger prompt.) +The @option{-1} is an option to @file{uniq.awk}. Instead of immediately running the program on @file{inputfile}, as @command{gawk} would ordinarily do, the debugger merely loads all @@ -26523,7 +28090,7 @@ @example gawk> @kbd{b are_equal} -@print{} Breakpoint 1 set at file `awklib/eg/prog/uniq.awk', line 64 +@print{} Breakpoint 1 set at file `awklib/eg/prog/uniq.awk', line 63 @end example The debugger tells us the file and line number where the breakpoint is. @@ -26535,8 +28102,8 @@ @print{} Starting program: @print{} Stopping in Rule ... @print{} Breakpoint 1, are_equal(n, m, clast, cline, alast, aline) - at `awklib/eg/prog/uniq.awk':64 -@print{} 64 if (fcount == 0 && charcount == 0) + at `awklib/eg/prog/uniq.awk':63 +@print{} 63 if (fcount == 0 && charcount == 0) gawk> @end example @@ -26548,12 +28115,12 @@ @example gawk> @kbd{bt} @print{} #0 are_equal(n, m, clast, cline, alast, aline) - at `awklib/eg/prog/uniq.awk':69 -@print{} #1 in main() at `awklib/eg/prog/uniq.awk':89 + at `awklib/eg/prog/uniq.awk':68 +@print{} #1 in main() at `awklib/eg/prog/uniq.awk':88 @end example This tells us that @code{are_equal()} was called by the main program at -line 89 of @file{uniq.awk}. (This is not a big surprise, since this +line 88 of @file{uniq.awk}. (This is not a big surprise, because this is the only call to @code{are_equal()} in the program, but in more complex programs, knowing who called a function and with what parameters can be the key to finding the source of the problem.) @@ -26570,23 +28137,23 @@ @end example @noindent -In this case, @code{n} is an uninitialized local variable, since the +In this case, @code{n} is an uninitialized local variable, because the function was called without arguments (@pxref{Function Calls}). A more useful variable to display might be the current record: @example gawk> @kbd{p $0} -@print{} $0 = string ("gawk is a wonderful program!") +@print{} $0 = "gawk is a wonderful program!" @end example @noindent -This might be a bit puzzling at first since this is the second line of -our test input above. Let's look at @code{NR}: +This might be a bit puzzling at first, as this is the second line of +our test input. Let's look at @code{NR}: @example gawk> @kbd{p NR} -@print{} NR = number (2) +@print{} NR = 2 @end example @noindent @@ -26605,7 +28172,7 @@ @example gawk> @kbd{p last} -@print{} last = string ("awk is a wonderful program!") +@print{} last = "awk is a wonderful program!" @end example Everything we have done so far has verified that the program has worked as @@ -26616,29 +28183,23 @@ @example gawk> @kbd{n} -@print{} 67 if (fcount > 0) @{ -@end example - -This tells us that @command{gawk} is now ready to execute line 67, which -decides whether to give the lines the special ``field skipping'' treatment -indicated by the @option{-f} command-line option. (Notice that we skipped -from where we were before at line 64 to here, since the condition in line 64 - -@example -if (fcount == 0 && charcount == 0) +@print{} 66 if (fcount > 0) @{ @end example -@noindent -was false.) +This tells us that @command{gawk} is now ready to execute line 66, which +decides whether to give the lines the special ``field-skipping'' treatment +indicated by the @option{-1} command-line option. (Notice that we skipped +from where we were before, at line 63, to here, because the condition +in line 63, @samp{if (fcount == 0 && charcount == 0)}, was false.) Continuing to step, we now get to the splitting of the current and last records: @example gawk> @kbd{n} -@print{} 68 n = split(last, alast) +@print{} 67 n = split(last, alast) gawk> @kbd{n} -@print{} 69 m = split($0, aline) +@print{} 68 m = split($0, aline) @end example At this point, we should be curious to see what our records were split @@ -26646,10 +28207,10 @@ @example gawk> @kbd{p n m alast aline} -@print{} n = number (5) -@print{} m = number (5) +@print{} n = 5 +@print{} m = untyped variable @print{} alast = array, 5 elements -@print{} aline = array, 5 elements +@print{} aline = untyped variable @end example @noindent @@ -26657,7 +28218,9 @@ @command{awk}'s @code{print} statement.) This is kind of disappointing, though. All we found out is that there -are five elements in each of our arrays. Useful enough (we now know that +are five elements in @code{alast}; @code{m} and @code{aline} don't have +values because we are at line 68 but haven't executed it yet. +This information is useful enough (we now know that none of the words were accidentally left out), but what if we want to see inside the array? @@ -26673,7 +28236,7 @@ @example gawk> @kbd{p alast[1]} -@print{} alast["1"] = string ("awk") +@print{} alast["1"] = "awk" @end example This would be kind of slow for a 100-member array, though, so @@ -26682,11 +28245,11 @@ @example gawk> @kbd{p @@alast} -@print{} alast["1"] = string ("awk") -@print{} alast["2"] = string ("is") -@print{} alast["3"] = string ("a") -@print{} alast["4"] = string ("wonderful") -@print{} alast["5"] = string ("program!") +@print{} alast["1"] = "awk" +@print{} alast["2"] = "is" +@print{} alast["3"] = "a" +@print{} alast["4"] = "wonderful" +@print{} alast["5"] = "program!" @end example It looks like we got this far OK. Let's take another step @@ -26694,23 +28257,23 @@ @example gawk> @kbd{n} -@print{} 70 clast = join(alast, fcount, n) +@print{} 69 clast = join(alast, fcount, n) gawk> @kbd{n} -@print{} 71 cline = join(aline, fcount, m) +@print{} 70 cline = join(aline, fcount, m) @end example Well, here we are at our error (sorry to spoil the suspense). What we had in mind was to join the fields starting from the second one to make -the virtual record to compare, and if the first field was numbered zero, +the virtual record to compare, and if the first field were numbered zero, this would work. Let's look at what we've got: @example gawk> @kbd{p cline clast} -@print{} cline = string ("gawk is a wonderful program!") -@print{} clast = string ("awk is a wonderful program!") +@print{} cline = "gawk is a wonderful program!" +@print{} clast = "awk is a wonderful program!" @end example -Hey, those look pretty familiar! They're just our original, unaltered, +Hey, those look pretty familiar! They're just our original, unaltered input records. A little thinking (the human brain is still the best debugging tool), and we realize that we were off by one! @@ -26738,7 +28301,7 @@ The @command{gawk} debugger command set can be divided into the following categories: -@itemize @bullet{} +@itemize @value{BULLET} @item Breakpoint control @@ -26760,13 +28323,14 @@ @end itemize Each of these are discussed in the following subsections. -In the following descriptions, commands which may be abbreviated +In the following descriptions, commands that may be abbreviated show the abbreviation on a second description line. A debugger command name may also be truncated if that partial name is unambiguous. The debugger has the built-in capability to -automatically repeat the previous command when just hitting @key{Enter}. -This works for the commands @code{list}, @code{next}, @code{nexti}, @code{step}, @code{stepi} -and @code{continue} executed without any argument. +automatically repeat the previous command just by hitting @kbd{Enter}. +This works for the commands @code{list}, @code{next}, @code{nexti}, +@code{step}, @code{stepi}, and @code{continue} executed without any +argument. @menu * Breakpoint Control:: Control of Breakpoints. @@ -26781,9 +28345,9 @@ @node Breakpoint Control @subsection Control of Breakpoints -As we saw above, the first thing you probably want to do in a debugging -session is to get your breakpoints set up, since otherwise your program -will just run as if it was not under the debugger. The commands for +As we saw earlier, the first thing you probably want to do in a debugging +session is to get your breakpoints set up, because your program +will otherwise just run as if it was not under the debugger. The commands for controlling breakpoints are: @table @asis @@ -26813,7 +28377,7 @@ function @var{function}. @end table -Each breakpoint is assigned a number which can be used to delete it from +Each breakpoint is assigned a number that can be used to delete it from the breakpoint list using the @code{delete} command. With a breakpoint, you may also supply a condition. This is an @@ -26849,12 +28413,13 @@ @cindex breakpoint condition @item @code{condition} @var{n} @code{"@var{expression}"} Add a condition to existing breakpoint or watchpoint @var{n}. The -condition is an @command{awk} expression that the debugger evaluates +condition is an @command{awk} expression @emph{enclosed in double quotes} +that the debugger evaluates whenever the breakpoint or watchpoint is reached. If the condition is true, then the debugger stops execution and prompts for a command. Otherwise, the debugger continues executing the program. If the condition expression is -not specified, any existing condition is removed; i.e., the breakpoint or -watchpoint is made unconditional. +not specified, any existing condition is removed (i.e., the breakpoint or +watchpoint is made unconditional). @cindex debugger commands, @code{d} (@code{delete}) @cindex debugger commands, @code{delete} @@ -26864,7 +28429,7 @@ @cindex breakpoint, delete by number @item @code{delete} [@var{n1 n2} @dots{}] [@var{n}--@var{m}] @itemx @code{d} [@var{n1 n2} @dots{}] [@var{n}--@var{m}] -Delete specified breakpoints or a range of breakpoints. Deletes +Delete specified breakpoints or a range of breakpoints. Delete all defined breakpoints if no argument is supplied. @cindex debugger commands, @code{disable} @@ -26873,7 +28438,7 @@ @cindex breakpoint, how to disable or enable @item @code{disable} [@var{n1 n2} @dots{} | @var{n}--@var{m}] Disable specified breakpoints or a range of breakpoints. Without -any argument, disables all breakpoints. +any argument, disable all breakpoints. @cindex debugger commands, @code{e} (@code{enable}) @cindex debugger commands, @code{enable} @@ -26883,18 +28448,18 @@ @item @code{enable} [@code{del} | @code{once}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}] @itemx @code{e} [@code{del} | @code{once}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}] Enable specified breakpoints or a range of breakpoints. Without -any argument, enables all breakpoints. -Optionally, you can specify how to enable the breakpoint: +any argument, enable all breakpoints. +Optionally, you can specify how to enable the breakpoints: @c nested table @table @code @item del -Enable the breakpoint(s) temporarily, then delete it when -the program stops at the breakpoint. +Enable the breakpoints temporarily, then delete each one when +the program stops at it. @item once -Enable the breakpoint(s) temporarily, then disable it when -the program stops at the breakpoint. +Enable the breakpoints temporarily, then disable each one when +the program stops at it. @end table @cindex debugger commands, @code{ignore} @@ -26962,7 +28527,7 @@ @item @code{continue} [@var{count}] @itemx @code{c} [@var{count}] Resume program execution. If continued from a breakpoint and @var{count} is -specified, ignores the breakpoint at that location the next @var{count} times +specified, ignore the breakpoint at that location the next @var{count} times before stopping. @cindex debugger commands, @code{finish} @@ -26995,7 +28560,7 @@ @item @code{return} [@var{value}] Cancel execution of a function call. If @var{value} (either a string or a number) is specified, it is used as the function's return value. If used in a -frame other than the innermost one (the currently executing function, i.e., +frame other than the innermost one (the currently executing function; i.e., frame number 0), discard all inner frames in addition to the selected one, and the caller of that frame becomes the innermost frame. @@ -27016,7 +28581,7 @@ @item @code{step} [@var{count}] @itemx @code{s} [@var{count}] Continue execution until control reaches a different source line in the -current stack frame. @code{step} steps inside any function called within +current stack frame, stepping inside any function called within the line. If the argument @var{count} is supplied, steps that many times before stopping, unless it encounters a breakpoint or watchpoint. @@ -27037,7 +28602,7 @@ @item @code{until} [[@var{filename}@code{:}]@var{n} | @var{function}] @itemx @code{u} [[@var{filename}@code{:}]@var{n} | @var{function}] Without any argument, continue execution until a line past the current -line in current stack frame is reached. With an argument, +line in the current stack frame is reached. With an argument, continue execution until the specified location is reached, or the current stack frame returns. @end table @@ -27061,7 +28626,7 @@ @end example @noindent -displays the assigned item number, the variable name and its current value. +This displays the assigned item number, the variable name, and its current value. If the display variable refers to a function parameter, it is silently deleted from the list as soon as the execution reaches a context where no such variable of the given name exists. @@ -27101,7 +28666,7 @@ @noindent This prints the third field in the input record (if the specified field does not exist, it prints @samp{Null field}). A variable can be an array element, with -the subscripts being constant values. To print the contents of an array, +the subscripts being constant string values. To print the contents of an array, prefix the name of the array with the @samp{@@} symbol: @example @@ -27126,10 +28691,10 @@ @item @code{set} @var{var}@code{=}@var{value} Assign a constant (number or string) value to an @command{awk} variable or field. -String values must be enclosed between double quotes (@code{"@dots{}"}). +String values must be enclosed between double quotes (@code{"}@dots{}@code{"}). You can also set special @command{awk} variables, such as @code{FS}, -@code{NF}, @code{NR}, etc. +@code{NF}, @code{NR}, and so on. @cindex debugger commands, @code{w} (@code{watch}) @cindex debugger commands, @code{watch} @@ -27141,7 +28706,7 @@ Add variable @var{var} (or field @code{$@var{n}}) to the watch list. The debugger then stops whenever the value of the variable or field changes. Each watched item is assigned a -number which can be used to delete it from the watch list using the +number that can be used to delete it from the watch list using the @code{unwatch} command. With a watchpoint, you may also supply a condition. This is an @@ -27167,27 +28732,33 @@ @end table @node Execution Stack -@subsection Dealing with the Stack +@subsection Working with the Stack -Whenever you run a program which contains any function calls, +Whenever you run a program that contains any function calls, @command{gawk} maintains a stack of all of the function calls leading up to where the program is right now. You can see how you got to where you are, and also move around in the stack to see what the state of things was in the -functions which called the one you are in. The commands for doing this are: +functions that called the one you are in. The commands for doing this are: @table @asis @cindex debugger commands, @code{bt} (@code{backtrace}) @cindex debugger commands, @code{backtrace} +@cindex debugger commands, @code{where} (@code{backtrace}) @cindex @code{backtrace} debugger command @cindex @code{bt} debugger command (alias for @code{backtrace}) +@cindex @code{where} debugger command +@cindex @code{where} debugger command (alias for @code{backtrace}) @cindex call stack, display in debugger @cindex traceback, display in debugger @item @code{backtrace} [@var{count}] @itemx @code{bt} [@var{count}] +@itemx @code{where} [@var{count}] Print a backtrace of all function calls (stack frames), or innermost @var{count} frames if @var{count} > 0. Print the outermost @var{count} frames if @var{count} < 0. The backtrace displays the name and arguments to each -function, the source file name, and the line number. +function, the source @value{FN}, and the line number. +The alias @code{where} for @code{backtrace} is provided for longtime +GDB users who may be used to that command. @cindex debugger commands, @code{down} @cindex @code{down} debugger command @@ -27201,10 +28772,11 @@ @cindex @code{f} debugger command (alias for @code{frame}) @item @code{frame} [@var{n}] @itemx @code{f} [@var{n}] -Select and print (frame number, function and argument names, source file, -and the source line) stack frame @var{n}. Frame 0 is the currently executing, -or @dfn{innermost}, frame (function call), frame 1 is the frame that called the -innermost one. The highest numbered frame is the one for the main program. +Select and print stack frame @var{n}. Frame 0 is the currently executing, +or @dfn{innermost}, frame (function call); frame 1 is the frame that +called the innermost one. The highest-numbered frame is the one for the +main program. The printed information consists of the frame number, +function and argument names, source file, and the source line. @cindex debugger commands, @code{up} @cindex @code{up} debugger command @@ -27214,11 +28786,11 @@ @end table @node Debugger Info -@subsection Obtaining Information about the Program and the Debugger State +@subsection Obtaining Information About the Program and the Debugger State Besides looking at the values of variables, there is often a need to get other sorts of information about the state of your program and of the -debugging environment itself. The @command{gawk} debugger has one command which +debugging environment itself. The @command{gawk} debugger has one command that provides this information, appropriately called @code{info}. @code{info} is used with one of a number of arguments that tell it exactly what you want to know: @@ -27236,7 +28808,7 @@ @table @code @item args @cindex show function arguments, in debugger -Arguments of the selected frame. +List arguments of the selected frame. @item break @cindex show breakpoints @@ -27248,20 +28820,20 @@ @item frame @cindex describe call stack frame, in debugger -Description of the selected stack frame. +Give a description of the selected stack frame. @item functions @cindex list function definitions, in debugger -List all function definitions including source file names and +List all function definitions including source @value{FN}s and line numbers. @item locals @cindex show local variables, in debugger -Local variables of the selected frame. +List local variables of the selected frame. @item source @cindex show name of current source file, in debugger -The name of the current source file. Each time the program stops, the +Print the name of the current source file. Each time the program stops, the current source file is the file containing the current instruction. When the debugger first starts, the current source file is the first file included via the @option{-f} option. The @@ -27302,44 +28874,45 @@ The available options are: @c nested table -@table @code -@item history_size +@c asis for docbook +@table @asis +@item @code{history_size} @cindex debugger history size -The maximum number of lines to keep in the history file @file{./.gawk_history}. -The default is 100. +Set the maximum number of lines to keep in the history file +@file{./.gawk_history}. The default is 100. -@item listsize +@item @code{listsize} @cindex debugger default list amount -The number of lines that @code{list} prints. The default is 15. +Specify the number of lines that @code{list} prints. The default is 15. -@item outfile +@item @code{outfile} @cindex redirect @command{gawk} output, in debugger Send @command{gawk} output to a file; debugger output still goes to standard output. An empty string (@code{""}) resets output to standard output. -@item prompt +@item @code{prompt} @cindex debugger prompt -The debugger prompt. The default is @samp{@w{gawk> }}. +Change the debugger prompt. The default is @samp{@w{gawk> }}. -@item save_history @r{[}on @r{|} off@r{]} +@item @code{save_history} [@code{on} | @code{off}] @cindex debugger history file Save command history to file @file{./.gawk_history}. The default is @code{on}. -@item save_options @r{[}on @r{|} off@r{]} +@item @code{save_options} [@code{on} | @code{off}] @cindex save debugger options Save current options to file @file{./.gawkrc} upon exit. The default is @code{on}. -Options are read back in to the next session upon startup. +Options are read back into the next session upon startup. -@item trace @r{[}on @r{|} off@r{]} +@item @code{trace} [@code{on} | @code{off}] @cindex instruction tracing, in debugger Turn instruction tracing on or off. The default is @code{off}. @end table @item @code{save} @var{filename} -Save the commands from the current session to the given file name, +Save the commands from the current session to the given @value{FN}, so that they can be replayed using the @command{source} command. @item @code{source} @var{filename} @@ -27354,7 +28927,7 @@ @code{source} commands; however, the @command{gawk} debugger will not source the same file more than once in order to avoid infinite recursion. -In addition to, or instead of the @code{source} command, you can use +In addition to, or instead of, the @code{source} command, you can use the @option{-D @var{file}} or @option{--debug=@var{file}} command-line options to execute commands from a file non-interactively (@pxref{Options}). @@ -27363,68 +28936,69 @@ @node Miscellaneous Debugger Commands @subsection Miscellaneous Commands -There are a few more commands which do not fit into the +There are a few more commands that do not fit into the previous categories, as follows: @table @asis @cindex debugger commands, @code{dump} @cindex @code{dump} debugger command @item @code{dump} [@var{filename}] -Dump bytecode of the program to standard output or to the file +Dump byte code of the program to standard output or to the file named in @var{filename}. This prints a representation of the internal -instructions which @command{gawk} executes to implement the @command{awk} +instructions that @command{gawk} executes to implement the @command{awk} commands in a program. This can be very enlightening, as the following partial dump of Davide Brini's obfuscated code (@pxref{Signature Program}) demonstrates: +@c FIXME: This will need updating if num-handler branch is ever merged in. @smallexample gawk> @kbd{dump} -@print{} # BEGIN -@print{} -@print{} [ 1:0xfcd340] Op_rule : [in_rule = BEGIN] [source_file = brini.awk] -@print{} [ 1:0xfcc240] Op_push_i : "~" [MALLOC|STRING|STRCUR] -@print{} [ 1:0xfcc2a0] Op_push_i : "~" [MALLOC|STRING|STRCUR] -@print{} [ 1:0xfcc280] Op_match : -@print{} [ 1:0xfcc1e0] Op_store_var : O -@print{} [ 1:0xfcc2e0] Op_push_i : "==" [MALLOC|STRING|STRCUR] -@print{} [ 1:0xfcc340] Op_push_i : "==" [MALLOC|STRING|STRCUR] -@print{} [ 1:0xfcc320] Op_equal : -@print{} [ 1:0xfcc200] Op_store_var : o -@print{} [ 1:0xfcc380] Op_push : o -@print{} [ 1:0xfcc360] Op_plus_i : 0 [MALLOC|NUMCUR|NUMBER] -@print{} [ 1:0xfcc220] Op_push_lhs : o [do_reference = true] -@print{} [ 1:0xfcc300] Op_assign_plus : -@print{} [ :0xfcc2c0] Op_pop : -@print{} [ 1:0xfcc400] Op_push : O -@print{} [ 1:0xfcc420] Op_push_i : "" [MALLOC|STRING|STRCUR] -@print{} [ :0xfcc4a0] Op_no_op : -@print{} [ 1:0xfcc480] Op_push : O -@print{} [ :0xfcc4c0] Op_concat : [expr_count = 3] [concat_flag = 0] -@print{} [ 1:0xfcc3c0] Op_store_var : x -@print{} [ 1:0xfcc440] Op_push_lhs : X [do_reference = true] -@print{} [ 1:0xfcc3a0] Op_postincrement : -@print{} [ 1:0xfcc4e0] Op_push : x -@print{} [ 1:0xfcc540] Op_push : o -@print{} [ 1:0xfcc500] Op_plus : -@print{} [ 1:0xfcc580] Op_push : o -@print{} [ 1:0xfcc560] Op_plus : -@print{} [ 1:0xfcc460] Op_leq : -@print{} [ :0xfcc5c0] Op_jmp_false : [target_jmp = 0xfcc5e0] -@print{} [ 1:0xfcc600] Op_push_i : "%c" [MALLOC|STRING|STRCUR] -@print{} [ :0xfcc660] Op_no_op : -@print{} [ 1:0xfcc520] Op_assign_concat : c -@print{} [ :0xfcc620] Op_jmp : [target_jmp = 0xfcc440] -@print{} -@dots{} -@print{} +@print{} # BEGIN +@print{} +@print{} [ 1:0xfcd340] Op_rule : [in_rule = BEGIN] [source_file = brini.awk] +@print{} [ 1:0xfcc240] Op_push_i : "~" [MALLOC|STRING|STRCUR] +@print{} [ 1:0xfcc2a0] Op_push_i : "~" [MALLOC|STRING|STRCUR] +@print{} [ 1:0xfcc280] Op_match : +@print{} [ 1:0xfcc1e0] Op_store_var : O +@print{} [ 1:0xfcc2e0] Op_push_i : "==" [MALLOC|STRING|STRCUR] +@print{} [ 1:0xfcc340] Op_push_i : "==" [MALLOC|STRING|STRCUR] +@print{} [ 1:0xfcc320] Op_equal : +@print{} [ 1:0xfcc200] Op_store_var : o +@print{} [ 1:0xfcc380] Op_push : o +@print{} [ 1:0xfcc360] Op_plus_i : 0 [MALLOC|NUMCUR|NUMBER] +@print{} [ 1:0xfcc220] Op_push_lhs : o [do_reference = true] +@print{} [ 1:0xfcc300] Op_assign_plus : +@print{} [ :0xfcc2c0] Op_pop : +@print{} [ 1:0xfcc400] Op_push : O +@print{} [ 1:0xfcc420] Op_push_i : "" [MALLOC|STRING|STRCUR] +@print{} [ :0xfcc4a0] Op_no_op : +@print{} [ 1:0xfcc480] Op_push : O +@print{} [ :0xfcc4c0] Op_concat : [expr_count = 3] [concat_flag = 0] +@print{} [ 1:0xfcc3c0] Op_store_var : x +@print{} [ 1:0xfcc440] Op_push_lhs : X [do_reference = true] +@print{} [ 1:0xfcc3a0] Op_postincrement : +@print{} [ 1:0xfcc4e0] Op_push : x +@print{} [ 1:0xfcc540] Op_push : o +@print{} [ 1:0xfcc500] Op_plus : +@print{} [ 1:0xfcc580] Op_push : o +@print{} [ 1:0xfcc560] Op_plus : +@print{} [ 1:0xfcc460] Op_leq : +@print{} [ :0xfcc5c0] Op_jmp_false : [target_jmp = 0xfcc5e0] +@print{} [ 1:0xfcc600] Op_push_i : "%c" [MALLOC|STRING|STRCUR] +@print{} [ :0xfcc660] Op_no_op : +@print{} [ 1:0xfcc520] Op_assign_concat : c +@print{} [ :0xfcc620] Op_jmp : [target_jmp = 0xfcc440] +@print{} +@dots{} +@print{} @print{} [ 2:0xfcc5a0] Op_K_printf : [expr_count = 17] [redir_type = ""] -@print{} [ :0xfcc140] Op_no_op : -@print{} [ :0xfcc1c0] Op_atexit : -@print{} [ :0xfcc640] Op_stop : -@print{} [ :0xfcc180] Op_no_op : -@print{} [ :0xfcd150] Op_after_beginfile : -@print{} [ :0xfcc160] Op_no_op : -@print{} [ :0xfcc1a0] Op_after_endfile : +@print{} [ :0xfcc140] Op_no_op : +@print{} [ :0xfcc1c0] Op_atexit : +@print{} [ :0xfcc640] Op_stop : +@print{} [ :0xfcc180] Op_no_op : +@print{} [ :0xfcd150] Op_after_beginfile : +@print{} [ :0xfcc160] Op_no_op : +@print{} [ :0xfcc1a0] Op_after_endfile : gawk> @end smallexample @@ -27450,7 +29024,7 @@ @c nested table @table @asis -@item @code{-} +@item @code{-} (Minus) Print lines before the lines last printed. @item @code{+} @@ -27468,7 +29042,7 @@ source file @var{filename}. This command may change the current source file. @item @var{function} -Print lines centered around beginning of the +Print lines centered around the beginning of the function @var{function}. This command may change the current source file. @end table @@ -27480,16 +29054,16 @@ @item @code{quit} @itemx @code{q} Exit the debugger. Debugging is great fun, but sometimes we all have -to tend to other obligations in life, and sometimes we find the bug, -and are free to go on to the next one! As we saw above, if you are -running a program, the debugger warns you if you accidentally type +to tend to other obligations in life, and sometimes we find the bug +and are free to go on to the next one! As we saw earlier, if you are +running a program, the debugger warns you when you type @samp{q} or @samp{quit}, to make sure you really want to quit. @cindex debugger commands, @code{trace} @cindex @code{trace} debugger command -@item @code{trace} @code{on} @r{|} @code{off} -Turn on or off a continuous printing of instructions which are about to -be executed, along with printing the @command{awk} line which they +@item @code{trace} [@code{on} | @code{off}] +Turn on or off continuous printing of the instructions that are about to +be executed, along with the @command{awk} lines they implement. The default is @code{off}. It is to be hoped that most of the ``opcodes'' in these instructions are @@ -27503,16 +29077,18 @@ @cindex command completion, in debugger @cindex history expansion, in debugger -If @command{gawk} is compiled with the @code{readline} library, you -can take advantage of that library's command completion and history expansion -features. The following types of completion are available: +If @command{gawk} is compiled with +@uref{http://cnswww.cns.cwru.edu/php/chet/readline/readline.html, +the GNU Readline library}, you can take advantage of that library's +command completion and history expansion features. The following types +of completion are available: @table @asis @item Command completion Command names. -@item Source file name completion -Source file names. Relevant commands are +@item Source @value{FN} completion +Source @value{FN}s. Relevant commands are @code{break}, @code{clear}, @code{list}, @@ -27536,13 +29112,13 @@ @end table @node Limitations -@section Limitations and Future Plans +@section Limitations We hope you find the @command{gawk} debugger useful and enjoyable to work with, but as with any program, especially in its early releases, it still has -some limitations. A few which are worth being aware of are: +some limitations. A few that it's worth being aware of are: -@itemize @bullet{} +@itemize @value{BULLET} @item At this point, the debugger does not give a detailed explanation of what you did wrong when you type in something it doesn't like. Rather, it just @@ -27550,16 +29126,19 @@ though, you'll feel like a real guru. @item -If you perused the dump of opcodes in @ref{Miscellaneous Debugger Commands}, +@c NOTE: no comma after the ref{} on purpose, due to following +@c parenthetical remark. +If you perused the dump of opcodes in @ref{Miscellaneous Debugger Commands} (or if you are already familiar with @command{gawk} internals), you will realize that much of the internal manipulation of data in @command{gawk}, as in many interpreters, is done on a stack. -@code{Op_push}, @code{Op_pop}, etc., are the ``bread and butter'' of -most @command{gawk} code. Unfortunately, as of now, the @command{gawk} -debugger does not allow you to examine the stack's contents. +@code{Op_push}, @code{Op_pop}, and the like are the ``bread and butter'' of +most @command{gawk} code. +Unfortunately, as of now, the @command{gawk} +debugger does not allow you to examine the stack's contents. That is, the intermediate results of expression evaluation are on the -stack, but cannot be printed. Rather, only variables which are defined +stack, but cannot be printed. Rather, only variables that are defined in the program can be printed. Of course, a workaround for this is to use more explicit variables at the debugging stage and then change back to obscure, perhaps more optimal code later. @@ -27567,480 +29146,418 @@ @item There is no way to look ``inside'' the process of compiling regular expressions to see if you got it right. As an @command{awk} -programmer, you are expected to know what @code{/[^[:alnum:][:blank:]]/} -means. +programmer, you are expected to know the meaning of +@code{/[^[:alnum:][:blank:]]/}. @item The @command{gawk} debugger is designed to be used by running a program (with all its parameters) on the command line, as described in @ref{Debugger Invocation}. -There is no way (as of now) to attach or ``break in'' to a running program. -This seems reasonable for a language which is used mainly for quickly +There is no way (as of now) to attach or ``break into'' a running program. +This seems reasonable for a language that is used mainly for quickly executing, short programs. @item -The @command{gawk} debugger only accepts source supplied with the @option{-f} option. +The @command{gawk} debugger only accepts source code supplied with the @option{-f} option. @end itemize +@ignore Look forward to a future release when these and other missing features may be added, and of course feel free to try to add them yourself! +@end ignore + +@node Debugging Summary +@section Summary + +@itemize @value{BULLET} +@item +Programs rarely work correctly the first time. Finding bugs +is called debugging, and a program that helps you find bugs is a +debugger. @command{gawk} has a built-in debugger that works very +similarly to the GNU Debugger, GDB. + +@item +Debuggers let you step through your program one statement at a time, +examine and change variable and array values, and do a number of other +things that let you understand what your program is actually doing (as +opposed to what it is supposed to do). + +@item +Like most debuggers, the @command{gawk} debugger works in terms of stack +frames, and lets you set both breakpoints (stop at a point in the code) +and watchpoints (stop when a data value changes). + +@item +The debugger command set is fairly complete, providing control over +breakpoints, execution, viewing and changing data, working with the stack, +getting information, and other tasks. + +@item +If the GNU Readline library is available when @command{gawk} is +compiled, it is used by the debugger to provide command-line history +and editing. + +@end itemize @node Arbitrary Precision Arithmetic -@chapter Arithmetic and Arbitrary Precision Arithmetic with @command{gawk} +@chapter Arithmetic and Arbitrary-Precision Arithmetic with @command{gawk} @cindex arbitrary precision @cindex multiple precision @cindex infinite precision @cindex floating-point, numbers@comma{} arbitrary precision -@cindex Knuth, Donald -@quotation -@i{There's a credibility gap: We don't know how much of the computer's answers -to believe. Novice computer users solve this problem by implicitly trusting -in the computer as an infallible authority; they tend to believe that all -digits of a printed answer are significant. Disillusioned computer users have -just the opposite approach; they are constantly afraid that their answers -are almost meaningless.}@footnote{Donald E.@: Knuth. -@cite{The Art of Computer Programming}. Volume 2, -@cite{Seminumerical Algorithms}, third edition, -1998, ISBN 0-201-89683-4, p.@: 229.} -@author Donald Knuth -@end quotation - -This @value{CHAPTER} discusses issues that you may encounter -when performing arithmetic. It begins by discussing some of -the general attributes of computer arithmetic, along with how -this can influence what you see when running @command{awk} programs. -This discussion applies to all versions of @command{awk}. +This @value{CHAPTER} introduces some basic concepts relating to +how computers do arithmetic and defines some important terms. +It then proceeds to describe floating-point arithmetic, +which is what @command{awk} uses for all its computations, including a +discussion of arbitrary-precision floating-point arithmetic, which is +a feature available only in @command{gawk}. It continues on to present +arbitrary-precision integers, and concludes with a description of some +points where @command{gawk} and the POSIX standard are not quite in +agreement. -The @value{CHAPTER} then moves on to describe @dfn{arbitrary precision -arithmetic}, a feature which is specific to @command{gawk}. +@quotation NOTE +Most users of @command{gawk} can safely skip this chapter. +But if you want to do scientific calculations with @command{gawk}, +this is the place to be. +@end quotation @menu -* General Arithmetic:: An introduction to computer arithmetic. -* Floating-point Programming:: Effective Floating-point Programming. -* Gawk and MPFR:: How @command{gawk} provides - arbitrary-precision arithmetic. -* Arbitrary Precision Floats:: Arbitrary Precision Floating-point Arithmetic - with @command{gawk}. -* Arbitrary Precision Integers:: Arbitrary Precision Integer Arithmetic with - @command{gawk}. +* Computer Arithmetic:: A quick intro to computer math. +* Math Definitions:: Defining terms used. +* MPFR features:: The MPFR features in @command{gawk}. +* FP Math Caution:: Things to know. +* Arbitrary Precision Integers:: Arbitrary Precision Integer Arithmetic with + @command{gawk}. +* POSIX Floating Point Problems:: Standards Versus Existing Practice. +* Floating point summary:: Summary of floating point discussion. @end menu -@node General Arithmetic +@node Computer Arithmetic @section A General Description of Computer Arithmetic -@cindex integers -@cindex floating-point, numbers -@cindex numbers, floating-point -Within computers, there are two kinds of numeric values: @dfn{integers} -and @dfn{floating-point}. -In school, integer values were referred to as ``whole'' numbers---that is, -numbers without any fractional part, such as 1, 42, or @minus{}17. +Until now, we have worked with data as either numbers or +strings. Ultimately, however, computers represent everything in terms +of @dfn{binary digits}, or @dfn{bits}. A decimal digit can take on any +of 10 values: zero through nine. A binary digit can take on any of two +values, zero or one. Using binary, computers (and computer software) +can represent and manipulate numerical and character data. In general, +the more bits you can use to represent a particular thing, the greater +the range of possible values it can take on. + +Modern computers support at least two, and often more, ways to do +arithmetic. Each kind of arithmetic uses a different representation +(organization of the bits) for the numbers. The kinds of arithmetic +that interest us are: + +@table @asis +@item Decimal arithmetic +This is the kind of arithmetic you learned in elementary school, using +paper and pencil (and/or a calculator). In theory, numbers can have an +arbitrary number of digits on either side (or both sides) of the decimal +point, and the results of a computation are always exact. + +Some modern systems can do decimal arithmetic in hardware, but usually you +need a special software library to provide access to these instructions. +There are also libraries that do decimal arithmetic entirely in software. + +Despite the fact that some users expect @command{gawk} to be performing +decimal arithmetic,@footnote{We don't know why they expect this, but +they do.} it does not do so. + +@item Integer arithmetic +In school, integer values were referred to as ``whole'' numbers---that +is, numbers without any fractional part, such as 1, 42, or @minus{}17. The advantage to integer numbers is that they represent values exactly. -The disadvantage is that their range is limited. On most systems, -this range is @minus{}2,147,483,648 to 2,147,483,647. -However, many systems now support a range from -@minus{}9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. +The disadvantage is that their range is limited. @cindex unsigned integers @cindex integers, unsigned -Integer values come in two flavors: @dfn{signed} and @dfn{unsigned}. -Signed values may be negative or positive, with the range of values just -described. -Unsigned values are always positive. On most systems, -the range is from 0 to 4,294,967,295. -However, many systems now support a range from -0 to 18,446,744,073,709,551,615. - -@cindex double precision floating-point -@cindex single precision floating-point -Floating-point numbers represent what are called ``real'' numbers; i.e., -those that do have a fractional part, such as 3.1415927. -The advantage to floating-point numbers is that they -can represent a much larger range of values. -The disadvantage is that there are numbers that they cannot represent -exactly. -@command{awk} uses @dfn{double precision} floating-point numbers, which -can hold more digits than @dfn{single precision} -floating-point numbers. -@c Floating-point issues are discussed more fully in -@c @ref{Floating Point Issues}. - -There a several important issues to be aware of, described next. - -@menu -* Floating Point Issues:: Stuff to know about floating-point numbers. -* Integer Programming:: Effective integer programming. -@end menu - -@node Floating Point Issues -@subsection Floating-Point Number Caveats - -This @value{SECTION} describes some of the issues -involved in using floating-point numbers. - -There is a very nice -@uref{http://www.validlab.com/goldberg/paper.pdf, paper on floating-point arithmetic} -by David Goldberg, -``What Every Computer Scientist Should Know About Floating-point Arithmetic,'' -@cite{ACM Computing Surveys} @strong{23}, 1 (1991-03), 5-48. -This is worth reading if you are interested in the details, -but it does require a background in computer science. +In computers, integer values come in two flavors: @dfn{signed} and +@dfn{unsigned}. Signed values may be negative or positive, whereas +unsigned values are always greater than or equal +to zero. + +In computer systems, integer arithmetic is exact, but the possible +range of values is limited. Integer arithmetic is generally faster than +floating-point arithmetic. + +@item Floating-point arithmetic +Floating-point numbers represent what were called in school ``real'' +numbers (i.e., those that have a fractional part, such as 3.1415927). +The advantage to floating-point numbers is that they can represent a +much larger range of values than can integers. The disadvantage is that +there are numbers that they cannot represent exactly. + +Modern systems support floating-point arithmetic in hardware, with a +limited range of values. There are software libraries that allow +the use of arbitrary-precision floating-point calculations. + +POSIX @command{awk} uses @dfn{double-precision} floating-point numbers, which +can hold more digits than @dfn{single-precision} floating-point numbers. +@command{gawk} has facilities for performing arbitrary-precision +floating-point arithmetic, which we describe in more detail shortly. +@end table + +Computers work with integer and floating-point values of different +ranges. Integer values are usually either 32 or 64 bits in size. +Single-precision floating-point values occupy 32 bits, whereas double-precision +floating-point values occupy 64 bits. Floating-point values are always +signed. The possible ranges of values are shown in @ref{table-numeric-ranges}. + +@float Table,table-numeric-ranges +@caption{Value ranges for different numeric representations} +@multitable @columnfractions .34 .33 .33 +@headitem Numeric representation @tab Minimum value @tab Maximum value +@item 32-bit signed integer @tab @minus{}2,147,483,648 @tab 2,147,483,647 +@item 32-bit unsigned integer @tab 0 @tab 4,294,967,295 +@item 64-bit signed integer @tab @minus{}9,223,372,036,854,775,808 @tab 9,223,372,036,854,775,807 +@item 64-bit unsigned integer @tab 0 @tab 18,446,744,073,709,551,615 +@iftex +@item Single-precision floating point (approximate) @tab @math{1.175494^{-38}} @tab @math{3.402823^{38}} +@item Double-precision floating point (approximate) @tab @math{2.225074^{-308}} @tab @math{1.797693^{308}} +@end iftex +@ifnottex +@ifnotdocbook +@item Single-precision floating point (approximate) @tab 1.175494e-38 @tab 3.402823e38 +@item Double-precision floating point (approximate) @tab 2.225074e-308 @tab 1.797693e308 +@end ifnotdocbook +@end ifnottex +@ifdocbook +@item Single-precision floating point (approximate) @tab +@c FIXME: Use @sup here for superscript +@docbook +1.175494-38 +@end docbook +@tab +@docbook +3.40282338 +@end docbook +@item Double-precision floating point (approximate) @tab +@docbook +2.225074-308 +@end docbook +@tab +@docbook +1.797693308 +@end docbook +@end ifdocbook +@end multitable +@end float -@menu -* String Conversion Precision:: The String Value Can Lie. -* Unexpected Results:: Floating Point Numbers Are Not Abstract - Numbers. -* POSIX Floating Point Problems:: Standards Versus Existing Practice. -@end menu +@node Math Definitions +@section Other Stuff to Know -@node String Conversion Precision -@subsubsection The String Value Can Lie +The rest of this @value{CHAPTER} uses a number of terms. Here are some +informal definitions that should help you work your way through the material +here: -Internally, @command{awk} keeps both the numeric value -(double precision floating-point) and the string value for a variable. -Separately, @command{awk} keeps -track of what type the variable has -(@pxref{Typing and Comparison}), -which plays a role in how variables are used in comparisons. +@table @dfn +@item Accuracy +A floating-point calculation's accuracy is how close it comes +to the real (paper and pencil) value. + +@item Error +The difference between what the result of a computation ``should be'' +and what it actually is. It is best to minimize error as much +as possible. + +@item Exponent +The order of magnitude of a value; +some number of bits in a floating-point value store the exponent. + +@item Inf +A special value representing infinity. Operations involving another +number and infinity produce infinity. + +@item NaN +``Not a number.''@footnote{Thanks to Michael Brennan for this description, +which we have paraphrased, and for the examples.} A special value that +results from attempting a calculation that has no answer as a real number. +In such a case, programs can either receive a floating-point exception, +or get @code{NaN} back as the result. The IEEE 754 standard recommends +that systems return @code{NaN}. Some examples: + +@table @code +@item sqrt(-1) +This makes sense in the range of complex numbers, but not in the +range of real numbers, so the result is @code{NaN}. + +@item log(-8) +@minus{}8 is out of the domain of @code{log()}, so the result is @code{NaN}. +@end table + +@item Normalized +How the significand (see later in this list) is usually stored. The +value is adjusted so that the first bit is one, and then that leading +one is assumed instead of physically stored. This provides one +extra bit of precision. -It is important to note that the string value for a number may not -reflect the full value (all the digits) that the numeric value -actually contains. -The following program, @file{values.awk}, illustrates this: +@item Precision +The number of bits used to represent a floating-point number. +The more bits, the more digits you can represent. +Binary and decimal precisions are related approximately, according to the +formula: -@example -@{ - sum = $1 + $2 - # see it for what it is - printf("sum = %.12g\n", sum) - # use CONVFMT - a = "<" sum ">" - print "a =", a - # use OFMT - print "sum =", sum -@} -@end example +@display +@iftex +@math{prec = 3.322 @cdot dps} +@end iftex +@ifnottex +@ifnotdocbook +@var{prec} = 3.322 * @var{dps} +@end ifnotdocbook +@end ifnottex +@docbook +prec = 3.322 ⋅ dps @c +@end docbook +@end display @noindent -This program shows the full value of the sum of @code{$1} and @code{$2} -using @code{printf}, and then prints the string values obtained -from both automatic conversion (via @code{CONVFMT}) and -from printing (via @code{OFMT}). +Here, @emph{prec} denotes the binary precision +(measured in bits) and @emph{dps} (short for decimal places) +is the decimal digits. + +@item Rounding mode +How numbers are rounded up or down when necessary. +More details are provided later. + +@item Significand +A floating-point value consists of the significand multiplied by 10 +to the power of the exponent. For example, in @code{1.2345e67}, +the significand is @code{1.2345}. + +@item Stability +From @uref{http://en.wikipedia.org/wiki/Numerical_stability, +the Wikipedia article on numerical stability}: +``Calculations that can be proven not to magnify approximation errors +are called @dfn{numerically stable}.'' +@end table + +See @uref{http://en.wikipedia.org/wiki/Accuracy_and_precision, +the Wikipedia article on accuracy and precision} for more information +on some of those terms. + +On modern systems, floating-point hardware uses the representation and +operations defined by the IEEE 754 standard. +Three of the standard IEEE 754 types are 32-bit single precision, +64-bit double precision, and 128-bit quadruple precision. +The standard also specifies extended precision formats +to allow greater precisions and larger exponent ranges. +(@command{awk} uses only the 64-bit double-precision format.) -Here is what happens when the program is run: +@ref{table-ieee-formats} lists the precision and exponent +field values for the basic IEEE 754 binary formats. -@example -$ @kbd{echo 3.654321 1.2345678 | awk -f values.awk} -@print{} sum = 4.8888888 -@print{} a = <4.88889> -@print{} sum = 4.88889 -@end example +@float Table,table-ieee-formats +@caption{Basic IEEE format values} +@multitable @columnfractions .20 .20 .20 .20 .20 +@headitem Name @tab Total bits @tab Precision @tab Minimum exponent @tab Maximum exponent +@item Single @tab 32 @tab 24 @tab @minus{}126 @tab +127 +@item Double @tab 64 @tab 53 @tab @minus{}1022 @tab +1023 +@item Quadruple @tab 128 @tab 113 @tab @minus{}16382 @tab +16383 +@end multitable +@end float -This makes it clear that the full numeric value is different from -what the default string representations show. +@quotation NOTE +The precision numbers include the implied leading one that gives them +one extra bit of significand. +@end quotation -@code{CONVFMT}'s default value is @code{"%.6g"}, which yields a value with -at most six significant digits. For some applications, you might want to -change it to specify more precision. -On most modern machines, most of the time, -17 digits is enough to capture a floating-point number's -value exactly.@footnote{Pathological cases can require up to -752 digits (!), but we doubt that you need to worry about this.} +@node MPFR features +@section Arbitrary-Precision Arithmetic Features in @command{gawk} -@node Unexpected Results -@subsubsection Floating Point Numbers Are Not Abstract Numbers +By default, @command{gawk} uses the double-precision floating-point values +supplied by the hardware of the system it runs on. However, if it was +compiled to do so, @command{gawk} uses the @uref{http://www.mpfr.org, +GNU MPFR} and @uref{http://gmplib.org, GNU MP} (GMP) libraries for +arbitrary-precision arithmetic on numbers. You can see if MPFR support +is available like so: -@cindex floating-point, numbers -Unlike numbers in the abstract sense (such as what you studied in high school -or college arithmetic), numbers stored in computers are limited in certain ways. -They cannot represent an infinite number of digits, nor can they always -represent things exactly. -In particular, -floating-point numbers cannot -always represent values exactly. Here is an example: - -@example -$ @kbd{awk '@{ printf("%010d\n", $1 * 100) @}'} -515.79 -@print{} 0000051579 -515.80 -@print{} 0000051579 -515.81 -@print{} 0000051580 -515.82 -@print{} 0000051582 -@kbd{Ctrl-d} +@example +$ @kbd{gawk --version} +@print{} GNU Awk 4.1.2, API: 1.1 (GNU MPFR 3.1.0-p3, GNU MP 5.0.2) +@print{} Copyright (C) 1989, 1991-2015 Free Software Foundation. +@dots{} @end example @noindent -This shows that some values can be represented exactly, -whereas others are only approximated. This is not a ``bug'' -in @command{awk}, but simply an artifact of how computers -represent numbers. - -@quotation NOTE -It cannot be emphasized enough that the behavior just -described is fundamental to modern computers. You will -see this kind of thing happen in @emph{any} programming -language using hardware floating-point numbers. It is @emph{not} -a bug in @command{gawk}, nor is it something that can be ``just -fixed.'' -@end quotation - -@cindex negative zero -@cindex positive zero -@cindex zero@comma{} negative vs.@: positive -Another peculiarity of floating-point numbers on modern systems -is that they often have more than one representation for the number zero! -In particular, it is possible to represent ``minus zero'' as well as -regular, or ``positive'' zero. - -This example shows that negative and positive zero are distinct values -when stored internally, but that they are in fact equal to each other, -as well as to ``regular'' zero: - -@example -$ @kbd{gawk 'BEGIN @{ mz = -0 ; pz = 0} -> @kbd{printf "-0 = %g, +0 = %g, (-0 == +0) -> %d\n", mz, pz, mz == pz} -> @kbd{printf "mz == 0 -> %d, pz == 0 -> %d\n", mz == 0, pz == 0} -> @kbd{@}'} -@print{} -0 = -0, +0 = 0, (-0 == +0) -> 1 -@print{} mz == 0 -> 1, pz == 0 -> 1 -@end example - -It helps to keep this in mind should you process numeric data -that contains negative zero values; the fact that the zero is negative -is noted and can affect comparisons. - -@node POSIX Floating Point Problems -@subsubsection Standards Versus Existing Practice - -Historically, @command{awk} has converted any non-numeric looking string -to the numeric value zero, when required. Furthermore, the original -definition of the language and the original POSIX standards specified that -@command{awk} only understands decimal numbers (base 10), and not octal -(base 8) or hexadecimal numbers (base 16). - -Changes in the language of the -2001 and 2004 POSIX standards can be interpreted to imply that @command{awk} -should support additional features. These features are: - -@itemize @bullet -@item -Interpretation of floating point data values specified in hexadecimal -notation (@samp{0xDEADBEEF}). (Note: data values, @emph{not} -source code constants.) - -@item -Support for the special IEEE 754 floating point values ``Not A Number'' -(NaN), positive Infinity (``inf'') and negative Infinity (``@minus{}inf''). -In particular, the format for these values is as specified by the ISO 1999 -C standard, which ignores case and can allow machine-dependent additional -characters after the @samp{nan} and allow either @samp{inf} or @samp{infinity}. -@end itemize - -The first problem is that both of these are clear changes to historical -practice: - -@itemize @bullet -@item -The @command{gawk} maintainer feels that supporting hexadecimal floating -point values, in particular, is ugly, and was never intended by the -original designers to be part of the language. - -@item -Allowing completely alphabetic strings to have valid numeric -values is also a very severe departure from historical practice. -@end itemize - -The second problem is that the @code{gawk} maintainer feels that this -interpretation of the standard, which requires a certain amount of -``language lawyering'' to arrive at in the first place, was not even -intended by the standard developers. In other words, ``we see how you -got where you are, but we don't think that that's where you want to be.'' +(You may see different version numbers than what's shown here. That's OK; +what's important is to see that GNU MPFR and GNU MP are listed in +the output.) -Recognizing the above issues, but attempting to provide compatibility -with the earlier versions of the standard, -the 2008 POSIX standard added explicit wording to allow, but not require, -that @command{awk} support hexadecimal floating point values and -special values for ``Not A Number'' and infinity. +Additionally, there are a few elements available in the @code{PROCINFO} +array to provide information about the MPFR and GMP libraries +(@pxref{Auto-set}). -Although the @command{gawk} maintainer continues to feel that -providing those features is inadvisable, -nevertheless, on systems that support IEEE floating point, it seems -reasonable to provide @emph{some} way to support NaN and Infinity values. -The solution implemented in @command{gawk} is as follows: +The MPFR library provides precise control over precisions and rounding +modes, and gives correctly rounded, reproducible, platform-independent +results. With the @option{-M} command-line option, +all floating-point arithmetic operators and numeric functions +can yield results to any desired precision level supported by MPFR. -@itemize @bullet -@item -With the @option{--posix} command-line option, @command{gawk} becomes -``hands off.'' String values are passed directly to the system library's -@code{strtod()} function, and if it successfully returns a numeric value, -that is what's used.@footnote{You asked for it, you got it.} -By definition, the results are not portable across -different systems. They are also a little surprising: +Two predefined variables, @code{PREC} and @code{ROUNDMODE}, +provide control over the working precision and the rounding mode. +The precision and the rounding mode are set globally for every operation +to follow. +@DBXREF{Setting precision} and @DBREF{Setting the rounding mode} +for more information. -@example -$ @kbd{echo nanny | gawk --posix '@{ print $1 + 0 @}'} -@print{} nan -$ @kbd{echo 0xDeadBeef | gawk --posix '@{ print $1 + 0 @}'} -@print{} 3735928559 -@end example +@node FP Math Caution +@section Floating-Point Arithmetic: Caveat Emptor! -@item -Without @option{--posix}, @command{gawk} interprets the four strings -@samp{+inf}, -@samp{-inf}, -@samp{+nan}, -and -@samp{-nan} -specially, producing the corresponding special numeric values. -The leading sign acts a signal to @command{gawk} (and the user) -that the value is really numeric. Hexadecimal floating point is -not supported (unless you also use @option{--non-decimal-data}, -which is @emph{not} recommended). For example: - -@example -$ @kbd{echo nanny | gawk '@{ print $1 + 0 @}'} -@print{} 0 -$ @kbd{echo +nan | gawk '@{ print $1 + 0 @}'} -@print{} nan -$ @kbd{echo 0xDeadBeef | gawk '@{ print $1 + 0 @}'} -@print{} 0 -@end example +@quotation +@i{Math class is tough!} +@author Teen Talk Barbie, July 1992 +@end quotation -@command{gawk} does ignore case in the four special values. -Thus @samp{+nan} and @samp{+NaN} are the same. -@end itemize +This @value{SECTION} provides a high-level overview of the issues +involved when doing lots of floating-point arithmetic.@footnote{There +is a very nice @uref{http://www.validlab.com/goldberg/paper.pdf, +paper on floating-point arithmetic} by David Goldberg, ``What Every +Computer Scientist Should Know About Floating-Point Arithmetic,'' +@cite{ACM Computing Surveys} @strong{23}, 1 (1991-03): 5-48. This is +worth reading if you are interested in the details, but it does require +a background in computer science.} +The discussion applies to both hardware and arbitrary-precision +floating-point arithmetic. -@node Integer Programming -@subsection Mixing Integers And Floating-point +@quotation CAUTION +The material here is purposely general. If you need to do serious +computer arithmetic, you should do some research first, and not +rely just on what we tell you. +@end quotation -As has been mentioned already, @command{awk} uses hardware double -precision with 64-bit IEEE binary floating-point representation -for numbers on most systems. A large integer like 9,007,199,254,740,997 -has a binary representation that, although finite, is more than 53 bits long; -it must also be rounded to 53 bits. -The biggest integer that can be stored in a C @code{double} is usually the same -as the largest possible value of a @code{double}. If your system @code{double} -is an IEEE 64-bit @code{double}, this largest possible value is an integer and -can be represented precisely. What more should one know about integers? - -If you want to know what is the largest integer, such that it and -all smaller integers can be stored in 64-bit doubles without losing precision, -then the answer is -@iftex -@math{2^{53}}. -@end iftex -@ifnottex -@ifnotdocbook -2^53. -@end ifnotdocbook -@end ifnottex -@docbook -253. @c -@end docbook -The next representable number is the even number -@iftex -@math{2^{53} + 2}, -@end iftex -@ifnottex -@ifnotdocbook -2^53 + 2, -@end ifnotdocbook -@end ifnottex -@docbook -253 + 2, @c -@end docbook -meaning it is unlikely that you will be able to make -@command{gawk} print -@iftex -@math{2^{53} + 1} -@end iftex -@ifnottex -@ifnotdocbook -2^53 + 1 -@end ifnotdocbook -@end ifnottex -@docbook -253 + 1 @c -@end docbook -in integer format. -The range of integers exactly representable by a 64-bit double -is -@iftex -@math{[-2^{53}, 2^{53}]}. -@end iftex -@ifnottex -@ifnotdocbook -[@minus{}2^53, 2^53]. -@end ifnotdocbook -@end ifnottex -@docbook -[−253, 253]. @c -@end docbook -If you ever see an integer outside this range in @command{awk} -using 64-bit doubles, you have reason to be very suspicious about -the accuracy of the output. Here is a simple program with erroneous output: - -@example -$ @kbd{gawk 'BEGIN @{ i = 2^53 - 1; for (j = 0; j < 4; j++) print i + j @}'} -@print{} 9007199254740991 -@print{} 9007199254740992 -@print{} 9007199254740992 -@print{} 9007199254740994 -@end example - -The lesson is to not assume that any large integer printed by @command{awk} -represents an exact result from your computation, especially if it wraps -around on your screen. - -@node Floating-point Programming -@section Understanding Floating-point Programming - -Numerical programming is an extensive area; if you need to develop -sophisticated numerical algorithms then @command{gawk} may not be -the ideal tool, and this documentation may not be sufficient. -It might require digesting a book or two@footnote{One recommended title is -@cite{Numerical Computing with IEEE Floating Point Arithmetic}, Michael L.@: -Overton, Society for Industrial and Applied Mathematics, 2004. -ISBN: 0-89871-482-6, ISBN-13: 978-0-89871-482-1. See -@uref{http://www.cs.nyu.edu/cs/faculty/overton/book}.} -to really internalize how to compute -with ideal accuracy and precision, -and the result often depends on the particular application. +@menu +* Inexactness of computations:: Floating point math is not exact. +* Getting Accuracy:: Getting more accuracy takes some work. +* Try To Round:: Add digits and round. +* Setting precision:: How to set the precision. +* Setting the rounding mode:: How to set the rounding mode. +@end menu -@quotation NOTE -A floating-point calculation's @dfn{accuracy} is how close it comes -to the real value. This is as opposed to the @dfn{precision}, which -usually refers to the number of bits used to represent the number -(see @uref{http://en.wikipedia.org/wiki/Accuracy_and_precision, -the Wikipedia article} for more information). -@end quotation - -There are two options for doing floating-point calculations: -hardware floating-point (as used by standard @command{awk} and -the default for @command{gawk}), and @dfn{arbitrary-precision} -floating-point, which is software based. -From this point forward, this @value{CHAPTER} -aims to provide enough information to understand both, and then -will focus on @command{gawk}'s facilities for the latter.@footnote{If you -are interested in other tools that perform arbitrary precision arithmetic, -you may want to investigate the POSIX @command{bc} tool. See -@uref{http://pubs.opengroup.org/onlinepubs/009695399/utilities/bc.html, -the POSIX specification for it}, for more information.} +@node Inexactness of computations +@subsection Floating-Point Arithmetic Is Not Exact Binary floating-point representations and arithmetic are inexact. Simple values like 0.1 cannot be precisely represented using binary floating-point numbers, and the limited precision of floating-point numbers means that slight changes in the order of operations or the precision of intermediate storage -can change the result. To make matters worse, with arbitrary precision -floating-point, you can set the precision before starting a computation, -but then you cannot be sure of the number of significant decimal places -in the final result. +can change the result. To make matters worse, with arbitrary-precision +floating-point arithmetic, you can set the precision before starting a +computation, but then you cannot be sure of the number of significant +decimal places in the final result. + +@menu +* Inexact representation:: Numbers are not exactly represented. +* Comparing FP Values:: How to compare floating point values. +* Errors accumulate:: Errors get bigger as they go. +@end menu -Sometimes, before you start to write any code, you should think more +@node Inexact representation +@subsubsection Many Numbers Cannot Be Represented Exactly + +So, before you start to write any code, you should think about what you really want and what's really happening. Consider the two numbers in the following example: @@ -28051,7 +29568,7 @@ Unlike the number in @code{y}, the number stored in @code{x} is exactly representable -in binary since it can be written as a finite sum of one or +in binary because it can be written as a finite sum of one or more fractions whose denominators are all powers of two. When @command{gawk} reads a floating-point number from program source, it automatically rounds that number to whatever @@ -28067,24 +29584,49 @@ Often the error is so small you do not even notice it, and if you do, you can always specify how much precision you would like in your output. -Usually this is a format string like @code{"%.15g"}, which when +Usually this is a format string like @code{"%.15g"}, which, when used in the previous example, produces an output identical to the input. +@node Comparing FP Values +@subsubsection Be Careful Comparing Values + Because the underlying representation can be a little bit off from the exact value, -comparing floating-point values to see if they are equal is generally not a good idea. -Here is an example where it does not work like you expect: +comparing floating-point values to see if they are exactly equal is generally a bad idea. +Here is an example where it does not work like you would expect: -@example +@example $ @kbd{gawk 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'} @print{} 0 @end example -The loss of accuracy during a single computation with floating-point numbers -usually isn't enough to worry about. However, if you compute a value -which is the result of a sequence of floating point operations, +The general wisdom when comparing floating-point values is to see if +they are within some small range of each other (called a @dfn{delta}, +or @dfn{tolerance}). +You have to decide how small a delta is important to you. Code to do +this looks something like the following: + +@example +delta = 0.00001 # for example +difference = abs(a) - abs(b) # subtract the two values +if (difference < delta) + # all ok +else + # not ok +@end example + +@noindent +(We assume that you have a simple absolute value function named +@code{abs()} defined elsewhere in your program.) + +@node Errors accumulate +@subsubsection Errors Accumulate + +The loss of accuracy during a single computation with floating-point +numbers usually isn't enough to worry about. However, if you compute a +value that is the result of a sequence of floating-point operations, the error can accumulate and greatly affect the computation itself. -Here is an attempt to compute the value of the constant -@value{PI} using one of its many series representations: +Here is an attempt to compute the value of @value{PI} using one of its +many series representations: @example BEGIN @{ @@ -28098,8 +29640,8 @@ @} @end example -When run, the early errors propagating through later computations -cause the loop to terminate prematurely after an attempt to divide by zero. +When run, the early errors propagate through later computations, +causing the loop to terminate prematurely after attempting to divide by zero: @example $ @kbd{gawk -f pi.awk} @@ -28126,394 +29668,124 @@ @print{} 4 @end example -Can computation using arbitrary precision help with the previous examples? -If you are impatient to know, see -@ref{Exact Arithmetic}. +@node Getting Accuracy +@subsection Getting the Accuracy You Need -Instead of arbitrary precision floating-point arithmetic, -often all you need is an adjustment of your logic -or a different order for the operations in your calculation. -The stability and the accuracy of the computation of the constant @value{PI} -in the earlier example can be enhanced by using the following -simple algebraic transformation: +Can arbitrary-precision arithmetic give exact results? There are +no easy answers. The standard rules of algebra often do not apply +when using floating-point arithmetic. +Among other things, the distributive and associative laws +do not hold completely, and order of operation may be important +for your computation. Rounding error, cumulative precision loss, +and underflow are often troublesome. + +When @command{gawk} tests the expressions @samp{0.1 + 12.2} and +@samp{12.3} for equality using the machine double-precision arithmetic, +it decides that they are not equal! (@xref{Comparing FP Values}.) +You can get the result you want by increasing the precision; 56 bits in +this case does the job: @example -(sqrt(x * x + 1) - 1) / x = x / (sqrt(x * x + 1) + 1) +$ @kbd{gawk -M -v PREC=56 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'} +@print{} 1 @end example -@noindent -After making this, change the program does converge to -@value{PI} in under 30 iterations: +If adding more bits is good, perhaps adding even more bits of +precision is better? +Here is what happens if we use an even larger value of @code{PREC}: @example -$ @kbd{gawk -f pi2.awk} -@print{} 3.215390309173473 -@print{} 3.159659942097501 -@print{} 3.146086215131436 -@print{} 3.142714599645370 -@print{} 3.141873049979825 -@dots{} -@print{} 3.141592653589797 -@print{} 3.141592653589797 +$ @kbd{gawk -M -v PREC=201 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'} +@print{} 0 @end example -There is no need to be unduly suspicious about the results from -floating-point arithmetic. The lesson to remember is that -floating-point arithmetic is always more complex than arithmetic using -pencil and paper. In order to take advantage of the power -of computer floating-point, you need to know its limitations -and work within them. For most casual use of floating-point arithmetic, -you will often get the expected result in the end if you simply round -the display of your final results to the correct number of significant -decimal digits. - -As general advice, avoid presenting numerical data in a manner that -implies better precision than is actually the case. - -@menu -* Floating-point Representation:: Binary floating-point representation. -* Floating-point Context:: Floating-point context. -* Rounding Mode:: Floating-point rounding mode. -@end menu - -@node Floating-point Representation -@subsection Binary Floating-point Representation -@cindex IEEE-754 format - -Although floating-point representations vary from machine to machine, -the most commonly encountered representation is that defined by the -IEEE 754 Standard. An IEEE-754 format value has three components: - -@itemize @bullet -@item -A sign bit telling whether the number is positive or negative. - -@item -An @dfn{exponent}, @var{e}, giving its order of magnitude. - -@item -A @dfn{significand}, @var{s}, -specifying the actual digits of the number. -@end itemize - -The value of the -number is then -@iftex -@math{s @cdot 2^e}. -@end iftex -@ifnottex -@ifnotdocbook -@var{s * 2^e}. -@end ifnotdocbook -@end ifnottex -@docbook -s ⋅ 2e. @c -@end docbook -The first bit of a non-zero binary significand -is always one, so the significand in an IEEE-754 format only includes the -fractional part, leaving the leading one implicit. -The significand is stored in @dfn{normalized} format, -which means that the first bit is always a one. - -Three of the standard IEEE-754 types are 32-bit single precision, -64-bit double precision and 128-bit quadruple precision. -The standard also specifies extended precision formats -to allow greater precisions and larger exponent ranges. - -@node Floating-point Context -@subsection Floating-point Context -@cindex context, floating-point - -A floating-point @dfn{context} defines the environment for arithmetic operations. -It governs precision, sets rules for rounding, and limits the range for exponents. -The context has the following primary components: - -@table @dfn -@item Precision -Precision of the floating-point format in bits. - -@item emax -Maximum exponent allowed for the format. - -@item emin -Minimum exponent allowed for the format. - -@item Underflow behavior -The format may or may not support gradual underflow. - -@item Rounding -The rounding mode of the context. -@end table - -@ref{table-ieee-formats} lists the precision and exponent -field values for the basic IEEE-754 binary formats: +This is not a bug in @command{gawk} or in the MPFR library. +It is easy to forget that the finite number of bits used to store the value +is often just an approximation after proper rounding. +The test for equality succeeds if and only if @emph{all} bits in the two operands +are exactly the same. Because this is not necessarily true after floating-point +computations with a particular precision and effective rounding mode, +a straight test for equality may not work. Instead, compare the +two numbers to see if they are within the desirable delta of each other. -@float Table,table-ieee-formats -@caption{Basic IEEE Format Context Values} -@multitable @columnfractions .20 .20 .20 .20 .20 -@headitem Name @tab Total bits @tab Precision @tab emin @tab emax -@item Single @tab 32 @tab 24 @tab @minus{}126 @tab +127 -@item Double @tab 64 @tab 53 @tab @minus{}1022 @tab +1023 -@item Quadruple @tab 128 @tab 113 @tab @minus{}16382 @tab +16383 -@end multitable -@end float +In applications where 15 or fewer decimal places suffice, +hardware double-precision arithmetic can be adequate, and is usually much faster. +But you need to keep in mind that every floating-point operation +can suffer a new rounding error with catastrophic consequences, as illustrated +by our earlier attempt to compute the value of @value{PI}. +Extra precision can greatly enhance the stability and the accuracy +of your computation in such cases. -@quotation NOTE -The precision numbers include the implied leading one that gives them -one extra bit of significand. -@end quotation +Additionally, you should understand that +repeated addition is not necessarily equivalent to multiplication +in floating-point arithmetic. In the example in +@ref{Errors accumulate}: -A floating-point context can also determine which signals are treated -as exceptions, and can set rules for arithmetic with special values. -Please consult the IEEE-754 standard or other resources for details. - -@command{gawk} ordinarily uses the hardware double precision -representation for numbers. On most systems, this is IEEE-754 -floating-point format, corresponding to 64-bit binary with 53 bits -of precision. +@example +$ @kbd{gawk 'BEGIN @{} +> @kbd{for (d = 1.1; d <= 1.5; d += 0.1) # loop five times (?)} +> @kbd{i++} +> @kbd{print i} +> @kbd{@}'} +@print{} 4 +@end example -@quotation NOTE -In case an underflow occurs, the standard allows, but does not require, -the result from an arithmetic operation to be a number smaller than -the smallest nonzero normalized number. Such numbers do -not have as many significant digits as normal numbers, and are called -@dfn{denormals} or @dfn{subnormals}. The alternative, simply returning a zero, -is called @dfn{flush to zero}. The basic IEEE-754 binary formats -support subnormal numbers. -@end quotation - -@node Rounding Mode -@subsection Floating-point Rounding Mode -@cindex rounding mode, floating-point - -The @dfn{rounding mode} specifies the behavior for the results of numerical -operations when discarding extra precision. Each rounding mode indicates -how the least significant returned digit of a rounded result is to -be calculated. -@ref{table-rounding-modes} lists the IEEE-754 defined -rounding modes: - -@float Table,table-rounding-modes -@caption{IEEE 754 Rounding Modes} -@multitable @columnfractions .45 .55 -@headitem Rounding Mode @tab IEEE Name -@item Round to nearest, ties to even @tab @code{roundTiesToEven} -@item Round toward plus Infinity @tab @code{roundTowardPositive} -@item Round toward negative Infinity @tab @code{roundTowardNegative} -@item Round toward zero @tab @code{roundTowardZero} -@item Round to nearest, ties away from zero @tab @code{roundTiesToAway} -@end multitable -@end float +@noindent +you may or may not succeed in getting the correct result by choosing +an arbitrarily large value for @code{PREC}. Reformulation of +the problem at hand is often the correct approach in such situations. -The default mode @code{roundTiesToEven} is the most preferred, -but the least intuitive. This method does the obvious thing for most values, -by rounding them up or down to the nearest digit. -For example, rounding 1.132 to two digits yields 1.13, -and rounding 1.157 yields 1.16. +@node Try To Round +@subsection Try a Few Extra Bits of Precision and Rounding -However, when it comes to rounding a value that is exactly halfway between, -things do not work the way you probably learned in school. -In this case, the number is rounded to the nearest even digit. -So rounding 0.125 to two digits rounds down to 0.12, -but rounding 0.6875 to three digits rounds up to 0.688. -You probably have already encountered this rounding mode when -using @code{printf} to format floating-point numbers. -For example: +Instead of arbitrary-precision floating-point arithmetic, +often all you need is an adjustment of your logic +or a different order for the operations in your calculation. +The stability and the accuracy of the computation of @value{PI} +in the earlier example can be enhanced by using the following +simple algebraic transformation: @example -BEGIN @{ - x = -4.5 - for (i = 1; i < 10; i++) @{ - x += 1.0 - printf("%4.1f => %2.0f\n", x, x) - @} -@} +(sqrt(x * x + 1) - 1) / x @equiv{} x / (sqrt(x * x + 1) + 1) @end example @noindent -produces the following output when run on the author's system:@footnote{It -is possible for the output to be completely different if the -C library in your system does not use the IEEE-754 even-rounding -rule to round halfway cases for @code{printf}.} +After making this change, the program converges to +@value{PI} in under 30 iterations: @example --3.5 => -4 --2.5 => -2 --1.5 => -2 --0.5 => 0 - 0.5 => 0 - 1.5 => 2 - 2.5 => 2 - 3.5 => 4 - 4.5 => 4 -@end example - -The theory behind the rounding mode @code{roundTiesToEven} is that -it more or less evenly distributes upward and downward rounds -of exact halves, which might cause any round-off error -to cancel itself out. This is the default rounding mode used -in IEEE-754 computing functions and operators. - -The other rounding modes are rarely used. -Round toward positive infinity (@code{roundTowardPositive}) -and round toward negative infinity (@code{roundTowardNegative}) -are often used to implement interval arithmetic, -where you adjust the rounding mode to calculate upper and lower bounds -for the range of output. The @code{roundTowardZero} -mode can be used for converting floating-point numbers to integers. -The rounding mode @code{roundTiesToAway} rounds the result to the -nearest number and selects the number with the larger magnitude -if a tie occurs. - -Some numerical analysts will tell you that your choice of rounding style -has tremendous impact on the final outcome, and advise you to wait until -final output for any rounding. Instead, you can often avoid round-off error problems by -setting the precision initially to some value sufficiently larger than -the final desired precision, so that the accumulation of round-off error -does not influence the outcome. -If you suspect that results from your computation are -sensitive to accumulation of round-off error, -one way to be sure is to look for a significant difference in output -when you change the rounding mode. - -@node Gawk and MPFR -@section @command{gawk} + MPFR = Powerful Arithmetic -@cindex MPFR -@cindex GMP - -The rest of this @value{CHAPTER} describes how to use the arbitrary precision -(also known as @dfn{multiple precision} or @dfn{infinite precision}) numeric -capabilities in @command{gawk} to produce maximally accurate results -when you need it. - -But first you should check if your version of -@command{gawk} supports arbitrary precision arithmetic. -The easiest way to find out is to look at the output of -the following command: - -@example -$ @kbd{./gawk --version} -@print{} GNU Awk 4.1.1, API: 1.1 (GNU MPFR 3.1.0-p3, GNU MP 5.0.2) -@print{} Copyright (C) 1989, 1991-2014 Free Software Foundation. +$ @kbd{gawk -f pi2.awk} +@print{} 3.215390309173473 +@print{} 3.159659942097501 +@print{} 3.146086215131436 +@print{} 3.142714599645370 +@print{} 3.141873049979825 @dots{} +@print{} 3.141592653589797 +@print{} 3.141592653589797 @end example -@noindent -(You may see different version numbers than what's shown here. That's OK; -what's important is to see that GNU MPFR and GNU MP are listed in -the output.) - -@command{gawk} uses the -@uref{http://www.mpfr.org, GNU MPFR} -and -@uref{http://gmplib.org, GNU MP} (GMP) -libraries for arbitrary precision -arithmetic on numbers. So if you do not see the names of these libraries -in the output, then your version of @command{gawk} does not support -arbitrary precision arithmetic. - -Additionally, -there are a few elements available in the @code{PROCINFO} array -to provide information about the MPFR and GMP libraries. -@xref{Auto-set}, for more information. - -@ignore -Even if you aren't interested in arbitrary precision arithmetic, you -may still benefit from knowing about how @command{gawk} handles numbers -in general, and the limitations of doing arithmetic with ordinary -@command{gawk} numbers. -@end ignore - - -@node Arbitrary Precision Floats -@section Arbitrary Precision Floating-point Arithmetic with @command{gawk} - -@command{gawk} uses the GNU MPFR library -for arbitrary precision floating-point arithmetic. The MPFR library -provides precise control over precisions and rounding modes, and gives -correctly rounded, reproducible, platform-independent results. With one -of the command-line options @option{--bignum} or @option{-M}, -all floating-point arithmetic operators and numeric functions can yield -results to any desired precision level supported by MPFR. -Two built-in variables, @code{PREC} and @code{ROUNDMODE}, -provide control over the working precision and the rounding mode -(@pxref{Setting Precision}, and -@pxref{Setting Rounding Mode}). -The precision and the rounding mode are set globally for every operation -to follow. - -The default working precision for arbitrary precision floating-point values is -53 bits, and the default value for @code{ROUNDMODE} is @code{"N"}, -which selects the IEEE-754 @code{roundTiesToEven} rounding mode -(@pxref{Rounding Mode}).@footnote{The -default precision is 53 bits, since according to the MPFR documentation, -the library should be able to exactly reproduce all computations with -double-precision machine floating-point numbers (@code{double} type -in C), except the default exponent range is much wider and subnormal -numbers are not implemented.} -@command{gawk} uses the default exponent range in MPFR -@iftex -(@math{emax = 2^{30} - 1, emin = -emax}) -@end iftex -@ifnottex -@ifnotdocbook -(@var{emax} = 2^30 @minus{} 1, @var{emin} = @minus{}@var{emax}) -@end ifnotdocbook -@end ifnottex -@docbook -(emax = 230 − 1, emin = −emax) @c -@end docbook -for all floating-point contexts. -There is no explicit mechanism to adjust the exponent range. -MPFR does not implement subnormal numbers by default, -and this behavior cannot be changed in @command{gawk}. - -@quotation NOTE -When emulating an IEEE-754 format (@pxref{Setting Precision}), -@command{gawk} internally adjusts the exponent range -to the value defined for the format and also performs computations needed for -gradual underflow (subnormal numbers). -@end quotation - -@quotation NOTE -MPFR numbers are variable-size entities, consuming only as much space as -needed to store the significant digits. Since the performance using MPFR -numbers pales in comparison to doing arithmetic using the underlying machine -types, you should consider using only as much precision as needed by -your program. -@end quotation - -@menu -* Setting Precision:: Setting the working precision. -* Setting Rounding Mode:: Setting the rounding mode. -* Floating-point Constants:: Representing floating-point constants. -* Changing Precision:: Changing the precision of a number. -* Exact Arithmetic:: Exact arithmetic with floating-point numbers. -@end menu - -@node Setting Precision -@subsection Setting the Working Precision -@cindex @code{PREC} variable -@cindex setting working precision +@node Setting precision +@subsection Setting the Precision @command{gawk} uses a global working precision; it does not keep track of the precision or accuracy of individual numbers. Performing an arithmetic operation or calling a built-in function rounds the result to the current -working precision. The default working precision is 53 bits, which can be -modified using the built-in variable @code{PREC}. You can also set the -value to one of the pre-defined case-insensitive strings +working precision. The default working precision is 53 bits, which you can +modify using the predefined variable @code{PREC}. You can also set the +value to one of the predefined case-insensitive strings shown in @ref{table-predefined-precision-strings}, -to emulate an IEEE-754 binary format. +to emulate an IEEE 754 binary format. @float Table,table-predefined-precision-strings @caption{Predefined precision strings for @code{PREC}} @multitable {@code{"double"}} {12345678901234567890123456789012345} -@headitem @code{PREC} @tab IEEE-754 Binary Format -@item @code{"half"} @tab 16-bit half-precision. -@item @code{"single"} @tab Basic 32-bit single precision. -@item @code{"double"} @tab Basic 64-bit double precision. -@item @code{"quad"} @tab Basic 128-bit quadruple precision. -@item @code{"oct"} @tab 256-bit octuple precision. +@headitem @code{PREC} @tab IEEE 754 binary format +@item @code{"half"} @tab 16-bit half-precision +@item @code{"single"} @tab Basic 32-bit single precision +@item @code{"double"} @tab Basic 64-bit double precision +@item @code{"quad"} @tab Basic 128-bit quadruple precision +@item @code{"oct"} @tab 256-bit octuple precision @end multitable @end float @@ -28527,253 +29799,137 @@ @print{} 0 @end example -Binary and decimal precisions are related approximately, according to the -formula: - -@iftex -@math{prec = 3.322 @cdot dps} -@end iftex -@ifnottex -@ifnotdocbook -@var{prec} = 3.322 * @var{dps} -@end ifnotdocbook -@end ifnottex -@docbook - -prec = 3.322 ⋅ dps @c - -@end docbook - -@noindent -Here, @var{prec} denotes the binary precision -(measured in bits) and @var{dps} (short for decimal places) -is the decimal digits. We can easily calculate how many decimal -digits the 53-bit significand of an IEEE double is equivalent to: -53 / 3.322 which is equal to about 15.95. -But what does 15.95 digits actually mean? It depends whether you are -concerned about how many digits you can rely on, or how many digits -you need. - -It is important to know how many bits it takes to uniquely identify -a double-precision value (the C type @code{double}). If you want to -convert from @code{double} to decimal and back to @code{double} (e.g., -saving a @code{double} representing an intermediate result to a file, and -later reading it back to restart the computation), then a few more decimal -digits are required. 17 digits is generally enough for a @code{double}. - -It can also be important to know what decimal numbers can be uniquely -represented with a @code{double}. If you want to convert -from decimal to @code{double} and back again, 15 digits is the most that -you can get. Stated differently, you should not present -the numbers from your floating-point computations with more than 15 -significant digits in them. - -Conversely, it takes a precision of 332 bits to hold an approximation -of the constant @value{PI} that is accurate to 100 decimal places. - -You should always add some extra bits in order to avoid the confusing round-off -issues that occur because numbers are stored internally in binary. - -@node Setting Rounding Mode -@subsection Setting the Rounding Mode -@cindex @code{ROUNDMODE} variable -@cindex setting rounding mode - -The @code{ROUNDMODE} variable provides -program level control over the rounding mode. -The correspondence between @code{ROUNDMODE} and the IEEE -rounding modes is shown in @ref{table-gawk-rounding-modes}. - -@float Table,table-gawk-rounding-modes -@caption{@command{gawk} Rounding Modes} -@multitable @columnfractions .45 .30 .25 -@headitem Rounding Mode @tab IEEE Name @tab @code{ROUNDMODE} -@item Round to nearest, ties to even @tab @code{roundTiesToEven} @tab @code{"N"} or @code{"n"} -@item Round toward plus Infinity @tab @code{roundTowardPositive} @tab @code{"U"} or @code{"u"} -@item Round toward negative Infinity @tab @code{roundTowardNegative} @tab @code{"D"} or @code{"d"} -@item Round toward zero @tab @code{roundTowardZero} @tab @code{"Z"} or @code{"z"} -@item Round to nearest, ties away from zero @tab @code{roundTiesToAway} @tab @code{"A"} or @code{"a"} -@end multitable -@end float - -@code{ROUNDMODE} has the default value @code{"N"}, -which selects the IEEE-754 rounding mode @code{roundTiesToEven}. -In @ref{table-gawk-rounding-modes}, @code{"A"} is listed to select the IEEE-754 mode -@code{roundTiesToAway}. This is only available -if your version of the MPFR library supports it; otherwise setting -@code{ROUNDMODE} to this value has no effect. @xref{Rounding Mode}, -for the meanings of the various rounding modes. - -Here is an example of how to change the default rounding behavior of -@code{printf}'s output: - -@example -$ @kbd{gawk -M -v ROUNDMODE="Z" 'BEGIN @{ printf("%.2f\n", 1.378) @}'} -@print{} 1.37 -@end example - -@node Floating-point Constants -@subsection Representing Floating-point Constants -@cindex constants, floating-point - -Be wary of floating-point constants! When reading a floating-point constant -from program source code, @command{gawk} uses the default precision, -unless overridden -by an assignment to the special variable @code{PREC} on the command -line, to store it internally as a MPFR number. -Changing the precision using @code{PREC} in the program text does -@emph{not} change the precision of a constant. If you need to -represent a floating-point constant at a higher precision than the -default and cannot use a command line assignment to @code{PREC}, -you should either specify the constant as a string, or -as a rational number, whenever possible. The following example -illustrates the differences among various ways to -print a floating-point constant: +@quotation CAUTION +Be wary of floating-point constants! When reading a floating-point +constant from program source code, @command{gawk} uses the default +precision (that of a C @code{double}), unless overridden by an assignment +to the special variable @code{PREC} on the command line, to store it +internally as an MPFR number. Changing the precision using @code{PREC} +in the program text does @emph{not} change the precision of a constant. + +If you need to represent a floating-point constant at a higher precision +than the default and cannot use a command-line assignment to @code{PREC}, +you should either specify the constant as a string, or as a rational +number, whenever possible. The following example illustrates the +differences among various ways to print a floating-point constant: @example $ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 0.1) @}'} -@print{} 0.1000000000000000055511151 +@print{} 0.1000000000000000055511151 $ @kbd{gawk -M -v PREC=113 'BEGIN @{ printf("%0.25f\n", 0.1) @}'} -@print{} 0.1000000000000000000000000 -$ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", "0.1") @}'} -@print{} 0.1000000000000000000000000 -$ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 1/10) @}'} -@print{} 0.1000000000000000000000000 -@end example - -In the first case, the number is stored with the default precision of 53 bits. - -@node Changing Precision -@subsection Changing the Precision of a Number -@cindex changing precision of a number - -@cindex Laurie, Dirk -@quotation -@i{The point is that in any variable-precision package, -a decision is made on how to treat numbers given as data, -or arising in intermediate results, which are represented in -floating-point format to a precision lower than working precision. -Do we promote them to full membership of the high-precision club, -or do we treat them and all their associates as second-class citizens? -Sometimes the first course is proper, sometimes the second, and it takes -careful analysis to tell which.}@footnote{Dirk Laurie. -@cite{Variable-precision Arithmetic Considered Perilous --- A Detective Story}. -Electronic Transactions on Numerical Analysis. Volume 28, pp. 168-173, 2008.} -@author Dirk Laurie -@end quotation - -@command{gawk} does not implicitly modify the precision of any previously -computed results when the working precision is changed with an assignment -to @code{PREC}. The precision of a number is always the one that was -used at the time of its creation, and there is no way for the user -to explicitly change it afterwards. However, since the result of a -floating-point arithmetic operation is always an arbitrary precision -floating-point value---with a precision set by the value of @code{PREC}---one of the -following workarounds effectively accomplishes the desired behavior: - -@example -x = x + 0.0 -@end example - -@noindent -or: - -@example -x += 0.0 +@print{} 0.1000000000000000000000000 +$ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", "0.1") @}'} +@print{} 0.1000000000000000000000000 +$ @kbd{gawk -M 'BEGIN @{ PREC = 113; printf("%0.25f\n", 1/10) @}'} +@print{} 0.1000000000000000000000000 @end example - -@node Exact Arithmetic -@subsection Exact Arithmetic with Floating-point Numbers - -@quotation CAUTION -Never depend on the exactness of floating-point arithmetic, -even for apparently simple expressions! @end quotation -Can arbitrary precision arithmetic give exact results? There are -no easy answers. The standard rules of algebra often do not apply -when using floating-point arithmetic. -Among other things, the distributive and associative laws -do not hold completely, and order of operation may be important -for your computation. Rounding error, cumulative precision loss -and underflow are often troublesome. +@node Setting the rounding mode +@subsection Setting the Rounding Mode -When @command{gawk} tests the expressions @samp{0.1 + 12.2} and @samp{12.3} -for equality -using the machine double precision arithmetic, it decides that they -are not equal! -(@xref{Floating-point Programming}.) -You can get the result you want by increasing the precision; -56 bits in this case will get the job done: +The @code{ROUNDMODE} variable provides +program-level control over the rounding mode. +The correspondence between @code{ROUNDMODE} and the IEEE +rounding modes is shown in @ref{table-gawk-rounding-modes}. -@example -$ @kbd{gawk -M -v PREC=56 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'} -@print{} 1 -@end example +@float Table,table-gawk-rounding-modes +@caption{@command{gawk} rounding modes} +@multitable @columnfractions .45 .30 .25 +@headitem Rounding mode @tab IEEE name @tab @code{ROUNDMODE} +@item Round to nearest, ties to even @tab @code{roundTiesToEven} @tab @code{"N"} or @code{"n"} +@item Round toward positive infinity @tab @code{roundTowardPositive} @tab @code{"U"} or @code{"u"} +@item Round toward negative infinity @tab @code{roundTowardNegative} @tab @code{"D"} or @code{"d"} +@item Round toward zero @tab @code{roundTowardZero} @tab @code{"Z"} or @code{"z"} +@item Round to nearest, ties away from zero @tab @code{roundTiesToAway} @tab @code{"A"} or @code{"a"} +@end multitable +@end float -If adding more bits is good, perhaps adding even more bits of -precision is better? -Here is what happens if we use an even larger value of @code{PREC}: +@code{ROUNDMODE} has the default value @code{"N"}, which +selects the IEEE 754 rounding mode @code{roundTiesToEven}. +In @ref{table-gawk-rounding-modes}, the value @code{"A"} selects +@code{roundTiesToAway}. This is only available if your version of the +MPFR library supports it; otherwise, setting @code{ROUNDMODE} to @code{"A"} +has no effect. -@example -$ @kbd{gawk -M -v PREC=201 'BEGIN @{ print (0.1 + 12.2 == 12.3) @}'} -@print{} 0 -@end example +The default mode @code{roundTiesToEven} is the most preferred, +but the least intuitive. This method does the obvious thing for most values, +by rounding them up or down to the nearest digit. +For example, rounding 1.132 to two digits yields 1.13, +and rounding 1.157 yields 1.16. -This is not a bug in @command{gawk} or in the MPFR library. -It is easy to forget that the finite number of bits used to store the value -is often just an approximation after proper rounding. -The test for equality succeeds if and only if @emph{all} bits in the two operands -are exactly the same. Since this is not necessarily true after floating-point -computations with a particular precision and effective rounding rule, -a straight test for equality may not work. - -So, don't assume that floating-point values can be compared for equality. -You should also exercise caution when using other forms of comparisons. -The standard way to compare between floating-point numbers is to determine -how much error (or @dfn{tolerance}) you will allow in a comparison and -check to see if one value is within this error range of the other. +However, when it comes to rounding a value that is exactly halfway between, +things do not work the way you probably learned in school. +In this case, the number is rounded to the nearest even digit. +So rounding 0.125 to two digits rounds down to 0.12, +but rounding 0.6875 to three digits rounds up to 0.688. +You probably have already encountered this rounding mode when +using @code{printf} to format floating-point numbers. +For example: -In applications where 15 or fewer decimal places suffice, -hardware double precision arithmetic can be adequate, and is usually much faster. -But you do need to keep in mind that every floating-point operation -can suffer a new rounding error with catastrophic consequences as illustrated -by our earlier attempt to compute the value of the constant @value{PI} -(@pxref{Floating-point Programming}). -Extra precision can greatly enhance the stability and the accuracy -of your computation in such cases. +@example +BEGIN @{ + x = -4.5 + for (i = 1; i < 10; i++) @{ + x += 1.0 + printf("%4.1f => %2.0f\n", x, x) + @} +@} +@end example -Repeated addition is not necessarily equivalent to multiplication -in floating-point arithmetic. In the example in -@ref{Floating-point Programming}: +@noindent +produces the following output when run on the author's system:@footnote{It +is possible for the output to be completely different if the +C library in your system does not use the IEEE 754 even-rounding +rule to round halfway cases for @code{printf}.} @example -$ @kbd{gawk 'BEGIN @{} -> @kbd{for (d = 1.1; d <= 1.5; d += 0.1) # loop five times (?)} -> @kbd{i++} -> @kbd{print i} -> @kbd{@}'} -@print{} 4 +-3.5 => -4 +-2.5 => -2 +-1.5 => -2 +-0.5 => 0 + 0.5 => 0 + 1.5 => 2 + 2.5 => 2 + 3.5 => 4 + 4.5 => 4 @end example -@noindent -you may or may not succeed in getting the correct result by choosing -an arbitrarily large value for @code{PREC}. Reformulation of -the problem at hand is often the correct approach in such situations. +The theory behind @code{roundTiesToEven} is that it more or less evenly +distributes upward and downward rounds of exact halves, which might +cause any accumulating round-off error to cancel itself out. This is the +default rounding mode for IEEE 754 computing functions and operators. + +The other rounding modes are rarely used. Rounding toward positive infinity +(@code{roundTowardPositive}) and toward negative infinity +(@code{roundTowardNegative}) are often used to implement interval +arithmetic, where you adjust the rounding mode to calculate upper and +lower bounds for the range of output. The @code{roundTowardZero} mode can +be used for converting floating-point numbers to integers. The rounding +mode @code{roundTiesToAway} rounds the result to the nearest number and +selects the number with the larger magnitude if a tie occurs. + +Some numerical analysts will tell you that your choice of rounding +style has tremendous impact on the final outcome, and advise you to +wait until final output for any rounding. Instead, you can often avoid +round-off error problems by setting the precision initially to some +value sufficiently larger than the final desired precision, so that +the accumulation of round-off error does not influence the outcome. +If you suspect that results from your computation are sensitive to +accumulation of round-off error, look for a significant difference in +output when you change the rounding mode to be sure. @node Arbitrary Precision Integers -@section Arbitrary Precision Integer Arithmetic with @command{gawk} +@section Arbitrary-Precision Integer Arithmetic with @command{gawk} @cindex integers, arbitrary precision @cindex arbitrary precision integers -If one of the options @option{--bignum} or @option{-M} is specified, -@command{gawk} performs all -integer arithmetic using GMP arbitrary precision integers. -Any number that looks like an integer in a program source or data file -is stored as an arbitrary precision integer. -The size of the integer is limited only by your computer's memory. -The current floating-point context has no effect on operations involving integers. -For example, the following computes +When given the @option{-M} option, +@command{gawk} performs all integer arithmetic using GMP arbitrary-precision +integers. Any number that looks like an integer in a source +or @value{DF} is stored as an arbitrary-precision integer. The size +of the integer is limited only by the available memory. For example, +the following computes @iftex @math{5^{4^{3^{2}}}}, @end iftex @@ -28786,33 +29942,34 @@ 5432, @c @end docbook the result of which is beyond the -limits of ordinary @command{gawk} numbers: +limits of ordinary hardware double-precision floating-point values: +@c FIXME: Use @sup here for superscript @example $ @kbd{gawk -M 'BEGIN @{} > @kbd{x = 5^4^3^2} -> @kbd{print "# of digits =", length(x)} +> @kbd{print "number of digits =", length(x)} > @kbd{print substr(x, 1, 20), "...", substr(x, length(x) - 19, 20)} > @kbd{@}'} -@print{} # of digits = 183231 +@print{} number of digits = 183231 @print{} 62060698786608744707 ... 92256259918212890625 @end example -If you were to compute the same value using arbitrary precision -floating-point values instead, the precision needed for correct output -(using the formula +If instead you were to compute the same value using arbitrary-precision +floating-point values, the precision needed for correct output (using +the formula @iftex -@math{prec = 3.322 @cdot dps}), +@math{prec = 3.322 @cdot dps}) would be @math{3.322 @cdot 183231}, @end iftex @ifnottex @ifnotdocbook -@samp{prec = 3.322 * dps}), +@samp{prec = 3.322 * dps}) would be 3.322 x 183231, @end ifnotdocbook @end ifnottex @docbook -prec = 3.322 ⋅ dps), +prec = 3.322 ⋅ dps) would be prec = 3.322 ⋅ 183231, @c @end docbook @@ -28822,8 +29979,8 @@ is a floating-point value with a precision equal to the working precision. The following program calculates the eighth term in Sylvester's sequence@footnote{Weisstein, Eric W. -@cite{Sylvester's Sequence}. From MathWorld---A Wolfram Web Resource. -@url{http://mathworld.wolfram.com/SylvestersSequence.html}} +@cite{Sylvester's Sequence}. From MathWorld---A Wolfram Web Resource +@w{(@url{http://mathworld.wolfram.com/SylvestersSequence.html}).}} using a recurrence: @example @@ -28843,15 +30000,15 @@ @samp{2.0} with an integer, to perform all computations using integer arithmetic to get the correct output. -It will sometimes be necessary for @command{gawk} to implicitly convert an -arbitrary precision integer into an arbitrary precision floating-point value. -This is primarily because the MPFR library does not always provide the -relevant interface to process arbitrary precision integers or mixed-mode -numbers as needed by an operation or function. -In such a case, the precision is set to the minimum value necessary -for exact conversion, and the working precision is not used for this purpose. -If this is not what you need or want, you can employ a subterfuge -like this: +Sometimes @command{gawk} must implicitly convert an arbitrary-precision +integer into an arbitrary-precision floating-point value. This is +primarily because the MPFR library does not always provide the relevant +interface to process arbitrary-precision integers or mixed-mode numbers +as needed by an operation or function. In such a case, the precision is +set to the minimum value necessary for exact conversion, and the working +precision is not used for this purpose. If this is not what you need or +want, you can employ a subterfuge and convert the integer to floating +point first, like this: @example gawk -M 'BEGIN @{ n = 13; print (n + 0.0) % 2.0 @}' @@ -28864,13 +30021,183 @@ gawk -M 'BEGIN @{ n = 13.0; print n % 2.0 @}' @end example -Note that for the particular example above, it is likely best +Note that for this particular example, it is likely best to just use the following: @example gawk -M 'BEGIN @{ n = 13; print n % 2 @}' @end example +@node POSIX Floating Point Problems +@section Standards Versus Existing Practice + +Historically, @command{awk} has converted any nonnumeric-looking string +to the numeric value zero, when required. Furthermore, the original +definition of the language and the original POSIX standards specified that +@command{awk} only understands decimal numbers (base 10), and not octal +(base 8) or hexadecimal numbers (base 16). + +Changes in the language of the +2001 and 2004 POSIX standards can be interpreted to imply that @command{awk} +should support additional features. These features are: + +@itemize @value{BULLET} +@item +Interpretation of floating-point data values specified in hexadecimal +notation (e.g., @code{0xDEADBEEF}). (Note: data values, @emph{not} +source code constants.) + +@item +Support for the special IEEE 754 floating-point values ``not a number'' +(NaN), positive infinity (``inf''), and negative infinity (``@minus{}inf''). +In particular, the format for these values is as specified by the ISO 1999 +C standard, which ignores case and can allow implementation-dependent additional +characters after the @samp{nan} and allow either @samp{inf} or @samp{infinity}. +@end itemize + +The first problem is that both of these are clear changes to historical +practice: + +@itemize @value{BULLET} +@item +The @command{gawk} maintainer feels that supporting hexadecimal +floating-point values, in particular, is ugly, and was never intended by the +original designers to be part of the language. + +@item +Allowing completely alphabetic strings to have valid numeric +values is also a very severe departure from historical practice. +@end itemize + +The second problem is that the @command{gawk} maintainer feels that this +interpretation of the standard, which required a certain amount of +``language lawyering'' to arrive at in the first place, was not even +intended by the standard developers. In other words, ``We see how you +got where you are, but we don't think that that's where you want to be.'' + +Recognizing these issues, but attempting to provide compatibility +with the earlier versions of the standard, +the 2008 POSIX standard added explicit wording to allow, but not require, +that @command{awk} support hexadecimal floating-point values and +special values for ``not a number'' and infinity. + +Although the @command{gawk} maintainer continues to feel that +providing those features is inadvisable, +nevertheless, on systems that support IEEE floating point, it seems +reasonable to provide @emph{some} way to support NaN and infinity values. +The solution implemented in @command{gawk} is as follows: + +@itemize @value{BULLET} +@item +With the @option{--posix} command-line option, @command{gawk} becomes +``hands off.'' String values are passed directly to the system library's +@code{strtod()} function, and if it successfully returns a numeric value, +that is what's used.@footnote{You asked for it, you got it.} +By definition, the results are not portable across +different systems. They are also a little surprising: + +@example +$ @kbd{echo nanny | gawk --posix '@{ print $1 + 0 @}'} +@print{} nan +$ @kbd{echo 0xDeadBeef | gawk --posix '@{ print $1 + 0 @}'} +@print{} 3735928559 +@end example + +@item +Without @option{--posix}, @command{gawk} interprets the four string values +@samp{+inf}, +@samp{-inf}, +@samp{+nan}, +and +@samp{-nan} +specially, producing the corresponding special numeric values. +The leading sign acts a signal to @command{gawk} (and the user) +that the value is really numeric. Hexadecimal floating point is +not supported (unless you also use @option{--non-decimal-data}, +which is @emph{not} recommended). For example: + +@example +$ @kbd{echo nanny | gawk '@{ print $1 + 0 @}'} +@print{} 0 +$ @kbd{echo +nan | gawk '@{ print $1 + 0 @}'} +@print{} nan +$ @kbd{echo 0xDeadBeef | gawk '@{ print $1 + 0 @}'} +@print{} 0 +@end example + +@command{gawk} ignores case in the four special values. +Thus, @samp{+nan} and @samp{+NaN} are the same. +@end itemize + +@node Floating point summary +@section Summary + +@itemize @value{BULLET} +@item +Most computer arithmetic is done using either integers or floating-point +values. Standard @command{awk} uses double-precision +floating-point values. + +@item +In the early 1990s Barbie mistakenly said, ``Math class is tough!'' +Although math isn't tough, floating-point arithmetic isn't the same +as pencil-and-paper math, and care must be taken: + +@c nested list +@itemize @value{MINUS} +@item +Not all numbers can be represented exactly. + +@item +Comparing values should use a delta, instead of being done directly +with @samp{==} and @samp{!=}. + +@item +Errors accumulate. + +@item +Operations are not always truly associative or distributive. +@end itemize + +@item +Increasing the accuracy can help, but it is not a panacea. + +@item +Often, increasing the accuracy and then rounding to the desired +number of digits produces reasonable results. + +@item +Use @option{-M} (or @option{--bignum}) to enable MPFR +arithmetic. Use @code{PREC} to set the precision in bits, and +@code{ROUNDMODE} to set the IEEE 754 rounding mode. + +@item +With @option{-M}, @command{gawk} performs +arbitrary-precision integer arithmetic using the GMP library. +This is faster and more space-efficient than using MPFR for +the same calculations. + +@item +There are several areas with respect to floating-point +numbers where @command{gawk} disagrees with the POSIX standard. +It pays to be aware of them. + +@item +Overall, there is no need to be unduly suspicious about the results from +floating-point arithmetic. The lesson to remember is that floating-point +arithmetic is always more complex than arithmetic using pencil and +paper. In order to take advantage of the power of floating-point arithmetic, +you need to know its limitations and work within them. For most casual +use of floating-point arithmetic, you will often get the expected result +if you simply round the display of your final results to the correct number +of significant decimal digits. + +@item +As general advice, avoid presenting numerical data in a manner that +implies better precision than is actually the case. + +@end itemize + @node Dynamic Extensions @chapter Writing Extensions for @command{gawk} @cindex dynamically loaded extensions @@ -28901,8 +30228,10 @@ * Finding Extensions:: How @command{gawk} finds compiled extensions. * Extension Example:: Example C code for an extension. * Extension Samples:: The sample extensions that ship with - @code{gawk}. + @command{gawk}. * gawkextlib:: The @code{gawkextlib} project. +* Extension summary:: Extension summary. +* Extension Exercises:: Exercises. @end menu @node Extension Intro @@ -28918,26 +30247,37 @@ @command{gawk}'s functionality. For example, they can provide access to system calls (such as @code{chdir()} to change directory) and to other C library routines that could be of use. As with most software, -``the sky is the limit;'' if you can imagine something that you might +``the sky is the limit''; if you can imagine something that you might want to do and can write in C or C++, you can write an extension to do it! -Extensions are written in C or C++, using the @dfn{Application Programming -Interface} (API) defined for this purpose by the @command{gawk} +Extensions are written in C or C++, using the @dfn{application programming +interface} (API) defined for this purpose by the @command{gawk} developers. The rest of this @value{CHAPTER} explains the facilities that the API provides and how to use -them, and presents a small sample extension. In addition, it documents -the sample extensions included in the @command{gawk} distribution, +them, and presents a small example extension. In addition, it documents +the sample extensions included in the @command{gawk} distribution and describes the @code{gawkextlib} project. +@ifclear FOR_PRINT @xref{Extension Design}, for a discussion of the extension mechanism goals and design. +@end ifclear +@ifset FOR_PRINT +See @uref{http://www.gnu.org/software/gawk/manual/html_node/Extension-Design.html} +for a discussion of the extension mechanism +goals and design. +@end ifset @node Plugin License @section Extension Licensing -Every dynamic extension should define the global symbol -@code{plugin_is_GPL_compatible} to assert that it has been licensed under -a GPL-compatible license. If this symbol does not exist, @command{gawk} -emits a fatal error and exits when it tries to load your extension. +Every dynamic extension must be distributed under a license that is +compatible with the GNU GPL (@pxref{Copying}). + +In order for the extension to tell @command{gawk} that it is +properly licensed, the extension must define the global symbol +@code{plugin_is_GPL_compatible}. If this symbol does not exist, +@command{gawk} emits a fatal error and exits when it tries to load +your extension. The declared type of the symbol should be @code{int}. It does not need to be in any allocated section, though. The code merely asserts that @@ -28948,22 +30288,22 @@ @end example @node Extension Mechanism Outline -@section At A High Level How It Works +@section How It Works at a High Level Communication between @command{gawk} and an extension is two-way. First, when an extension -is loaded, it is passed a pointer to a @code{struct} whose fields are +is loaded, @command{gawk} passes it a pointer to a @code{struct} whose fields are function pointers. @ifnotdocbook -This is shown in @ref{load-extension}. +This is shown in @ref{figure-load-extension}. @end ifnotdocbook @ifdocbook -This is shown in @inlineraw{docbook, }. +This is shown in @inlineraw{docbook, }. @end ifdocbook @ifnotdocbook -@float Figure,load-extension -@caption{Loading The Extension} +@float Figure,figure-load-extension +@caption{Loading the extension} @c FIXME: One day, it should not be necessary to have two cases, @c but rather just the one without the "txt" final argument. @c This applies to the other figures as well. @@ -28977,39 +30317,43 @@ @end ifnotdocbook @docbook -
+
Loading the extension - + + +
@end docbook The extension can call functions inside @command{gawk} through these function pointers, at runtime, without needing (link-time) access to @command{gawk}'s symbols. One of these function pointers is to a -function for ``registering'' new built-in functions. +function for ``registering'' new functions. @ifnotdocbook -This is shown in @ref{load-new-function}. +This is shown in @ref{figure-register-new-function}. @end ifnotdocbook @ifdocbook -This is shown in @inlineraw{docbook, }. +This is shown in @inlineraw{docbook, }. @end ifdocbook @ifnotdocbook -@float Figure,load-new-function -@caption{Loading The New Function} +@float Figure,figure-register-new-function +@caption{Registering a new function} @ifinfo -@center @image{api-figure2, , , Loading the new function, txt} +@center @image{api-figure2, , , Registering a new Function, txt} @end ifinfo @ifnotinfo -@center @image{api-figure2, , , Loading the new function} +@center @image{api-figure2, , , Registering a new Function} @end ifnotinfo @end float @end ifnotdocbook @docbook -
-Loading the new function - +
+Registering a new function + + +
@end docbook @@ -29019,15 +30363,15 @@ associates the function pointer with a name and can then call it, using a defined calling convention. @ifnotdocbook -This is shown in @ref{call-new-function}. +This is shown in @ref{figure-call-new-function}. @end ifnotdocbook @ifdocbook -This is shown in @inlineraw{docbook, }. +This is shown in @inlineraw{docbook, }. @end ifdocbook @ifnotdocbook -@float Figure,call-new-function -@caption{Calling The New Function} +@float Figure,figure-call-new-function +@caption{Calling the new function} @ifinfo @center @image{api-figure3, , , Calling the new function, txt} @end ifinfo @@ -29038,9 +30382,11 @@ @end ifnotdocbook @docbook -
-Calling The New Function - +
+Calling the new function + + +
@end docbook @@ -29048,21 +30394,21 @@ pointers in the API @code{struct} to do its work, such as updating variables or arrays, printing messages, setting @code{ERRNO}, and so on. -Convenience macros in the @file{gawkapi.h} header file make calling -through the function pointers look like regular function calls so that -extension code is quite readable and understandable. +Convenience macros make calling through the function pointers look +like regular function calls so that extension code is quite readable +and understandable. Although all of this sounds somewhat complicated, the result is that extension code is quite straightforward to write and to read. You can -see this in the sample extensions @file{filefuncs.c} (@pxref{Extension -Example}) and also the @file{testext.c} code for testing the APIs. +see this in the sample extension @file{filefuncs.c} (@pxref{Extension +Example}) and also in the @file{testext.c} code for testing the APIs. Some other bits and pieces: -@itemize @bullet +@itemize @value{BULLET} @item The API provides access to @command{gawk}'s @code{do_@var{xxx}} values, -reflecting command line options, like @code{do_lint}, @code{do_profiling} +reflecting command-line options, like @code{do_lint}, @code{do_profiling}, and so on (@pxref{Extension API Variables}). These are informational: an extension cannot affect their values inside @command{gawk}. In addition, attempting to assign to them @@ -29073,26 +30419,28 @@ extension can check if the @command{gawk} it is loaded with supports the facilities it was compiled with. (Version mismatches ``shouldn't'' happen, but we all know how @emph{that} goes.) -@xref{Extension Versioning}, for details. +@DBXREF{Extension Versioning} for details. @end itemize - @node Extension API Description @section API Description @cindex extension API +C or C++ code for an extension must include the header file +@file{gawkapi.h}, which declares the functions and defines the data +types used to communicate with @command{gawk}. This (rather large) @value{SECTION} describes the API in detail. @menu * Extension API Functions Introduction:: Introduction to the API functions. * General Data Types:: The data types. -* Requesting Values:: How to get a value. * Memory Allocation Functions:: Functions for allocating memory. * Constructor Functions:: Functions for creating values. * Registration Functions:: Functions to register things with @command{gawk}. * Printing Messages:: Functions for printing messages. * Updating @code{ERRNO}:: Functions for updating @code{ERRNO}. +* Requesting Values:: How to get a value. * Accessing Parameters:: Functions for accessing parameters. * Symbol Table Access:: Functions for accessing global variables. @@ -29104,29 +30452,35 @@ @node Extension API Functions Introduction @subsection Introduction -Access to facilities within @command{gawk} are made available +Access to facilities within @command{gawk} is achieved by calling through function pointers passed into your extension. API function pointers are provided for the following kinds of operations: -@itemize @bullet +@itemize @value{BULLET} @item -Registrations functions. You may register: -@itemize @minus +Allocating, reallocating, and releasing memory. + @item -extension functions, +Registration functions. You may register: + +@c nested list +@itemize @value{MINUS} @item -exit callbacks, +Extension functions @item -a version string, +Exit callbacks @item -input parsers, +A version string @item -output wrappers, +Input parsers @item -and two-way processors. +Output wrappers +@item +Two-way processors @end itemize -All of these are discussed in detail, later in this @value{CHAPTER}. + +All of these are discussed in detail later in this @value{CHAPTER}. @item Printing fatal, warning, and ``lint'' warning messages. @@ -29143,9 +30497,6 @@ or changing one. @item -Allocating, reallocating, and releasing memory. - -@item Creating and releasing cached values; this provides an efficient way to use values for multiple variables and can be a big performance win. @@ -29153,7 +30504,7 @@ @item Manipulating arrays: -@itemize @minus +@itemize @value{MINUS} @item Retrieving, adding, deleting, and modifying elements @@ -29167,28 +30518,30 @@ Clearing an array @item -Flattening an array for easy C style looping over all its indices and elements +Flattening an array for easy C-style looping over all its indices and elements @end itemize @end itemize Some points about using the API: -@itemize @bullet +@itemize @value{BULLET} @item -The following types and/or macros and/or functions are referenced +The following types, macros, and/or functions are referenced in @file{gawkapi.h}. For correct use, you must therefore include the corresponding standard header file @emph{before} including @file{gawkapi.h}: +@c FIXME: Make this is a float at some point. @multitable {@code{memset()}, @code{memcpy()}} {@code{}} -@headitem C Entity @tab Header File +@headitem C entity @tab Header file @item @code{EOF} @tab @code{} +@item Values for @code{errno} @tab @code{} @item @code{FILE} @tab @code{} @item @code{NULL} @tab @code{} @item @code{memcpy()} @tab @code{} @item @code{memset()} @tab @code{} @item @code{size_t} @tab @code{} @item @code{struct stat} @tab @code{} -@end multitable +@end multitable Due to portability concerns, especially to systems that are not fully standards-compliant, it is your responsibility @@ -29197,9 +30550,6 @@ a portability hodge-podge as can be seen in some parts of the @command{gawk} source code. -To pass reasonable integer values for @code{ERRNO}, you will also need to -include @code{}. - @item The @file{gawkapi.h} file may be included more than once without ill effect. Doing so, however, is poor coding practice. @@ -29208,35 +30558,35 @@ Although the API only uses ISO C 90 features, there is an exception; the ``constructor'' functions use the @code{inline} keyword. If your compiler does not support this keyword, you should either place -@samp{-Dinline=''} on your command line, or use the GNU Autotools and include a +@samp{-Dinline=''} on your command line or use the GNU Autotools and include a @file{config.h} file in your extensions. @item -All pointers filled in by @command{gawk} are to memory +All pointers filled in by @command{gawk} point to memory managed by @command{gawk} and should be treated by the extension as read-only. Memory for @emph{all} strings passed into @command{gawk} -from the extension @emph{must} come from calling the API-provided function -pointers @code{api_malloc()}, @code{api_calloc()} or @code{api_realloc()}, +from the extension @emph{must} come from calling one of +@code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}, and is managed by @command{gawk} from then on. @item The API defines several simple @code{struct}s that map values as seen from @command{awk}. A value can be a @code{double}, a string, or an array (as in multidimensional arrays, or when creating a new array). -String values maintain both pointer and length since embedded @code{NUL} +String values maintain both pointer and length, because embedded @sc{nul} characters are allowed. @quotation NOTE By intent, strings are maintained using the current multibyte encoding (as defined by @env{LC_@var{xxx}} environment variables) and not using wide characters. This matches how @command{gawk} stores strings internally -and also how characters are likely to be input and output from files. +and also how characters are likely to be input into and output from files. @end quotation @item When retrieving a value (such as a parameter or that of a global variable or array element), the extension requests a specific type (number, string, -scalars, value cookie, array, or ``undefined''). When the request is +scalar, value cookie, array, or ``undefined''). When the request is ``undefined,'' the returned value will have the real underlying type. However, if the request and actual type don't match, the access function @@ -29248,14 +30598,14 @@ @c The table there should be presented here @end itemize -While you may call the API functions by using the function pointers -directly, the interface is not so pretty. To make extension code look +You may call the API functions by using the function pointers +directly, but the interface is not so pretty. To make extension code look more like regular code, the @file{gawkapi.h} header file defines several macros that you should use in your code. This @value{SECTION} presents the macros as if they were functions. @node General Data Types -@subsection General Purpose Data Types +@subsection General-Purpose Data Types @cindex Robbins, Arnold @cindex Ramey, Chet @@ -29270,9 +30620,12 @@ @author Chet Ramey @end quotation -The extension API defines a number of simple types and structures for general -purpose use. Additional, more specialized, data structures are introduced -in subsequent @value{SECTION}s, together with the functions that use them. +The extension API defines a number of simple types and structures for +general-purpose use. Additional, more specialized, data structures are +introduced in subsequent @value{SECTION}s, together with the functions +that use them. + +The general-purpose types and structures are as follows: @table @code @item typedef void *awk_ext_id_t; @@ -29290,7 +30643,7 @@ @itemx @ @ @ @ awk_false = 0, @itemx @ @ @ @ awk_true @itemx @} awk_bool_t; -A simple boolean type. +A simple Boolean type. @item typedef struct awk_string @{ @itemx @ @ @ @ char *str;@ @ @ @ @ @ /* data */ @@ -29299,8 +30652,9 @@ This represents a mutable string. @command{gawk} owns the memory pointed to if it supplied the value. Otherwise, it takes ownership of the memory pointed to. -@strong{Such memory must come from calling the API-provided function -pointers @code{api_malloc()}, @code{api_calloc()}, or @code{api_realloc()}!} +@emph{Such memory must come from calling one of the +@code{gawk_malloc()}, @code{gawk_calloc()}, or +@code{gawk_realloc()} functions!} As mentioned earlier, strings are maintained using the current multibyte encoding. @@ -29326,7 +30680,7 @@ @itemx @ @ @ @ @ @ @ @ awk_value_cookie_t@ vc; @itemx @ @ @ @ @} u; @itemx @} awk_value_t; -An ``@command{awk} value.'' +An ``@command{awk} value.'' The @code{val_type} member indicates what kind of value the @code{union} holds, and each member is of the appropriate type. @@ -29335,17 +30689,18 @@ @itemx #define array_cookie@ @ @ u.a @itemx #define scalar_cookie@ @ u.scl @itemx #define value_cookie@ @ @ u.vc -These macros make accessing the fields of the @code{awk_value_t} more +Using these macros makes accessing the fields of the @code{awk_value_t} more readable. @item typedef void *awk_scalar_t; -Scalars can be represented as an opaque type. These values are obtained from -@command{gawk} and then passed back into it. This is discussed in a general fashion below, -and in more detail in @ref{Symbol table by cookie}. +Scalars can be represented as an opaque type. These values are obtained +from @command{gawk} and then passed back into it. This is discussed +in a general fashion in the text following this list, and in more detail in +@ref{Symbol table by cookie}. @item typedef void *awk_value_cookie_t; A ``value cookie'' is an opaque type representing a cached value. -This is also discussed in a general fashion below, +This is also discussed in a general fashion in the text following this list, and in more detail in @ref{Cached values}. @end table @@ -29355,9 +30710,9 @@ indicates what is in the @code{union}. Representing numbers is easy---the API uses a C @code{double}. Strings -require more work. Since @command{gawk} allows embedded @code{NUL} bytes +require more work. Because @command{gawk} allows embedded @sc{nul} bytes in string values, a string must be represented as a pair containing a -data-pointer and length. This is the @code{awk_string_t} type. +data pointer and length. This is the @code{awk_string_t} type. Identifiers (i.e., the names of global variables) can be associated with either scalar values or with arrays. In addition, @command{gawk} @@ -29368,14 +30723,14 @@ The various macros listed earlier make it easier to use the elements of the @code{union} as if they were fields in a @code{struct}; this is a common coding practice in C. Such code is easier to write and to -read, however it remains @emph{your} responsibility to make sure that +read, but it remains @emph{your} responsibility to make sure that the @code{val_type} member correctly reflects the type of the value in -the @code{awk_value_t}. +the @code{awk_value_t} struct. Conceptually, the first three members of the @code{union} (number, string, and array) are all that is needed for working with @command{awk} values. -However, since the API provides routines for accessing and changing -the value of global scalar variables only by using the variable's name, +However, because the API provides routines for accessing and changing +the value of a global scalar variable only by using the variable's name, there is a performance penalty: @command{gawk} must find the variable each time it is accessed and changed. This turns out to be a real issue, not just a theoretical one. @@ -29385,170 +30740,27 @@ can obtain a @dfn{scalar cookie}@footnote{See @uref{http://catb.org/jargon/html/C/cookie.html, the ``cookie'' entry in the Jargon file} for a definition of @dfn{cookie}, and @uref{http://catb.org/jargon/html/M/magic-cookie.html, -the ``magic cookie'' entry in the Jargon file} for a nice example. See -also the entry for ``Cookie'' in the @ref{Glossary}.} +the ``magic cookie'' entry in the Jargon file} for a nice example. +@ifclear FOR_PRINT +See also the entry for ``Cookie'' in the @ref{Glossary}. +@end ifclear +} object for that variable, and then use the cookie for getting the variable's value or for changing the variable's value. -This is the @code{awk_scalar_t} type and @code{scalar_cookie} macro. +The @code{awk_scalar_t} type holds a scalar cookie, and the +@code{scalar_cookie} macro provides access to the value of that type +in the @code{awk_value_t} struct. Given a scalar cookie, @command{gawk} can directly retrieve or -modify the value, as required, without having to first find it. +modify the value, as required, without having to find it first. The @code{awk_value_cookie_t} type and @code{value_cookie} macro are similar. If you know that you wish to use the same numeric or string @emph{value} for one or more variables, you can create the value once, retaining a @dfn{value cookie} for it, and then pass in that value cookie whenever you wish to set the value of a -variable. This saves both storage space within the running @command{gawk} -process as well as the time needed to create the value. - -@node Requesting Values -@subsection Requesting Values - -All of the functions that return values from @command{gawk} -work in the same way. You pass in an @code{awk_valtype_t} value -to indicate what kind of value you expect. If the actual value -matches what you requested, the function returns true and fills -in the @code{awk_value_t} result. -Otherwise, the function returns false, and the @code{val_type} -member indicates the type of the actual value. You may then -print an error message, or reissue the request for the actual -value type, as appropriate. This behavior is summarized in -@ref{table-value-types-returned}. - -@c FIXME: Try to do this with spans... -@ifdocbook -@anchor{table-value-types-returned} -@end ifdocbook -@docbook - - - - - Type of Actual Value: - - - - - - - - - - - - - - - - - String - Number - Array - Undefined - - - - - - String - String - String - false - false - - - - Number - Number if can be converted, else false - Number - false - false - - - Type - Array - false - false - Array - false - - - Requested: - Scalar - Scalar - Scalar - false - false - - - - Undefined - String - Number - Array - Undefined - - - - Value Cookie - false - false - false - false - - - - -@end docbook - -@ifnotplaintext -@ifnotdocbook -@float Table,table-value-types-returned -@caption{Value Types Returned} -@multitable @columnfractions .50 .50 -@headitem @tab Type of Actual Value: -@end multitable -@multitable @columnfractions .166 .166 .198 .15 .15 .166 -@headitem @tab @tab String @tab Number @tab Array @tab Undefined -@item @tab @b{String} @tab String @tab String @tab false @tab false -@item @tab @b{Number} @tab Number if can be converted, else false @tab Number @tab false @tab false -@item @b{Type} @tab @b{Array} @tab false @tab false @tab Array @tab false -@item @b{Requested:} @tab @b{Scalar} @tab Scalar @tab Scalar @tab false @tab false -@item @tab @b{Undefined} @tab String @tab Number @tab Array @tab Undefined -@item @tab @b{Value Cookie} @tab false @tab false @tab false @tab false -@end multitable -@end float -@end ifnotdocbook -@end ifnotplaintext -@ifplaintext -@float Table,table-value-types-returned -@caption{Value Types Returned} -@example - +-------------------------------------------------+ - | Type of Actual Value: | - +------------+------------+-----------+-----------+ - | String | Number | Array | Undefined | -+-----------+-----------+------------+------------+-----------+-----------+ -| | String | String | String | false | false | -| |-----------+------------+------------+-----------+-----------+ -| | Number | Number if | Number | false | false | -| | | can be | | | | -| | | converted, | | | | -| | | else false | | | | -| |-----------+------------+------------+-----------+-----------+ -| Type | Array | false | false | Array | false | -| Requested |-----------+------------+------------+-----------+-----------+ -| | Scalar | Scalar | Scalar | false | false | -| |-----------+------------+------------+-----------+-----------+ -| | Undefined | String | Number | Array | Undefined | -| |-----------+------------+------------+-----------+-----------+ -| | Value | false | false | false | false | -| | Cookie | | | | | -+-----------+-----------+------------+------------+-----------+-----------+ -@end example -@end float -@end ifplaintext +variable. This saves storage space within the running @command{gawk} +process and reduces the time needed to create the value. @node Memory Allocation Functions @subsection Memory Allocation Functions and Convenience Macros @@ -29558,50 +30770,54 @@ The API provides a number of @dfn{memory allocation} functions for allocating memory that can be passed to @command{gawk}, as well as a number of convenience macros. +This @value{SUBSECTION} presents them all as function prototypes, in +the way that extension code would use them: @table @code @item void *gawk_malloc(size_t size); -Call @command{gawk}-provided @code{api_malloc()} to allocate storage that may +Call the correct version of @code{malloc()} to allocate storage that may be passed to @command{gawk}. @item void *gawk_calloc(size_t nmemb, size_t size); -Call @command{gawk}-provided @code{api_calloc()} to allocate storage that may +Call the correct version of @code{calloc()} to allocate storage that may be passed to @command{gawk}. @item void *gawk_realloc(void *ptr, size_t size); -Call @command{gawk}-provided @code{api_realloc()} to allocate storage that may +Call the correct version of @code{realloc()} to allocate storage that may be passed to @command{gawk}. @item void gawk_free(void *ptr); -Call @command{gawk}-provided @code{api_free()} to release storage that was -allocated with @code{gawk_malloc()}, @code{gawk_calloc()} or @code{gawk_realloc()}. +Call the correct version of @code{free()} to release storage that was +allocated with @code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}. @end table The API has to provide these functions because it is possible for an extension to be compiled and linked against a different version of the C library than was used for the @command{gawk} -executable.@footnote{This is more common on MS-Windows systems, but +executable.@footnote{This is more common on MS-Windows systems, but it can happen on Unix-like systems as well.} If @command{gawk} were to use its version of @code{free()} when the memory came from an unrelated version of @code{malloc()}, unexpected behavior would likely result. Two convenience macros may be used for allocating storage -from the API-provided function pointers @code{api_malloc()} and -@code{api_realloc()}. If the allocation fails, they cause @command{gawk} +from @code{gawk_malloc()} and +@code{gawk_realloc()}. If the allocation fails, they cause @command{gawk} to exit with a fatal error message. They should be used as if they were -procedure calls that do not return a value. +procedure calls that do not return a value: @table @code @item #define emalloc(pointer, type, size, message) @dots{} The arguments to this macro are as follows: + @c nested table @table @code @item pointer The pointer variable to point at the allocated storage. @item type -The type of the pointer variable, used to create a cast for the call to @code{api_malloc()}. +The type of the pointer variable. This is used to create a cast for +the call to @code{gawk_malloc()}. @item size The total number of bytes to be allocated. @@ -29625,8 +30841,8 @@ @end example @item #define erealloc(pointer, type, size, message) @dots{} -This is like @code{emalloc()}, but it calls @code{api_realloc()}, -instead of @code{api_malloc()}. +This is like @code{emalloc()}, but it calls @code{gawk_realloc()} +instead of @code{gawk_malloc()}. The arguments are the same as for the @code{emalloc()} macro. @end table @@ -29636,32 +30852,32 @@ The API provides a number of @dfn{constructor} functions for creating string and numeric values, as well as a number of convenience macros. This @value{SUBSECTION} presents them all as function prototypes, in -the way that extension code would use them. +the way that extension code would use them: @table @code @item static inline awk_value_t * -@itemx make_const_string(const char *string, size_t length, awk_value_t *result) +@itemx make_const_string(const char *string, size_t length, awk_value_t *result); This function creates a string value in the @code{awk_value_t} variable pointed to by @code{result}. It expects @code{string} to be a C string constant (or other string data), and automatically creates a @emph{copy} of the data for storage in @code{result}. It returns @code{result}. @item static inline awk_value_t * -@itemx make_malloced_string(const char *string, size_t length, awk_value_t *result) +@itemx make_malloced_string(const char *string, size_t length, awk_value_t *result); This function creates a string value in the @code{awk_value_t} variable pointed to by @code{result}. It expects @code{string} to be a @samp{char *} -value pointing to data previously obtained from the api-provided functions @code{api_malloc()}, @code{api_calloc()} or @code{api_realloc()}. The idea here +value pointing to data previously obtained from @code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}. The idea here is that the data is passed directly to @command{gawk}, which assumes responsibility for it. It returns @code{result}. @item static inline awk_value_t * -@itemx make_null_string(awk_value_t *result) +@itemx make_null_string(awk_value_t *result); This specialized function creates a null string (the ``undefined'' value) in the @code{awk_value_t} variable pointed to by @code{result}. It returns @code{result}. @item static inline awk_value_t * -@itemx make_number(double num, awk_value_t *result) +@itemx make_number(double num, awk_value_t *result); This function simply creates a numeric value in the @code{awk_value_t} variable pointed to by @code{result}. @end table @@ -29701,21 +30917,22 @@ @table @code @item const char *name; The name of the new function. -@command{awk} level code calls the function by this name. +@command{awk}-level code calls the function by this name. This is a regular C string. Function names must obey the rules for @command{awk} -identifiers. That is, they must begin with either a letter +identifiers. That is, they must begin with either an English letter or an underscore, which may be followed by any number of letters, digits, and underscores. Letter case in function names is significant. @item awk_value_t *(*function)(int num_actual_args, awk_value_t *result); -This is a pointer to the C function that provides the desired +This is a pointer to the C function that provides the extension's functionality. -The function must fill in the result with either a number +The function must fill in @code{*result} with either a number or a string. @command{gawk} takes ownership of any string memory. -As mentioned earlier, string memory @strong{must} come from the api-provided functions @code{api_malloc()}, @code{api_calloc()} or @code{api_realloc()}. +As mentioned earlier, string memory @emph{must} come from one of +@code{gawk_malloc()}, @code{gawk_calloc()}, or @code{gawk_realloc()}. The @code{num_actual_args} argument tells the C function how many actual parameters were passed from the calling @command{awk} code. @@ -29726,7 +30943,7 @@ @item size_t num_expected_args; This is the number of arguments the function expects to receive. Each extension function may decide what to do if the number of -arguments isn't what it expected. Following @command{awk} functions, it +arguments isn't what it expected. As with real @command{awk} functions, it is likely OK to ignore extra arguments. @end table @@ -29746,16 +30963,17 @@ An @dfn{exit callback} function is a function that @command{gawk} calls before it exits. -Such functions are useful if you have general ``clean up'' tasks -that should be performed in your extension (such as closing data -base connections or other resource deallocations). +Such functions are useful if you have general ``cleanup'' tasks +that should be performed in your extension (such as closing database +connections or other resource deallocations). You can register such -a function with @command{gawk} using the following function. +a function with @command{gawk} using the following function: @table @code @item void awk_atexit(void (*funcp)(void *data, int exit_status), @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ void *arg0); The parameters are: + @c nested table @table @code @item funcp @@ -29765,24 +30983,25 @@ @command{gawk} intends to pass to the @code{exit()} system call. @item arg0 -A pointer to private data which @command{gawk} saves in order to pass to +A pointer to private data that @command{gawk} saves in order to pass to the function pointed to by @code{funcp}. @end table @end table -Exit callback functions are called in Last-In-First-Out (LIFO) order---that is, in -the reverse order in which they are registered with @command{gawk}. +Exit callback functions are called in last-in, first-out (LIFO) +order---that is, in the reverse order in which they are registered with +@command{gawk}. @node Extension Version String @subsubsection Registering An Extension Version String -You can register a version string which indicates the name and -version of your extension, with @command{gawk}, as follows: +You can register a version string that indicates the name and +version of your extension with @command{gawk}, as follows: @table @code @item void register_ext_version(const char *version); Register the string pointed to by @code{version} with @command{gawk}. -@command{gawk} does @emph{not} copy the @code{version} string, so +Note that @command{gawk} does @emph{not} copy the @code{version} string, so it should not be changed. @end table @@ -29799,7 +31018,7 @@ Additionally, it sets the value of @code{RT} (@pxref{Built-in Variables}). If you want, you can provide your own custom input parser. An input -parser's job is to return a record to the @command{gawk} record processing +parser's job is to return a record to the @command{gawk} record-processing code, along with indicators for the value and length of the data to be used for @code{RT}, if any. @@ -29807,19 +31026,19 @@ (where @var{XXX} is a prefix name for your extension): @table @code -@item awk_bool_t @var{XXX}_can_take_file(const awk_input_buf_t *iobuf) +@item awk_bool_t @var{XXX}_can_take_file(const awk_input_buf_t *iobuf); This function examines the information available in @code{iobuf} (which we discuss shortly). Based on the information there, it decides if the input parser should be used for this file. If so, it should return true. Otherwise, it should return false. It should not change any state (variable values, etc.) within @command{gawk}. -@item awk_bool_t @var{XXX}_take_control_of(awk_input_buf_t *iobuf) +@item awk_bool_t @var{XXX}_take_control_of(awk_input_buf_t *iobuf); When @command{gawk} decides to hand control of the file over to the input parser, it calls this function. This function in turn must fill -in certain fields in the @code{awk_input_buf_t} structure, and ensure +in certain fields in the @code{awk_input_buf_t} structure and ensure that certain conditions are true. It should then return true. If an -error of some kind occurs, it should not fill in any fields, and should +error of some kind occurs, it should not fill in any fields and should return false; then @command{gawk} will not use the input parser. The details are presented shortly. @end table @@ -29849,8 +31068,9 @@ A pointer to your @code{@var{XXX}_take_control_of()} function. @item awk_const struct input_parser *awk_const next; -This pointer is used by @command{gawk}. -The extension cannot modify it. +This is for use by @command{gawk}; +therefore it is marked @code{awk_const} so that the extension cannot +modify it. @end table The steps are as follows: @@ -29863,7 +31083,7 @@ @item When your extension is loaded, register your input parser with @command{gawk} using the @code{register_input_parser()} API function -(described below). +(described next). @end enumerate An @code{awk_input_buf_t} looks like this: @@ -29893,11 +31113,11 @@ @item int fd; A file descriptor for the file. If @command{gawk} was able to -open the file, then @code{fd} will @emph{not} be equal to +open the file, then @code{fd} will @emph{not} be equal to @code{INVALID_HANDLE}. Otherwise, it will. @item struct stat sbuf; -If file descriptor is valid, then @command{gawk} will have filled +If the file descriptor is valid, then @command{gawk} will have filled in this structure via a call to the @code{fstat()} system call. @end table @@ -29907,15 +31127,15 @@ of a variable defined previously by the extension and set by @command{awk} code), the name of the file, whether or not the file descriptor is valid, the information -in the @code{struct stat}, or any combination of the above. +in the @code{struct stat}, or any combination of these factors. Once @code{@var{XXX}_can_take_file()} has returned true, and @command{gawk} has decided to use your input parser, it calls -@code{@var{XXX}_take_control_of()}. That function then fills one of +@code{@var{XXX}_take_control_of()}. That function then fills either the @code{get_record} field or the @code{read_func} field in the @code{awk_input_buf_t}. It must also ensure that @code{fd} is @emph{not} -set to @code{INVALID_HANDLE}. All of the fields that may be filled by -@code{@var{XXX}_take_control_of()} are as follows: +set to @code{INVALID_HANDLE}. The following list describes the fields that +may be filled by @code{@var{XXX}_take_control_of()}: @table @code @item void *opaque; @@ -29930,24 +31150,24 @@ @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ size_t *rt_len); This function pointer should point to a function that creates the input records. Said function is the core of the input parser. Its behavior -is described below. +is described in the text following this list. @item ssize_t (*read_func)(); -This function pointer should point to function that has the +This function pointer should point to a function that has the same behavior as the standard POSIX @code{read()} system call. It is an alternative to the @code{get_record} pointer. Its behavior -is also described below. +is also described in the text following this list. @item void (*close_func)(struct awk_input *iobuf); This function pointer should point to a function that does -the ``tear down.'' It should release any resources allocated by +the ``teardown.'' It should release any resources allocated by @code{@var{XXX}_take_control_of()}. It may also close the file. If it does so, it should set the @code{fd} field to @code{INVALID_HANDLE}. If @code{fd} is still not @code{INVALID_HANDLE} after the call to this function, @command{gawk} calls the regular @code{close()} system call. -Having a ``tear down'' function is optional. If your input parser does +Having a ``teardown'' function is optional. If your input parser does not need it, do not set this field. Then, @command{gawk} calls the regular @code{close()} system call on the file descriptor, so it should be valid. @@ -29958,7 +31178,7 @@ @table @code @item char **out -This is a pointer to a @code{char *} variable which is set to point +This is a pointer to a @code{char *} variable that is set to point to the record. @command{gawk} makes its own copy of the data, so the extension must manage this storage. @@ -29977,8 +31197,8 @@ @code{*rt_start} should be set to point to the data to be used for @code{RT}, and @code{*rt_len} should be set to the length of the data. Otherwise, @code{*rt_len} should be set to zero. -@code{gawk} makes its own copy of this data, so the -extension must manage the storage. +@command{gawk} makes its own copy of this data, so the +extension must manage this storage. @end table The return value is the length of the buffer pointed to by @@ -29990,8 +31210,8 @@ to zero, so there is no need to set it unless an error occurs. If an error does occur, the function should return @code{EOF} and set -@code{*errcode} to a non-zero value. In that case, if @code{*errcode} -does not equal @minus{}1, @command{gawk} automatically updates +@code{*errcode} to a value greater than zero. In that case, if @code{*errcode} +does not equal zero, @command{gawk} automatically updates the @code{ERRNO} variable based on the value of @code{*errcode}. (In general, setting @samp{*errcode = errno} should do the right thing.) @@ -30011,19 +31231,19 @@ You must choose one method or the other: either a function that returns a record, or one that returns raw data. In particular, if you supply a function to get a record, @command{gawk} will -call it, and never call the raw read function. +call it, and will never call the raw read function. @end quotation @command{gawk} ships with a sample extension that reads directories, -returning records for each entry in the directory (@pxref{Extension +returning records for each entry in a directory (@pxref{Extension Sample Readdir}). You may wish to use that code as a guide for writing your own input parser. When writing an input parser, you should think about (and document) how it is expected to interact with @command{awk} code. You may want -it to always be called, and take effect as appropriate (as the +it to always be called, and to take effect as appropriate (as the @code{readdir} extension does). Or you may want it to take effect -based upon the value of an @code{awk} variable, as the XML extension +based upon the value of an @command{awk} variable, as the XML extension from the @code{gawkextlib} project does (@pxref{gawkextlib}). In the latter case, code in a @code{BEGINFILE} section can look at @code{FILENAME} and @code{ERRNO} to decide whether or @@ -30074,12 +31294,12 @@ The function pointed to by this field is called when @command{gawk} decides to let the output wrapper take control of the file. It should fill in appropriate members of the @code{awk_output_buf_t} structure, -as described below, and return true if successful, false otherwise. +as described next, and return true if successful, false otherwise. @item awk_const struct output_wrapper *awk_const next; This is for use by @command{gawk}; -therefore they are marked @code{awk_const} so that the extension cannot -modify them. +therefore it is marked @code{awk_const} so that the extension cannot +modify it. @end table The @code{awk_output_buf_t} structure looks like this: @@ -30131,7 +31351,7 @@ These pointers should be set to point to functions that perform the equivalent function as the @code{} functions do, if appropriate. @command{gawk} uses these function pointers for all output. -@command{gawk} initializes the pointers to point to internal, ``pass through'' +@command{gawk} initializes the pointers to point to internal ``pass-through'' functions that just call the regular @code{} functions, so an extension only needs to redefine those functions that are appropriate for what it does. @@ -30141,8 +31361,8 @@ upon the @code{name} and @code{mode} fields, and any additional state (such as @command{awk} variable values) that is appropriate. -When @command{gawk} calls @code{@var{XXX}_take_control_of()}, it should fill -in the other fields, as appropriate, except for @code{fp}, which it should just +When @command{gawk} calls @code{@var{XXX}_take_control_of()}, that function should fill +in the other fields as appropriate, except for @code{fp}, which it should just use normally. You register your output wrapper with the following function: @@ -30182,21 +31402,21 @@ The name of the two-way processor. @item awk_bool_t (*can_take_two_way)(const char *name); -This function returns true if it wants to take over two-way I/O for this filename. +The function pointed to by this field should return true if it wants to take over two-way I/O for this @value{FN}. It should not change any state (variable values, etc.) within @command{gawk}. @item awk_bool_t (*take_control_of)(const char *name, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_input_buf_t *inbuf, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_output_buf_t *outbuf); -This function should fill in the @code{awk_input_buf_t} and +The function pointed to by this field should fill in the @code{awk_input_buf_t} and @code{awk_outut_buf_t} structures pointed to by @code{inbuf} and @code{outbuf}, respectively. These structures were described earlier. @item awk_const struct two_way_processor *awk_const next; This is for use by @command{gawk}; -therefore they are marked @code{awk_const} so that the extension cannot -modify them. +therefore it is marked @code{awk_const} so that the extension cannot +modify it. @end table As with the input parser and output processor, you provide @@ -30217,9 +31437,9 @@ @cindex messages from extensions You can print different kinds of warning messages from your -extension, as described below. Note that for these functions, -you must pass in the extension id received from @command{gawk} -when the extension was loaded.@footnote{Because the API uses only ISO C 90 +extension, as described here. Note that for these functions, +you must pass in the extension ID received from @command{gawk} +when the extension was loaded:@footnote{Because the API uses only ISO C 90 features, it cannot make use of the ISO C 99 variadic macro feature to hide that parameter. More's the pity.} @@ -30257,10 +31477,148 @@ Set @code{ERRNO} directly to the string value of @code{ERRNO}. @command{gawk} makes a copy of the value of @code{string}. -@item void unset_ERRNO(); +@item void unset_ERRNO(void); Unset @code{ERRNO}. @end table +@node Requesting Values +@subsection Requesting Values + +All of the functions that return values from @command{gawk} +work in the same way. You pass in an @code{awk_valtype_t} value +to indicate what kind of value you expect. If the actual value +matches what you requested, the function returns true and fills +in the @code{awk_value_t} result. +Otherwise, the function returns false, and the @code{val_type} +member indicates the type of the actual value. You may then +print an error message or reissue the request for the actual +value type, as appropriate. This behavior is summarized in +@ref{table-value-types-returned}. + +@float Table,table-value-types-returned +@caption{API value types returned} +@docbook + + + + + + + + + + + Type of Actual Value + + + + String + Number + Array + Undefined + + + + + + String + String + String + False + False + + + + Number + Number if can be converted, else false + Number + False + False + + + Type + Array + False + False + Array + False + + + Requested + Scalar + Scalar + Scalar + False + False + + + + Undefined + String + Number + Array + Undefined + + + + Value cookie + False + False + False + False + + + + +@end docbook + +@ifnotplaintext +@ifnotdocbook +@multitable @columnfractions .50 .50 +@headitem @tab Type of Actual Value +@end multitable +@c 10/2014: Thanks to Karl Berry for this bit to reduce the space: +@tex +\vglue-1.1\baselineskip +@end tex +@multitable @columnfractions .166 .166 .198 .15 .15 .166 +@headitem @tab @tab String @tab Number @tab Array @tab Undefined +@item @tab @b{String} @tab String @tab String @tab False @tab False +@item @tab @b{Number} @tab Number if can be converted, else false @tab Number @tab False @tab False +@item @b{Type} @tab @b{Array} @tab False @tab False @tab Array @tab False +@item @b{Requested} @tab @b{Scalar} @tab Scalar @tab Scalar @tab False @tab False +@item @tab @b{Undefined} @tab String @tab Number @tab Array @tab Undefined +@item @tab @b{Value cookie} @tab False @tab False @tab False @tab False +@end multitable +@end ifnotdocbook +@end ifnotplaintext +@ifplaintext +@example + +-------------------------------------------------+ + | Type of Actual Value: | + +------------+------------+-----------+-----------+ + | String | Number | Array | Undefined | ++-----------+-----------+------------+------------+-----------+-----------+ +| | String | String | String | False | False | +| |-----------+------------+------------+-----------+-----------+ +| | Number | Number if | Number | False | False | +| | | can be | | | | +| | | converted, | | | | +| | | else false | | | | +| |-----------+------------+------------+-----------+-----------+ +| Type | Array | False | False | Array | False | +| Requested |-----------+------------+------------+-----------+-----------+ +| | Scalar | Scalar | Scalar | False | False | +| |-----------+------------+------------+-----------+-----------+ +| | Undefined | String | Number | Array | Undefined | +| |-----------+------------+------------+-----------+-----------+ +| | Value | False | False | False | False | +| | cookie | | | | | ++-----------+-----------+------------+------------+-----------+-----------+ +@end example +@end ifplaintext +@end float + @node Accessing Parameters @subsection Accessing and Updating Parameters @@ -30272,17 +31630,17 @@ @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_valtype_t wanted, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_value_t *result); Fill in the @code{awk_value_t} structure pointed to by @code{result} -with the @code{count}'th argument. Return true if the actual -type matches @code{wanted}, false otherwise. In the latter +with the @code{count}th argument. Return true if the actual +type matches @code{wanted}, and false otherwise. In the latter case, @code{result@w{->}val_type} indicates the actual type -(@pxref{table-value-types-returned}). Counts are zero based---the first +(@pxref{table-value-types-returned}). Counts are zero-based---the first argument is numbered zero, the second one, and so on. @code{wanted} indicates the type of value expected. @item awk_bool_t set_argument(size_t count, awk_array_t array); Convert a parameter that was undefined into an array; this provides -call-by-reference for arrays. Return false if @code{count} is too big, -or if the argument's type is not undefined. @xref{Array Manipulation}, +call by reference for arrays. Return false if @code{count} is too big, +or if the argument's type is not undefined. @DBXREF{Array Manipulation} for more information on creating arrays. @end table @@ -30305,8 +31663,9 @@ The following routines provide the ability to access and update global @command{awk}-level variables by name. In compiler terminology, identifiers of different kinds are termed @dfn{symbols}, thus the ``sym'' -in the routines' names. The data structure which stores information +in the routines' names. The data structure that stores information about symbols is termed a @dfn{symbol table}. +The functions are as follows: @table @code @item awk_bool_t sym_lookup(const char *name, @@ -30315,14 +31674,14 @@ Fill in the @code{awk_value_t} structure pointed to by @code{result} with the value of the variable named by the string @code{name}, which is a regular C string. @code{wanted} indicates the type of value expected. -Return true if the actual type matches @code{wanted}, false otherwise +Return true if the actual type matches @code{wanted}, and false otherwise. In the latter case, @code{result->val_type} indicates the actual type (@pxref{table-value-types-returned}). @item awk_bool_t sym_update(const char *name, awk_value_t *value); Update the variable named by the string @code{name}, which is a regular C string. The variable is added to @command{gawk}'s symbol table -if it is not there. Return true if everything worked, false otherwise. +if it is not there. Return true if everything worked, and false otherwise. Changing types (scalar to array or vice versa) of an existing variable is @emph{not} allowed, nor may this routine be used to update an array. @@ -30334,10 +31693,10 @@ However, with the exception of the @code{PROCINFO} array, an extension cannot change any of those variables. -@quotation NOTE +@quotation CAUTION It is possible for the lookup of @code{PROCINFO} to fail. This happens if the @command{awk} program being run does not reference @code{PROCINFO}; -in this case @command{gawk} doesn't bother to create the array and +in this case, @command{gawk} doesn't bother to create the array and populate it. @end quotation @@ -30349,21 +31708,21 @@ avoids looking up variables in @command{gawk}'s symbol table every time access is needed. This was discussed earlier, in @ref{General Data Types}. -The following functions let you work with scalar cookies. +The following functions let you work with scalar cookies: @table @code @item awk_bool_t sym_lookup_scalar(awk_scalar_t cookie, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_valtype_t wanted, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_value_t *result); Retrieve the current value of a scalar cookie. -Once you have obtained a scalar_cookie using @code{sym_lookup()}, you can +Once you have obtained a scalar cookie using @code{sym_lookup()}, you can use this function to get its value more efficiently. Return false if the value cannot be retrieved. @item awk_bool_t sym_update_scalar(awk_scalar_t cookie, awk_value_t *value); Update the value associated with a scalar cookie. Return false if -the new value is not one of @code{AWK_STRING} or @code{AWK_NUMBER}. -Here too, the built-in variables may not be updated. +the new value is not of type @code{AWK_STRING} or @code{AWK_NUMBER}. +Here too, the predefined variables may not be updated. @end table It is not obvious at first glance how to work with scalar cookies or @@ -30394,18 +31753,21 @@ @noindent This code looks (and is) simple and straightforward. So what's the problem? -Consider what happens if @command{awk}-level code associated with your -extension calls the @code{magic()} function (implemented in C by @code{do_magic()}), -once per record, while processing hundreds of thousands or millions of records. -The @code{MAGIC_VAR} variable is looked up in the symbol table once or twice per function call! - -The symbol table lookup is really pure overhead; it is considerably more efficient -to get a cookie that represents the variable, and use that to get the variable's -value and update it as needed.@footnote{The difference is measurable and quite real. Trust us.} - -Thus, the way to use cookies is as follows. First, install your extension's variable -in @command{gawk}'s symbol table using @code{sym_update()}, as usual. Then get a -scalar cookie for the variable using @code{sym_lookup()}: +Well, consider what happens if @command{awk}-level code associated +with your extension calls the @code{magic()} function (implemented in +C by @code{do_magic()}), once per record, while processing hundreds +of thousands or millions of records. The @code{MAGIC_VAR} variable is +looked up in the symbol table once or twice per function call! + +The symbol table lookup is really pure overhead; it is considerably +more efficient to get a cookie that represents the variable, and use +that to get the variable's value and update it as needed.@footnote{The +difference is measurable and quite real. Trust us.} + +Thus, the way to use cookies is as follows. First, install +your extension's variable in @command{gawk}'s symbol table using +@code{sym_update()}, as usual. Then get a scalar cookie for the variable +using @code{sym_lookup()}: @example static awk_scalar_t magic_var_cookie; /* cookie for MAGIC_VAR */ @@ -30418,7 +31780,7 @@ /* install initial value */ sym_update("MAGIC_VAR", make_number(42.0, & value)); - /* get cookie */ + /* get the cookie */ sym_lookup("MAGIC_VAR", AWK_SCALAR, & value); /* save the cookie */ @@ -30460,14 +31822,15 @@ @subsubsection Creating and Using Cached Values The routines in this section allow you to create and release -cached values. As with scalar cookies, in theory, cached values +cached values. Like scalar cookies, in theory, cached values are not necessary. You can create numbers and strings using the functions in @ref{Constructor Functions}. You can then assign those values to variables using @code{sym_update()} or @code{sym_update_scalar()}, as you like. However, you can understand the point of cached values if you remember that -@emph{every} string value's storage @emph{must} come from @code{api_malloc()}, @code{api_calloc()} or @code{api_realloc()}. +@emph{every} string value's storage @emph{must} come from @code{gawk_malloc()}, +@code{gawk_calloc()}, or @code{gawk_realloc()}. If you have 20 variables, all of which have the same string value, you must create 20 identical copies of the string.@footnote{Numeric values are clearly less problematic, requiring only a C @code{double} to store.} @@ -30478,11 +31841,11 @@ @table @code @item awk_bool_t create_value(awk_value_t *value, awk_value_cookie_t *result); -Create a cached string or numeric value from @code{value} for efficient later -assignment. -Only @code{AWK_NUMBER} and @code{AWK_STRING} values are allowed. Any other type -is rejected. While @code{AWK_UNDEFINED} could be allowed, doing so would -result in inferior performance. +Create a cached string or numeric value from @code{value} for +efficient later assignment. Only values of type @code{AWK_NUMBER} +and @code{AWK_STRING} are allowed. Any other type is rejected. +@code{AWK_UNDEFINED} could be allowed, but doing so would result in +inferior performance. @item awk_bool_t release_value(awk_value_cookie_t vc); Release the memory associated with a value cookie obtained @@ -30503,7 +31866,7 @@ size_t long_string_len; /* code from earlier */ - @dots{} + @dots{} /* @dots{} fill in long_string and long_string_len @dots{} */ make_malloced_string(long_string, long_string_len, & value); create_value(& value, & answer_cookie); /* create cookie */ @@ -30533,21 +31896,21 @@ @end example @noindent -Using value cookies in this way saves considerable storage, since all of +Using value cookies in this way saves considerable storage, as all of @code{VAR1} through @code{VAR100} share the same value. You might be wondering, ``Is this sharing problematic? -What happens if @command{awk} code assigns a new value to @code{VAR1}, -are all the others be changed too?'' +What happens if @command{awk} code assigns a new value to @code{VAR1}; +are all the others changed too?'' That's a great question. The answer is that no, it's not a problem. -Internally, @command{gawk} uses reference-counted strings. This means +Internally, @command{gawk} uses @dfn{reference-counted strings}. This means that many variables can share the same string value, and @command{gawk} keeps track of the usage. When a variable's value changes, @command{gawk} simply decrements the reference count on the old value and updates the variable to use the new value. -Finally, as part of your clean up action (@pxref{Exit Callback Functions}) +Finally, as part of your cleanup action (@pxref{Exit Callback Functions}) you should release any cached values that you created, using @code{release_value()}. @@ -30555,7 +31918,7 @@ @subsection Array Manipulation @cindex array manipulation in extensions -The primary data structure@footnote{Okay, the only data structure.} in @command{awk} +The primary data structure@footnote{OK, the only data structure.} in @command{awk} is the associative array (@pxref{Arrays}). Extensions need to be able to manipulate @command{awk} arrays. The API provides a number of data structures for working with arrays, @@ -30576,7 +31939,7 @@ @node Array Data Types @subsubsection Array Data Types -The data types associated with arrays are listed below. +The data types associated with arrays are as follows: @table @code @item typedef void *awk_array_t; @@ -30593,7 +31956,7 @@ @itemx @ @ @ @ struct awk_element *next; @itemx @ @ @ @ enum @{ @itemx @ @ @ @ @ @ @ @ AWK_ELEMENT_DEFAULT = 0,@ @ /* set by gawk */ -@itemx @ @ @ @ @ @ @ @ AWK_ELEMENT_DELETE = 1@ @ @ @ /* set by extension if should be deleted */ +@itemx @ @ @ @ @ @ @ @ AWK_ELEMENT_DELETE = 1@ @ @ @ /* set by extension */ @itemx @ @ @ @ @} flags; @itemx @ @ @ @ awk_value_t index; @itemx @ @ @ @ awk_value_t value; @@ -30613,8 +31976,8 @@ added to an array in a loop that traverses the list. @item enum @{ @dots{} @} flags; -A set of flag values that convey information between @command{gawk} -and the extension. Currently there is only one: @code{AWK_ELEMENT_DELETE}. +A set of flag values that convey information between the extension +and @command{gawk}. Currently there is only one: @code{AWK_ELEMENT_DELETE}. Setting it causes @command{gawk} to delete the element from the original array upon release of the flattened array. @@ -30625,8 +31988,8 @@ @end table @item typedef struct awk_flat_array @{ -@itemx @ @ @ @ awk_const void *awk_const opaque1;@ @ @ @ /* private data for use by gawk */ -@itemx @ @ @ @ awk_const void *awk_const opaque2;@ @ @ @ /* private data for use by gawk */ +@itemx @ @ @ @ awk_const void *awk_const opaque1;@ @ @ @ /* for use by gawk */ +@itemx @ @ @ @ awk_const void *awk_const opaque2;@ @ @ @ /* for use by gawk */ @itemx @ @ @ @ awk_const size_t count;@ @ @ @ @ /* how many elements */ @itemx @ @ @ @ awk_element_t elements[1];@ @ /* will be extended */ @itemx @} awk_flat_array_t; @@ -30641,11 +32004,11 @@ @node Array Functions @subsubsection Array Functions -The following functions relate to individual array elements. +The following functions relate to individual array elements: @table @code @item awk_bool_t get_element_count(awk_array_t a_cookie, size_t *count); -For the array represented by @code{a_cookie}, return in @code{*count} +For the array represented by @code{a_cookie}, place in @code{*count} the number of elements it contains. A subarray counts as a single element. Return false if there is an error. @@ -30660,12 +32023,13 @@ @code{index} is not in the array (@pxref{table-value-types-returned}). The value for @code{index} can be numeric, in which case @command{gawk} -converts it to a string. Using non-integral values is possible, but +converts it to a string. Using nonintegral values is possible, but requires that you understand how such values are converted to strings -(@pxref{Conversion}); thus using integral values is safest. +(@pxref{Conversion}); thus, using integral values is safest. -As with @emph{all} strings passed into @code{gawk} from an extension, -the string value of @code{index} must come from the API-provided functions @code{api_malloc()}, @code{api_calloc()} or @code{api_realloc()} and +As with @emph{all} strings passed into @command{gawk} from an extension, +the string value of @code{index} must come from @code{gawk_malloc()}, +@code{gawk_calloc()}, or @code{gawk_realloc()}, and @command{gawk} releases the storage. @item awk_bool_t set_array_element(awk_array_t a_cookie, @@ -30673,7 +32037,8 @@ @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const@ awk_value_t *const value); In the array represented by @code{a_cookie}, create or modify the element whose index is given by @code{index}. -The @code{ARGV} and @code{ENVIRON} arrays may not be changed. +The @code{ARGV} and @code{ENVIRON} arrays may not be changed, +although the @code{PROCINFO} array can be. @item awk_bool_t set_array_element_by_elem(awk_array_t a_cookie, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_element_t element); @@ -30691,9 +32056,9 @@ The following functions relate to arrays as a whole: @table @code -@item awk_array_t create_array(); +@item awk_array_t create_array(void); Create a new array to which elements may be added. -@xref{Creating Arrays}, for a discussion of how to +@DBXREF{Creating Arrays} for a discussion of how to create a new array and add elements to it. @item awk_bool_t clear_array(awk_array_t a_cookie); @@ -30708,13 +32073,19 @@ structure and fill it in. Set the pointer whose address is passed as @code{data} to point to this structure. Return true upon success, or false otherwise. -@xref{Flattening Arrays}, for a discussion of how to +@ifset FOR_PRINT +See the next section +@end ifset +@ifclear FOR_PRINT +@xref{Flattening Arrays}, +@end ifclear +for a discussion of how to flatten an array and work with it. @item awk_bool_t release_flattened_array(awk_array_t a_cookie, @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ awk_flat_array_t *data); When done with a flattened array, release the storage using this function. -You must pass in both the original array cookie, and the address of +You must pass in both the original array cookie and the address of the created @code{awk_flat_array_t} structure. The function returns true upon success, false otherwise. @end table @@ -30722,12 +32093,13 @@ @node Flattening Arrays @subsubsection Working With All The Elements of an Array -To @dfn{flatten} an array is create a structure that +To @dfn{flatten} an array is to create a structure that represents the full array in a fashion that makes it easy -for C code to traverse the entire array. Test code +for C code to traverse the entire array. Some of the code in @file{extension/testext.c} does this, and also serves as a nice example showing how to use the APIs. +We walk through that part of the code one step at a time. First, the @command{gawk} script that drives the test extension: @example @@ -30780,9 +32152,9 @@ @end example The function then proceeds in steps, as follows. First, retrieve -the name of the array, passed as the first argument. Then -retrieve the array itself. If either operation fails, print -error messages and return: +the name of the array, passed as the first argument, followed by +the array itself. If either operation fails, print an +error message and return: @example /* get argument named array as flat array and print it */ @@ -30818,7 +32190,7 @@ @end example The third step is to actually flatten the array, and then -to double check that the count in the @code{awk_flat_array_t} +to double-check that the count in the @code{awk_flat_array_t} is the same as the count just retrieved: @example @@ -30839,7 +32211,7 @@ The fourth step is to retrieve the index of the element to be deleted, which was passed as the second argument. Remember that argument counts passed to @code{get_argument()} -are zero-based, thus the second argument is numbered one: +are zero-based, and thus the second argument is numbered one: @example if (! get_argument(1, AWK_STRING, & value3)) @{ @@ -30854,7 +32226,7 @@ index that is supposed to be deleted, the function sets the @code{AWK_ELEMENT_DELETE} bit in the @code{flags} field of the element. When the array is released, @command{gawk} -traverses the flattened array, and deletes any elements which +traverses the flattened array, and deletes any elements that have this flag bit set: @example @@ -30866,8 +32238,7 @@ valrep2str(& flat_array->elements[i].value)); if (strcmp(value3.str_value.str, - flat_array->elements[i].index.str_value.str) - == 0) @{ + flat_array->elements[i].index.str_value.str) == 0) @{ flat_array->elements[i].flags |= AWK_ELEMENT_DELETE; printf("dump_array_and_delete: marking element \"%s\" " "for deletion\n", @@ -30890,7 +32261,7 @@ @} @end example -Finally, since everything was successful, the function sets the +Finally, because everything was successful, the function sets the return value to success, and returns: @example @@ -30925,7 +32296,7 @@ There are two important points about creating arrays from extension code: -@enumerate 1 +@itemize @value{BULLET} @item You must install a new array into @command{gawk}'s symbol table immediately upon creating it. Once you have done so, @@ -30944,10 +32315,10 @@ Thus, the correct way to build an array is to work ``top down.'' Create the array, and immediately install it in @command{gawk}'s symbol table using @code{sym_update()}, or install it as an element in a previously -existing array using @code{set_element()}. We show example code shortly. +existing array using @code{set_array_element()}. We show example code shortly. @item -Due to gawk internals, after using @code{sym_update()} to install an array +Due to @command{gawk} internals, after using @code{sym_update()} to install an array into @command{gawk}, you have to retrieve the array cookie from the value passed in to @command{sym_update()} before doing anything else with it, like so: @@ -30967,11 +32338,13 @@ If installing an array as a subarray, you must also retrieve the value of the array cookie after the call to @code{set_element()}. -@end enumerate +@end itemize The following C code is a simple test extension to create an array -with two regular elements and with a subarray. The leading @samp{#include} -directives and boilerplate variable declarations are omitted for brevity. +with two regular elements and with a subarray. The leading @code{#include} +directives and boilerplate variable declarations +(@pxref{Extension API Boilerplate}) +are omitted for brevity. The first step is to create a new array and then install it in the symbol table: @@ -31084,7 +32457,7 @@ @end ignore @end example -Here is sample script that loads the extension +Here is a sample script that loads the extension and then dumps the array: @example @@ -31114,7 +32487,7 @@ @end example @noindent -(@xref{Finding Extensions}, for more information on the +(@DBXREF{Finding Extensions} for more information on the @env{AWKLIBPATH} environment variable.) @node Extension API Variables @@ -31141,10 +32514,10 @@ @table @code @item GAWK_API_MAJOR_VERSION -The major version of the API. +The major version of the API @item GAWK_API_MINOR_VERSION -The minor version of the API. +The minor version of the API @end table The minor version increases when new functions are added to the API. Such @@ -31162,14 +32535,14 @@ @table @code @item api->major_version -The major version of the running @command{gawk}. +The major version of the running @command{gawk} @item api->minor_version -The minor version of the running @command{gawk}. +The minor version of the running @command{gawk} @end table It is up to the extension to decide if there are API incompatibilities. -Typically a check like this is enough: +Typically, a check like this is enough: @example if (api->major_version != GAWK_API_MAJOR_VERSION @@ -31183,7 +32556,7 @@ @end example Such code is included in the boilerplate @code{dl_load_func()} macro -provided in @file{gawkapi.h} (discussed later, in +provided in @file{gawkapi.h} (discussed in @ref{Extension API Boilerplate}). @node Extension API Informational Variables @@ -31196,12 +32569,14 @@ @command{gawk} was invoked. The variables are: @table @code +@item do_debug +This variable is true if @command{gawk} was invoked with @option{--debug} option. + @item do_lint -This variable is true if @command{gawk} was invoked with @option{--lint} option -(@pxref{Options}). +This variable is true if @command{gawk} was invoked with @option{--lint} option. -@item do_traditional -This variable is true if @command{gawk} was invoked with @option{--traditional} option. +@item do_mpfr +This variable is true if @command{gawk} was invoked with @option{--bignum} option. @item do_profile This variable is true if @command{gawk} was invoked with @option{--profile} option. @@ -31209,15 +32584,12 @@ @item do_sandbox This variable is true if @command{gawk} was invoked with @option{--sandbox} option. -@item do_debug -This variable is true if @command{gawk} was invoked with @option{--debug} option. - -@item do_mpfr -This variable is true if @command{gawk} was invoked with @option{--bignum} option. +@item do_traditional +This variable is true if @command{gawk} was invoked with @option{--traditional} option. @end table The value of @code{do_lint} can change if @command{awk} code -modifies the @code{LINT} built-in variable (@pxref{Built-in Variables}). +modifies the @code{LINT} predefined variable (@pxref{Built-in Variables}). The others should not change during execution. @node Extension API Boilerplate @@ -31226,12 +32598,12 @@ As mentioned earlier (@pxref{Extension Mechanism Outline}), the function definitions as presented are really macros. To use these macros, your extension must provide a small amount of boilerplate code (variables and -functions) towards the top of your source file, using pre-defined names -as described below. The boilerplate needed is also provided in comments +functions) toward the top of your source file, using predefined names +as described here. The boilerplate needed is also provided in comments in the @file{gawkapi.h} header file: @example -/* Boiler plate code: */ +/* Boilerplate code: */ int plugin_is_GPL_compatible; static gawk_api_t *const api; @@ -31250,12 +32622,12 @@ /* OR: */ static awk_bool_t -init_my_module(void) +init_my_extension(void) @{ @dots{} @} -static awk_bool_t (*init_func)(void) = init_my_module; +static awk_bool_t (*init_func)(void) = init_my_extension; dl_load_func(func_table, some_name, "name_space_in_quotes") @end example @@ -31264,8 +32636,14 @@ @table @code @item int plugin_is_GPL_compatible; -This asserts that the extension is compatible with the GNU GPL -(@pxref{Copying}). If your extension does not have this, @command{gawk} +This asserts that the extension is compatible with +@ifclear FOR_PRINT +the GNU GPL (@pxref{Copying}). +@end ifclear +@ifset FOR_PRINT +the GNU GPL. +@end ifset +If your extension does not have this, @command{gawk} will not load it (@pxref{Plugin License}). @item static gawk_api_t *const api; @@ -31284,15 +32662,16 @@ your extension. @item static awk_ext_func_t func_table[] = @{ @dots{} @}; -This is an array of one or more @code{awk_ext_func_t} structures +This is an array of one or more @code{awk_ext_func_t} structures, as described earlier (@pxref{Extension Functions}). It can then be looped over for multiple calls to @code{add_ext_func()}. +@c Use @var{OR} for docbook @item static awk_bool_t (*init_func)(void) = NULL; -@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @r{OR} -@itemx static awk_bool_t init_my_module(void) @{ @dots{} @} -@itemx static awk_bool_t (*init_func)(void) = init_my_module; +@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @var{OR} +@itemx static awk_bool_t init_my_extension(void) @{ @dots{} @} +@itemx static awk_bool_t (*init_func)(void) = init_my_extension; If you need to do some initialization work, you should define a function that does it (creates variables, opens files, etc.) and then define the @code{init_func} pointer to point to your @@ -31308,7 +32687,7 @@ all the necessary initializations. @end table -The point of the all the variables and arrays is to let the +The point of all the variables and arrays is to let the @code{dl_load()} function (from the @code{dl_load_func()} macro) do all the standard work. It does the following: @@ -31343,7 +32722,7 @@ built in the default fashion, the directory in which to find extensions is @file{/usr/local/lib/gawk}. You can also specify a search path with a list of directories to search for compiled extensions. -@xref{AWKLIBPATH Variable}, for more information. +@DBXREF{AWKLIBPATH Variable} for more information. @node Extension Example @section Example: Some File Functions @@ -31351,7 +32730,7 @@ @quotation @i{No matter where you go, there you are.} -@author Buckaroo Bonzai +@author Buckaroo Banzai @end quotation @c It's enough to show chdir and stat, no need for fts @@ -31359,8 +32738,8 @@ Two useful functions that are not in @command{awk} are @code{chdir()} (so that an @command{awk} program can change its directory) and @code{stat()} (so that an @command{awk} program can gather information about a file). -This @value{SECTION} implements these functions for @command{gawk} -in an extension. +In order to illustrate the API in action, this @value{SECTION} implements +these functions for @command{gawk} in an extension. @menu * Internal File Description:: What the new functions will do. @@ -31382,8 +32761,7 @@ newdir = "/home/arnold/funstuff" ret = chdir(newdir) if (ret < 0) @{ - printf("could not change to %s: %s\n", - newdir, ERRNO) > "/dev/stderr" + printf("could not change to %s: %s\n", newdir, ERRNO) > "/dev/stderr" exit 1 @} @dots{} @@ -31415,7 +32793,7 @@ @table @code @item "name" -The name of the file that was @code{stat()}'ed. +The name of the file that was @code{stat()}ed. @item "dev" @itemx "ino" @@ -31471,7 +32849,7 @@ The file is a directory. @item "fifo" -The file is a named-pipe (also known as a FIFO). +The file is a named pipe (also known as a FIFO). @item "file" The file is just a regular file. @@ -31494,7 +32872,7 @@ a value. Where no value can be determined, it defaults to 512. @end table -Several additional elements may be present depending upon the operating +Several additional elements may be present, depending upon the operating system and the type of the file. You can test for them in your @command{awk} program by using the @code{in} operator (@pxref{Reference to Elements}): @@ -31524,12 +32902,11 @@ in the @command{gawk} distribution for the complete version.} The file includes a number of standard header files, and then includes -the @file{gawkapi.h} header file which provides the API definitions. -Those are followed by the necessary variable declarations +the @file{gawkapi.h} header file, which provides the API definitions. +Those are followed by the necessary variable declarations to make use of the API macros and boilerplate code -(@pxref{Extension API Boilerplate}). +(@pxref{Extension API Boilerplate}): -@c break line for page breaking @example #ifdef HAVE_CONFIG_H #include @@ -31566,13 +32943,13 @@ @cindex programming conventions, @command{gawk} extensions By convention, for an @command{awk} function @code{foo()}, the C function that implements it is called @code{do_foo()}. The function should have -two arguments: the first is an @code{int} usually called @code{nargs}, +two arguments. The first is an @code{int}, usually called @code{nargs}, that represents the number of actual arguments for the function. -The second is a pointer to an @code{awk_value_t}, usually named -@code{result}. +The second is a pointer to an @code{awk_value_t} structure, usually named +@code{result}: @example -/* do_chdir --- provide dynamically loaded chdir() builtin for gawk */ +/* do_chdir --- provide dynamically loaded chdir() function for gawk */ static awk_value_t * do_chdir(int nargs, awk_value_t *result) @@ -31589,13 +32966,13 @@ @end example The @code{newdir} -variable represents the new directory to change to, retrieved +variable represents the new directory to change to, which is retrieved with @code{get_argument()}. Note that the first argument is numbered zero. If the argument is retrieved successfully, the function calls the @code{chdir()} system call. If the @code{chdir()} fails, @code{ERRNO} -is updated. +is updated: @example if (get_argument(0, AWK_STRING, & newdir)) @{ @@ -31614,9 +32991,8 @@ The @code{stat()} extension is more involved. First comes a function that turns a numeric mode into a printable representation -(e.g., 644 becomes @samp{-rw-r--r--}). This is omitted here for brevity: +(e.g., octal @code{0644} becomes @samp{-rw-r--r--}). This is omitted here for brevity: -@c break line for page breaking @example /* format_mode --- turn a stat mode field into something readable */ @@ -31671,9 +33047,9 @@ The following function does most of the work to fill in the @code{awk_array_t} result array with values obtained -from a valid @code{struct stat}. It is done in a separate function +from a valid @code{struct stat}. This work is done in a separate function to support the @code{stat()} function for @command{gawk} and also -to support the @code{fts()} extension which is included in +to support the @code{fts()} extension, which is included in the same file but whose code is not shown here (@pxref{Extension Sample File Functions}). @@ -31782,13 +33158,22 @@ @} @} - array_set(array, "type", make_const_string(type, strlen(type), &tmp)); + array_set(array, "type", make_const_string(type, strlen(type), & tmp)); return 0; @} @end example -Finally, here is the @code{do_stat()} function. It starts with +The third argument to @code{stat()} was not discussed previously. This +argument is optional. If present, it causes @code{do_stat()} to use +the @code{stat()} system call instead of the @code{lstat()} system +call. This is done by using a function pointer: @code{statfunc}. +@code{statfunc} is initialized to point to @code{lstat()} (instead +of @code{stat()}) to get the file information, in case the file is a +symbolic link. However, if the third argument is included, @code{statfunc} +is set to point to @code{stat()}, instead. + +Here is the @code{do_stat()} function, which starts with variable declarations and argument checking: @ignore @@ -31819,16 +33204,10 @@ @} @end example -The third argument to @code{stat()} was not discussed previously. This argument -is optional. If present, it causes @code{stat()} to use the @code{stat()} -system call instead of the @code{lstat()} system call. - Then comes the actual work. First, the function gets the arguments. -Next, it gets the information for the file. -The code use @code{lstat()} (instead of @code{stat()}) -to get the file information, -in case the file is a symbolic link. -If there's an error, it sets @code{ERRNO} and returns: +Next, it gets the information for the file. If the called function +(@code{lstat()} or @code{stat()}) returns an error, the code sets +@code{ERRNO} and returns: @example /* file is first arg, array to hold results is second */ @@ -31848,7 +33227,7 @@ /* always empty out the array */ clear_array(array); - /* stat the file, if error, set ERRNO and return */ + /* stat the file; if error, set ERRNO and return */ ret = statfunc(name, & sbuf); if (ret < 0) @{ update_ERRNO_int(errno); @@ -31857,7 +33236,7 @@ @end example The tedious work is done by @code{fill_stat_array()}, shown -earlier. When done, return the result from @code{fill_stat_array()}: +earlier. When done, the function returns the result from @code{fill_stat_array()}: @example ret = fill_stat_array(name, array, & sbuf); @@ -31870,7 +33249,9 @@ new function(s) into @command{gawk}. The @code{filefuncs} extension also provides an @code{fts()} -function, which we omit here. For its sake there is an initialization +function, which we omit here +(@pxref{Extension Sample File Functions}). +For its sake, there is an initialization function: @example @@ -31890,7 +33271,9 @@ static awk_ext_func_t func_table[] = @{ @{ "chdir", do_chdir, 1 @}, @{ "stat", do_stat, 2 @}, +#ifndef __MINGW32__ @{ "fts", do_fts, 3 @}, +#endif @}; @end example @@ -31904,12 +33287,10 @@ dl_load_func(func_table, filefuncs, "") @end example -And that's it! As an exercise, consider adding functions to -implement system calls such as @code{chown()}, @code{chmod()}, -and @code{umask()}. +And that's it! @node Using Internal File Ops -@subsection Integrating The Extensions +@subsection Integrating the Extensions @cindex @command{gawk}, interpreter@comma{} adding code to Now that the code is written, it must be possible to add it at @@ -31918,9 +33299,9 @@ a file named @file{filefuncs.c}, and @var{idir} is the location of the @file{gawkapi.h} header file, the following steps@footnote{In practice, you would probably want to -use the GNU Autotools---Automake, Autoconf, Libtool, and Gettext---to +use the GNU Autotools (Automake, Autoconf, Libtool, and @command{gettext}) to configure and build your libraries. Instructions for doing so are beyond -the scope of this @value{DOCUMENT}. @xref{gawkextlib}, for WWW links to +the scope of this @value{DOCUMENT}. @DBXREF{gawkextlib} for Internet links to the tools.} create a GNU/Linux shared library: @example @@ -31928,7 +33309,7 @@ $ @kbd{gcc -o filefuncs.so -shared filefuncs.o} @end example -Once the library exists, it is loaded by using the @code{@@load} keyword. +Once the library exists, it is loaded by using the @code{@@load} keyword: @example # file testff.awk @@ -31948,19 +33329,19 @@ for (i in data) printf "data[\"%s\"] = %s\n", i, data[i] print "testff.awk modified:", - strftime("%m %d %y %H:%M:%S", data["mtime"]) + strftime("%m %d %Y %H:%M:%S", data["mtime"]) print "\nInfo for JUNK" ret = stat("JUNK", data) print "ret =", ret for (i in data) printf "data[\"%s\"] = %s\n", i, data[i] - print "JUNK modified:", strftime("%m %d %y %H:%M:%S", data["mtime"]) + print "JUNK modified:", strftime("%m %d %Y %H:%M:%S", data["mtime"]) @} @end example The @env{AWKLIBPATH} environment variable tells -@command{gawk} where to find shared libraries (@pxref{Finding Extensions}). +@command{gawk} where to find extensions (@pxref{Finding Extensions}). We set it to the current directory and run the program: @example @@ -31969,35 +33350,37 @@ @print{} Info for testff.awk @print{} ret = 0 @print{} data["blksize"] = 4096 -@print{} data["mtime"] = 1350838628 +@print{} data["devbsize"] = 512 +@print{} data["mtime"] = 1412004710 @print{} data["mode"] = 33204 @print{} data["type"] = file @print{} data["dev"] = 2053 @print{} data["gid"] = 1000 -@print{} data["ino"] = 1719496 -@print{} data["ctime"] = 1350838628 +@print{} data["ino"] = 10358899 +@print{} data["ctime"] = 1412004710 @print{} data["blocks"] = 8 @print{} data["nlink"] = 1 @print{} data["name"] = testff.awk -@print{} data["atime"] = 1350838632 +@print{} data["atime"] = 1412004716 @print{} data["pmode"] = -rw-rw-r-- -@print{} data["size"] = 662 +@print{} data["size"] = 666 @print{} data["uid"] = 1000 -@print{} testff.awk modified: 10 21 12 18:57:08 -@print{} +@print{} testff.awk modified: 09 29 2014 18:31:50 +@print{} @print{} Info for JUNK @print{} ret = -1 -@print{} JUNK modified: 01 01 70 02:00:00 +@print{} JUNK modified: 01 01 1970 02:00:00 @end example @node Extension Samples -@section The Sample Extensions In The @command{gawk} Distribution +@section The Sample Extensions in the @command{gawk} Distribution @cindex extensions distributed with @command{gawk} -This @value{SECTION} provides brief overviews of the sample extensions +This @value{SECTION} provides a brief overview of the sample extensions that come in the @command{gawk} distribution. Some of them are intended -for production use, such the @code{filefuncs}, @code{readdir} and @code{inplace} extensions. -Others mainly provide example code that shows how to use the extension API. +for production use (e.g., the @code{filefuncs}, @code{readdir}, and +@code{inplace} extensions). Others mainly provide example code that +shows how to use the extension API. @menu * Extension Sample File Functions:: The file functions sample. @@ -32012,34 +33395,34 @@ * Extension Sample Rev2way:: Reversing data sample two-way processor. * Extension Sample Read write array:: Serializing an array to a file. * Extension Sample Readfile:: Reading an entire file into a string. -* Extension Sample API Tests:: Tests for the API. * Extension Sample Time:: An interface to @code{gettimeofday()} and @code{sleep()}. +* Extension Sample API Tests:: Tests for the API. @end menu @node Extension Sample File Functions -@subsection File Related Functions +@subsection File-Related Functions -The @code{filefuncs} extension provides three different functions, as follows: +The @code{filefuncs} extension provides three different functions, as follows. The usage is: -@table @code -@item @@load "filefuncs" +@table @asis +@item @code{@@load "filefuncs"} This is how you load the extension. @cindex @code{chdir()} extension function -@item result = chdir("/some/directory") +@item @code{result = chdir("/some/directory")} The @code{chdir()} function is a direct hook to the @code{chdir()} system call to change the current directory. It returns zero -upon success or less than zero upon error. In the latter case it updates -@code{ERRNO}. +upon success or a value less than zero upon error. +In the latter case, it updates @code{ERRNO}. @cindex @code{stat()} extension function -@item result = stat("/some/path", statdata @r{[}, follow@r{]}) +@item @code{result = stat("/some/path", statdata} [@code{, follow}]@code{)} The @code{stat()} function provides a hook into the @code{stat()} system call. -It returns zero upon success or less than zero upon error. -In the latter case it updates @code{ERRNO}. +It returns zero upon success or a value less than zero upon error. +In the latter case, it updates @code{ERRNO}. By default, it uses the @code{lstat()} system call. However, if passed a third argument, it uses @code{stat()} instead. @@ -32048,69 +33431,27 @@ When the call is successful, @code{stat()} fills the @code{statdata} array with information retrieved from the filesystem, as follows: -@c nested table -@multitable @columnfractions .25 .60 -@item @code{statdata["name"]} @tab -The name of the file. - -@item @code{statdata["dev"]} @tab -Corresponds to the @code{st_dev} field in the @code{struct stat}. - -@item @code{statdata["ino"]} @tab -Corresponds to the @code{st_ino} field in the @code{struct stat}. - -@item @code{statdata["mode"]} @tab -Corresponds to the @code{st_mode} field in the @code{struct stat}. - -@item @code{statdata["nlink"]} @tab -Corresponds to the @code{st_nlink} field in the @code{struct stat}. - -@item @code{statdata["uid"]} @tab -Corresponds to the @code{st_uid} field in the @code{struct stat}. - -@item @code{statdata["gid"]} @tab -Corresponds to the @code{st_gid} field in the @code{struct stat}. - -@item @code{statdata["size"]} @tab -Corresponds to the @code{st_size} field in the @code{struct stat}. - -@item @code{statdata["atime"]} @tab -Corresponds to the @code{st_atime} field in the @code{struct stat}. - -@item @code{statdata["mtime"]} @tab -Corresponds to the @code{st_mtime} field in the @code{struct stat}. - -@item @code{statdata["ctime"]} @tab -Corresponds to the @code{st_ctime} field in the @code{struct stat}. - -@item @code{statdata["rdev"]} @tab -Corresponds to the @code{st_rdev} field in the @code{struct stat}. -This element is only present for device files. - -@item @code{statdata["major"]} @tab -Corresponds to the @code{st_major} field in the @code{struct stat}. -This element is only present for device files. - -@item @code{statdata["minor"]} @tab -Corresponds to the @code{st_minor} field in the @code{struct stat}. -This element is only present for device files. - -@item @code{statdata["blksize"]} @tab -Corresponds to the @code{st_blksize} field in the @code{struct stat}, -if this field is present on your system. -(It is present on all modern systems that we know of.) - -@item @code{statdata["pmode"]} @tab -A human-readable version of the mode value, such as printed by -@command{ls}. For example, @code{"-rwxr-xr-x"}. - -@item @code{statdata["linkval"]} @tab -If the named file is a symbolic link, this element will exist -and its value is the value of the symbolic link (where the -symbolic link points to). - -@item @code{statdata["type"]} @tab -The type of the file as a string. One of +@multitable @columnfractions .15 .50 .20 +@headitem Subscript @tab Field in @code{struct stat} @tab File type +@item @code{"name"} @tab The @value{FN} @tab All +@item @code{"dev"} @tab @code{st_dev} @tab All +@item @code{"ino"} @tab @code{st_ino} @tab All +@item @code{"mode"} @tab @code{st_mode} @tab All +@item @code{"nlink"} @tab @code{st_nlink} @tab All +@item @code{"uid"} @tab @code{st_uid} @tab All +@item @code{"gid"} @tab @code{st_gid} @tab All +@item @code{"size"} @tab @code{st_size} @tab All +@item @code{"atime"} @tab @code{st_atime} @tab All +@item @code{"mtime"} @tab @code{st_mtime} @tab All +@item @code{"ctime"} @tab @code{st_ctime} @tab All +@item @code{"rdev"} @tab @code{st_rdev} @tab Device files +@item @code{"major"} @tab @code{st_major} @tab Device files +@item @code{"minor"} @tab @code{st_minor} @tab Device files +@item @code{"blksize"} @tab @code{st_blksize} @tab All +@item @code{"pmode"} @tab A human-readable version of the mode value, like that printed by +@command{ls} (for example, @code{"-rwxr-xr-x"}) @tab All +@item @code{"linkval"} @tab The value of the symbolic link @tab Symbolic links +@item @code{"type"} @tab The type of the file as a string---one of @code{"file"}, @code{"blockdev"}, @code{"chardev"}, @@ -32120,16 +33461,16 @@ @code{"symlink"}, @code{"door"}, or -@code{"unknown"}. -Not all systems support all file types. +@code{"unknown"} +(not all systems support all file types) @tab All @end multitable @cindex @code{fts()} extension function -@item flags = or(FTS_PHYSICAL, ...) -@itemx result = fts(pathlist, flags, filedata) +@item @code{flags = or(FTS_PHYSICAL, ...)} +@itemx @code{result = fts(pathlist, flags, filedata)} Walk the file trees provided in @code{pathlist} and fill in the -@code{filedata} array as described below. @code{flags} is the bitwise -OR of several predefined constant values, also described below. +@code{filedata} array, as described next. @code{flags} is the bitwise +OR of several predefined values, also described in a moment. Return zero if there were no errors, otherwise return @minus{}1. @end table @@ -32143,7 +33484,7 @@ @table @code @item pathlist -An array of filenames. The element values are used; the index values are ignored. +An array of @value{FN}s. The element values are used; the index values are ignored. @item flags This should be the bitwise OR of one or more of the following @@ -32174,20 +33515,21 @@ whether or not @code{FTS_LOGICAL} is set. @item FTS_SEEDOT -By default, the @code{fts()} routines do not return entries for @file{.} (dot) -and @file{..} (dot-dot). This option causes entries for dot-dot to also -be included. (The extension always includes an entry for dot, -see below.) +By default, the C library @code{fts()} routines do not return entries for +@file{.} (dot) and @file{..} (dot-dot). This option causes entries for +dot-dot to also be included. (The extension always includes an entry +for dot; more on this in a moment.) @item FTS_XDEV During a traversal, do not cross onto a different mounted filesystem. @end table @item filedata -The @code{filedata} array is first cleared. Then, @code{fts()} creates +The @code{filedata} array holds the results. +@code{fts()} first clears it. Then it creates an element in @code{filedata} for every element in @code{pathlist}. The index is the name of the directory or file given in @code{pathlist}. -The element for this index is itself an array. There are two cases. +The element for this index is itself an array. There are two cases: @c nested table @table @emph @@ -32213,8 +33555,8 @@ @item The path is a directory In this case, the array contains one element for each entry in the -directory. If an entry is a file, that element is as for files, just -described. If the entry is a directory, that element is (recursively), +directory. If an entry is a file, that element is the same as for files, just +described. If the entry is a directory, that element is (recursively) an array describing the subdirectory. If @code{FTS_SEEDOT} was provided in the flags, then there will also be an element named @code{".."}. This element will be an array containing the data as provided by @code{stat()}. @@ -32226,24 +33568,25 @@ @end table The @code{fts()} function returns zero if there were no errors. -Otherwise it returns @minus{}1. +Otherwise, it returns @minus{}1. @quotation NOTE The @code{fts()} extension does not exactly mimic the interface of the C library @code{fts()} routines, choosing instead to -provide an interface that is based on associative arrays, which should -be more comfortable to use from an @command{awk} program. This includes the -lack of a comparison function, since @command{gawk} already provides -powerful array sorting facilities. While an @code{fts_read()}-like +provide an interface that is based on associative arrays, which is +more comfortable to use from an @command{awk} program. This includes the +lack of a comparison function, because @command{gawk} already provides +powerful array sorting facilities. Although an @code{fts_read()}-like interface could have been provided, this felt less natural than simply creating a multidimensional array to represent the file hierarchy and its information. @end quotation -See @file{test/fts.awk} in the @command{gawk} distribution for an example. +See @file{test/fts.awk} in the @command{gawk} distribution for an example +use of the @code{fts()} extension function. @node Extension Sample Fnmatch -@subsection Interface To @code{fnmatch()} +@subsection Interface to @code{fnmatch()} This extension provides an interface to the C library @code{fnmatch()} function. The usage is: @@ -32256,10 +33599,10 @@ @item result = fnmatch(pattern, string, flags) The return value is zero on success, @code{FNM_NOMATCH} if the string did not match the pattern, or -a different non-zero value if an error occurred. +a different nonzero value if an error occurred. @end table -Besides the @code{fnmatch()} function, the @code{fnmatch} extension +In addition to the @code{fnmatch()} function, the @code{fnmatch} extension adds one constant (@code{FNM_NOMATCH}), and an array of flag values named @code{FNM}. @@ -32267,36 +33610,26 @@ @table @code @item pattern -The filename wildcard to match. +The @value{FN} wildcard to match @item string -The filename string. +The @value{FN} string @item flag Either zero, or the bitwise OR of one or more of the -flags in the @code{FNM} array. +flags in the @code{FNM} array @end table -The flags are follows: +The flags are as follows: @multitable @columnfractions .25 .75 -@item @code{FNM["CASEFOLD"]} @tab -Corresponds to the @code{FNM_CASEFOLD} flag as defined in @code{fnmatch()}. - -@item @code{FNM["FILE_NAME"]} @tab -Corresponds to the @code{FNM_FILE_NAME} flag as defined in @code{fnmatch()}. - -@item @code{FNM["LEADING_DIR"]} @tab -Corresponds to the @code{FNM_LEADING_DIR} flag as defined in @code{fnmatch()}. - -@item @code{FNM["NOESCAPE"]} @tab -Corresponds to the @code{FNM_NOESCAPE} flag as defined in @code{fnmatch()}. - -@item @code{FNM["PATHNAME"]} @tab -Corresponds to the @code{FNM_PATHNAME} flag as defined in @code{fnmatch()}. - -@item @code{FNM["PERIOD"]} @tab -Corresponds to the @code{FNM_PERIOD} flag as defined in @code{fnmatch()}. +@headitem Array element @tab Corresponding flag defined by @code{fnmatch()} +@item @code{FNM["CASEFOLD"]} @tab @code{FNM_CASEFOLD} +@item @code{FNM["FILE_NAME"]} @tab @code{FNM_FILE_NAME} +@item @code{FNM["LEADING_DIR"]} @tab @code{FNM_LEADING_DIR} +@item @code{FNM["NOESCAPE"]} @tab @code{FNM_NOESCAPE} +@item @code{FNM["PATHNAME"]} @tab @code{FNM_PATHNAME} +@item @code{FNM["PERIOD"]} @tab @code{FNM_PERIOD} @end multitable Here is an example: @@ -32310,9 +33643,9 @@ @end example @node Extension Sample Fork -@subsection Interface To @code{fork()}, @code{wait()} and @code{waitpid()} +@subsection Interface to @code{fork()}, @code{wait()}, and @code{waitpid()} -The @code{fork} extension adds three functions, as follows. +The @code{fork} extension adds three functions, as follows: @table @code @item @@load "fork" @@ -32321,14 +33654,14 @@ @cindex @code{fork()} extension function @item pid = fork() This function creates a new process. The return value is zero in the -child and the process-ID number of the child in the parent, or @minus{}1 +child and the process ID number of the child in the parent, or @minus{}1 upon error. In the latter case, @code{ERRNO} indicates the problem. In the child, @code{PROCINFO["pid"]} and @code{PROCINFO["ppid"]} are updated to reflect the correct values. @cindex @code{waitpid()} extension function @item ret = waitpid(pid) -This function takes a numeric argument, which is the process-ID to +This function takes a numeric argument, which is the process ID to wait for. The return value is that of the @code{waitpid()} system call. @@ -32356,8 +33689,8 @@ @subsection Enabling In-Place File Editing @cindex @code{inplace} extension -The @code{inplace} extension emulates GNU @command{sed}'s @option{-i} option -which performs ``in place'' editing of each input file. +The @code{inplace} extension emulates GNU @command{sed}'s @option{-i} option, +which performs ``in-place'' editing of each input file. It uses the bundled @file{inplace.awk} include file to invoke the extension properly: @@ -32371,11 +33704,16 @@ # Please set INPLACE_SUFFIX to make a backup copy. For example, you may # want to set INPLACE_SUFFIX to .bak on the command line or in a BEGIN rule. +# N.B. We call inplace_end() in the BEGINFILE and END rules so that any +# actions in an ENDFILE rule will be redirected as expected. + BEGINFILE @{ - inplace_begin(FILENAME, INPLACE_SUFFIX) + if (_inplace_filename != "") + inplace_end(_inplace_filename, INPLACE_SUFFIX) + inplace_begin(_inplace_filename = FILENAME, INPLACE_SUFFIX) @} -ENDFILE @{ +END @{ inplace_end(FILENAME, INPLACE_SUFFIX) @} @end group @@ -32387,8 +33725,12 @@ and permissions as the original. After the file has been processed, the extension restores standard output to its original destination. If @code{INPLACE_SUFFIX} is not an empty string, the original file is -linked to a backup filename created by appending that suffix. Finally, -the temporary file is renamed to the original filename. +linked to a backup @value{FN} created by appending that suffix. Finally, +the temporary file is renamed to the original @value{FN}. + +The @code{_inplace_filename} variable serves to keep track of the +current filename so as to not invoke @code{inplace_end()} before +processing the first file. If any error occurs, the extension issues a fatal error to terminate processing immediately without damaging the original file. @@ -32406,14 +33748,11 @@ > @kbd{@{ print @}' file1 file2 file3} @end example -We leave it as an exercise to write a wrapper script that presents an -interface similar to @samp{sed -i}. - @node Extension Sample Ord @subsection Character and Numeric values: @code{ord()} and @code{chr()} The @code{ordchr} extension adds two functions, named -@code{ord()} and @code{chr()}, as follows. +@code{ord()} and @code{chr()}, as follows: @table @code @item @@load "ordchr" @@ -32454,13 +33793,16 @@ they are read, with each entry returned as a record. The record consists of three fields. The first two are the inode number and the -filename, separated by a forward slash character. +@value{FN}, separated by a forward slash character. On systems where the directory entry contains the file type, the record -has a third field (also separated by a slash) which is a single letter -indicating the type of the file: +has a third field (also separated by a slash), which is a single letter +indicating the type of the file. The letters and their corresponding file +types are shown in @ref{table-readdir-file-types}. +@float Table,table-readdir-file-types +@caption{File types returned by the @code{readdir} extension} @multitable @columnfractions .1 .9 -@headitem Letter @tab File Type +@headitem Letter @tab File type @item @code{b} @tab Block device @item @code{c} @tab Character device @item @code{d} @tab Directory @@ -32470,6 +33812,7 @@ @item @code{s} @tab Socket @item @code{u} @tab Anything else (unknown) @end multitable +@end float On systems without the file type information, the third field is always @samp{u}. @@ -32487,14 +33830,14 @@ @@load "readdir" @dots{} BEGIN @{ FS = "/" @} -@{ print "file name is", $2 @} +@{ print "@value{FN} is", $2 @} @end example @node Extension Sample Revout @subsection Reversing Output The @code{revoutput} extension adds a simple output wrapper that reverses -the characters in each output line. It's main purpose is to show how to +the characters in each output line. Its main purpose is to show how to write an output wrapper, although it may be mildly amusing for the unwary. Here is an example: @@ -32504,19 +33847,18 @@ BEGIN @{ REVOUT = 1 - print "hello, world" > "/dev/stdout" + print "don't panic" > "/dev/stdout" @} @end example -The output from this program is: -@samp{dlrow ,olleh}. +The output from this program is @samp{cinap t'nod}. @node Extension Sample Rev2way @subsection Two-Way I/O Example The @code{revtwoway} extension adds a simple two-way processor that reverses the characters in each line sent to it for reading back by -the @command{awk} program. It's main purpose is to show how to write +the @command{awk} program. Its main purpose is to show how to write a two-way processor, although it may also be mildly amusing. The following example shows how to use it: @@ -32526,25 +33868,37 @@ BEGIN @{ cmd = "/magic/mirror" - print "hello, world" |& cmd + print "don't panic" |& cmd cmd |& getline result print result close(cmd) @} @end example +The output from this program +@ifnotinfo +also is: +@end ifnotinfo +@ifinfo +is: +@end ifinfo +@samp{cinap t'nod}. + @node Extension Sample Read write array -@subsection Dumping and Restoring An Array +@subsection Dumping and Restoring an Array The @code{rwarray} extension adds two functions, named @code{writea()} and @code{reada()}, as follows: @table @code +@item @@load "rwarray" +This is how you load the extension. + @cindex @code{writea()} extension function @item ret = writea(file, array) This function takes a string argument, which is the name of the file -to which dump the array, and the array itself as the second argument. -@code{writea()} understands multidimensional arrays. It returns one on +to which to dump the array, and the array itself as the second argument. +@code{writea()} understands arrays of arrays. It returns one on success, or zero upon failure. @cindex @code{reada()} extension function @@ -32552,12 +33906,12 @@ @code{reada()} is the inverse of @code{writea()}; it reads the file named as its first argument, filling in the array named as the second argument. It clears the array first. -Here too, the return value is one on success and zero upon failure. +Here too, the return value is one on success, or zero upon failure. @end table The array created by @code{reada()} is identical to that written by @code{writea()} in the sense that the contents are the same. However, -due to implementation issues, the array traversal order of the recreated +due to implementation issues, the array traversal order of the re-created array is likely to be different from that of the original array. As array traversal order in @command{awk} is by default undefined, this is (technically) not a problem. If you need to guarantee a particular traversal @@ -32565,7 +33919,7 @@ (@pxref{Array Sorting}). The file contains binary data. All integral values are written in network -byte order. However, double precision floating-point values are written +byte order. However, double-precision floating-point values are written as native binary data. Thus, arrays containing only string data can theoretically be dumped on systems with one byte order and restored on systems with a different one, but this has not been tried. @@ -32581,7 +33935,7 @@ @end example @node Extension Sample Readfile -@subsection Reading An Entire File +@subsection Reading an Entire File The @code{readfile} extension adds a single function named @code{readfile()}, and an input parser: @@ -32615,23 +33969,11 @@ @} @end example -@node Extension Sample API Tests -@subsection API Tests -@cindex @code{testext} extension - -The @code{testext} extension exercises parts of the extension API that -are not tested by the other samples. The @file{extension/testext.c} -file contains both the C code for the extension and @command{awk} -test code inside C comments that run the tests. The testing framework -extracts the @command{awk} code and runs the tests. See the source file -for more information. - @node Extension Sample Time @subsection Extension Time Functions -These functions can be used either by invoking @command{gawk} -with a command-line argument of @samp{-l time} or by -inserting @samp{@@load "time"} in your script. +The @code{time} extension adds two functions, named @code{gettimeofday()} +and @code{sleep()}, as follows: @table @code @item @@load "time" @@ -32640,11 +33982,11 @@ @cindex @code{gettimeofday()} extension function @item the_time = gettimeofday() Return the time in seconds that has elapsed since 1970-01-01 UTC as a -floating point value. If the time is unavailable on this platform, return +floating-point value. If the time is unavailable on this platform, return @minus{}1 and set @code{ERRNO}. The returned time should have sub-second precision, but the actual precision may vary based on the platform. If the standard C @code{gettimeofday()} system call is available on this -platform, then it simply returns the value. Otherwise, if on Windows, +platform, then it simply returns the value. Otherwise, if on MS-Windows, it tries to use @code{GetSystemTimeAsFileTime()}. @cindex @code{sleep()} extension function @@ -32652,11 +33994,22 @@ Attempt to sleep for @var{seconds} seconds. If @var{seconds} is negative, or the attempt to sleep fails, return @minus{}1 and set @code{ERRNO}. Otherwise, return zero after sleeping for the indicated amount of time. -Note that @var{seconds} may be a floating-point (non-integral) value. +Note that @var{seconds} may be a floating-point (nonintegral) value. Implementation details: depending on platform availability, this function tries to use @code{nanosleep()} or @code{select()} to implement the delay. @end table +@node Extension Sample API Tests +@subsection API Tests +@cindex @code{testext} extension + +The @code{testext} extension exercises parts of the extension API that +are not tested by the other samples. The @file{extension/testext.c} +file contains both the C code for the extension and @command{awk} +test code inside C comments that run the tests. The testing framework +extracts the @command{awk} code and runs the tests. See the source file +for more information. + @node gawkextlib @section The @code{gawkextlib} Project @cindex @code{gawkextlib} @@ -32668,35 +34021,37 @@ processing XML files. This is the evolution of the original @command{xgawk} (XML @command{gawk}) project. -As of this writing, there are five extensions: +As of this writing, there are seven extensions: -@itemize @bullet +@itemize @value{BULLET} @item -XML parser extension, using the @uref{http://expat.sourceforge.net, Expat} -XML parsing library. +@code{errno} extension @item -PDF extension. +GD graphics library extension @item -PostgreSQL extension. +PDF extension @item -GD graphics library extension. +PostgreSQL extension @item -MPFR library extension. -This provides access to a number of MPFR functions which @command{gawk}'s -native MPFR support does not. -@end itemize +MPFR library extension +(this provides access to a number of MPFR functions that @command{gawk}'s +native MPFR support does not) + +@item +Redis extension -The @code{time} extension described earlier (@pxref{Extension Sample -Time}) was originally from this project but has been moved in to the -main @command{gawk} distribution. +@item +XML parser extension, using the @uref{http://expat.sourceforge.net, Expat} +XML parsing library +@end itemize @cindex @command{git} utility You can check out the code for the @code{gawkextlib} project -using the @uref{http://git-scm.com, GIT} distributed source +using the @uref{http://git-scm.com, Git} distributed source code control system. The command is as follows: @example @@ -32712,7 +34067,7 @@ @uref{http://www.gnu.org/software/automake, Automake}, @uref{http://www.gnu.org/software/libtool, Libtool}, and -@uref{http://www.gnu.org/software/gettext, Gettext}). +@uref{http://www.gnu.org/software/gettext, GNU @command{gettext}}). The simple recipe for building and testing @code{gawkextlib} is as follows. First, build and install @command{gawk}: @@ -32724,80 +34079,244 @@ make install @ii{Install gawk} @end example -Next, build @code{gawkextlib} and test it: - -@example -cd .../path/to/gawkextlib-code -./update-autotools @ii{Generate configure, etc.} - @ii{You may have to run this command twice} -./configure --with-gawk=/tmp/newgawk @ii{Configure, point at ``installed'' gawk} -make && make check @ii{Build and check that all is OK} -make install @ii{Install the extensions} -@end example - -If you have installed @command{gawk} in the standard way, then you -will likely not need the @option{--with-gawk} option when configuring -@code{gawkextlib}. You may also need to use the @command{sudo} utility +Next, go to @url{http://sourceforge.net/projects/gawkextlib/files} to +download @code{gawkextlib} and any extensions that you would like to build. +The @file{README} file at that site explains how to build the code. If you +installed @command{gawk} in a non-standard location, you will need to +specify @code{./configure --with-gawk=@var{/path/to/gawk}} to find it. +You may need to use the @command{sudo} utility to install both @command{gawk} and @code{gawkextlib}, depending upon how your system works. If you write an extension that you wish to share with other -@command{gawk} users, please consider doing so through the +@command{gawk} users, consider doing so through the @code{gawkextlib} project. -See the project's web site for more information. +See the project's website for more information. -@iftex -@part Part IV:@* Appendices -@end iftex +@node Extension summary +@section Summary + +@itemize @value{BULLET} +@item +You can write extensions (sometimes called plug-ins) for @command{gawk} +in C or C++ using the application programming interface (API) defined +by the @command{gawk} developers. + +@item +Extensions must have a license compatible with the GNU General Public +License (GPL), and they must assert that fact by declaring a variable +named @code{plugin_is_GPL_compatible}. + +@item +Communication between @command{gawk} and an extension is two-way. +@command{gawk} passes a @code{struct} to the extension that contains +various data fields and function pointers. The extension can then call +into @command{gawk} via the supplied function pointers to accomplish +certain tasks. + +@item +One of these tasks is to ``register'' the name and implementation of +new @command{awk}-level functions with @command{gawk}. The implementation +takes the form of a C function pointer with a defined signature. +By convention, implementation functions are named @code{do_@var{XXXX}()} +for some @command{awk}-level function @code{@var{XXXX}()}. + +@item +The API is defined in a header file named @file{gawkapi.h}. You must include +a number of standard header files @emph{before} including it in your source file. + +@item +API function pointers are provided for the following kinds of operations: + +@itemize @value{BULLET} +@item +Allocating, reallocating, and releasing memory + +@item +Registration functions (you may register +extension functions, +exit callbacks, +a version string, +input parsers, +output wrappers, +and two-way processors) + +@item +Printing fatal, warning, and ``lint'' warning messages + +@item +Updating @code{ERRNO}, or unsetting it + +@item +Accessing parameters, including converting an undefined parameter into +an array + +@item +Symbol table access (retrieving a global variable, creating one, +or changing one) + +@item +Creating and releasing cached values; this provides an +efficient way to use values for multiple variables and +can be a big performance win + +@item +Manipulating arrays +(retrieving, adding, deleting, and modifying elements; +getting the count of elements in an array; +creating a new array; +clearing an array; +and +flattening an array for easy C-style looping over all its indices and elements) +@end itemize + +@item +The API defines a number of standard data types for representing +@command{awk} values, array elements, and arrays. + +@item +The API provides convenience functions for constructing values. +It also provides memory management functions to ensure compatibility +between memory allocated by @command{gawk} and memory allocated by an +extension. + +@item +@emph{All} memory passed from @command{gawk} to an extension must be +treated as read-only by the extension. + +@item +@emph{All} memory passed from an extension to @command{gawk} must come from +the API's memory allocation functions. @command{gawk} takes responsibility for +the memory and releases it when appropriate. + +@item +The API provides information about the running version of @command{gawk} so +that an extension can make sure it is compatible with the @command{gawk} +that loaded it. + +@item +It is easiest to start a new extension by copying the boilerplate code +described in this @value{CHAPTER}. Macros in the @file{gawkapi.h} header +file make this easier to do. + +@item +The @command{gawk} distribution includes a number of small but useful +sample extensions. The @code{gawkextlib} project includes several more +(larger) extensions. If you wish to write an extension and contribute it +to the community of @command{gawk} users, the @code{gawkextlib} project +is the place to do so. + +@end itemize + +@c EXCLUDE START +@node Extension Exercises +@section Exercises + +@enumerate +@item +Add functions to implement system calls such as @code{chown()}, +@code{chmod()}, and @code{umask()} to the file operations extension +presented in @ref{Internal File Ops}. + +@c Idea from comp.lang.awk, February 2015 +@item +Write an input parser that prints a prompt if the input is +a from a ``terminal'' device. You can use the @code{isatty()} +function to tell if the input file is a terminal. (Hint: this function +is usually expensive to call; try to call it just once.) +The content of the prompt should come from a variable settable +by @command{awk}-level code. +You can write the prompt to stanard error. However, +for best results, open a new file descriptor (or file pointer) +on @file{/dev/tty} and print the prompt there, in case standard +error has been redirected. + +Why is standard error a better +choice than standard output for writing the prompt? +Which reading mechanism should you replace, the one to get +a record, or the one to read raw bytes? + +@item +(Hard.) +How would you provide namespaces in @command{gawk}, so that the +names of functions in different extensions don't conflict with each other? +If you come up with a really good scheme, contact the @command{gawk} +maintainer to tell him about it. + +@item +Write a wrapper script that provides an interface similar to +@samp{sed -i} for the ``inplace'' extension presented in +@ref{Extension Sample Inplace}. + +@end enumerate +@c EXCLUDE END + +@ifnotinfo +@part @value{PART4}Appendices +@end ifnotinfo -@ignore @ifdocbook -@part Part IV:@* Appendices +@ifclear FOR_PRINT +Part IV contains the appendices (including the two licenses that cover +the @command{gawk} source code and this @value{DOCUMENT}, respectively) +and the Glossary: +@end ifclear -Part IV provides the appendices, the Glossary, and two licenses that cover -the @command{gawk} source code and this @value{DOCUMENT}, respectively. -It contains the following appendices: +@ifset FOR_PRINT +Part IV contains three appendices, the last of which is the license that +covers the @command{gawk} source code: +@end ifset -@itemize @bullet +@itemize @value{BULLET} @item -@ref{Language History}. +@ref{Language History} @item -@ref{Installation}. +@ref{Installation} +@ifclear FOR_PRINT @item -@ref{Notes}. +@ref{Notes} @item -@ref{Basic Concepts}. +@ref{Basic Concepts} @item -@ref{Glossary}. +@ref{Glossary} +@end ifclear @item -@ref{Copying}. +@ref{Copying} +@ifclear FOR_PRINT @item -@ref{GNU Free Documentation License}. +@ref{GNU Free Documentation License} +@end ifclear @end itemize @end ifdocbook -@end ignore @node Language History @appendix The Evolution of the @command{awk} Language -This @value{DOCUMENT} describes the GNU implementation of @command{awk}, which follows -the POSIX specification. -Many long-time @command{awk} users learned @command{awk} programming -with the original @command{awk} implementation in Version 7 Unix. -(This implementation was the basis for @command{awk} in Berkeley Unix, -through 4.3-Reno. Subsequent versions of Berkeley Unix, and some systems -derived from 4.4BSD-Lite, use various versions of @command{gawk} -for their @command{awk}.) -This @value{CHAPTER} briefly describes the -evolution of the @command{awk} language, with cross-references to other parts -of the @value{DOCUMENT} where you can find more information. +This @value{DOCUMENT} describes the GNU implementation of @command{awk}, +which follows the POSIX specification. Many longtime @command{awk} +users learned @command{awk} programming with the original @command{awk} +implementation in Version 7 Unix. (This implementation was the basis for +@command{awk} in Berkeley Unix, through 4.3-Reno. Subsequent versions +of Berkeley Unix, and, for a while, some systems derived from 4.4BSD-Lite, used various +versions of @command{gawk} for their @command{awk}.) This @value{CHAPTER} +briefly describes the evolution of the @command{awk} language, with +cross-references to other parts of the @value{DOCUMENT} where you can +find more information. + +@ifset FOR_PRINT +To save space, we have omitted +information on the history of features in @command{gawk} from this +edition. You can find it in the +@uref{http://www.gnu.org/software/gawk/manual/html_node/Feature-History.html, +online documentation}. +@end ifset @menu * V7/SVR3.1:: The major changes between V7 and System V @@ -32813,13 +34332,12 @@ * Common Extensions:: Common Extensions Summary. * Ranges and Locales:: How locales used to affect regexp ranges. * Contributors:: The major contributors to @command{gawk}. +* History summary:: History summary. @end menu @node V7/SVR3.1 @appendixsec Major Changes Between V7 and SVR3.1 -@c STARTOFRANGE gawkv @cindex @command{awk}, versions of -@c STARTOFRANGE gawkv1 @cindex @command{awk}, versions of, changes between V7 and SVR3.1 The @command{awk} language evolved considerably between the release of @@ -32827,89 +34345,85 @@ System V Release 3.1 (1987). This @value{SECTION} summarizes the changes, with cross-references to further details: -@itemize @bullet +@itemize @value{BULLET} @item The requirement for @samp{;} to separate rules on a line -(@pxref{Statements/Lines}). +(@pxref{Statements/Lines}) @item User-defined functions and the @code{return} statement -(@pxref{User-defined}). +(@pxref{User-defined}) @item The @code{delete} statement (@pxref{Delete}). @item The @code{do}-@code{while} statement -(@pxref{Do Statement}). +(@pxref{Do Statement}) @item The built-in functions @code{atan2()}, @code{cos()}, @code{sin()}, @code{rand()}, and -@code{srand()} (@pxref{Numeric Functions}). +@code{srand()} (@pxref{Numeric Functions}) @item The built-in functions @code{gsub()}, @code{sub()}, and @code{match()} -(@pxref{String Functions}). +(@pxref{String Functions}) @item The built-in functions @code{close()} and @code{system()} -(@pxref{I/O Functions}). +(@pxref{I/O Functions}) @item The @code{ARGC}, @code{ARGV}, @code{FNR}, @code{RLENGTH}, @code{RSTART}, -and @code{SUBSEP} built-in variables (@pxref{Built-in Variables}). +and @code{SUBSEP} predefined variables (@pxref{Built-in Variables}) @item -Assignable @code{$0} (@pxref{Changing Fields}). +Assignable @code{$0} (@pxref{Changing Fields}) @item The conditional expression using the ternary operator @samp{?:} -(@pxref{Conditional Exp}). +(@pxref{Conditional Exp}) @item -The expression @samp{@var{index-variable} in @var{array}} outside of @code{for} -statements (@pxref{Reference to Elements}). +The expression @samp{@var{indx} in @var{array}} outside of @code{for} +statements (@pxref{Reference to Elements}) @item The exponentiation operator @samp{^} (@pxref{Arithmetic Ops}) and its assignment operator -form @samp{^=} (@pxref{Assignment Ops}). +form @samp{^=} (@pxref{Assignment Ops}) @item C-compatible operator precedence, which breaks some old @command{awk} -programs (@pxref{Precedence}). +programs (@pxref{Precedence}) @item Regexps as the value of @code{FS} (@pxref{Field Separators}) and as the third argument to the @code{split()} function (@pxref{String Functions}), rather than using only the first character -of @code{FS}. +of @code{FS} @item Dynamic regexps as operands of the @samp{~} and @samp{!~} operators -(@pxref{Regexp Usage}). +(@pxref{Computed Regexps}) @item The escape sequences @samp{\b}, @samp{\f}, and @samp{\r} -(@pxref{Escape Sequences}). -(Some vendors have updated their old versions of @command{awk} to -recognize @samp{\b}, @samp{\f}, and @samp{\r}, but this is not -something you can rely on.) +(@pxref{Escape Sequences}) @item Redirection of input for the @code{getline} function -(@pxref{Getline}). +(@pxref{Getline}) @item Multiple @code{BEGIN} and @code{END} rules -(@pxref{BEGIN/END}). +(@pxref{BEGIN/END}) @item Multidimensional arrays -(@pxref{Multidimensional}). +(@pxref{Multidimensional}) @end itemize -@c ENDOFRANGE gawkv1 @node SVR4 @appendixsec Changes Between SVR3.1 and SVR4 @@ -32918,56 +34432,56 @@ The System V Release 4 (1989) version of Unix @command{awk} added these features (some of which originated in @command{gawk}): -@itemize @bullet +@itemize @value{BULLET} @item -The @code{ENVIRON} array (@pxref{Built-in Variables}). +The @code{ENVIRON} array (@pxref{Built-in Variables}) @c gawk and MKS awk @item Multiple @option{-f} options on the command line -(@pxref{Options}). +(@pxref{Options}) @c MKS awk @item The @option{-v} option for assigning variables before program execution begins -(@pxref{Options}). +(@pxref{Options}) @c GNU, Bell Laboratories & MKS together @item -The @option{--} option for terminating command-line options. +The @option{--} signal for terminating command-line options @item The @samp{\a}, @samp{\v}, and @samp{\x} escape sequences -(@pxref{Escape Sequences}). +(@pxref{Escape Sequences}) @c GNU, for ANSI C compat @item A defined return value for the @code{srand()} built-in function -(@pxref{Numeric Functions}). +(@pxref{Numeric Functions}) @item The @code{toupper()} and @code{tolower()} built-in string functions for case translation -(@pxref{String Functions}). +(@pxref{String Functions}) @item A cleaner specification for the @samp{%c} format-control letter in the @code{printf} function -(@pxref{Control Letters}). +(@pxref{Control Letters}) @item The ability to dynamically pass the field width and precision (@code{"%*.*d"}) -in the argument list of the @code{printf} function -(@pxref{Control Letters}). +in the argument list of @code{printf} and @code{sprintf()} +(@pxref{Control Letters}) @item The use of regexp constants, such as @code{/foo/}, as expressions, where they are equivalent to using the matching operator, as in @samp{$0 ~ /foo/} -(@pxref{Using Constant Regexps}). +(@pxref{Using Constant Regexps}) @item Processing of escape sequences inside command-line variable assignments -(@pxref{Assignment Options}). +(@pxref{Assignment Options}) @end itemize @node POSIX @@ -32978,53 +34492,52 @@ The POSIX Command Language and Utilities standard for @command{awk} (1992) introduced the following changes into the language: -@itemize @bullet +@itemize @value{BULLET} @item The use of @option{-W} for implementation-specific options -(@pxref{Options}). +(@pxref{Options}) @item The use of @code{CONVFMT} for controlling the conversion of numbers -to strings (@pxref{Conversion}). +to strings (@pxref{Conversion}) @item The concept of a numeric string and tighter comparison rules to go -with it (@pxref{Typing and Comparison}). +with it (@pxref{Typing and Comparison}) @item -The use of built-in variables as function parameter names is forbidden -(@pxref{Definition Syntax}. +The use of predefined variables as function parameter names is forbidden +(@pxref{Definition Syntax}) @item More complete documentation of many of the previously undocumented -features of the language. +features of the language @end itemize In 2012, a number of extensions that had been commonly available for many years were finally added to POSIX. They are: -@itemize @bullet +@itemize @value{BULLET} @item The @code{fflush()} built-in function for flushing buffered output -(@pxref{I/O Functions}). +(@pxref{I/O Functions}) @item The @code{nextfile} statement -(@pxref{Nextfile Statement}). +(@pxref{Nextfile Statement}) @item The ability to delete all of an array at once with @samp{delete @var{array}} -(@pxref{Delete}). +(@pxref{Delete}) @end itemize -@xref{Common Extensions}, for a list of common extensions +@DBXREF{Common Extensions} for a list of common extensions not permitted by the POSIX standard. The 2008 POSIX standard can be found online at @url{http://www.opengroup.org/onlinepubs/9699919799/}. -@c ENDOFRANGE gawkv @node BTL @appendixsec Extensions in Brian Kernighan's @command{awk} @@ -33038,43 +34551,40 @@ (@pxref{Other Versions}). This @value{SECTION} describes common extensions that -originally appeared in his version of @command{awk}. +originally appeared in his version of @command{awk}: -@itemize @bullet +@itemize @value{BULLET} @item The @samp{**} and @samp{**=} operators (@pxref{Arithmetic Ops} and -@ref{Assignment Ops}). +@ref{Assignment Ops}) @item The use of @code{func} as an abbreviation for @code{function} -(@pxref{Definition Syntax}). +(@pxref{Definition Syntax}) @item The @code{fflush()} built-in function for flushing buffered output -(@pxref{I/O Functions}). +(@pxref{I/O Functions}) @ignore @item The @code{SYMTAB} array, that allows access to @command{awk}'s internal symbol -table. This feature is not documented, largely because +table. This feature was never documented for his @command{awk}, largely because it is somewhat shakily implemented. For instance, you cannot access arrays -or array elements through it. +or array elements through it @end ignore @end itemize -@xref{Common Extensions}, for a full list of the extensions +@DBXREF{Common Extensions} for a full list of the extensions available in his @command{awk}. @node POSIX/GNU @appendixsec Extensions in @command{gawk} Not in POSIX @command{awk} -@c STARTOFRANGE fripls @cindex compatibility mode (@command{gawk}), extensions -@c STARTOFRANGE exgnot @cindex extensions, in @command{gawk}, not in POSIX @command{awk} -@c STARTOFRANGE posnot @cindex POSIX, @command{gawk} extensions not included in The GNU implementation, @command{gawk}, adds a large number of features. They can all be disabled with either the @option{--traditional} or @@ -33085,15 +34595,15 @@ summarizes the additional features over POSIX @command{awk} that are in the current version of @command{gawk}. -@itemize @bullet +@itemize @value{BULLET} @item -Additional built-in variables: +Additional predefined variables: -@itemize @minus +@itemize @value{MINUS} @item The -@code{ARGIND} +@code{ARGIND}, @code{BINMODE}, @code{ERRNO}, @code{FIELDWIDTHS}, @@ -33105,122 +34615,128 @@ and @code{TEXTDOMAIN} variables -(@pxref{Built-in Variables}). +(@pxref{Built-in Variables}) @end itemize @item Special files in I/O redirections: -@itemize @minus{} +@itemize @value{MINUS} @item -The @file{/dev/stdin}, @file{/dev/stdout}, @file{/dev/stderr} and -@file{/dev/fd/@var{N}} special file names -(@pxref{Special Files}). +The @file{/dev/stdin}, @file{/dev/stdout}, @file{/dev/stderr}, and +@file{/dev/fd/@var{N}} special @value{FN}s +(@pxref{Special Files}) @item The @file{/inet}, @file{/inet4}, and @samp{/inet6} special files for TCP/IP networking using @samp{|&} to specify which version of the -IP protocol to use. -(@pxref{TCP/IP Networking}). +IP protocol to use +(@pxref{TCP/IP Networking}) @end itemize @item Changes and/or additions to the language: -@itemize @minus{} +@itemize @value{MINUS} @item The @samp{\x} escape sequence -(@pxref{Escape Sequences}). +(@pxref{Escape Sequences}) @item Full support for both POSIX and GNU regexps -(@pxref{Regexp}). +(@pxref{Regexp}) @item The ability for @code{FS} and for the third argument to @code{split()} to be null strings -(@pxref{Single Character Fields}). +(@pxref{Single Character Fields}) @item The ability for @code{RS} to be a regexp -(@pxref{Records}). +(@pxref{Records}) @item The ability to use octal and hexadecimal constants in @command{awk} program source code -(@pxref{Nondecimal-numbers}). +(@pxref{Nondecimal-numbers}) @item The @samp{|&} operator for two-way I/O to a coprocess -(@pxref{Two-way I/O}). +(@pxref{Two-way I/O}) @item Indirect function calls -(@pxref{Indirect Calls}). +(@pxref{Indirect Calls}) @item Directories on the command line produce a warning and are skipped -(@pxref{Command line directories}). +(@pxref{Command-line directories}) @end itemize @item New keywords: -@itemize @minus{} -@item -The @code{BEGINFILE} and @code{ENDFILE} special patterns. -(@pxref{BEGINFILE/ENDFILE}). - -@item -The ability to delete all of an array at once with @samp{delete @var{array}} -(@pxref{Delete}). - +@itemize @value{MINUS} @item -The @code{nextfile} statement -(@pxref{Nextfile Statement}). +The @code{BEGINFILE} and @code{ENDFILE} special patterns +(@pxref{BEGINFILE/ENDFILE}) @item The @code{switch} statement -(@pxref{Switch Statement}). +(@pxref{Switch Statement}) @end itemize @item Changes to standard @command{awk} functions: -@itemize @minus +@itemize @value{MINUS} @item The optional second argument to @code{close()} that allows closing one end of a two-way pipe to a coprocess -(@pxref{Two-way I/O}). +(@pxref{Two-way I/O}) @item -POSIX compliance for @code{gsub()} and @code{sub()}. +POSIX compliance for @code{gsub()} and @code{sub()} with @option{--posix} @item The @code{length()} function accepts an array argument and returns the number of elements in the array -(@pxref{String Functions}). +(@pxref{String Functions}) @item The optional third argument to the @code{match()} function for capturing text-matching subexpressions within a regexp -(@pxref{String Functions}). +(@pxref{String Functions}) @item Positional specifiers in @code{printf} formats for making translations easier -(@pxref{Printf Ordering}). +(@pxref{Printf Ordering}) @item The @code{split()} function's additional optional fourth -argument which is an array to hold the text of the field separators. -(@pxref{String Functions}). +argument, which is an array to hold the text of the field separators +(@pxref{String Functions}) @end itemize @item Additional functions only in @command{gawk}: -@itemize @minus +@itemize @value{MINUS} +@item +The @code{gensub()}, @code{patsplit()}, and @code{strtonum()} functions +for more powerful text manipulation +(@pxref{String Functions}) + +@item +The @code{asort()} and @code{asorti()} functions for sorting arrays +(@pxref{Array Sorting}) + +@item +The @code{mktime()}, @code{systime()}, and @code{strftime()} +functions for working with timestamps +(@pxref{Time Functions}) + @item The @code{and()}, @@ -33231,48 +34747,32 @@ and @code{xor()} functions for bit manipulation -(@pxref{Bitwise Functions}). +(@pxref{Bitwise Functions}) @c In 4.1, and(), or() and xor() grew the ability to take > 2 arguments @item -The @code{asort()} and @code{asorti()} functions for sorting arrays -(@pxref{Array Sorting}). +The @code{isarray()} function to check if a variable is an array or not +(@pxref{Type Functions}) @item -The @code{bindtextdomain()}, @code{dcgettext()} and @code{dcngettext()} +The @code{bindtextdomain()}, @code{dcgettext()}, and @code{dcngettext()} functions for internationalization -(@pxref{Programmer i18n}). - -@item -The @code{fflush()} function from Brian Kernighan's -version of @command{awk} -(@pxref{I/O Functions}). - -@item -The @code{gensub()}, @code{patsplit()}, and @code{strtonum()} functions -for more powerful text manipulation -(@pxref{String Functions}). - -@item -The @code{mktime()}, @code{systime()}, and @code{strftime()} -functions for working with timestamps -(@pxref{Time Functions}). +(@pxref{Programmer i18n}) @end itemize - @item Changes and/or additions in the command-line options: -@itemize @minus +@itemize @value{MINUS} @item The @env{AWKPATH} environment variable for specifying a path search for the @option{-f} command-line option -(@pxref{Options}). +(@pxref{Options}) @item The @env{AWKLIBPATH} environment variable for specifying a path search for the @option{-l} command-line option -(@pxref{Options}). +(@pxref{Options}) @item The @@ -33301,7 +34801,7 @@ and @option{-V} short options. Also, the -ability to use GNU-style long-named options that start with @option{--} +ability to use GNU-style long-named options that start with @option{--}, and the @option{--assign}, @option{--bignum}, @@ -33309,7 +34809,7 @@ @option{--copyright}, @option{--debug}, @option{--dump-variables}, -@option{--execle}, +@option{--exec}, @option{--field-separator}, @option{--file}, @option{--gen-pot}, @@ -33338,10 +34838,10 @@ @item Support for the following obsolete systems was removed from the code -and the documentation for @command{gawk} version 4.0: +and the documentation for @command{gawk} @value{PVERSION} 4.0: @c nested table -@itemize @minus +@itemize @value{MINUS} @item Amiga @@ -33380,14 +34880,23 @@ @end itemize +@item +Support for the following obsolete system was removed from the code +for @command{gawk} @value{PVERSION} 4.1: + +@c nested table +@itemize @value{MINUS} +@item +Ultrix +@end itemize + @end itemize @c XXX ADD MORE STUFF HERE -@c ENDOFRANGE fripls -@c ENDOFRANGE exgnot -@c ENDOFRANGE posnot +@c This does not need to be in the formal book. +@ifclear FOR_PRINT @node Feature History @appendixsec History of @command{gawk} Features @@ -33417,7 +34926,7 @@ Version 2.10 of @command{gawk} introduced the following features: -@itemize @bullet +@itemize @value{BULLET} @item The @env{AWKPATH} environment variable for specifying a path search for the @option{-f} command-line option @@ -33429,13 +34938,13 @@ @item The @file{/dev/stdin}, @file{/dev/stdout}, @file{/dev/stderr} and -@file{/dev/fd/@var{N}} special file names +@file{/dev/fd/@var{N}} special @value{FN}s (@pxref{Special Files}). @end itemize Version 2.13 of @command{gawk} introduced the following features: -@itemize @bullet +@itemize @value{BULLET} @item The @code{FIELDWIDTHS} variable and its effects (@pxref{Constant Size}). @@ -33449,7 +34958,7 @@ Additional command-line options (@pxref{Options}): -@itemize @minus +@itemize @value{MINUS} @item The @option{-W lint} option to provide error and portability checking for both the source code and at runtime. @@ -33464,19 +34973,19 @@ Version 2.14 of @command{gawk} introduced the following feature: -@itemize @bullet +@itemize @value{BULLET} @item -The @code{next file} statement for skipping to the next data file +The @code{next file} statement for skipping to the next @value{DF} (@pxref{Nextfile Statement}). @end itemize Version 2.15 of @command{gawk} introduced the following features: -@itemize @bullet +@itemize @value{BULLET} @item New variables (@pxref{Built-in Variables}): -@itemize @minus +@itemize @value{MINUS} @item @code{ARGIND}, which tracks the movement of @code{FILENAME} through @code{ARGV}. @@ -33488,17 +34997,17 @@ @item The @file{/dev/pid}, @file{/dev/ppid}, @file{/dev/pgrpid}, and -@file{/dev/user} special file names. These have since been removed. +@file{/dev/user} special @value{FN}s. These have since been removed. @item The ability to delete all of an array at once with @samp{delete @var{array}} (@pxref{Delete}). @item -Command line option changes +Command-line option changes (@pxref{Options}): -@itemize @minus +@itemize @value{MINUS} @item The ability to use GNU-style long-named options that start with @option{--}. @@ -33510,11 +35019,11 @@ Version 3.0 of @command{gawk} introduced the following features: -@itemize @bullet +@itemize @value{BULLET} @item New or changed variables: -@itemize @minus +@itemize @value{MINUS} @item @code{IGNORECASE} changed, now applying to string comparison as well as regexp operations @@ -33552,14 +35061,15 @@ (@pxref{Nextfile Statement}). @item -The @code{fflush()} function from the -Bell Laboratories research version of @command{awk} -(@pxref{I/O Functions}). +The @code{fflush()} function from +BWK @command{awk} +(then at Bell Laboratories; +@pxref{I/O Functions}). @item -New command line options: +New command-line options: -@itemize @minus +@itemize @value{MINUS} @item The @option{--lint-old} option to warn about constructs that are not available in @@ -33567,9 +35077,9 @@ (@pxref{V7/SVR3.1}). @item -The @option{-m} option from the -Bell Laboratories research version of @command{awk} -This was later removed. +The @option{-m} option from BWK @command{awk}. (Brian was +still at Bell Laboratories at the time.) This was later removed from +both his @command{awk} and from @command{gawk}. @item The @option{--re-interval} option to provide interval expressions in regexps @@ -33586,17 +35096,18 @@ @item Amiga support. +This has since been removed. @end itemize Version 3.1 of @command{gawk} introduced the following features: -@itemize @bullet +@itemize @value{BULLET} @item New variables (@pxref{Built-in Variables}): -@itemize @minus +@itemize @value{MINUS} @item @code{BINMODE}, for non-POSIX systems, which allows binary I/O for input and/or output files @@ -33644,7 +35155,7 @@ @item A number of new built-in functions: -@itemize @minus +@itemize @value{MINUS} @item The @code{asort()} and @code{asorti()} functions for sorting arrays (@pxref{Array Sorting}). @@ -33675,10 +35186,10 @@ (@pxref{Nextfile Statement}). @item -Additional commnd line options +Additional command-line options (@pxref{Options}): -@itemize @minus +@itemize @value{MINUS} @item The @option{--dump-variables} option to print a list of all global variables. @@ -33712,7 +35223,7 @@ (@pxref{Quick Installation}). @item -The use of GNU @code{gettext} for @command{gawk}'s own message output +The use of GNU @command{gettext} for @command{gawk}'s own message output (@pxref{Gawk I18N}). @item @@ -33722,7 +35233,8 @@ Tandem support. This was later removed. @item -The Atari port became officially unsupported. +The Atari port became officially unsupported and was +later removed entirely. @item The source code changed to use ISO C standard-style function definitions. @@ -33744,12 +35256,12 @@ Version 4.0 of @command{gawk} introduced the following features: -@itemize @bullet +@itemize @value{BULLET} @item Variable additions: -@itemize @minus +@itemize @value{MINUS} @item @code{FPAT}, which allows you to specify a regexp that matches the fields, instead of matching the field separator @@ -33807,7 +35319,7 @@ (@pxref{String Functions}). @item -The behavior of @code{fflush()} changed to match Brian Kernighan's @command{awk} +The behavior of @code{fflush()} changed to match BWK @command{awk} and for POSIX; now both @samp{fflush()} and @samp{fflush("")} flush all open output redirections (@pxref{I/O Functions}). @@ -33815,7 +35327,7 @@ @item The @code{isarray()} function which distinguishes if an item is an array -or not, to make it possible to traverse multidimensional arrays +or not, to make it possible to traverse arrays of arrays (@pxref{Type Functions}). @item @@ -33845,10 +35357,10 @@ (@pxref{Switch Statement}). @item -Command line option changes +Command-line option changes (@pxref{Options}): -@itemize @minus +@itemize @value{MINUS} @item The @option{-b} and @option{--characters-as-bytes} options which prevent @command{gawk} from treating input as a multibyte string. @@ -33870,7 +35382,7 @@ @item Directories named on the command line now produce a warning, not a fatal error, unless @option{--posix} or @option{--traditional} are used -(@pxref{Command line directories}). +(@pxref{Command-line directories}). @item The @command{gawk} internals were rewritten, bringing the @command{dgawk} @@ -33899,7 +35411,7 @@ @item Support was removed for the following systems: -@itemize @minus +@itemize @value{MINUS} @item Atari @@ -33937,7 +35449,7 @@ Version 4.1 of @command{gawk} introduced the following features: -@itemize @bullet +@itemize @value{BULLET} @item Three new arrays: @@ -33946,13 +35458,13 @@ @item The three executables @command{gawk}, @command{pgawk}, and @command{dgawk}, were merged into -one, named just @command{gawk}. As a result the command line options changed. +one, named just @command{gawk}. As a result the command-line options changed. @item -Command line option changes +Command-line option changes (@pxref{Options}): -@itemize @minus +@itemize @value{MINUS} @item The @option{-D} option invokes the debugger. @@ -33963,11 +35475,11 @@ @item The @option{-l} and @option{--load} options load compiled dynamic extensions. -@item +@item The @option{-M} and @option{--bignum} options enable MPFR. @item -The @option{-o} only does pretty-printing. +The @option{-o} option only does pretty-printing. @item The @option{-p} option is used for profiling. @@ -33978,7 +35490,7 @@ @item Support for high precision arithmetic with MPFR. -(@pxref{Gawk and MPFR}). +(@pxref{Arbitrary Precision Arithmetic}). @item The @code{and()}, @code{or()} and @code{xor()} functions @@ -33990,42 +35502,48 @@ The dynamic extension interface was completely redone (@pxref{Dynamic Extensions}). +@item +Redirected @code{getline} became allowed inside +@code{BEGINFILE} and @code{ENDFILE} +(@pxref{BEGINFILE/ENDFILE}). + +@item +The @code{where} command was added to the debugger +(@pxref{Execution Stack}). + @end itemize @c XXX ADD MORE STUFF HERE +@end ifclear @node Common Extensions @appendixsec Common Extensions Summary @cindex extensions, Brian Kernighan's @command{awk} @cindex extensions, @command{mawk} -This @value{SECTION} summarizes the common extensions supported +The following table summarizes the common extensions supported by @command{gawk}, Brian Kernighan's @command{awk}, and @command{mawk}, -the three most widely-used freely available versions of @command{awk} +the three most widely used freely available versions of @command{awk} (@pxref{Other Versions}). -@multitable {@file{/dev/stderr} special file} {BWK Awk} {Mawk} {GNU Awk} -@headitem Feature @tab BWK Awk @tab Mawk @tab GNU Awk -@item @samp{\x} Escape sequence @tab X @tab X @tab X -@item @code{FS} as null string @tab X @tab X @tab X -@item @file{/dev/stdin} special file @tab X @tab X @tab X -@item @file{/dev/stdout} special file @tab X @tab X @tab X -@item @file{/dev/stderr} special file @tab X @tab X @tab X -@item @code{delete} without subscript @tab X @tab X @tab X -@item @code{fflush()} function @tab X @tab X @tab X -@item @code{length()} of an array @tab X @tab X @tab X -@item @code{nextfile} statement @tab X @tab X @tab X -@item @code{**} and @code{**=} operators @tab X @tab @tab X -@item @code{func} keyword @tab X @tab @tab X -@item @code{BINMODE} variable @tab @tab X @tab X -@item @code{RS} as regexp @tab @tab X @tab X -@item Time related functions @tab @tab X @tab X +@multitable {@file{/dev/stderr} special file} {BWK @command{awk}} {@command{mawk}} {@command{gawk}} {Now standard} +@headitem Feature @tab BWK @command{awk} @tab @command{mawk} @tab @command{gawk} @tab Now standard +@item @samp{\x} escape sequence @tab X @tab X @tab X @tab +@item @code{FS} as null string @tab X @tab X @tab X @tab +@item @file{/dev/stdin} special file @tab X @tab X @tab X @tab +@item @file{/dev/stdout} special file @tab X @tab X @tab X @tab +@item @file{/dev/stderr} special file @tab X @tab X @tab X @tab +@item @code{delete} without subscript @tab X @tab X @tab X @tab X +@item @code{fflush()} function @tab X @tab X @tab X @tab X +@item @code{length()} of an array @tab X @tab X @tab X @tab +@item @code{nextfile} statement @tab X @tab X @tab X @tab X +@item @code{**} and @code{**=} operators @tab X @tab @tab X @tab +@item @code{func} keyword @tab X @tab @tab X @tab +@item @code{BINMODE} variable @tab @tab X @tab X @tab +@item @code{RS} as regexp @tab @tab X @tab X @tab +@item Time-related functions @tab @tab X @tab X @tab @end multitable -(Technically speaking, as of late 2012, @code{fflush()}, @samp{delete @var{array}}, -and @code{nextfile} are no longer extensions, since they have been added -to POSIX.) - @node Ranges and Locales @appendixsec Regexp Ranges and Locales: A Long Sad Story @@ -34039,9 +35557,9 @@ inclusive. Ordering was based on the numeric value of each character in the machine's native character set. Thus, on ASCII-based systems, @samp{[a-z]} matched all the lowercase letters, and only the lowercase -letters, since the numeric values for the letters from @samp{a} through +letters, as the numeric values for the letters from @samp{a} through @samp{z} were contiguous. (On an EBCDIC system, the range @samp{[a-z]} -includes additional, non-alphabetic characters as well.) +includes additional nonalphabetic characters as well.) Almost all introductory Unix literature explained range expressions as working in this fashion, and in particular, would teach that the @@ -34050,8 +35568,8 @@ And indeed, this was true.@footnote{And Life was good.} The 1992 POSIX standard introduced the idea of locales (@pxref{Locales}). -Since many locales include other letters besides the plain twenty-six -letters of the American English alphabet, the POSIX standard added +Because many locales include other letters besides the plain 26 +letters of the English alphabet, the POSIX standard added character classes (@pxref{Bracket Expressions}) as a way to match different kinds of characters besides the traditional ones in the ASCII character set. @@ -34062,14 +35580,15 @@ But outside those locales, the ordering was defined to be based on @dfn{collation order}. +What does that mean? In many locales, @samp{A} and @samp{a} are both less than @samp{B}. In other words, these locales sort characters in dictionary order, and @samp{[a-dx-z]} is typically not equivalent to @samp{[abcdxyz]}; -instead it might be equivalent to @samp{[ABCXYabcdxyz]}, for example. +instead, it might be equivalent to @samp{[ABCXYabcdxyz]}, for example. -This point needs to be emphasized: Much literature teaches that you should +This point needs to be emphasized: much literature teaches that you should use @samp{[a-z]} to match a lowercase character. But on systems with -non-ASCII locales, this also matched all of the uppercase characters +non-ASCII locales, this also matches all of the uppercase characters except @samp{A} or @samp{Z}! This was a continuous cause of confusion, even well into the twenty-first century. @@ -34083,7 +35602,7 @@ @end example @noindent -This output is unexpected, since the @samp{bc} at the end of +This output is unexpected, as the @samp{bc} at the end of @samp{something1234abc} should not normally match @samp{[A-Z]*}. This result is due to the locale setting (and thus you may not see it on your system). @@ -34091,26 +35610,26 @@ @cindex Unicode Similar considerations apply to other ranges. For example, @samp{["-/]} is perfectly valid in ASCII, but is not valid in many Unicode locales, -such as @samp{en_US.UTF-8}. +such as @code{en_US.UTF-8}. Early versions of @command{gawk} used regexp matching code that was not -locale aware, so ranges had their traditional interpretation. +locale-aware, so ranges had their traditional interpretation. When @command{gawk} switched to using locale-aware regexp matchers, the problems began; especially as both GNU/Linux and commercial Unix vendors started implementing non-ASCII locales, @emph{and making them the default}. Perhaps the most frequently asked question became something -like ``why does @samp{[A-Z]} match lowercase letters?!?'' +like, ``Why does @samp{[A-Z]} match lowercase letters?!?'' @cindex Berry, Karl This situation existed for close to 10 years, if not more, and the @command{gawk} maintainer grew weary of trying to explain that @command{gawk} was being nicely standards-compliant, and that the issue -was in the user's locale. During the development of version 4.0, +was in the user's locale. During the development of @value{PVERSION} 4.0, he modified @command{gawk} to always treat ranges in the original, pre-POSIX fashion, unless @option{--posix} was used (@pxref{Options}).@footnote{And thus was born the Campaign for Rational Range Interpretation (or -RRI). A number of GNU tools have either implemented this change, +RRI). A number of GNU tools have already implemented this change, or will soon. Thanks to Karl Berry for coining the phrase ``Rational Range Interpretation.''} @@ -34124,9 +35643,10 @@ By using this lovely technical term, the standard gives license to implementors to implement ranges in whatever way they choose. -The @command{gawk} maintainer chose to apply the pre-POSIX meaning in all -cases: the default regexp matching; with @option{--traditional} and with -@option{--posix}; in all cases, @command{gawk} remains POSIX compliant. +The @command{gawk} maintainer chose to apply the pre-POSIX meaning +both with the default regexp matching and when @option{--traditional} or +@option{--posix} are used. +In all cases @command{gawk} remains POSIX-compliant. @node Contributors @appendixsec Major Contributors to @command{gawk} @@ -34139,7 +35659,7 @@ This @value{SECTION} names the major contributors to @command{gawk} and/or this @value{DOCUMENT}, in approximate chronological order: -@itemize @bullet +@itemize @value{BULLET} @item @cindex Aho, Alfred @cindex Weinberger, Peter @@ -34172,7 +35692,7 @@ Richard Stallman helped finish the implementation and the initial draft of this @value{DOCUMENT}. -He is also the founder of the FSF and the GNU project. +He is also the founder of the FSF and the GNU Project. @item @cindex Woods, John @@ -34219,8 +35739,8 @@ Michal Jaegermann provided the port to Atari systems and its documentation. (This port is no longer supported.) -He continues to provide portability checking with DEC Alpha -systems, and has done a lot of work to make sure @command{gawk} +He continues to provide portability checking, +and has done a lot of work to make sure @command{gawk} works on non-32-bit systems. @item @@ -34259,7 +35779,7 @@ @cindex Zoulas, Christos Christos Zoulas provided the @code{extension()} -built-in function for dynamically adding new modules. +built-in function for dynamically adding new functions. (This was obsoleted at @command{gawk} 4.1.) @item @@ -34291,7 +35811,7 @@ @cindex Peters, Arno Arno Peters did the initial work to convert @command{gawk} to use -GNU Automake and GNU @code{gettext}. +GNU Automake and GNU @command{gettext}. @item @cindex Broder, Alan J.@: @@ -34318,7 +35838,7 @@ @cindex McPhee, Patrick Patrick T.J.@: McPhee contributed the code for dynamic loading in Windows32 environments. -(This is no longer supported) +(This is no longer supported.) @item @cindex Wallin, Anders @@ -34333,34 +35853,37 @@ @cindex Haque, John John Haque made the following contributions: -@itemize @minus +@itemize @value{MINUS} @item The modifications to convert @command{gawk} -into a byte-code interpreter, including the debugger. +into a byte-code interpreter, including the debugger @item -The addition of true multidimensional arrays. -@ref{Arrays of Arrays}. +The addition of true arrays of arrays @item -The additional modifications for support of arbitrary precision arithmetic. +The additional modifications for support of arbitrary-precision arithmetic @item The initial text of -@ref{Arbitrary Precision Arithmetic}. +@ref{Arbitrary Precision Arithmetic} @item The work to merge the three versions of @command{gawk} -into one, for the 4.1 release. +into one, for the 4.1 release @item -Improved array internals for arrays indexed by integers. +Improved array internals for arrays indexed by integers @item -The improved array sorting features were driven by John together -with Pat Rankin. +The improved array sorting features were also driven by John, together +with Pat Rankin @end itemize +@cindex Papadopoulos, Panos +@item +Panos Papadopoulos contributed the original text for @ref{Include Files}. + @item @cindex Yawitz, Efraim Efraim Yawitz contributed the original text for @ref{Debugger}. @@ -34372,6 +35895,11 @@ Arnold Robbins and Andrew Schorr, with notable contributions from the rest of the development team. +@cindex Malmberg, John E. +@item +John Malmberg contributed significant improvements to the +OpenVMS port and the related documentation. + @item @cindex Colombo, Antonio Antonio Giovanni Colombo rewrote a number of examples in the early @@ -34384,21 +35912,54 @@ helping David Trueman, and as the primary maintainer since around 1994. @end itemize +@node History summary +@appendixsec Summary + +@itemize @value{BULLET} +@item +The @command{awk} language has evolved over time. The first release +was with V7 Unix, circa 1978. In 1987, for System V Release 3.1, +major additions, including user-defined functions, were made to the language. +Additional changes were made for System V Release 4, in 1989. +Since then, further minor changes have happened under the auspices of the +POSIX standard. + +@item +Brian Kernighan's @command{awk} provides a small number of extensions +that are implemented in common with other versions of @command{awk}. + +@item +@command{gawk} provides a large number of extensions over POSIX @command{awk}. +They can be disabled with either the @option{--traditional} or @option{--posix} +options. + +@item +The interaction of POSIX locales and regexp matching in @command{gawk} has been confusing over +the years. Today, @command{gawk} implements Rational Range Interpretation, where +ranges of the form @samp{[a-z]} match @emph{only} the characters numerically between +@samp{a} through @samp{z} in the machine's native character set. Usually this is ASCII, +but it can be EBCDIC on IBM S/390 systems. + +@item +Many people have contributed to @command{gawk} development over the years. +We hope that the list provided in this @value{CHAPTER} is complete and gives +the appropriate credit where credit is due. + +@end itemize + @node Installation @appendix Installing @command{gawk} @c last two commas are part of see also @cindex operating systems, See Also GNU/Linux@comma{} PC operating systems@comma{} Unix -@c STARTOFRANGE gligawk @cindex @command{gawk}, installing -@c STARTOFRANGE ingawk @cindex installing @command{gawk} This appendix provides instructions for installing @command{gawk} on the various platforms that are supported by the developers. The primary developer supports GNU/Linux (and Unix), whereas the other ports are contributed. -@xref{Bugs}, -for the electronic mail addresses of the people who did +@DBXREF{Bugs} +for the email addresses of the people who maintain the respective ports. @menu @@ -34409,6 +35970,7 @@ * Bugs:: Reporting Problems and Bugs. * Other Versions:: Other freely available @command{awk} implementations. +* Installation summary:: Summary of installation. @end menu @node Gawk Distribution @@ -34428,9 +35990,9 @@ @node Getting @appendixsubsec Getting the @command{gawk} Distribution @cindex @command{gawk}, source code@comma{} obtaining -There are three ways to get GNU software: +There are two ways to get GNU software: -@itemize @bullet +@itemize @value{BULLET} @item Copy it from someone else who already has it. @@ -34451,7 +36013,7 @@ The GNU software archive is mirrored around the world. The up-to-date list of mirror sites is available from -@uref{http://www.gnu.org/order/ftp.html, the main FSF web site}. +@uref{http://www.gnu.org/order/ftp.html, the main FSF website}. Try to use one of the mirrors; they will be less busy, and you can usually find one closer to your site. @@ -34460,16 +36022,15 @@ @command{gawk} is distributed as several @code{tar} files compressed with different compression programs: @command{gzip}, @command{bzip2}, and @command{xz}. For simplicity, the rest of these instructions assume -you are using the one compressed with the GNU Zip program, @code{gzip}. +you are using the one compressed with the GNU Gzip program (@command{gzip}). -Once you have the distribution (for example, +Once you have the distribution (e.g., @file{gawk-@value{VERSION}.@value{PATCHLEVEL}.tar.gz}), use @code{gzip} to expand the file and then use @code{tar} to extract it. You can use the following pipeline to produce the @command{gawk} distribution: @example -# Under System V, add 'o' to the tar options gzip -d -c gawk-@value{VERSION}.@value{PATCHLEVEL}.tar.gz | tar -xvpf - @end example @@ -34485,7 +36046,7 @@ creates a directory named @file{gawk-@value{VERSION}.@value{PATCHLEVEL}} in the current directory. -The distribution file name is of the form +The distribution @value{FN} is of the form @file{gawk-@var{V}.@var{R}.@var{P}.tar.gz}. The @var{V} represents the major version of @command{gawk}, the @var{R} represents the current release of version @var{V}, and @@ -34501,7 +36062,6 @@ @node Distribution contents @appendixsubsec Contents of the @command{gawk} Distribution -@c STARTOFRANGE gawdis @cindex @command{gawk}, distribution The @command{gawk} distribution has a number of C source files, @@ -34513,12 +36073,12 @@ @table @asis @item Various @samp{.c}, @samp{.y}, and @samp{.h} files -The actual @command{gawk} source code. +These files contain the actual @command{gawk} source code. @end table @table @file @item ABOUT-NLS -Information about GNU @command{gettext} and translations. +A file containing information about GNU @command{gettext} and translations. @item AUTHORS A file with some information about the authorship of @command{gawk}. @@ -34548,7 +36108,7 @@ The GNU General Public License. @item POSIX.STD -A description of behaviors in the POSIX standard for @command{awk} which +A description of behaviors in the POSIX standard for @command{awk} that are left undefined, or where @command{gawk} may not comply fully, as well as a list of things that the POSIX standard should describe but does not. @@ -34556,7 +36116,7 @@ @item doc/awkforai.txt Pointers to the original draft of a short article describing why @command{gawk} is a good language for -Artificial Intelligence (AI) programming. +artificial intelligence (AI) programming. @item doc/bc_notes A brief description of @command{gawk}'s ``byte code'' internals. @@ -34599,10 +36159,10 @@ @item doc/gawkinet.texi The Texinfo source file for @ifinfo -@inforef{Top, , General Introduction, gawkinet, TCP/IP Internetworking with @command{gawk}}. +@inforef{Top, , General Introduction, gawkinet, @value{GAWKINETTITLE}}. @end ifinfo @ifnotinfo -@cite{TCP/IP Internetworking with @command{gawk}}. +@cite{@value{GAWKINETTITLE}}. @end ifnotinfo It should be processed with @TeX{} (via @command{texi2dvi} or @command{texi2pdf}) @@ -34611,7 +36171,7 @@ @item doc/gawkinet.info The generated Info file for -@cite{TCP/IP Internetworking with @command{gawk}}. +@cite{@value{GAWKINETTITLE}}. @item doc/igawk.1 The @command{troff} source for a manual page describing the @command{igawk} @@ -34624,8 +36184,8 @@ @item Makefile.am @itemx */Makefile.am -Files used by the GNU @command{automake} software for generating -the @file{Makefile.in} files used by @command{autoconf} and +Files used by the GNU Automake software for generating +the @file{Makefile.in} files used by Autoconf and @command{configure}. @item Makefile.in @@ -34662,7 +36222,7 @@ The library functions from @ref{Library Functions}, and the @command{igawk} program from -@ref{Igawk Program}, +@DBREF{Igawk Program} are included as ready-to-use files in the @command{gawk} distribution. They are installed as part of the installation process. The rest of the programs in this @value{DOCUMENT} are available in appropriate @@ -34677,12 +36237,15 @@ Files needed for building @command{gawk} on POSIX-compliant systems. @item pc/* -Files needed for building @command{gawk} under MS-Windows and OS/2 -(@pxref{PC Installation}, for details). +Files needed for building @command{gawk} under MS-Windows +@ifclear FOR_PRINT +and OS/2 +@end ifclear +(@DBPXREF{PC Installation} for details). @item vms/* -Files needed for building @command{gawk} under VMS -(@pxref{VMS Installation}, for details). +Files needed for building @command{gawk} under Vax/VMS and OpenVMS +(@DBPXREF{VMS Installation} for details). @item test/* A test suite for @@ -34691,10 +36254,9 @@ If @command{gawk} successfully passes @samp{make check}, then you can be confident of a successful port. @end table -@c ENDOFRANGE gawdis @node Unix Installation -@appendixsec Compiling and Installing @command{gawk} on Unix-like Systems +@appendixsec Compiling and Installing @command{gawk} on Unix-Like Systems Usually, you can compile and install @command{gawk} by typing only two commands. However, if you use an unusual system, you may need @@ -34707,28 +36269,27 @@ @end menu @node Quick Installation -@appendixsubsec Compiling @command{gawk} for Unix-like Systems +@appendixsubsec Compiling @command{gawk} for Unix-Like Systems The normal installation steps should work on all modern commercial Unix-derived systems, GNU/Linux, BSD-based systems, and the Cygwin environment for MS-Windows. After you have extracted the @command{gawk} distribution, @command{cd} -to @file{gawk-@value{VERSION}.@value{PATCHLEVEL}}. Like most GNU software, -@command{gawk} is configured -automatically for your system by running the @command{configure} program. -This program is a Bourne shell script that is generated automatically using -GNU @command{autoconf}. +to @file{gawk-@value{VERSION}.@value{PATCHLEVEL}}. As with most GNU +software, you configure @command{gawk} for your system by running the +@command{configure} program. This program is a Bourne shell script that +is generated automatically using GNU Autoconf. @ifnotinfo -(The @command{autoconf} software is +(The Autoconf software is described fully in @cite{Autoconf---Generating Automatic Configuration Scripts}, which can be found online at @uref{http://www.gnu.org/software/autoconf/manual/index.html, -the Free Software Foundation's web site}.) +the Free Software Foundation's website}.) @end ifnotinfo @ifinfo -(The @command{autoconf} software is described fully starting with +(The Autoconf software is described fully starting with @inforef{Top, , Autoconf, autoconf,Autoconf---Generating Automatic Configuration Scripts}.) @end ifinfo @@ -34772,7 +36333,7 @@ If these steps do not work, or if any of the tests fail, check the files in the @file{README_d} directory to see if you've found a known problem. If the failure is not described there, -please send in a bug report (@pxref{Bugs}). +send in a bug report (@pxref{Bugs}). Of course, once you've built @command{gawk}, it is likely that you will wish to install it. To do so, you need to run the command @samp{make @@ -34804,7 +36365,7 @@ @cindex @option{--disable-lint} configuration option @cindex configuration option, @code{--disable-lint} @item --disable-lint -Disable all lint checking within @code{gawk}. The +Disable all lint checking within @command{gawk}. The @option{--lint} and @option{--lint-old} options (@pxref{Options}) are accepted, but silently do nothing. @@ -34812,14 +36373,17 @@ (@pxref{User-modified}) has no effect on the running @command{awk} program. -When used with GCC's automatic dead-code-elimination, this option -cuts almost 200K bytes off the size of the @command{gawk} -executable on GNU/Linux x86 systems. Results on other systems and +When used with the GNU Compiler Collection's (GCC's) +automatic dead-code-elimination, this option +cuts almost 23K bytes off the size of the @command{gawk} +executable on GNU/Linux x86_64 systems. Results on other systems and with other compilers are likely to vary. Using this option may bring you some slight performance improvement. +@quotation CAUTION Using this option will cause some of the tests in the test suite to fail. This option may be removed at a later date. +@end quotation @cindex @option{--disable-nls} configuration option @cindex configuration option, @code{--disable-nls} @@ -34831,12 +36395,12 @@ @cindex @option{--with-whiny-user-strftime} configuration option @cindex configuration option, @code{--with-whiny-user-strftime} @item --with-whiny-user-strftime -Force use of the included version of the @code{strftime()} +Force use of the included version of the C @code{strftime()} function for deficient systems. @end table Use the command @samp{./configure --help} to see the full list of -options that @command{configure} supplies. +options supplied by @command{configure}. @node Configuration Philosophy @appendixsubsec The Configuration Process @@ -34870,19 +36434,19 @@ @cindex @code{custom.h} file It is possible for your C compiler to lie to @command{configure}. It may do so by not exiting with an error when a library function is not -available. To get around this, edit the file @file{custom.h}. +available. To get around this, edit the @file{custom.h} file. Use an @samp{#ifdef} that is appropriate for your system, and either @code{#define} any constants that @command{configure} should have defined but didn't, or @code{#undef} any constants that @command{configure} defined and -should not have. @file{custom.h} is automatically included by -@file{config.h}. +should not have. The @file{custom.h} file is automatically included by +the @file{config.h} file. It is also possible that the @command{configure} program generated by -@command{autoconf} will not work on your system in some other fashion. -If you do have a problem, the file @file{configure.ac} is the input for -@command{autoconf}. You may be able to change this file and generate a +Autoconf will not work on your system in some other fashion. +If you do have a problem, the @file{configure.ac} file is the input for +Autoconf. You may be able to change this file and generate a new version of @command{configure} that works on your system -(@pxref{Bugs}, +(@DBPXREF{Bugs} for information on how to report problems in configuring @command{gawk}). The same mechanism may be used to send in updates to @file{configure.ac} and/or @file{custom.h}. @@ -34907,17 +36471,23 @@ @cindex PC operating systems@comma{} @command{gawk} on, installing @cindex operating systems, PC@comma{} @command{gawk} on, installing -This @value{SECTION} covers installation and usage of @command{gawk} on x86 machines +This @value{SECTION} covers installation and usage of @command{gawk} +on Intel architecture machines +@ifclear FOR_PRINT running MS-DOS, any version of MS-Windows, or OS/2. +@end ifclear +@ifset FOR_PRINT +running MS-DOS and any version of MS-Windows. +@end ifset In this @value{SECTION}, the term ``Windows32'' -refers to any of Microsoft Windows-95/98/ME/NT/2000/XP/Vista/7. +refers to any of Microsoft Windows 95/98/ME/NT/2000/XP/Vista/7/8. -The limitations of MS-DOS (and MS-DOS shells under Windows32 or OS/2) has meant -that various ``DOS extenders'' are often used with programs such as -@command{gawk}. The varying capabilities of Microsoft Windows 3.1 -and Windows32 can add to the confusion. For an overview of the -considerations, please refer to @file{README_d/README.pc} in the -distribution. +The limitations of MS-DOS (and MS-DOS shells under the other operating +systems) have meant that various ``DOS extenders'' are often used with +programs such as @command{gawk}. The varying capabilities of Microsoft +Windows 3.1 and Windows32 can add to the confusion. For an overview +of the considerations, refer to @file{README_d/README.pc} in +the distribution. @menu * PC Binary Installation:: Installing a prepared distribution. @@ -34931,6 +36501,7 @@ * MSYS:: Using @command{gawk} In The MSYS Environment. @end menu +@ifclear FOR_PRINT @node PC Binary Installation @appendixsubsubsec Installing a Prepared Distribution for PC Systems @@ -34969,13 +36540,21 @@ The binary distribution may contain a separate file containing additional or more detailed installation instructions. +@end ifclear @node PC Compiling @appendixsubsubsec Compiling @command{gawk} for PC Operating Systems +@ifclear FOR_PRINT @command{gawk} can be compiled for MS-DOS, Windows32, and OS/2 using the GNU -development tools from DJ Delorie (DJGPP: MS-DOS only) or Eberhard -Mattes (EMX: MS-DOS, Windows32 and OS/2). The file +development tools from DJ Delorie (DJGPP: MS-DOS only), MinGW (Windows32) or Eberhard +Mattes (EMX: MS-DOS, Windows32 and OS/2). +@end ifclear +@ifset FOR_PRINT +@command{gawk} can be compiled for MS-DOS and Windows32 using the GNU +development tools from DJ Delorie (DJGPP: MS-DOS only) or MinGW (Windows32). +@end ifset +The file @file{README_d/README.pc} in the @command{gawk} distribution contains additional notes, and @file{pc/Makefile} contains important information on compilation options. @@ -34995,8 +36574,10 @@ build @command{gawk} using the DJGPP tools, enter @samp{make djgpp}. (The DJGPP tools needed for the build may be found at @uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/}.) To build a -native MS-Windows binary of @command{gawk}, type @samp{make mingw32}. +native MS-Windows binary of @command{gawk} using the MinGW tools, +type @samp{make mingw32}. +@ifclear FOR_PRINT @cindex compiling @command{gawk} with EMX for OS/2 The 32 bit EMX version of @command{gawk} works ``out of the box'' under OS/2. However, it is highly recommended to use GCC 2.95.3 for the compilation. @@ -35031,7 +36612,7 @@ @end ignore @ignore -The internal @code{gettext} library tends to be problematic. It is therefore recommended +The internal @command{gettext} library tends to be problematic. It is therefore recommended to use either an external one (@option{--without-included-gettext}) or to disable NLS entirely (@option{--disable-nls}). @end ignore @@ -35068,8 +36649,11 @@ the Makefiles of this package. If you encounter any problems with @command{make}, try GNU Make 3.79.1 or later versions. You should find the latest version on -@uref{ftp://hobbes.nmsu.edu/pub/os2/}. +@uref{ftp://hobbes.nmsu.edu/pub/os2/}.@footnote{As of November 2014, +this site is still there, but the author could not find a package +for GNU Make.} @end quotation +@end ifclear @node PC Testing @appendixsubsubsec Testing @command{gawk} on PC Operating Systems @@ -35081,6 +36665,7 @@ Alternatively, run @command{make check CMP="diff -a"} to use GNU @command{diff} in text mode instead of @command{cmp} to compare the resulting files. +@ifclear FOR_PRINT Most of the tests work properly with Stewartson's shell along with the companion utilities or appropriate GNU utilities. However, some editing of @@ -35093,70 +36678,82 @@ @code{fork()}/@code{execl()} to start child processes. Also the @code{mbfw1} and @code{mbprintf1} tests fail because the needed multibyte functionality is not available. - +@end ifclear @node PC Using @appendixsubsubsec Using @command{gawk} on PC Operating Systems -@c STARTOFRANGE opgawx @cindex operating systems, PC, @command{gawk} on -@c STARTOFRANGE pcgawon @cindex PC operating systems, @command{gawk} on Under MS-DOS and MS-Windows, the Cygwin and MinGW environments support both the @samp{|&} operator and TCP/IP networking (@pxref{TCP/IP Networking}). +@ifclear FOR_PRINT EMX (OS/2 only) supports at least the @samp{|&} operator. +@end ifclear @cindex search paths @cindex search paths, for source files -@cindex @command{gawk}, OS/2 version of @cindex @command{gawk}, MS-DOS version of @cindex @command{gawk}, MS-Windows version of -@cindex @code{;} (semicolon), @code{AWKPATH} variable and -@cindex semicolon (@code{;}), @code{AWKPATH} variable and +@cindex @code{;} (semicolon), @env{AWKPATH} variable and +@cindex semicolon (@code{;}), @env{AWKPATH} variable and @cindex @env{AWKPATH} environment variable The MS-DOS and MS-Windows versions of @command{gawk} search for program files as described in @ref{AWKPATH Variable}. However, semicolons (rather than colons) separate elements in the @env{AWKPATH} variable. If @env{AWKPATH} is not set or is empty, then the default -search path for MS-Windows and MS-DOS versions is -@code{@w{".;c:/lib/awk;c:/gnu/lib/awk"}}. +search path is @samp{@w{.;c:/lib/awk;c:/gnu/lib/awk}}. +@ifclear FOR_PRINT +@cindex @command{gawk}, OS/2 version of @cindex @code{UNIXROOT} variable, on OS/2 systems The search path for OS/2 (32 bit, EMX) is determined by the prefix directory (most likely @file{/usr} or @file{c:/usr}) that has been specified as an option of -the @command{configure} script like it is the case for the Unix versions. +the @command{configure} script as is the case for the Unix versions. If @file{c:/usr} is the prefix directory then the default search path contains @file{.} and @file{c:/usr/share/awk}. Additionally, to support binary distributions of @command{gawk} for OS/2 -systems whose drive @samp{c:} might not support long file names or might not exist +systems whose drive @samp{c:} might not support long @value{FN}s or might not exist at all, there is a special environment variable. If @env{UNIXROOT} specifies a drive then this specific drive is also searched for program files. E.g., if @env{UNIXROOT} is set to @file{e:} the complete default search path is -@code{@w{".;c:/usr/share/awk;e:/usr/share/awk"}}. +@samp{@w{.;c:/usr/share/awk;e:/usr/share/awk}}. An @command{sh}-like shell (as opposed to @command{command.com} under MS-DOS or @command{cmd.exe} under MS-Windows or OS/2) may be useful for @command{awk} programming. The DJGPP collection of tools includes an MS-DOS port of Bash, and several shells are available for OS/2, including @command{ksh}. +@end ifclear +@ifset FOR_PRINT +An @command{sh}-like shell (as opposed to @command{command.com} under MS-DOS +or @command{cmd.exe} under MS-Windows) may be useful for @command{awk} programming. +The DJGPP collection of tools includes an MS-DOS port of Bash. +@end ifset @cindex common extensions, @code{BINMODE} variable @cindex extensions, common@comma{} @code{BINMODE} variable @cindex differences in @command{awk} and @command{gawk}, @code{BINMODE} variable @cindex @code{BINMODE} variable -Under MS-Windows, OS/2 and MS-DOS, @command{gawk} (and many other text programs) silently -translate end-of-line @code{"\r\n"} to @code{"\n"} on input and @code{"\n"} -to @code{"\r\n"} on output. A special @code{BINMODE} variable @value{COMMONEXT} +@ifclear FOR_PRINT +Under MS-Windows, OS/2 and MS-DOS, +@end ifclear +@ifset FOR_PRINT +Under MS-Windows and MS-DOS, +@end ifset +@command{gawk} (and many other text programs) silently +translates end-of-line @samp{\r\n} to @samp{\n} on input and @samp{\n} +to @samp{\r\n} on output. A special @code{BINMODE} variable @value{COMMONEXT} allows control over these translations and is interpreted as follows: -@itemize @bullet +@itemize @value{BULLET} @item -If @code{BINMODE} is @code{"r"}, or one, +If @code{BINMODE} is @code{"r"} or one, then binary mode is set on read (i.e., no translations on reads). @item -If @code{BINMODE} is @code{"w"}, or two, +If @code{BINMODE} is @code{"w"} or two, then binary mode is set on write (i.e., no translations on writes). @@ -35179,7 +36776,7 @@ standard output is accomplished by using an appropriate @samp{-v BINMODE=@var{N}} option on the command line. @code{BINMODE} is set at the time a file or pipe is opened and cannot be -changed mid-stream. +changed midstream. The name @code{BINMODE} was chosen to match @command{mawk} (@pxref{Other Versions}). @@ -35187,7 +36784,7 @@ @command{mawk} adds a @samp{-W BINMODE=@var{N}} option and an environment variable that can set @code{BINMODE}, @code{RS}, and @code{ORS}. The files @file{binmode[1-3].awk} (under @file{gnu/lib/awk} in some of the -prepared distributions) have been chosen to match @command{mawk}'s @samp{-W +prepared binary distributions) have been chosen to match @command{mawk}'s @samp{-W BINMODE=@var{N}} option. These can be changed or discarded; in particular, the setting of @code{RS} giving the fewest ``surprises'' is open to debate. @command{mawk} uses @samp{RS = "\r\n"} if binary mode is set on read, which is @@ -35215,7 +36812,7 @@ mode on reads, but does not affect the mode on standard input: @example -gawk -v RS="\r\n" --source "BEGIN @{ BINMODE = 1 @}" @dots{} +gawk -v RS="\r\n" -e "BEGIN @{ BINMODE = 1 @}" @dots{} @end example @noindent @@ -35235,8 +36832,8 @@ @command{gawk} can be built and used ``out of the box'' under MS-Windows if you are using the @uref{http://www.cygwin.com, Cygwin environment}. -This environment provides an excellent simulation of GNU/Linux, using the -GNU tools, such as Bash, the GNU Compiler Collection (GCC), GNU Make, +This environment provides an excellent simulation of GNU/Linux, using +Bash, GCC, GNU Make, and other GNU programs. Compilation and installation for Cygwin is the same as for a Unix system: @@ -35244,7 +36841,7 @@ tar -xvpzf gawk-@value{VERSION}.@value{PATCHLEVEL}.tar.gz cd gawk-@value{VERSION}.@value{PATCHLEVEL} ./configure -make +make && make check @end example When compared to GNU/Linux on the same system, the @samp{configure} @@ -35255,15 +36852,15 @@ @appendixsubsubsec Using @command{gawk} In The MSYS Environment In the MSYS environment under MS-Windows, @command{gawk} automatically -uses binary mode for reading and writing files. Thus there is no +uses binary mode for reading and writing files. Thus, there is no need to use the @code{BINMODE} variable. This can cause problems with other Unix-like components that have been ported to MS-Windows that expect @command{gawk} to do automatic -translation of @code{"\r\n"}, since it won't. Caveat Emptor! +translation of @code{"\r\n"}, because it won't. @node VMS Installation -@appendixsubsec How to Compile and Install @command{gawk} on VMS +@appendixsubsec Compiling and Installing @command{gawk} on Vax/VMS and OpenVMS @c based on material from Pat Rankin @c now rankin@pactechdata.com @@ -35311,27 +36908,27 @@ $ @kbd{MMK/DESCRIPTION=[.vms]descrip.mms gawk} @end example -@code{MMK} is an open source, free, near-clone of @code{MMS} and -can better handle @code{ODS-5} volumes with upper- and lowercase filenames. -@code{MMK} is available from @uref{https://github.com/endlesssoftware/mmk}. +@command{MMK} is an open source, free, near-clone of @command{MMS} and +can better handle ODS-5 volumes with upper- and lowercase @value{FN}s. +@command{MMK} is available from @uref{https://github.com/endlesssoftware/mmk}. -With @code{ODS-5} volumes and extended parsing enabled, the case of the target +With ODS-5 volumes and extended parsing enabled, the case of the target parameter may need to be exact. @command{gawk} has been tested under VAX/VMS 7.3 and Alpha/VMS 7.3-1 -using Compaq C V6.4, and Alpha/VMS 7.3, Alpha/VMS 7.3-2, and IA64/VMS 8.3. +using Compaq C V6.4, and under Alpha/VMS 7.3, Alpha/VMS 7.3-2, and IA64/VMS 8.3. The most recent builds used HP C V7.3 on Alpha VMS 8.3 and both Alpha and IA64 VMS 8.4 used HP C 7.3.@footnote{The IA64 architecture is also known as ``Itanium.''} -The @file{[.vms]gawk_build_steps.txt} provides information on how to build -@command{gawk} into a PCSI kit that is compatible with the GNV product. +@DBXREF{VMS GNV} for information on building +@command{gawk} as a PCSI kit that is compatible with the GNV product. @node VMS Dynamic Extensions @appendixsubsubsec Compiling @command{gawk} Dynamic Extensions on VMS The extensions that have been ported to VMS can be built using one of -the following commands. +the following commands: @example $ @kbd{MMS/DESCRIPTION=[.vms]descrip.mms extensions} @@ -35348,7 +36945,7 @@ or a logical name to find the dynamic extensions. Dynamic extensions need to be compiled with the same compiler options for -floating point, pointer size, and symbol name handling as were used +floating-point, pointer size, and symbol name handling as were used to compile @command{gawk} itself. Alpha and Itanium should use IEEE floating point. The pointer size is 32 bits, and the symbol name handling should be exact case with CRC shortening for @@ -35367,8 +36964,8 @@ /name=(as_is,short) @end example -Compile time macros need to be defined before the first VMS-supplied -header file is included. +Compile-time macros need to be defined before the first VMS-supplied +header file is included, as follows: @example #if (__CRTL_VER >= 70200000) && !defined (__VAX) @@ -35384,6 +36981,11 @@ #endif @end example +If you are writing your own extensions to run on VMS, you must supply these +definitions yourself. The @file{config.h} file created when building @command{gawk} +on VMS does this for you; if instead you use that file or a similar one, then you +must remember to include it before any VMS-supplied header files. + @node VMS Installation Details @appendixsubsubsec Installing @command{gawk} on VMS @@ -35409,7 +37011,7 @@ @file{GNV$GNU:[vms_help]gawk.hlp}. The PCSI kit also installs a @file{GNV$GNU:[vms_bin]gawk_verb.cld} file -which can be used to add @command{gawk} and @command{awk} as DCL commands. +that can be used to add @command{gawk} and @command{awk} as DCL commands. For just the current process you can use: @@ -35418,7 +37020,7 @@ @end example Or the system manager can use @file{GNV$GNU:[vms_bin]gawk_verb.cld} to -add the @command{gawk} and @command{awk} to the system wide @samp{DCLTABLES}. +add the @command{gawk} and @command{awk} to the system-wide @samp{DCLTABLES}. The DCL syntax is documented in the @file{gawk.hlp} file. @@ -35443,11 +37045,11 @@ The logical name @samp{AWK_LIBRARY} can designate a default location for @command{awk} program files. For the @option{-f} option, if the specified -file name has no device or directory path information in it, @command{gawk} +@value{FN} has no device or directory path information in it, @command{gawk} looks in the current directory first, then in the directory specified by the translation of @samp{AWK_LIBRARY} if the file is not found. If, after searching in both directories, the file still is not found, -@command{gawk} appends the suffix @samp{.awk} to the filename and retries +@command{gawk} appends the suffix @samp{.awk} to the @value{FN} and retries the file search. If @samp{AWK_LIBRARY} has no definition, a default value of @samp{SYS$LIBRARY:} is used for it. @@ -35473,25 +37075,25 @@ The VMS port of @command{gawk} includes a @code{DCL}-style interface in addition to the original shell-style interface (see the help entry for details). One side effect of dual command-line parsing is that if there is only a -single parameter (as in the quoted string program above), the command +single parameter (as in the quoted string program), the command becomes ambiguous. To work around this, the normally optional @option{--} flag is required to force Unix-style parsing rather than @code{DCL} parsing. If any -other dash-type options (or multiple parameters such as data files to +other dash-type options (or multiple parameters such as @value{DF}s to process) are present, there is no ambiguity and @option{--} can be omitted. @cindex exit status, of VMS -The @code{exit} value is a Unix-style value and is encoded to a VMS exit +The @code{exit} value is a Unix-style value and is encoded into a VMS exit status value when the program exits. The VMS severity bits will be set based on the @code{exit} value. -A failure is indicated by 1 and VMS sets the @code{ERROR} status. -A fatal error is indicated by 2 and VMS will set the @code{FATAL} status. +A failure is indicated by 1, and VMS sets the @code{ERROR} status. +A fatal error is indicated by 2, and VMS sets the @code{FATAL} status. All other values will have the @code{SUCCESS} status. The exit value is encoded to comply with VMS coding standards and will have the @code{C_FACILITY_NO} of @code{0x350000} with the constant @code{0xA000} added to the number shifted over by 3 bits to make room for the severity codes. -To extract the actual @command{gawk} exit code from the VMS status use: +To extract the actual @command{gawk} exit code from the VMS status, use: @example unix_status = (vms_status .and. &x7f8) / 8 @@ -35501,7 +37103,7 @@ A C program that uses @code{exec()} to call @command{gawk} will get the original Unix-style exit value. -Older versions of @command{gawk} treated a Unix exit code 0 as 1, a failure +Older versions of @command{gawk} for VMS treated a Unix exit code 0 as 1, a failure as 2, a fatal error as 4, and passed all the other numbers through. This violated the VMS exit status coding requirements. @@ -35510,7 +37112,7 @@ VMS reports time values in GMT unless one of the @code{SYS$TIMEZONE_RULE} or @code{TZ} logical names is set. Older versions of VMS, such as VAX/VMS -7.3 do not set these logical names. +7.3, do not set these logical names. @c @cindex directory search @c @cindex path, search @@ -35528,15 +37130,15 @@ The VMS GNV package provides a build environment similar to POSIX with ports of a collection of open source tools. The @command{gawk} found in the GNV -base kit is an older port. Currently the GNV project is being reorganized +base kit is an older port. Currently, the GNV project is being reorganized to supply individual PCSI packages for each component. -See @uref{https://sourceforge.net/p/gnv/wiki/InstallingGNVPackages/}. +See @w{@uref{https://sourceforge.net/p/gnv/wiki/InstallingGNVPackages/}.} The normal build procedure for @command{gawk} produces a program that is suitable for use with GNV. -The @file{vms/gawk_build_steps.txt} in the source documents the procedure -for building a VMS PCSI kit that is compatible with GNV. +The file @file{vms/gawk_build_steps.txt} in the distribution documents +the procedure for building a VMS PCSI kit that is compatible with GNV. @ignore @c The VMS POSIX product, also known as POSIX for OpenVMS, is long defunct @@ -35585,125 +37187,119 @@ $ @kbd{gawk :== $sys$common:[syshlp.examples.tcpip.snmp]gawk.exe} @end example -This is apparently version 2.15.6, which is extremely old. We +This is apparently @value{PVERSION} 2.15.6, which is extremely old. We recommend compiling and using the current version. -@c ENDOFRANGE opgawx -@c ENDOFRANGE pcgawon @node Bugs @appendixsec Reporting Problems and Bugs -@cindex archeologists +@cindex archaeologists @quotation -@i{There is nothing more dangerous than a bored archeologist.} -@author The Hitchhiker's Guide to the Galaxy +@i{There is nothing more dangerous than a bored archaeologist.} +@author Douglas Adams, @cite{The Hitchhiker's Guide to the Galaxy} @end quotation @c the radio show, not the book. :-) -@c STARTOFRANGE dbugg @cindex debugging @command{gawk}, bug reports -@c STARTOFRANGE tblgawb @cindex troubleshooting, @command{gawk}, bug reports If you have problems with @command{gawk} or think that you have found a bug, -please report it to the developers; we cannot promise to do anything +report it to the developers; we cannot promise to do anything, but we might well want to fix it. -Before reporting a bug, make sure you have actually found a real bug. -Carefully reread the documentation and see if it really says you can do +Before reporting a bug, make sure you have really found a genuine bug. +Carefully reread the documentation and see if it says you can do what you're trying to do. If it's not clear whether you should be able to do something or not, report that too; it's a bug in the documentation! Before reporting a bug or trying to fix it yourself, try to isolate it -to the smallest possible @command{awk} program and input data file that -reproduces the problem. Then send us the program and data file, +to the smallest possible @command{awk} program and input @value{DF} that +reproduce the problem. Then send us the program and @value{DF}, some idea of what kind of Unix system you're using, the compiler you used to compile @command{gawk}, and the exact results @command{gawk} gave you. Also say what you expected to occur; this helps us decide whether the problem is really in the documentation. -Please include the version number of @command{gawk} you are using. +Make sure to include the version number of @command{gawk} you are using. You can get this information with the command @samp{gawk --version}. @cindex @code{bug-gawk@@gnu.org} bug reporting address @cindex email address for bug reports, @code{bug-gawk@@gnu.org} @cindex bug reports, email address, @code{bug-gawk@@gnu.org} -Once you have a precise problem, send email to +Once you have a precise problem description, send email to @EMAIL{bug-gawk@@gnu.org,bug-gawk at gnu dot org}. -@cindex Robbins, Arnold -Using this address automatically sends a copy of your -mail to me. If necessary, I can be reached directly at -@EMAIL{arnold@@skeeve.com,arnold at skeeve dot com}. -The bug reporting address is preferred since the +The @command{gawk} maintainers subscribe to this address, and +thus they will receive your bug report. +Although you can send mail to the maintainers directly, +the bug reporting address is preferred because the email list is archived at the GNU Project. -@emph{All email should be in English, since that is my native language.} +@emph{All email must be in English. This is the only language +understood in common by all the maintainers.} @cindex @code{comp.lang.awk} newsgroup @quotation CAUTION Do @emph{not} try to report bugs in @command{gawk} by posting to the Usenet/Internet newsgroup @code{comp.lang.awk}. -While the @command{gawk} developers do occasionally read this newsgroup, -there is no guarantee that we will see your posting. The steps described -above are the official recognized ways for reporting bugs. +The @command{gawk} developers do occasionally read this newsgroup, +but there is no guarantee that we will see your posting. The steps described +here are the only officially recognized way for reporting bugs. Really. @end quotation @quotation NOTE Many distributions of GNU/Linux and the various BSD-based operating systems have their own bug reporting systems. If you report a bug using your distribution's -bug reporting system, @emph{please} also send a copy to +bug reporting system, you should also send a copy to @EMAIL{bug-gawk@@gnu.org,bug-gawk at gnu dot org}. -This is for two reasons. First, while some distributions forward +This is for two reasons. First, although some distributions forward bug reports ``upstream'' to the GNU mailing list, many don't, so there is a good -chance that the @command{gawk} maintainer won't even see the bug report! Second, -mail to the GNU list is archived, and having everything at the GNU project -keeps things self-contained and not dependant on other web sites. +chance that the @command{gawk} maintainers won't even see the bug report! Second, +mail to the GNU list is archived, and having everything at the GNU Project +keeps things self-contained and not dependent on other organizations. @end quotation Non-bug suggestions are always welcome as well. If you have questions about things that are unclear in the documentation or are just obscure -features, ask me; I will try to help you out, although I -may not have the time to fix the problem. You can send me electronic -mail at the Internet address noted previously. - -If you find bugs in one of the non-Unix ports of @command{gawk}, please send -an electronic mail message to the person who maintains that port. They -are named in the following list, as well as in the @file{README} file in the @command{gawk} -distribution. Information in the @file{README} file should be considered -authoritative if it conflicts with this @value{DOCUMENT}. +features, ask on the bug list; we will try to help you out if we can. -The people maintaining the non-Unix ports of @command{gawk} are -as follows: +If you find bugs in one of the non-Unix ports of @command{gawk}, +send an email to the bug list, with a copy to the +person who maintains that port. The maintainers are named in the following list, +as well as in the @file{README} file in the @command{gawk} distribution. +Information in the @file{README} file should be considered authoritative +if it conflicts with this @value{DOCUMENT}. + +The people maintaining the various @command{gawk} ports are: @c put the index entries outside the table, for docbook -@cindex Deifik, Scott -@cindex Zaretskii, Eli @cindex Buening, Andreas -@cindex Rankin, Pat +@cindex Deifik, Scott @cindex Malmberg, John @cindex Pitts, Dave -@multitable {MS-Windows with MINGW} {123456789012345678901234567890123456789001234567890} -@item MS-DOS with DJGPP @tab Scott Deifik, @EMAIL{scottd.mail@@sbcglobal.net,scottd dot mail at sbcglobal dot net}. +@cindex Robbins, Arnold +@cindex Zaretskii, Eli +@multitable {MS-Windows with MinGW} {123456789012345678901234567890123456789001234567890} +@item Unix and POSIX systems @tab Arnold Robbins, @EMAIL{arnold@@skeeve.com,arnold at skeeve dot com} + +@item MS-DOS with DJGPP @tab Scott Deifik, @EMAIL{scottd.mail@@sbcglobal.net,scottd dot mail at sbcglobal dot net} -@item MS-Windows with MINGW @tab Eli Zaretskii, @EMAIL{eliz@@gnu.org,eliz at gnu dot org}. +@item MS-Windows with MinGW @tab Eli Zaretskii, @EMAIL{eliz@@gnu.org,eliz at gnu dot org} -@item OS/2 @tab Andreas Buening, @EMAIL{andreas.buening@@nexgo.de,andreas dot buening at nexgo dot de}. +@c Leave this in the print version on purpose. +@c OS/2 is not mentioned anywhere else in the print version though. +@item OS/2 @tab Andreas Buening, @EMAIL{andreas.buening@@nexgo.de,andreas dot buening at nexgo dot de} -@item VMS @tab Pat Rankin, @EMAIL{r.pat.rankin@@gmail.com,r.pat.rankin at gmail.com}, and -John Malmberg, @EMAIL{wb8tyw@@qsl.net,wb8tyw at qsl.net}. +@item VMS @tab John Malmberg, @EMAIL{wb8tyw@@qsl.net,wb8tyw at qsl.net} -@item z/OS (OS/390) @tab Dave Pitts, @EMAIL{dpitts@@cozx.com,dpitts at cozx dot com}. +@item z/OS (OS/390) @tab Dave Pitts, @EMAIL{dpitts@@cozx.com,dpitts at cozx dot com} @end multitable -If your bug is also reproducible under Unix, please send a copy of your +If your bug is also reproducible under Unix, send a copy of your report to the @EMAIL{bug-gawk@@gnu.org,bug-gawk at gnu dot org} email list as well. -@c ENDOFRANGE dbugg -@c ENDOFRANGE tblgawb @node Other Versions @appendixsec Other Freely Available @command{awk} Implementations -@c STARTOFRANGE awkim @cindex @command{awk}, implementations @ignore From: emory!amc.com!brennan (Michael Brennan) @@ -35713,11 +37309,20 @@ @end ignore @cindex Brennan, Michael +@ifnotdocbook @quotation -@i{It's kind of fun to put comments like this in your awk code.}@* +@i{It's kind of fun to put comments like this in your awk code:}@* @ @ @ @ @ @ @code{// Do C++ comments work? answer: yes! of course} @author Michael Brennan @end quotation +@end ifnotdocbook + +@docbook +
Michael Brennan +It's kind of fun to put comments like this in your awk code. +      // Do C++ comments work? answer: yes! of course +
+@end docbook There are a number of other freely available @command{awk} implementations. This @value{SECTION} briefly describes where to get them: @@ -35731,7 +37336,7 @@ Brian Kernighan, one of the original designers of Unix @command{awk}, has made his implementation of @command{awk} freely available. -You can retrieve this version via the World Wide Web from +You can retrieve this version via @uref{http://www.cs.princeton.edu/~bwk, his home page}. It is available in several archive formats: @@ -35747,14 +37352,14 @@ @end table @cindex @command{git} utility -You can also retrieve it from Git Hub: +You can also retrieve it from GitHub: @example git clone git://github.com/onetrueawk/awk bwkawk @end example @noindent -The above command creates a copy of the @uref{http://www.git-scm.com, Git} +This command creates a copy of the @uref{http://git-scm.com, Git} repository in a directory named @file{bwkawk}. If you leave that argument off the @command{git} command line, the repository copy is created in a directory named @file{awk}. @@ -35762,16 +37367,25 @@ This version requires an ISO C (1990 standard) compiler; the C compiler from GCC (the GNU Compiler Collection) works quite nicely. -@xref{Common Extensions}, +@DBXREF{Common Extensions} for a list of extensions in this @command{awk} that are not in POSIX @command{awk}. +As a side note, Dan Bornstein has created a Git repository tracking +all the versions of BWK @command{awk} that he could find. It's +available at @uref{git://github.com/danfuzz/one-true-awk}. + @cindex Brennan, Michael @cindex @command{mawk} utility @cindex source code, @command{mawk} @item @command{mawk} Michael Brennan wrote an independent implementation of @command{awk}, -called @command{mawk}. It is available under the GPL -(@pxref{Copying}), +called @command{mawk}. It is available under the +@ifclear FOR_PRINT +GPL (@pxref{Copying}), +@end ifclear +@ifset FOR_PRINT +GPL, +@end ifset just as @command{gawk} is. The original distribution site for the @command{mawk} source code @@ -35789,7 +37403,7 @@ is similar to @command{gawk}'s (@pxref{Unix Installation}). -@xref{Common Extensions}, +@DBXREF{Common Extensions} for a list of extensions in @command{mawk} that are not in POSIX @command{awk}. @cindex Sumner, Andrew @@ -35798,7 +37412,7 @@ @item @command{awka} Written by Andrew Sumner, @command{awka} translates @command{awk} programs into C, compiles them, -and links them with a library of functions that provides the core +and links them with a library of functions that provide the core @command{awk} functionality. It also has a number of extensions. @@ -35810,26 +37424,26 @@ @c andrewsumner@@yahoo.net The project seems to be frozen; no new code changes have been made -since approximately 2003. +since approximately 2001. @cindex Beebe, Nelson H.F.@: @cindex @command{pawk} (profiling version of Brian Kernighan's @command{awk}) @cindex source code, @command{pawk} @item @command{pawk} Nelson H.F.@: Beebe at the University of Utah has modified -Brian Kernighan's @command{awk} to provide timing and profiling information. -It is different from @command{gawk} with the @option{--profile} option. -(@pxref{Profiling}), +BWK @command{awk} to provide timing and profiling information. +It is different from @command{gawk} with the @option{--profile} option +(@pxref{Profiling}) in that it uses CPU-based profiling, not line-count profiling. You may find it at either @uref{ftp://ftp.math.utah.edu/pub/pawk/pawk-20030606.tar.gz} or @uref{http://www.math.utah.edu/pub/pawk/pawk-20030606.tar.gz}. -@item Busybox Awk -@cindex Busybox Awk -@cindex source code, Busybox Awk -Busybox is a GPL-licensed program providing small versions of many +@item BusyBox @command{awk} +@cindex BusyBox Awk +@cindex source code, BusyBox Awk +BusyBox is a GPL-licensed program providing small versions of many applications within a single executable. It is aimed at embedded systems. It includes a full implementation of POSIX @command{awk}. When building it, be careful not to do @samp{make install} as it will overwrite @@ -35840,10 +37454,10 @@ @cindex Solaris, POSIX-compliant @command{awk} @cindex source code, Solaris @command{awk} @item The OpenSolaris POSIX @command{awk} -The version of @command{awk} in @file{/usr/xpg4/bin} on Solaris is -more-or-less POSIX-compliant. It is based on the @command{awk} from -Mortice Kern Systems for PCs. -This author was able to make it compile and work under GNU/Linux +The versions of @command{awk} in @file{/usr/xpg4/bin} and +@file{/usr/xpg6/bin} on Solaris are more or less POSIX-compliant. +They are based on the @command{awk} from Mortice Kern Systems for PCs. +We were able to make this code compile and work under GNU/Linux with 1--2 hours of work. Making it more generally portable (using GNU Autoconf and/or Automake) would take more work, and this has not been done, at least to our knowledge. @@ -35851,8 +37465,8 @@ @cindex Illumos @cindex Illumos, POSIX-compliant @command{awk} @cindex source code, Illumos @command{awk} -The source code used to be available from the OpenSolaris web site. -However, that project was ended and the web site shut down. Fortunately, the +The source code used to be available from the OpenSolaris website. +However, that project was ended and the website shut down. Fortunately, the @uref{http://wiki.illumos.org/display/illumos/illumos+Home, Illumos project} makes this implementation available. You can view the files one at a time from @uref{https://github.com/joyent/illumos-joyent/blob/master/usr/src/cmd/awk_xpg4}. @@ -35871,7 +37485,7 @@ @cindex libmawk @cindex source code, libmawk This is an embeddable @command{awk} interpreter derived from -@command{mawk}. For more information see +@command{mawk}. For more information, see @uref{http://repo.hu/projects/libmawk/}. @item @code{pawk} @@ -35880,13 +37494,12 @@ This is a Python module that claims to bring @command{awk}-like features to Python. See @uref{https://github.com/alecthomas/pawk} for more information. (This is not related to Nelson Beebe's -modified version of Brian Kernighan's @command{awk}, -described earlier.) +modified version of BWK @command{awk}, described earlier.) -@item @w{QSE Awk} -@cindex QSE Awk -@cindex source code, QSE Awk -This is an embeddable @command{awk} interpreter. For more information +@item @w{QSE @command{awk}} +@cindex QSE @command{awk} +@cindex source code, QSE @command{awk} +This is an embeddable @command{awk} interpreter. For more information, see @uref{http://code.google.com/p/qse/} and @uref{http://awk.info/?tools/qse}. @item @command{QTawk} @@ -35898,20 +37511,57 @@ See @uref{http://www.quiktrim.org/QTawk.html} for more information, including the manual and a download link. -@item Other Versions -See also the @uref{http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations, -Wikipedia article}, for information on additional versions. +The project may also be frozen; no new code changes have been made +since approximately 2008. + +@item Other versions +See also the ``Versions and implementations'' section of the +@uref{http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations, +Wikipedia article} on @command{awk} for information on additional versions. @end table -@c ENDOFRANGE gligawk -@c ENDOFRANGE ingawk -@c ENDOFRANGE awkim +@node Installation summary +@appendixsec Summary + +@itemize @value{BULLET} +@item +The @command{gawk} distribution is available from the GNU Project's main +distribution site, @code{ftp.gnu.org}. The canonical build recipe is: + +@example +wget http://ftp.gnu.org/gnu/gawk/gawk-@value{VERSION}.@value{PATCHLEVEL}.tar.gz +tar -xvpzf gawk-@value{VERSION}.@value{PATCHLEVEL}.tar.gz +cd gawk-@value{VERSION}.@value{PATCHLEVEL} +./configure && make && make check +@end example + +@item +@command{gawk} may be built on non-POSIX systems as well. The currently +supported systems are MS-Windows using DJGPP, MSYS, MinGW, and Cygwin, +@ifclear FOR_PRINT +OS/2 using EMX, +@end ifclear +and both Vax/VMS and OpenVMS. +Instructions for each system are included in this @value{APPENDIX}. + +@item +Bug reports should be sent via email to @email{bug-gawk@@gnu.org}. +Bug reports should be in English and should include the version of @command{gawk}, +how it was compiled, and a short program and @value{DF} that demonstrate +the problem. + +@item +There are a number of other freely available @command{awk} +implementations. Many are POSIX-compliant; others are less so. + +@end itemize + + +@ifclear FOR_PRINT @node Notes @appendix Implementation Notes -@c STARTOFRANGE gawii @cindex @command{gawk}, implementation issues -@c STARTOFRANGE impis @cindex implementation issues, @command{gawk} This appendix contains information mainly of interest to implementers and @@ -35926,6 +37576,7 @@ * Implementation Limitations:: Some limitations of the implementation. * Extension Design:: Design notes about the extension API. * Old Extension Mechanism:: Some compatibility for old extensions. +* Notes summary:: Summary of implementation notes. @end menu @node Compatibility Mode @@ -35946,7 +37597,7 @@ @table @code @item -Y @itemx --parsedebug -Prints out the parse stack information as the program is being parsed. +Print out the parse stack information as the program is being parsed. @end table This option is intended only for serious @command{gawk} developers @@ -35970,15 +37621,15 @@ @command{gawk}. * New Ports:: Porting @command{gawk} to a new operating system. -* Derived Files:: Why derived files are kept in the - @command{git} repository. +* Derived Files:: Why derived files are kept in the Git + repository. @end menu @node Accessing The Source @appendixsubsec Accessing The @command{gawk} Git Repository As @command{gawk} is Free Software, the source code is always available. -@ref{Gawk Distribution}, describes how to get and build the formal, +@DBREF{Gawk Distribution} describes how to get and build the formal, released versions of @command{gawk}. @cindex @command{git} utility @@ -35986,7 +37637,7 @@ changes, you will probably wish to work with the development version. To do so, you will need to access the @command{gawk} source code repository. The code is maintained using the -@uref{http://git-scm.com/, Git distributed version control system}. +@uref{http://git-scm.com, Git distributed version control system}. You will need to install it if your system doesn't have it. Once you have done so, use the command: @@ -35995,8 +37646,8 @@ @end example @noindent -This will clone the @command{gawk} repository. If you are behind a -firewall that will not allow you to use the Git native protocol, you +This clones the @command{gawk} repository. If you are behind a +firewall that does not allow you to use the Git native protocol, you can still access the repository using: @example @@ -36015,21 +37666,18 @@ @node Adding Code @appendixsubsec Adding New Features -@c STARTOFRANGE adfgaw @cindex adding, features to @command{gawk} -@c STARTOFRANGE fadgaw @cindex features, adding to @command{gawk} -@c STARTOFRANGE gawadf @cindex @command{gawk}, features, adding You are free to add any new features you like to @command{gawk}. However, if you want your changes to be incorporated into the @command{gawk} distribution, there are several steps that you need to take in order to -make it possible to include your changes: +make it possible to include them: @enumerate 1 @item Before building the new feature into @command{gawk} itself, -consider writing it as an extension module +consider writing it as an extension (@pxref{Dynamic Extensions}). If that's not possible, continue with the rest of the steps in this list. @@ -36046,14 +37694,15 @@ @item Get the latest version. It is much easier for me to integrate changes if they are relative to -the most recent distributed version of @command{gawk}. If your version of -@command{gawk} is very old, I may not be able to integrate them at all. +the most recent distributed version of @command{gawk}, or better yet, +relative to the latest code in the Git repository. If your version of +@command{gawk} is very old, I may not be able to integrate your changes at all. (@xref{Getting}, for information on getting the latest version of @command{gawk}.) @item @ifnotinfo -Follow the @uref{http://www.gnu.org/prep/standards/, @cite{GNU Coding Standards}}. +Follow the @cite{GNU Coding Standards}. @end ifnotinfo @ifinfo See @inforef{Top, , Version, standards, GNU Coding Standards}. @@ -36062,7 +37711,7 @@ read it, please do so, preferably @emph{before} starting to modify @command{gawk}. (The @cite{GNU Coding Standards} are available from the GNU Project's -@uref{http://www.gnu.org/prep/standards_toc.html, web site}. +@uref{http://www.gnu.org/prep/standards/, website}. Texinfo, Info, and DVI versions are also available.) @cindex @command{gawk}, coding style in @@ -36074,7 +37723,7 @@ of braces and the use of TABs. In brief, the coding rules for @command{gawk} are as follows: -@itemize @bullet +@itemize @value{BULLET} @item Use ANSI/ISO style (prototype) function headers when defining functions. @@ -36178,15 +37827,13 @@ Include an entry for the @file{ChangeLog} file with your submission. This helps further minimize the amount of work I have to do, making it easier for me to accept patches. +It is simplest if you just make this part of your diff. @end enumerate Although this sounds like a lot of work, please remember that while you may write the new code, I have to maintain it and support it. If it isn't possible for me to do that with a minimum of extra work, then I probably will not. -@c ENDOFRANGE adfgaw -@c ENDOFRANGE gawadf -@c ENDOFRANGE fadgaw @node New Ports @appendixsubsec Porting @command{gawk} to a New Operating System @@ -36235,15 +37882,44 @@ people. Thus, you should not change them unless it is for a very good reason; i.e., changes are not out of the question, but changes to these files are scrutinized extra carefully. -The files are @file{dfa.c}, @file{dfa.h}, @file{getopt1.c}, @file{getopt.c}, -@file{getopt.h}, @file{install-sh}, @file{mkinstalldirs}, @file{regcomp.c}, -@file{regex.c}, @file{regexec.c}, @file{regexex.c}, @file{regex.h}, -@file{regex_internal.c}, and @file{regex_internal.h}. +The files are +@file{dfa.c}, +@file{dfa.h}, +@file{getopt.c}, +@file{getopt.h}, +@file{getopt1.c}, +@file{getopt_int.h}, +@file{gettext.h}, +@file{regcomp.c}, +@file{regex.c}, +@file{regex.h}, +@file{regex_internal.c}, +@file{regex_internal.h}, +and +@file{regexec.c}. + +@item +A number of other files are provided by the GNU +Autotools (Autoconf, Automake, and GNU @command{gettext}). +You should not change them either, unless it is for a very +good reason. The files are +@file{ABOUT-NLS}, +@file{config.guess}, +@file{config.rpath}, +@file{config.sub}, +@file{depcomp}, +@file{INSTALL}, +@file{install-sh}, +@file{missing}, +@file{mkinstalldirs}, +@file{xalloc.h}, +and +@file{ylwrap}. @item Be willing to continue to maintain the port. Non-Unix operating systems are supported by volunteers who maintain -the code needed to compile and run @command{gawk} on their systems. If noone +the code needed to compile and run @command{gawk} on their systems. If no-one volunteers to maintain a port, it becomes unsupported and it may be necessary to remove it from the distribution. @@ -36289,23 +37965,22 @@ coding style and brace layout that suits your taste. @node Derived Files -@appendixsubsec Why Generated Files Are Kept In @command{git} +@appendixsubsec Why Generated Files Are Kept In Git -@c STARTOFRANGE gawkgit -@cindex @command{git}, use of for @command{gawk} source code +@cindex Git, use of for @command{gawk} source code @c From emails written March 22, 2012, to the gawk developers list. -If you look at the @command{gawk} source in the @command{git} +If you look at the @command{gawk} source in the Git repository, you will notice that it includes files that are automatically generated by GNU infrastructure tools, such as @file{Makefile.in} from -@command{automake} and even @file{configure} from @command{autoconf}. +Automake and even @file{configure} from Autoconf. This is different from many Free Software projects that do not store the derived files, because that keeps the repository less cluttered, and it is easier to see the substantive changes when comparing versions and trying to understand what changed between commits. -However, there are two reasons why the @command{gawk} maintainer +However, there are several reasons why the @command{gawk} maintainer likes to have everything in the repository. First, because it is then easy to reproduce any given version completely, @@ -36324,11 +37999,10 @@ @emph{it} would build?) If the repository has all the generated files, then it's easy to just check -them out and build. (Or @emph{easier}, depending upon how far back we go. -@code{:-)}) +them out and build. (Or @emph{easier}, depending upon how far back we go.) And that brings us to the second (and stronger) reason why all the files -really need to be in @command{git}. It boils down to who do you cater +really need to be in Git. It boils down to who do you cater to---the @command{gawk} developer(s), or the user who just wants to check out a version and try it out? @@ -36337,10 +38011,10 @@ world to just clone the repository, check out the branch of interest and build it. Without their having to have the correct version(s) of the autotools.@footnote{There is one GNU program that is (in our opinion) -severely difficult to bootstrap from the @command{git} repository. For -example, on the author's old (but still working) PowerPC macintosh with +severely difficult to bootstrap from the Git repository. For +example, on the author's old (but still working) PowerPC Macintosh with Mac OS X 10.5, it was necessary to bootstrap a ton of software, starting -with @command{git} itself, in order to try to work with the latest code. +with Git itself, in order to try to work with the latest code. It's not pleasant, and especially on older systems, it's a big waste of time. @@ -36363,18 +38037,26 @@ Further, the @command{gawk} maintainer would argue that it's also important for the @command{gawk} developers. When he tried to check out -the @code{xgawk} branch@footnote{A branch created by one of the other +the @code{xgawk} branch@footnote{A branch (since removed) created by one of the other developers that did not include the generated files.} to build it, he couldn't. (No @file{ltmain.sh} file, and he had no idea how to create it, and that was not the only problem.) He felt @emph{extremely} frustrated. With respect to that branch, the maintainer is no different than Jane User who wants to try to build -@code{gawk-4.0-stable} or @code{master} from the repository. +@code{gawk-4.1-stable} or @code{master} from the repository. Thus, the maintainer thinks that it's not just important, but critical, that for any given branch, the above incantation @emph{just works}. +@c Added 9/2014: +A third reason to have all the files is that without them, using @samp{git +bisect} to try to find the commit that introduced a bug is exceedingly +difficult. The maintainer tried to do that on another project that +requires running bootstrapping scripts just to create @command{configure} +and so on; it was really painful. When the repository is self-contained, +using @command{git bisect} in it is very easy. + @c So - that's my reasoning and philosophy. What are some of the consequences and/or actions to take? @@ -36390,29 +38072,29 @@ @item He is really good at @samp{git diff x y > /tmp/diff1 ; gvim /tmp/diff1} to -remove the diffs that aren't of interest in order to review code. @code{:-)} +remove the diffs that aren't of interest in order to review code. @end enumerate @item It would certainly help if everyone used the same versions of the GNU tools as he does, which in general are the latest released versions of -@command{automake}, -@command{autoconf}, +Automake, +Autoconf, @command{bison}, and -@command{gettext}. +GNU @command{gettext}. @ignore -If it would help if I sent out an "I just upgraded to version x.y -of tool Z" kind of message to this list, I can do that. Up until +If it would help if I sent out an ``I just upgraded to version x.y +of tool Z'' kind of message to this list, I can do that. Up until now it hasn't been a real issue since I'm the only one who's been dorking with the configuration machinery. @end ignore -@enumerate A -@item +@c @enumerate A +@c @item Installing from source is quite easy. It's how the maintainer worked for years -under Fedora. +(and still works). He had @file{/usr/local/bin} at the front of his @env{PATH} and just did: @example @@ -36423,10 +38105,11 @@ make install # as root @end example -@item +@c @item +@ignore These days the maintainer uses Ubuntu 12.04 which is medium current, but -he is already doing the above for @command{autoconf}, @command{automake} -and @command{bison}. +he is already doing the above for Automake, Autoconf, and @command{bison}. +@end ignore @ignore (C. Rant: Recent Linux versions with GNOME 3 really suck. What @@ -36434,7 +38117,7 @@ me to Ubuntu, but Ubuntu 11.04 and 11.10 are totally unusable from a UI perspective. Bleah.) @end ignore -@end enumerate +@c @end enumerate @ignore @item @@ -36450,7 +38133,7 @@ Most of the above was originally written by the maintainer to other @command{gawk} developers. It raised the objection from one of the developers ``@dots{} that anybody pulling down the source from -@command{git} is not an end user.'' +Git is not an end user.'' However, this is not true. There are ``power @command{awk} users'' who can build @command{gawk} (using the magic incantation shown previously) @@ -36460,10 +38143,10 @@ It was then suggested that there be a @command{cron} job to create nightly tarballs of ``the source.'' Here, the problem is that there are source trees, corresponding to the various branches! So, -nightly tar balls aren't the answer, especially as the repository can go +nightly tarballs aren't the answer, especially as the repository can go for weeks without significant change being introduced. -Fortunately, the @command{git} server can meet this need. For any given +Fortunately, the Git server can meet this need. For any given branch named @var{branchname}, use: @example @@ -36472,7 +38155,6 @@ @noindent to retrieve a snapshot of the given branch. -@c ENDOFRANGE gawkgit @node Future Extensions @appendixsec Probable Future Extensions @@ -36523,9 +38205,10 @@ @author Larry Wall @end quotation -The @file{TODO} file in the @command{gawk} Git repository lists possible -future enhancements. Some of these relate to the source code, and others -to possible new features. Please see that file for the list. +The @file{TODO} file in the @code{master} branch of the @command{gawk} +Git repository lists possible future enhancements. Some of these relate +to the source code, and others to possible new features. Please see +that file for the list. @xref{Additions}, if you are interested in tackling any of the projects listed there. @@ -36539,7 +38222,7 @@ @multitable @columnfractions .40 .60 @headitem Item @tab Limit @item Characters in a character class @tab 2^(number of bits per byte) -@item Length of input record @tab @code{MAX_INT } +@item Length of input record @tab @code{MAX_INT} @item Length of output record @tab Unlimited @item Length of source line @tab Unlimited @item Number of fields in a record @tab @code{MAX_LONG} @@ -36548,9 +38231,9 @@ @item Number of input records total @tab @code{MAX_LONG} @item Number of pipe redirections @tab min(number of processes per user, number of open files) @item Numeric values @tab Double-precision floating point (if not using MPFR) -@item Size of a field @tab @code{MAX_INT } -@item Size of a literal string @tab @code{MAX_INT } -@item Size of a printf string @tab @code{MAX_INT } +@item Size of a field @tab @code{MAX_INT} +@item Size of a literal string @tab @code{MAX_INT} +@item Size of a printf string @tab @code{MAX_INT} @end multitable @node Extension Design @@ -36585,7 +38268,7 @@ The old extension mechanism had several problems: -@itemize @bullet +@itemize @value{BULLET} @item It depended heavily upon @command{gawk} internals. Any time the @code{NODE} structure@footnote{A critical central data structure @@ -36597,8 +38280,8 @@ @item Being able to call into @command{gawk} from an extension required linker facilities that are common on Unix-derived systems but that did -not work on Windows systems; users wanting extensions on Windows -had to statically link them into @command{gawk}, even though Windows supports +not work on MS-Windows systems; users wanting extensions on MS-Windows +had to statically link them into @command{gawk}, even though MS-Windows supports dynamic loading of shared objects. @item @@ -36621,7 +38304,7 @@ Some goals for the new API were: -@itemize @bullet +@itemize @value{BULLET} @item The API should be independent of @command{gawk} internals. Changes in @command{gawk} internals should not be visible to the writer of an @@ -36636,7 +38319,7 @@ same ``appearance'' to @command{awk}-level code as @command{awk} functions do. This means that extensions should have: -@itemize @minus +@itemize @value{MINUS} @item The ability to access function parameters. @@ -36652,13 +38335,13 @@ @item The ability to create arrays (including @command{gawk}'s true -multidimensional arrays). +arrays of arrays). @end itemize @end itemize Some additional important goals were: -@itemize @bullet +@itemize @value{BULLET} @item The API should use only features in ISO C 90, so that extensions can be written using the widest range of C and C++ compilers. The header @@ -36673,15 +38356,15 @@ symbols@footnote{The @dfn{symbols} are the variables and functions defined inside @command{gawk}. Access to these symbols by code external to @command{gawk} loaded dynamically at runtime is -problematic on Windows.} by the compile-time or dynamic linker, -in order to enable creation of extensions that also work on Windows. +problematic on MS-Windows.} by the compile-time or dynamic linker, +in order to enable creation of extensions that also work on MS-Windows. @end itemize During development, it became clear that there were other features that should be available to extensions, which were also subsequently provided: -@itemize @bullet +@itemize @value{BULLET} @item Extensions should have the ability to hook into @command{gawk}'s I/O redirection mechanism. In particular, the @command{xgawk} @@ -36692,7 +38375,7 @@ @item An extension should be able to provide a ``call back'' function -to perform clean up actions when @command{gawk} exits. +to perform cleanup actions when @command{gawk} exits. @item An extension should be able to provide a version string so that @@ -36720,7 +38403,7 @@ @appendixsubsec Other Design Decisions As an arbitrary design decision, extensions can read the values of -built-in variables and arrays (such as @code{ARGV} and @code{FS}), but cannot +predefined variables and arrays (such as @code{ARGV} and @code{FS}), but cannot change them, with the exception of @code{PROCINFO}. The reason for this is to prevent an extension function from affecting @@ -36762,7 +38445,7 @@ The API can later be expanded, in two ways: -@itemize @bullet +@itemize @value{BULLET} @item @command{gawk} passes an ``extension id'' into the extension when it first loads the extension. The extension then passes this id back @@ -36785,12 +38468,12 @@ @ref{Dynamic Extensions}, describes the supported API and mechanisms for writing extensions for @command{gawk}. This API was introduced -in version 4.1. However, for many years @command{gawk} +in @value{PVERSION} 4.1. However, for many years @command{gawk} provided an extension mechanism that required knowledge of @command{gawk} internals and that was not as well designed. -In order to provide a transition period, @command{gawk} version -4.1 continues to support the original extension mechanism. +In order to provide a transition period, @command{gawk} @value{PVERSION} 4.1 +continues to support the original extension mechanism. This will be true for the life of exactly one major release. This support will be withdrawn, and removed from the source code, at the next major release. @@ -36816,13 +38499,46 @@ convert any old extensions that you may have to use the new API described in @ref{Dynamic Extensions}. -@c ENDOFRANGE impis -@c ENDOFRANGE gawii +@node Notes summary +@appendixsec Summary + +@itemize @value{BULLET} +@item +@command{gawk}'s extensions can be disabled with either the +@option{--traditional} option or with the @option{--posix} option. +The @option{--parsedebug} option is available if @command{gawk} is +compiled with @samp{-DDEBUG}. + +@item +The source code for @command{gawk} is maintained in a publicly +accessible Git repository. Anyone may check it out and view the source. + +@item +Contributions to @command{gawk} are welcome. Following the steps +outlined in this @value{CHAPTER} will make it easier to integrate +your contributions into the code base. +This applies both to new feature contributions and to ports to +additional operating systems. + +@item +@command{gawk} has some limits---generally those that are imposed by +the machine architecture. + +@item +The extension API design was intended to solve a number of problems +with the previous extension mechanism, enable features needed by +the @code{xgawk} project, and provide binary compatibility going forward. + +@item +The previous extension mechanism is still supported in @value{PVERSION} 4.1 +of @command{gawk}, but it @emph{will} be removed in the next major release. + +@end itemize + @node Basic Concepts @appendix Basic Programming Concepts @cindex programming, concepts -@c STARTOFRANGE procon @cindex programming, concepts This @value{APPENDIX} attempts to define some of the basic concepts @@ -36864,9 +38580,11 @@ @end ifnotdocbook @docbook -
+
General Program Flow - + + +
@end docbook @@ -36889,7 +38607,7 @@ as shown in @ref{figure-process-flow}: @end ifnotdocbook @ifdocbook -as shown in @inlineraw{docbook }: +as shown in @inlineraw{docbook, }: @end ifdocbook @ifnotdocbook @@ -36905,9 +38623,11 @@ @end ifnotdocbook @docbook -
+
Basic Program Stages - + + +
@end docbook @@ -37005,7 +38725,7 @@ referred to as @dfn{scalar} values. Groups of values, such as arrays, are not scalars. -@ref{General Arithmetic}, provided a basic introduction to numeric +@ref{Computer Arithmetic}, provided a basic introduction to numeric types (integer and floating-point) and how they are used in a computer. Please review that information, including a number of caveats that were presented. @@ -37021,14 +38741,14 @@ Humans are used to working in decimal; i.e., base 10. In base 10, numbers go from 0 to 9, and then ``roll over'' into the next -column. (Remember grade school? 42 is 4 times 10 plus 2.) +column. (Remember grade school? 42 = 4 x 10 + 2.) There are other number bases though. Computers commonly use base 2 or @dfn{binary}, base 8 or @dfn{octal}, and base 16 or @dfn{hexadecimal}. In binary, each column represents two times the value in the column to its right. Each column may contain either a 0 or a 1. -Thus, binary 1010 represents 1 times 8, plus 0 times 4, plus 1 times 2, -plus 0 times 1, or decimal 10. +Thus, binary 1010 represents (1 x 8) + (0 x 4) + (1 x 2) ++ (0 x 1), or decimal 10. Octal and hexadecimal are discussed more in @ref{Nondecimal-numbers}. @@ -37056,7 +38776,6 @@ In 1999, a revised ISO C standard was approved and released. Where it makes sense, POSIX @command{awk} is compatible with 1999 ISO C. -@c ENDOFRANGE procon @node Glossary @unnumbered Glossary @@ -37065,9 +38784,16 @@ @item Action A series of @command{awk} statements attached to a rule. If the rule's pattern matches an input record, @command{awk} executes the -rule's action. Actions are always enclosed in curly braces. +rule's action. Actions are always enclosed in braces. (@xref{Action Overview}.) +@cindex Ada programming language +@cindex programming languages, Ada +@item Ada +A programming language originally defined by the U.S.@: Department of +Defense for embedded programming. It was designed to enforce good +Software Engineering practices. + @cindex Spencer, Henry @cindex @command{sed} utility @cindex amazing @command{awk} assembler (@command{aaa}) @@ -37079,13 +38805,6 @@ better written in another language. You can get it from @uref{http://awk.info/?awk100/aaa}. -@cindex Ada programming language -@cindex programming languages, Ada -@item Ada -A programming language originally defined by the U.S.@: Department of -Defense for embedded programming. It was designed to enforce good -Software Engineering practices. - @cindex amazingly workable formatter (@command{awf}) @cindex @command{awf} (amazingly workable formatter) program @item Amazingly Workable Formatter (@command{awf}) @@ -37107,6 +38826,21 @@ These standards often become international standards as well. See also ``ISO.'' +@item Argument +An argument can be two different things. It can be an option or a +@value{FN} passed to a command while invoking it from the command line, or +it can be something passed to a @dfn{function} inside a program, e.g. +inside @command{awk}. + +In the latter case, an argument can be passed to a function in two ways. +Either it is given to the called function by value, i.e., a copy of the +value of the variable is made available to the called function, but the +original variable cannot be modified by the function itself; or it is +given by reference, i.e., a pointer to the interested variable is passed to +the function, which can then directly modify it. In @command{awk} +scalars are passed by value, and arrays are passed by reference. +See ``Pass By Value/Reference.'' + @item Array A grouping of multiple values under the same name. Most languages just provide sequential arrays. @@ -37148,6 +38882,25 @@ @end ifinfo See also ``Bourne Shell.'' +@item Binary +Base-two notation, where the digits are @code{0}--@code{1}. Since +electronic circuitry works ``naturally'' in base 2 (just think of Off/On), +everything inside a computer is calculated using base 2. Each digit +represents the presence (or absence) of a power of 2 and is called a +@dfn{bit}. So, for example, the base-two number @code{10101} is +the same as decimal 21, ((1 x 16) + (1 x 4) + (1 x 1)). + +Since base-two numbers quickly become +very long to read and write, they are usually grouped by 3 (i.e., they are +read as octal numbers), or by 4 (i.e., they are read as hexadecimal +numbers). There is no direct way to insert base 2 numbers in a C program. +If need arises, such numbers are usually inserted as octal or hexadecimal +numbers. The number of base-two digits that fit into registers used for +representing integer numbers in computers is a rough indication of the +computing power of the computer itself. Most computers nowadays use 64 +bits for representing integer numbers in their registers, but 32-bit, +16-bit and 8-bit registers have been widely used in the past. +@xref{Nondecimal-numbers}. @item Bit Short for ``Binary Digit.'' All values in computer memory ultimately reduce to binary digits: values @@ -37170,10 +38923,28 @@ @item Bourne Shell The standard shell (@file{/bin/sh}) on Unix and Unix-like systems, -originally written by Steven R.@: Bourne. +originally written by Steven R.@: Bourne at Bell Laboratories. Many shells (Bash, @command{ksh}, @command{pdksh}, @command{zsh}) are generally upwardly compatible with the Bourne shell. +@item Braces +The characters @samp{@{} and @samp{@}}. Braces are used in +@command{awk} for delimiting actions, compound statements, and function +bodies. + +@item Bracket Expression +Inside a @dfn{regular expression}, an expression included in square +brackets, meant to designate a single character as belonging to a +specified character class. A bracket expression can contain a list of one +or more characters, like @samp{[abc]}, a range of characters, like +@samp{[A-Z]}, or a name, delimited by @samp{:}, that designates a known set +of characters, like @samp{[:digit:]}. The form of bracket expression +enclosed between @samp{:} is independent of the underlying representation +of the character themselves, which could utilize the ASCII, ECBDIC, or +Unicode codesets, depending on the architecture of the computer system, and on +localization. +See also ``Regular Expression.'' + @item Built-in Function The @command{awk} language provides built-in functions that perform various numerical, I/O-related, and string computations. Examples are @@ -37219,9 +38990,6 @@ Changing some of them affects @command{awk}'s running environment. (@xref{Built-in Variables}.) -@item Braces -See ``Curly Braces.'' - @item C The system programming language that most GNU software is written in. The @command{awk} programming language has C-like syntax, and this @value{DOCUMENT} @@ -37230,9 +38998,25 @@ In general, @command{gawk} attempts to be as similar to the 1990 version of ISO C as makes sense. +@item C Shell +The C Shell (@command{csh} or its improved version, @command{tcsh}) is a Unix shell that was +created by Bill Joy in the late 1970s. The C shell was differentiated from +other shells by its interactive features and overall style, which +looks more like C. The C Shell is not backward compatible with the Bourne +Shell, so special attention is required when converting scripts +written for other Unix shells to the C shell, especially with regard to the management of +shell variables. +See also ``Bourne Shell.'' + @item C++ A popular object-oriented programming language derived from C. +@item Character Class +See ``Bracket Expression.'' + +@item Character List +See ``Bracket Expression.'' + @cindex ASCII @cindex ISO 8859-1 @cindex ISO Latin-1 @@ -37245,7 +39029,7 @@ Standard Code for Information Interchange). Many European countries use an extension of ASCII known as ISO-8859-1 (ISO Latin-1). The @uref{http://www.unicode.org, Unicode character set} is -becoming increasingly popular and standard, and is particularly +increasingly popular and standard, and is particularly widely used on GNU/Linux systems. @cindex Kernighan, Brian @@ -37256,12 +39040,65 @@ and produces @command{pic} input for drawing them. It was written in @command{awk} by Brian Kernighan and Jon Bentley, and is available from -@uref{http://netlib.sandia.gov/netlib/typesetting/chem.gz}. +@uref{http://netlib.org/typesetting/chem}. + +@item Comparison Expression +A relation that is either true or false, such as @samp{a < b}. +Comparison expressions are used in @code{if}, @code{while}, @code{do}, +and @code{for} +statements, and in patterns to select which input records to process. +(@xref{Typing and Comparison}.) + +@cindex compiled programs +@item Compiler +A program that translates human-readable source code into +machine-executable object code. The object code is then executed +directly by the computer. +See also ``Interpreter.'' + +@item Complemented Bracket Expression +The negation of a @dfn{bracket expression}. All that is @emph{not} +described by a given bracket expression. The symbol @samp{^} precedes +the negated bracket expression. E.g.: @samp{[[^:digit:]} +designates whatever character is not a digit. @samp{[^bad]} +designates whatever character is not one of the letters @samp{b}, @samp{a}, +or @samp{d}. +See ``Bracket Expression.'' + +@item Compound Statement +A series of @command{awk} statements, enclosed in curly braces. Compound +statements may be nested. +(@xref{Statements}.) + +@item Computed Regexps +See ``Dynamic Regular Expressions.'' + +@item Concatenation +Concatenating two strings means sticking them together, one after another, +producing a new string. For example, the string @samp{foo} concatenated with +the string @samp{bar} gives the string @samp{foobar}. +(@xref{Concatenation}.) + +@item Conditional Expression +An expression using the @samp{?:} ternary operator, such as +@samp{@var{expr1} ? @var{expr2} : @var{expr3}}. The expression +@var{expr1} is evaluated; if the result is true, the value of the whole +expression is the value of @var{expr2}; otherwise the value is +@var{expr3}. In either case, only one of @var{expr2} and @var{expr3} +is evaluated. (@xref{Conditional Exp}.) + +@item Control Statement +A control statement is an instruction to perform a given operation or a set +of operations inside an @command{awk} program, if a given condition is +true. Control statements are: @code{if}, @code{for}, @code{while}, and +@code{do} +(@pxref{Statements}). +@cindex McIlroy, Doug @cindex cookie @item Cookie A peculiar goodie, token, saying or remembrance -produced by or presented to a program. (With thanks to Doug McIlroy.) +produced by or presented to a program. (With thanks to Professor Doug McIlroy.) @ignore From: Doug McIlroy Date: Sat, 13 Oct 2012 19:55:25 -0400 @@ -37305,43 +39142,8 @@ @item Coprocess A subordinate program with which two-way communications is possible. -@cindex compiled programs -@item Compiler -A program that translates human-readable source code into -machine-executable object code. The object code is then executed -directly by the computer. -See also ``Interpreter.'' - -@item Compound Statement -A series of @command{awk} statements, enclosed in curly braces. Compound -statements may be nested. -(@xref{Statements}.) - -@item Concatenation -Concatenating two strings means sticking them together, one after another, -producing a new string. For example, the string @samp{foo} concatenated with -the string @samp{bar} gives the string @samp{foobar}. -(@xref{Concatenation}.) - -@item Conditional Expression -An expression using the @samp{?:} ternary operator, such as -@samp{@var{expr1} ? @var{expr2} : @var{expr3}}. The expression -@var{expr1} is evaluated; if the result is true, the value of the whole -expression is the value of @var{expr2}; otherwise the value is -@var{expr3}. In either case, only one of @var{expr2} and @var{expr3} -is evaluated. (@xref{Conditional Exp}.) - -@item Comparison Expression -A relation that is either true or false, such as @samp{a < b}. -Comparison expressions are used in @code{if}, @code{while}, @code{do}, -and @code{for} -statements, and in patterns to select which input records to process. -(@xref{Typing and Comparison}.) - @item Curly Braces -The characters @samp{@{} and @samp{@}}. Curly braces are used in -@command{awk} for delimiting actions, compound statements, and function -bodies. +See ``Braces.'' @cindex dark corner @item Dark Corner @@ -37385,15 +39187,15 @@ @code{"foo"}, but it may also be an expression whose value can vary. (@xref{Computed Regexps}.) +@item Empty String +See ``Null String.'' + @item Environment -A collection of strings, of the form @var{name}@code{=}@code{val}, that each +A collection of strings, of the form @samp{@var{name}=@var{val}}, that each program has available to it. Users generally place values into the environment in order to provide information to various programs. Typical examples are the environment variables @env{HOME} and @env{PATH}. -@item Empty String -See ``Null String.'' - @cindex epoch, definition of @item Epoch The date used as the ``beginning of time'' for timestamps. @@ -37420,11 +39222,11 @@ @item Field When @command{awk} reads an input record, it splits the record into pieces separated by whitespace (or by a separator regexp that you can -change by setting the built-in variable @code{FS}). Such pieces are +change by setting the predefined variable @code{FS}). Such pieces are called fields. If the pieces are of fixed length, you can use the built-in variable @code{FIELDWIDTHS} to describe their lengths. If you wish to specify the contents of fields instead of the field -separator, you can use the built-in variable @code{FPAT} to do so. +separator, you can use the predefined variable @code{FPAT} to do so. (@xref{Field Separators}, @ref{Constant Size}, and @@ -37440,25 +39242,21 @@ See also ``Double Precision'' and ``Single Precision.'' @item Format -Format strings are used to control the appearance of output in the -@code{strftime()} and @code{sprintf()} functions, and are used in the +Format strings control the appearance of output in the +@code{strftime()} and @code{sprintf()} functions, and in the @code{printf} statement as well. Also, data conversions from numbers to strings -are controlled by the format strings contained in the built-in variables +are controlled by the format strings contained in the predefined variables @code{CONVFMT} and @code{OFMT}. (@xref{Control Letters}.) +@item Fortran +Shorthand for FORmula TRANslator, one of the first programming languages +available for scientific calculations. It was created by John Backus, +and has been available since 1957. It is still in use today. + @item Free Documentation License This document describes the terms under which this @value{DOCUMENT} is published and may be copied. (@xref{GNU Free Documentation License}.) -@item Function -A specialized group of statements used to encapsulate general -or program-specific tasks. @command{awk} has a number of built-in -functions, and also allows you to define your own. -(@xref{Functions}.) - -@item FSF -See ``Free Software Foundation.'' - @cindex FSF (Free Software Foundation) @cindex Free Software Foundation (FSF) @cindex Stallman, Richard @@ -37468,6 +39266,26 @@ It was founded by Richard M.@: Stallman, the author of the original Emacs editor. GNU Emacs is the most widely used version of Emacs today. +@item FSF +See ``Free Software Foundation.'' + +@item Function +A part of an @command{awk} program that can be invoked from every point of +the program, to perform a task. @command{awk} has several built-in +functions. +Users can define their own functions in every part of the program. +Function can be recursive, i.e., they may invoke themselves. +@xref{Functions}. +In @command{gawk} it is also possible to have functions shared +among different programs, and included where required using the +@code{@@include} directive +(@pxref{Include Files}). +In @command{gawk} the name of the function that should be invoked +can be generated at run time, i.e., dynamically. +The @command{gawk} extension API provides constructor functions +(@pxref{Constructor Functions}). + + @item @command{gawk} The GNU implementation of @command{awk}. @@ -37510,7 +39328,7 @@ @code{A}--@code{F}, with @samp{A} representing 10, @samp{B} representing 11, and so on, up to @samp{F} for 15. Hexadecimal numbers are written in C using a leading @samp{0x}, -to indicate their base. Thus, @code{0x12} is 18 (1 times 16 plus 2). +to indicate their base. Thus, @code{0x12} is 18 ((1 x 16) + 2). @xref{Nondecimal-numbers}. @item I/O @@ -37584,12 +39402,18 @@ @code{function}, @code{func}, @code{if}, -@code{nextfile}, @code{next}, +@code{nextfile}, @code{switch}, and @code{while}. +@item Korn Shell +The Korn Shell (@command{ksh}) is a Unix shell which was developed by David Korn at Bell +Laboratories in the early 1980s. The Korn Shell is backward-compatible with the Bourne +shell and includes many features of the C shell. +See also ``Bourne Shell.'' + @cindex LGPL (Lesser General Public License) @cindex Lesser General Public License (LGPL) @cindex GNU Lesser General Public License @@ -37598,12 +39422,12 @@ or shared objects, and their source code may be distributed. -@item Linux -See ``GNU/Linux.'' - @item LGPL See ``Lesser General Public License.'' +@item Linux +See ``GNU/Linux.'' + @item Localization The process of providing the data necessary for an internationalized program to work in a particular language. @@ -37629,6 +39453,14 @@ Instead, they denote regular expression operations, such as repetition, grouping, or alternation. +@item Nesting +Nesting is where information is organized in layers, or where objects +contain other similar objects. +In @command{gawk} the @code{@@include} +directive can be nested. The ``natural'' nesting of arithmetic and +logical operations can be changed using parentheses +(@pxref{Precedence}). + @item No-op An operation that does nothing. @@ -37646,12 +39478,13 @@ @item Octal Base-eight notation, where the digits are @code{0}--@code{7}. Octal numbers are written in C using a leading @samp{0}, -to indicate their base. Thus, @code{013} is 11 (one times 8 plus 3). +to indicate their base. Thus, @code{013} is 11 ((1 x 8) + 3). @xref{Nondecimal-numbers}. -@cindex P1003.1 POSIX standard -@item P1003.1 -See ``POSIX.'' +@item Output Record +A single chunk of data that is written out by @command{awk}. Usually, an +@command{awk} output record consists of one or more lines of text. +@xref{Records}. @item Pattern Patterns tell @command{awk} which input records are interesting to which @@ -37667,6 +39500,9 @@ source of computer usage problems. (Problem Exists Between Keyboard And Chair.) +@item Plug-in +See ``Extensions.'' + @item POSIX The name for a series of standards that specify a Portable Operating System interface. The ``IX'' denotes @@ -37691,10 +39527,13 @@ can specify ranges of input lines for @command{awk} to process or it can specify single lines. (@xref{Pattern Overview}.) +@item Record +See ``Input record'' and ``Output record.'' + @item Recursion When a function calls itself, either directly or indirectly. -As long as this is not clear, refer to the entry for ``recursion.'' If this is clear, stop, and proceed to the next entry. +Otherwise, refer to the entry for ``recursion.'' @item Redirection Redirection means performing input from something other than the standard input @@ -37708,6 +39547,15 @@ (@xref{Getline}, and @ref{Redirection}.) +@item Reference Counts +An internal mechanism in @command{gawk} to minimize the amount of memory +needed to store the value of string variables. If the value assumed by +a variable is used in more than one place, only one copy of the value +itself is kept, and the associated reference count is increased when the +same value is used by an additional variable, and decresed when the related +variable is no longer in use. When the reference count goes to zero, +the memory space used to store the value of the variable is freed. + @item Regexp See ``Regular Expression.'' @@ -37725,6 +39573,15 @@ when you write the @command{awk} program and cannot be changed during its execution. (@xref{Regexp Usage}.) +@item Regular Expression Operators +See ``Metacharacters.'' + +@item Rounding +Rounding the result of an arithmetic operation can be tricky. +More than one way of rounding exists, and in @command{gawk} +it is possible to choose which method should be used in a program. +@xref{Setting the rounding mode}. + @item Rule A segment of an @command{awk} program that specifies how to process single input records. A rule consists of a @dfn{pattern} and an @dfn{action}. @@ -37745,12 +39602,12 @@ In @command{gawk}, a list of directories to search for @command{awk} program source files. In the shell, a list of directories to search for executable programs. -@item Seed -The initial value, or starting point, for a sequence of random numbers. - @item @command{sed} See ``Stream Editor.'' +@item Seed +The initial value, or starting point, for a sequence of random numbers. + @item Shell The command interpreter for Unix and POSIX-compliant systems. The shell works both interactively, and as a programming language @@ -37773,17 +39630,23 @@ An internal representation of numbers that can have fractional parts. Single precision numbers keep track of fewer digits than do double precision numbers, but operations on them are sometimes less expensive in terms of CPU time. -This is the type used by some very old versions of @command{awk} to store +This is the type used by some ancient versions of @command{awk} to store numeric values. It is the C type @code{float}. @item Space The character generated by hitting the space bar on the keyboard. @item Special File -A file name interpreted internally by @command{gawk}, instead of being handed +A @value{FN} interpreted internally by @command{gawk}, instead of being handed directly to the underlying operating system---for example, @file{/dev/stderr}. (@xref{Special Files}.) +@item Statement +An expression inside an @command{awk} program in the action part +of a pattern--action rule, or inside an +@command{awk} function. A statement can be a variable assignment, +an array operation, a loop, etc. + @item Stream Editor A program that reads records from an input stream and processes them one or more at a time. This is in contrast with batch programs, which may @@ -37810,7 +39673,7 @@ A value in the ``seconds since the epoch'' format used by Unix and POSIX systems. Used for the @command{gawk} functions @code{mktime()}, @code{strftime()}, and @code{systime()}. -See also ``Epoch'' and ``UTC.'' +See also ``Epoch,'' ``GMT,'' and ``UTC.'' @cindex Linux @cindex GNU/Linux @@ -37834,11 +39697,18 @@ reference time for day and date calculations. See also ``Epoch'' and ``GMT.'' +@item Variable +A name for a value. In @command{awk}, variables may be either scalars +or arrays. + @item Whitespace A sequence of space, TAB, or newline characters occurring inside an input record or a string. + @end table +@end ifclear + @c The GNU General Public License. @node Copying @unnumbered GNU General Public License @@ -37850,7 +39720,7 @@ @end docbook @c This file is intended to be included within another document, -@c hence no sectioning command or @node. +@c hence no sectioning command or @node. @display Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/} @@ -38072,7 +39942,7 @@ conditions: @enumerate a -@item +@item The work must carry prominent notices stating that you modified it, and giving a relevant date. @@ -38522,7 +40392,7 @@ the ``copyright'' line and a pointer to where the full notice is found. @smallexample -@var{one line to give the program's name and a brief idea of what it does.} +@var{one line to give the program's name and a brief idea of what it does.} Copyright (C) @var{year} @var{name of author} This program is free software: you can redistribute it and/or modify @@ -38545,7 +40415,7 @@ notice like this when it starts in an interactive mode: @smallexample -@var{program} Copyright (C) @var{year} @var{name of author} +@var{program} Copyright (C) @var{year} @var{name of author} This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}. This is free software, and you are welcome to redistribute it under certain conditions; type @samp{show c} for details. @@ -38568,7 +40438,7 @@ the GNU Lesser General Public License instead of this License. But first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}. - +@ifclear FOR_PRINT @c The GNU Free Documentation License. @node GNU Free Documentation License @unnumbered GNU Free Documentation License @@ -39083,9 +40953,7 @@ free software license, such as the GNU General Public License, to permit their use in free software. -@c Local Variables: -@c ispell-local-pdict: "ispell-dict" -@c End: +@end ifclear @ifnotdocbook @node Index @@ -39126,16 +40994,18 @@ Use --foo, not -Wfoo when describing long options Use "Bell Laboratories", but not "Bell Labs". Use "behavior" instead of "behaviour". + Use "coprocess" instead of "co-process". Use "zeros" instead of "zeroes". Use "nonzero" not "non-zero". Use "runtime" not "run time" or "run-time". - Use "command-line" not "command line". + Use "command-line" as an adjective and "command line" as a noun. Use "online" not "on-line". Use "whitespace" not "white space". Use "Input/Output", not "input/output". Also "I/O", not "i/o". Use "lefthand"/"righthand", not "left-hand"/"right-hand". Use "workaround", not "work-around". Use "startup"/"cleanup", not "start-up"/"clean-up" + Use "filesystem", not "file system" Use @code{do}, and not @code{do}-@code{while}, except where actually discussing the do-while. Use "versus" in text and "vs." in index entries @@ -39150,8 +41020,6 @@ The numbers zero through ten should be spelled out, except when talking about file descriptor numbers. > 10 and < 0, it's ok to use numbers. - In tables, put command-line options in @code, while in the text, - put them in @option. For most cases, do NOT put a comma before "and", "or" or "but". But exercise taste with this rule. Don't show the awk command with a program in quotes when it's @@ -39198,9 +41066,6 @@ Suggestions: ------------ -% Next edition: -% 1. Standardize the error messages from the functions and programs -% in the two sample code chapters. Better sidebars can almost sort of be done with: @@ -39232,3 +41097,6 @@ } which sorta sucks. + +TODO: +Check that all dark corners are indexed properly. diff -urN gawk-4.1.1/doc/texinfo.tex gawk-4.1.2/doc/texinfo.tex --- gawk-4.1.1/doc/texinfo.tex 2014-04-08 19:12:01.000000000 +0300 +++ gawk-4.1.2/doc/texinfo.tex 2015-04-27 18:09:07.000000000 +0300 @@ -3,11 +3,12 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2014-03-18.17} +\def\texinfoversion{2015-02-05.16} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. +% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 +% Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -96,7 +97,9 @@ \let\ptexraggedright=\raggedright \let\ptexrbrace=\} \let\ptexslash=\/ +\let\ptexsp=\sp \let\ptexstar=\* +\let\ptexsup=\sup \let\ptext=\t \let\ptextop=\top {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode @@ -1010,24 +1013,15 @@ % paragraph. % \gdef\dosuppressfirstparagraphindent{% - \gdef\indent{% - \restorefirstparagraphindent - \indent - }% - \gdef\noindent{% - \restorefirstparagraphindent - \noindent - }% - \global\everypar = {% - \kern -\parindent - \restorefirstparagraphindent - }% + \gdef\indent {\restorefirstparagraphindent \indent}% + \gdef\noindent{\restorefirstparagraphindent \noindent}% + \global\everypar = {\kern -\parindent \restorefirstparagraphindent}% } - +% \gdef\restorefirstparagraphindent{% - \global \let \indent = \ptexindent - \global \let \noindent = \ptexnoindent - \global \everypar = {}% + \global\let\indent = \ptexindent + \global\let\noindent = \ptexnoindent + \global\everypar = {}% } @@ -2090,12 +2084,9 @@ \endgroup } - % In order for the font changes to affect most math symbols and letters, -% we have to define the \textfont of the standard families. Since -% texinfo doesn't allow for producing subscripts and superscripts except -% in the main text, we don't bother to reset \scriptfont and -% \scriptscriptfont (which would also require loading a lot more fonts). +% we have to define the \textfont of the standard families. We don't +% bother to reset \scriptfont and \scriptscriptfont; awaiting user need. % \def\resetmathfonts{% \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy @@ -2109,8 +2100,8 @@ % \tenSTYLE to set the current font. % % Each font-changing command also sets the names \lsize (one size lower) -% and \lllsize (three sizes lower). These relative commands are used in -% the LaTeX logo and acronyms. +% and \lllsize (three sizes lower). These relative commands are used +% in, e.g., the LaTeX logo and acronyms. % % This all needs generalizing, badly. % @@ -2146,7 +2137,7 @@ \let\tenttsl=\secttsl \def\curfontsize{sec}% \def\lsize{subsec}\def\lllsize{reduced}% - \resetmathfonts \setleading{16pt}} + \resetmathfonts \setleading{17pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc @@ -2851,6 +2842,8 @@ \let\v=\check \let\~=\tilde \let\dotaccent=\dot + % have to provide another name for sup operator + \let\mathopsup=\sup $\finishmath } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. @@ -2874,6 +2867,18 @@ } } +% for @sub and @sup, if in math mode, just do a normal sub/superscript. +% If in text, use math to place as sub/superscript, but switch +% into text mode, with smaller fonts. This is a different font than the +% one used for real math sub/superscripts (8pt vs. 7pt), but let's not +% fix it (significant additions to font machinery) until someone notices. +% +\def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi} +\def\finishsub#1{$\sb{\hbox{\selectfonts\lllsize #1}}$}% +% +\def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} +\def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}% + % ctrl is no longer a Texinfo command, but leave this definition for fun. \def\ctrl #1{{\tt \rawbackslash \hat}#1} @@ -4484,7 +4489,6 @@ % Called from \indexdummies and \atdummies. % \def\commondummies{% - % % \definedummyword defines \#1 as \string\#1\space, thus effectively % preventing its expansion. This is used only for control words, % not control letters, because the \space would be incorrect for @@ -4561,6 +4565,7 @@ \definedummyword\guilsinglright \definedummyword\lbracechar \definedummyword\leq + \definedummyword\mathopsup \definedummyword\minus \definedummyword\ogonek \definedummyword\pounds @@ -4574,6 +4579,8 @@ \definedummyword\quotesinglbase \definedummyword\rbracechar \definedummyword\result + \definedummyword\sub + \definedummyword\sup \definedummyword\textdegree % % We want to disable all macros so that they are not expanded by \write. @@ -4648,6 +4655,7 @@ \definedummyword\samp \definedummyword\strong \definedummyword\tie + \definedummyword\U \definedummyword\uref \definedummyword\url \definedummyword\var @@ -5739,13 +5747,16 @@ % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. +% Not used for @heading series. % % To test against our argument. \def\Ynothingkeyword{Ynothing} -\def\Yomitfromtockeyword{Yomitfromtoc} \def\Yappendixkeyword{Yappendix} +\def\Yomitfromtockeyword{Yomitfromtoc} % \def\chapmacro#1#2#3{% + \checkenv{}% chapters, etc., should not start inside an environment. + % % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs @@ -5798,6 +5809,7 @@ % {% \chapfonts \rmisbold + \let\footnote=\errfootnoteheading % give better error message % % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called @@ -5891,22 +5903,29 @@ % Print any size, any type, section title. % -% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is -% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the -% section number. +% #1 is the text of the title, +% #2 is the section level (sec/subsec/subsubsec), +% #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc), +% #4 is the section number. % \def\seckeyword{sec} % \def\sectionheading#1#2#3#4{% {% - \checkenv{}% should not be in an environment. + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + % It is ok for the @heading series commands to appear inside an + % environment (it's been historically allowed, though the logic is + % dubious), but not the others. + \ifx\temptype\Yomitfromtockeyword\else + \checkenv{}% non-@*heading should not be in an environment. + \fi + \let\footnote=\errfootnoteheading % % Switch to the right set of fonts. \csname #2fonts\endcsname \rmisbold % - \def\sectionlevel{#2}% - \def\temptype{#3}% - % % Insert first mark before the heading break (see notes for \domark). \let\prevsectiondefs=\lastsectiondefs \ifx\temptype\Ynothingkeyword @@ -6333,6 +6352,7 @@ % other math active characters (just in case), to plain's definitions. \mathactive % + % Inverse of the list at the beginning of the file. \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc @@ -6348,7 +6368,9 @@ \let\+=\tabalign \let\}=\ptexrbrace \let\/=\ptexslash + \let\sp=\ptexsp \let\*=\ptexstar + %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode \let\t=\ptext \expandafter \let\csname top\endcsname=\ptextop % we've made it outer \let\frenchspacing=\plainfrenchspacing @@ -7414,7 +7436,6 @@ % % \anythingelse will almost certainly be an error of some kind. - % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. @@ -7523,8 +7544,7 @@ % the catcode regime underwhich the body was input). % % If you compile with TeX (not eTeX), and you have macros with 10 or more -% arguments, you need that no macro has more than 256 arguments, otherwise an -% error is produced. +% arguments, no macro can have more than 256 arguments (else error). \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax @@ -8318,14 +8338,7 @@ \catcode`\\=\other % % Make the characters 128-255 be printing characters. - {% - \count1=128 - \def\loop{% - \catcode\count1=\other - \advance\count1 by 1 - \ifnum \count1<256 \loop \fi - }% - }% + {\setnonasciicharscatcodenonglobal\other}% % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 @@ -8359,9 +8372,6 @@ % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% - \let\indent=\ptexindent - \let\noindent=\ptexnoindent - % \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % @@ -8388,7 +8398,7 @@ % % Nested footnotes are not supported in TeX, that would take a lot % more work. (\startsavinginserts does not suffice.) - \let\footnote=\errfootnote + \let\footnote=\errfootnotenest % % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. @@ -8427,12 +8437,17 @@ } }%end \catcode `\@=11 -\def\errfootnote{% +\def\errfootnotenest{% \errhelp=\EMsimple \errmessage{Nested footnotes not supported in texinfo.tex, even though they work in makeinfo; sorry} } +\def\errfootnoteheading{% + \errhelp=\EMsimple + \errmessage{Footnotes in chapters, sections, etc., are not supported} +} + % In case a @footnote appears in a vbox, save the footnote text and create % the real \insert just after the vbox finished. Otherwise, the insertion % would be lost. @@ -8856,20 +8871,20 @@ { \catcode`\_ = \active \globaldefs=1 -\parseargdef\documentlanguage{\begingroup - \let_=\normalunderscore % normal _ character for filenames +\parseargdef\documentlanguage{% \tex % read txi-??.tex file in plain TeX. % Read the file by the name they passed if it exists. + \let_ = \normalunderscore % normal _ character for filename test \openin 1 txi-#1.tex \ifeof 1 - \documentlanguagetrywithoutunderscore{#1_\finish}% + \documentlanguagetrywithoutunderscore #1_\finish \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 \endgroup % end raw TeX -\endgroup} +} % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. @@ -8934,6 +8949,7 @@ \catcode\count255=#1\relax \advance\count255 by 1 \repeat + } % @documentencoding sets the definition of non-ASCII characters @@ -8968,10 +8984,12 @@ % \else \ifx \declaredencoding \utfeight \setnonasciicharscatcode\active - \utfeightchardefs + % since we already invoked \utfeightchardefs at the top level + % (below), do not re-invoke it, then our check for duplicated + % definitions triggers. Making non-ascii chars active is enough. % \else - \message{Unknown document encoding #1, ignoring.}% + \message{Ignoring unknown document encoding: #1.}% % \fi % utfeight \fi % latnine @@ -8980,10 +8998,11 @@ \fi % ascii } +% emacs-page % A message to be logged when using a character that isn't available % the default font encoding (OT1). % -\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} +\def\missingcharmsg#1{\message{Character missing, sorry: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} @@ -9019,12 +9038,10 @@ \gdef^^b4{\'{}} \gdef^^b5{$\mu$} \gdef^^b6{\P} - % - \gdef^^b7{$^.$} + \gdef^^b7{\ifmmode\cdot\else $\cdot$\fi} \gdef^^b8{\cedilla\ } \gdef^^b9{$^1$} \gdef^^ba{\ordm} - % \gdef^^bb{\guillemetright} \gdef^^bc{$1\over4$} \gdef^^bd{$1\over2$} @@ -9279,6 +9296,18 @@ \UTFviiiLoop \endgroup +\def\globallet{\global\let} % save some \expandafter's below + +% @U{xxxx} to produce U+xxxx, if we support it. +\def\U#1{% + \expandafter\ifx\csname uni:#1\endcsname \relax + \errhelp = \EMsimple + \errmessage{Unicode character U+#1 not supported, sorry}% + \else + \csname uni:#1\endcsname + \fi +} + \begingroup \catcode`\"=12 \catcode`\<=12 @@ -9287,7 +9316,6 @@ \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 - \gdef\DeclareUnicodeCharacter#1#2{% \countUTFz = "#1\relax %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% @@ -9302,6 +9330,13 @@ \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter \gdef\UTFviiiTmp{#2}% + % + \expandafter\ifx\csname uni:#1\endcsname \relax \else + \errmessage{Internal error, already defined: #1}% + \fi + % + % define an additional control sequence for this code point. + \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp \endgroup} \gdef\parseXMLCharref{% @@ -9339,23 +9374,49 @@ \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup +% https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M +% U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block) +% U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) +% U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A +% U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B +% +% Many of our renditions are less than wonderful, and all the missing +% characters are available somewhere. Loading the necessary fonts +% awaits user request. We can't truly support Unicode without +% reimplementing everything that's been done in LaTeX for many years, +% plus probably using luatex or xetex, and who knows what else. +% We won't be doing that here in this simple file. But we can try to at +% least make most of the characters not bomb out. +% \def\utfeightchardefs{% \DeclareUnicodeCharacter{00A0}{\tie} \DeclareUnicodeCharacter{00A1}{\exclamdown} \DeclareUnicodeCharacter{00A3}{\pounds} + \DeclareUnicodeCharacter{00A7}{\S} \DeclareUnicodeCharacter{00A8}{\"{ }} \DeclareUnicodeCharacter{00A9}{\copyright} \DeclareUnicodeCharacter{00AA}{\ordf} \DeclareUnicodeCharacter{00AB}{\guillemetleft} + \DeclareUnicodeCharacter{00AC}{\ifmmode\lnot\else $\lnot$\fi} \DeclareUnicodeCharacter{00AD}{\-} \DeclareUnicodeCharacter{00AE}{\registeredsymbol} \DeclareUnicodeCharacter{00AF}{\={ }} \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} + \DeclareUnicodeCharacter{00B1}{\ifmmode\pm\else $\pm$\fi} + \DeclareUnicodeCharacter{00B2}{$^2$} + \DeclareUnicodeCharacter{00B3}{$^3$} \DeclareUnicodeCharacter{00B4}{\'{ }} + \DeclareUnicodeCharacter{00B5}{$\mu$} + \DeclareUnicodeCharacter{00B6}{\P} + \DeclareUnicodeCharacter{00B7}{\ifmmode\cdot\else $\cdot$\fi} \DeclareUnicodeCharacter{00B8}{\cedilla{ }} + \DeclareUnicodeCharacter{00B9}{$^1$} \DeclareUnicodeCharacter{00BA}{\ordm} \DeclareUnicodeCharacter{00BB}{\guillemetright} + \DeclareUnicodeCharacter{00BC}{$1\over4$} + \DeclareUnicodeCharacter{00BD}{$1\over2$} + \DeclareUnicodeCharacter{00BE}{$3\over4$} \DeclareUnicodeCharacter{00BF}{\questiondown} \DeclareUnicodeCharacter{00C0}{\`A} @@ -9382,6 +9443,7 @@ \DeclareUnicodeCharacter{00D4}{\^O} \DeclareUnicodeCharacter{00D5}{\~O} \DeclareUnicodeCharacter{00D6}{\"O} + \DeclareUnicodeCharacter{00D7}{\ifmmode\times\else $\times$\fi} \DeclareUnicodeCharacter{00D8}{\O} \DeclareUnicodeCharacter{00D9}{\`U} \DeclareUnicodeCharacter{00DA}{\'U} @@ -9415,6 +9477,7 @@ \DeclareUnicodeCharacter{00F4}{\^o} \DeclareUnicodeCharacter{00F5}{\~o} \DeclareUnicodeCharacter{00F6}{\"o} + \DeclareUnicodeCharacter{00F7}{\ifmmode\div\else $\div$\fi} \DeclareUnicodeCharacter{00F8}{\o} \DeclareUnicodeCharacter{00F9}{\`u} \DeclareUnicodeCharacter{00FA}{\'u} @@ -9434,20 +9497,23 @@ \DeclareUnicodeCharacter{0107}{\'c} \DeclareUnicodeCharacter{0108}{\^C} \DeclareUnicodeCharacter{0109}{\^c} - \DeclareUnicodeCharacter{0118}{\ogonek{E}} - \DeclareUnicodeCharacter{0119}{\ogonek{e}} \DeclareUnicodeCharacter{010A}{\dotaccent{C}} \DeclareUnicodeCharacter{010B}{\dotaccent{c}} \DeclareUnicodeCharacter{010C}{\v{C}} \DeclareUnicodeCharacter{010D}{\v{c}} \DeclareUnicodeCharacter{010E}{\v{D}} + \DeclareUnicodeCharacter{010F}{d'} + \DeclareUnicodeCharacter{0110}{\DH} + \DeclareUnicodeCharacter{0111}{\dh} \DeclareUnicodeCharacter{0112}{\=E} \DeclareUnicodeCharacter{0113}{\=e} \DeclareUnicodeCharacter{0114}{\u{E}} \DeclareUnicodeCharacter{0115}{\u{e}} \DeclareUnicodeCharacter{0116}{\dotaccent{E}} \DeclareUnicodeCharacter{0117}{\dotaccent{e}} + \DeclareUnicodeCharacter{0118}{\ogonek{E}} + \DeclareUnicodeCharacter{0119}{\ogonek{e}} \DeclareUnicodeCharacter{011A}{\v{E}} \DeclareUnicodeCharacter{011B}{\v{e}} \DeclareUnicodeCharacter{011C}{\^G} @@ -9457,14 +9523,20 @@ \DeclareUnicodeCharacter{0120}{\dotaccent{G}} \DeclareUnicodeCharacter{0121}{\dotaccent{g}} + \DeclareUnicodeCharacter{0122}{\cedilla{G}} + \DeclareUnicodeCharacter{0123}{\cedilla{g}} \DeclareUnicodeCharacter{0124}{\^H} \DeclareUnicodeCharacter{0125}{\^h} + \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}} + \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}} \DeclareUnicodeCharacter{0128}{\~I} \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} \DeclareUnicodeCharacter{012A}{\=I} \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} \DeclareUnicodeCharacter{012C}{\u{I}} \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} + \DeclareUnicodeCharacter{012E}{\ogonek{I}} + \DeclareUnicodeCharacter{012F}{\ogonek{i}} \DeclareUnicodeCharacter{0130}{\dotaccent{I}} \DeclareUnicodeCharacter{0131}{\dotless{i}} @@ -9472,15 +9544,29 @@ \DeclareUnicodeCharacter{0133}{ij} \DeclareUnicodeCharacter{0134}{\^J} \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} + \DeclareUnicodeCharacter{0136}{\cedilla{K}} + \DeclareUnicodeCharacter{0137}{\cedilla{k}} + \DeclareUnicodeCharacter{0138}{\ifmmode\kappa\else $\kappa$\fi} \DeclareUnicodeCharacter{0139}{\'L} \DeclareUnicodeCharacter{013A}{\'l} + \DeclareUnicodeCharacter{013B}{\cedilla{L}} + \DeclareUnicodeCharacter{013C}{\cedilla{l}} + \DeclareUnicodeCharacter{013D}{L'}% should kern + \DeclareUnicodeCharacter{013E}{l'}% should kern + \DeclareUnicodeCharacter{013F}{L\U{00B7}} + \DeclareUnicodeCharacter{0140}{l\U{00B7}} \DeclareUnicodeCharacter{0141}{\L} \DeclareUnicodeCharacter{0142}{\l} \DeclareUnicodeCharacter{0143}{\'N} \DeclareUnicodeCharacter{0144}{\'n} + \DeclareUnicodeCharacter{0145}{\cedilla{N}} + \DeclareUnicodeCharacter{0146}{\cedilla{n}} \DeclareUnicodeCharacter{0147}{\v{N}} \DeclareUnicodeCharacter{0148}{\v{n}} + \DeclareUnicodeCharacter{0149}{'n} + \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}} + \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}} \DeclareUnicodeCharacter{014C}{\=O} \DeclareUnicodeCharacter{014D}{\=o} \DeclareUnicodeCharacter{014E}{\u{O}} @@ -9492,6 +9578,8 @@ \DeclareUnicodeCharacter{0153}{\oe} \DeclareUnicodeCharacter{0154}{\'R} \DeclareUnicodeCharacter{0155}{\'r} + \DeclareUnicodeCharacter{0156}{\cedilla{R}} + \DeclareUnicodeCharacter{0157}{\cedilla{r}} \DeclareUnicodeCharacter{0158}{\v{R}} \DeclareUnicodeCharacter{0159}{\v{r}} \DeclareUnicodeCharacter{015A}{\'S} @@ -9503,10 +9591,12 @@ \DeclareUnicodeCharacter{0160}{\v{S}} \DeclareUnicodeCharacter{0161}{\v{s}} - \DeclareUnicodeCharacter{0162}{\cedilla{t}} - \DeclareUnicodeCharacter{0163}{\cedilla{T}} + \DeclareUnicodeCharacter{0162}{\cedilla{T}} + \DeclareUnicodeCharacter{0163}{\cedilla{t}} \DeclareUnicodeCharacter{0164}{\v{T}} - + \DeclareUnicodeCharacter{0165}{\v{t}} + \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}} + \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}} \DeclareUnicodeCharacter{0168}{\~U} \DeclareUnicodeCharacter{0169}{\~u} \DeclareUnicodeCharacter{016A}{\=U} @@ -9518,6 +9608,8 @@ \DeclareUnicodeCharacter{0170}{\H{U}} \DeclareUnicodeCharacter{0171}{\H{u}} + \DeclareUnicodeCharacter{0172}{\ogonek{U}} + \DeclareUnicodeCharacter{0173}{\ogonek{u}} \DeclareUnicodeCharacter{0174}{\^W} \DeclareUnicodeCharacter{0175}{\^w} \DeclareUnicodeCharacter{0176}{\^Y} @@ -9529,6 +9621,7 @@ \DeclareUnicodeCharacter{017C}{\dotaccent{z}} \DeclareUnicodeCharacter{017D}{\v{Z}} \DeclareUnicodeCharacter{017E}{\v{z}} + \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}} \DeclareUnicodeCharacter{01C4}{D\v{Z}} \DeclareUnicodeCharacter{01C5}{D\v{z}} @@ -9734,12 +9827,51 @@ \DeclareUnicodeCharacter{2261}{\equiv} }% end of \utfeightchardefs - % US-ASCII character definitions. \def\asciichardefs{% nothing need be done \relax } +% Latin1 (ISO-8859-1) character definitions. +\def\nonasciistringdefs{% + \setnonasciicharscatcode\active + \def\defstringchar##1{\def##1{\string##1}}% + \defstringchar^^a0\defstringchar^^a1\defstringchar^^a2\defstringchar^^a3% + \defstringchar^^a4\defstringchar^^a5\defstringchar^^a6\defstringchar^^a7% + \defstringchar^^a8\defstringchar^^a9\defstringchar^^aa\defstringchar^^ab% + \defstringchar^^ac\defstringchar^^ad\defstringchar^^ae\defstringchar^^af% + % + \defstringchar^^b0\defstringchar^^b1\defstringchar^^b2\defstringchar^^b3% + \defstringchar^^b4\defstringchar^^b5\defstringchar^^b6\defstringchar^^b7% + \defstringchar^^b8\defstringchar^^b9\defstringchar^^ba\defstringchar^^bb% + \defstringchar^^bc\defstringchar^^bd\defstringchar^^be\defstringchar^^bf% + % + \defstringchar^^c0\defstringchar^^c1\defstringchar^^c2\defstringchar^^c3% + \defstringchar^^c4\defstringchar^^c5\defstringchar^^c6\defstringchar^^c7% + \defstringchar^^c8\defstringchar^^c9\defstringchar^^ca\defstringchar^^cb% + \defstringchar^^cc\defstringchar^^cd\defstringchar^^ce\defstringchar^^cf% + % + \defstringchar^^d0\defstringchar^^d1\defstringchar^^d2\defstringchar^^d3% + \defstringchar^^d4\defstringchar^^d5\defstringchar^^d6\defstringchar^^d7% + \defstringchar^^d8\defstringchar^^d9\defstringchar^^da\defstringchar^^db% + \defstringchar^^dc\defstringchar^^dd\defstringchar^^de\defstringchar^^df% + % + \defstringchar^^e0\defstringchar^^e1\defstringchar^^e2\defstringchar^^e3% + \defstringchar^^e4\defstringchar^^e5\defstringchar^^e6\defstringchar^^e7% + \defstringchar^^e8\defstringchar^^e9\defstringchar^^ea\defstringchar^^eb% + \defstringchar^^ec\defstringchar^^ed\defstringchar^^ee\defstringchar^^ef% + % + \defstringchar^^f0\defstringchar^^f1\defstringchar^^f2\defstringchar^^f3% + \defstringchar^^f4\defstringchar^^f5\defstringchar^^f6\defstringchar^^f7% + \defstringchar^^f8\defstringchar^^f9\defstringchar^^fa\defstringchar^^fb% + \defstringchar^^fc\defstringchar^^fd\defstringchar^^fe\defstringchar^^ff% +} + + +% define all the unicode characters we know about, for the sake of @U. +\utfeightchardefs + + % Make non-ASCII characters printable again for compatibility with % existing Texinfo documents that may use them, even without declaring a % document encoding. @@ -10093,6 +10225,7 @@ % {@catcode`- = @active @gdef@normalturnoffactive{% + @nonasciistringdefs @let-=@normaldash @let"=@normaldoublequote @let$=@normaldollar %$ font-lock fix @@ -10161,7 +10294,7 @@ @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) -@c page-delimiter: "^\\\\message" +@c page-delimiter: "^\\\\message\\|emacs-page" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" diff -urN gawk-4.1.1/eval.c gawk-4.1.2/eval.c --- gawk-4.1.1/eval.c 2014-02-20 20:52:05.000000000 +0200 +++ gawk-4.1.2/eval.c 2015-04-28 16:49:46.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2013 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -216,6 +216,7 @@ return; #ifndef ZOS_USS + /* use of isalpha is ok here (see is_alpha in awkgram.y) */ for (i = 0200; i <= 0377; i++) { if (isalpha(i) && islower(i) && i != toupper(i)) casetable[i] = toupper(i); @@ -241,6 +242,7 @@ "Node_func", "Node_ext_func", "Node_old_ext_func", + "Node_builtin_func", "Node_array_ref", "Node_array_tree", "Node_array_leaf", @@ -528,7 +530,7 @@ * In either case, ret will be the right thing to return. */ } -#if MBS_SUPPORT +#if ! defined(__DJGPP__) else { /* Similar logic, using wide characters */ (void) force_wstring(s1); @@ -608,15 +610,14 @@ const unsigned char *cp1 = (const unsigned char *) t1->stptr; const unsigned char *cp2 = (const unsigned char *) t2->stptr; -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { ret = strncasecmpmbs((const unsigned char *) cp1, (const unsigned char *) cp2, l); - } else -#endif - /* Could use tolower() here; see discussion above. */ - for (ret = 0; l-- > 0 && ret == 0; cp1++, cp2++) - ret = casetable[*cp1] - casetable[*cp2]; + } else { + /* Could use tolower() here; see discussion above. */ + for (ret = 0; l-- > 0 && ret == 0; cp1++, cp2++) + ret = casetable[*cp1] - casetable[*cp2]; + } } else ret = memcmp(t1->stptr, t2->stptr, l); @@ -706,6 +707,8 @@ load_casetable(); if (do_traditional) IGNORECASE = false; + else if ((n->flags & (NUMCUR|NUMBER)) != 0) + IGNORECASE = ! iszero(n); else if ((n->flags & (STRING|STRCUR)) != 0) { if ((n->flags & MAYBE_NUM) == 0) { (void) force_string(n); @@ -714,9 +717,7 @@ (void) force_number(n); IGNORECASE = ! iszero(n); } - } else if ((n->flags & (NUMCUR|NUMBER)) != 0) - IGNORECASE = ! iszero(n); - else + } else IGNORECASE = false; /* shouldn't happen */ set_RS(); /* set_RS() calls set_FS() if need be, for us */ @@ -803,9 +804,35 @@ void set_OFS() { + static bool first = true; + size_t new_ofs_len; + + if (first) /* true when called from init_vars() in main() */ + first = false; + else { + /* rebuild $0 using OFS that was current when $0 changed */ + if (! field0_valid) { + get_field(UNLIMITED - 1, NULL); + rebuild_record(); + } + } + + /* + * Save OFS value for use in building record and in printing. + * Can't just have OFS point into the OFS_node since it's + * already updated when we come into this routine, and we need + * the old value to rebuild the record (see above). + */ OFS_node->var_value = force_string(OFS_node->var_value); - OFS = OFS_node->var_value->stptr; - OFSlen = OFS_node->var_value->stlen; + new_ofs_len = OFS_node->var_value->stlen; + + if (OFS == NULL) + emalloc(OFS, char *, new_ofs_len + 2, "set_OFS"); + else if (OFSlen < new_ofs_len) + erealloc(OFS, char *, new_ofs_len + 2, "set_OFS"); + + memcpy(OFS, OFS_node->var_value->stptr, OFS_node->var_value->stlen); + OFSlen = new_ofs_len; OFS[OFSlen] = '\0'; } @@ -1153,7 +1180,7 @@ /* r_get_field --- get the address of a field node */ -static inline NODE ** +NODE ** r_get_field(NODE *n, Func_ptr *assign, bool reference) { long field_num; @@ -1298,7 +1325,13 @@ if (m->type == Node_param_list) m = GET_PARAM(m->param_cnt); - + + /* $0 needs to be passed by value to a function */ + if (m == fields_arr[0]) { + DEREF(m); + m = dupnode(m); + } + switch (m->type) { case Node_var_new: case Node_var_array: diff -urN gawk-4.1.1/ext.c gawk-4.1.2/ext.c --- gawk-4.1.1/ext.c 2014-03-05 06:00:36.000000000 +0200 +++ gawk-4.1.2/ext.c 2015-04-05 13:19:19.000000000 +0300 @@ -46,33 +46,9 @@ static bool is_letter(unsigned char c) { - switch (c) { - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': - case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': - case 's': case 't': case 'u': case 'v': case 'w': case 'x': - case 'y': case 'z': - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': - case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': - case '_': - return true; - default: - return false; - } -} - -/* is_identifier_char --- return true if a character can be used in an identifier */ - -static bool -is_identifier_char(unsigned char c) -{ - return (is_letter(c) || isdigit(c)); + return (is_alpha(c) || c == '_'); } - #define INIT_FUNC "dl_load" /* load_ext --- load an external library */ @@ -224,7 +200,7 @@ return awk_false; for (sp++; (c = *sp++) != '\0';) { - if (! is_identifier_char(c)) + if (! is_identchar(c)) return awk_false; } @@ -279,7 +255,7 @@ fatal(_("extension: illegal character `%c' in function name `%s'"), *sp, name); for (sp++; (c = *sp++) != '\0';) { - if (! is_identifier_char(c)) + if (! is_identchar(c)) fatal(_("extension: illegal character `%c' in function name `%s'"), c, name); } @@ -421,6 +397,9 @@ { SRCFILE *s; + if (srcfiles == NULL) + return; + for (s = srcfiles->next; s != srcfiles; s = s->next) if (s->stype == SRC_EXTLIB && s->fini_func) (*s->fini_func)(); diff -urN gawk-4.1.1/extension/ChangeLog gawk-4.1.2/extension/ChangeLog --- gawk-4.1.1/extension/ChangeLog 2014-04-08 20:34:16.000000000 +0300 +++ gawk-4.1.2/extension/ChangeLog 2015-04-29 08:53:32.000000000 +0300 @@ -1,3 +1,94 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + +2015-04-08 Arnold D. Robbins + + * Makefile.am, filefuncs.c, inplace.3am, inplace.c: + Update copyright years. + +2015-03-18 Arnold D. Robbins + + * configure: Updated to libtool 2.4.6. + +2015-03-18 Arnold D. Robbins + + * inplace.3am (SYNOPSIS): Updated to not show the contents + of the extension. + (BUGS): Removed. + +2015-03-17 Arnold D. Robbins + + * inplace.c (do_inplace_begin): Jump through more hoops to satisfy + a newer version of clang. + * inplace.3am (BUGS): Add new section and documentation. + +2015-02-26 Arnold D. Robbins + + * Makefile.am (EXTRA_DIST): Add rwarray0.c to the list. + +2015-02-11 Arnold D. Robbins + + * filefuncs.c: Punctuation fix. + +2015-01-24 Arnold D. Robbins + + Infrastructure updates. + + Automake 1.15. Libtool 2.4.5. + + * configure.ac: Remove gettext macros. + +2015-01-07 Arnold D. Robbins + + * testext.c (var_test): Adjust for PROCINFO now being there. + +2014-11-23 Arnold D. Robbins + + * inplace.c (do_inplace_begin): Jump through hoops to silence + GCC warnings about return value of chown. + +2014-10-12 Arnold D. Robbins + + * Makefile.am (uninstall-so): Remove *.lib too, per suggestion + from Andreas Buening. + +2014-10-12 KO Myung-Hun + + Fixes for OS/2: + + * Makefile.am (uninstall-so): Remove *.dll and *.a, also. + +2014-10-08 Arnold D. Robbins + + * inplace.c (do_inplace_begin): Use a cast to void in front + of the second call to chown to avoid compiler warnings from clang. + +2014-09-29 Arnold D. Robbins + + * filefuncs.c: Minor edits to sync with documentation. + * testext.c: Add test to get PROCINFO, expected to fail. + +2014-08-12 Arnold D. Robbins + + * Makefile.am (RM): Define for makes that don't have it, + such as on OpenBSD. Thanks to Jeremie Courreges-Anglas + for the report. + +2014-06-13 Paul Gortmaker + + * Makefile.am (uninstall-so): Came across below bug while cross + compiling, and changed both install-data-hook and uninstall-so + to use $(DESTDIR) on v4.1.1 before seeing most of the fix in + gawk-4.1.1-3-g976f73ab0356; here we ensure uninstall-so also + uses the $(DESTDIR) prefix on its use of pkgextensiondir. + +2014-04-11 Arnold D. Robbins + + * Makefile.am (install-data-hook): Use $(DESTDIR) when removing + the .la files. Thanks to Lars Wendler + for the report and fix. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff -urN gawk-4.1.1/extension/INSTALL gawk-4.1.2/extension/INSTALL --- gawk-4.1.1/extension/INSTALL 2014-01-20 21:52:59.000000000 +0200 +++ gawk-4.1.2/extension/INSTALL 2015-04-27 18:09:07.000000000 +0300 @@ -1,7 +1,7 @@ Installation Instructions ************************* -Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation, +Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, @@ -12,8 +12,8 @@ Basic Installation ================== - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following + Briefly, the shell command `./configure && make && make install' +should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented diff -urN gawk-4.1.1/extension/Makefile.am gawk-4.1.2/extension/Makefile.am --- gawk-4.1.1/extension/Makefile.am 2014-02-20 20:42:25.000000000 +0200 +++ gawk-4.1.2/extension/Makefile.am 2015-04-27 18:09:07.000000000 +0300 @@ -1,7 +1,7 @@ # # extension/Makefile.am --- automake input file for gawk # -# Copyright (C) 1995-2006, 2012 the Free Software Foundation, Inc. +# Copyright (C) 1995-2006, 2012-2015 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -29,6 +29,9 @@ # correctly after changing configure.ac ACLOCAL_AMFLAGS = -I m4 +# For some make's, e.g. OpenBSD, that don't define this +RM = rm -f + # Note: rwarray does not currently compile. pkgextension_LTLIBRARIES = \ @@ -100,12 +103,15 @@ install-data-hook: for i in $(pkgextension_LTLIBRARIES) ; do \ - $(RM) $(pkgextensiondir)/$$i ; \ + $(RM) $(DESTDIR)$(pkgextensiondir)/$$i ; \ done # Keep the uninstall check working: uninstall-so: - $(RM) $(pkgextensiondir)/*.so + $(RM) $(DESTDIR)$(pkgextensiondir)/*.so + $(RM) $(DESTDIR)$(pkgextensiondir)/*.dll + $(RM) $(DESTDIR)$(pkgextensiondir)/*.a + $(RM) $(DESTDIR)$(pkgextensiondir)/*.lib uninstall-recursive: uninstall-so @@ -113,7 +119,8 @@ ChangeLog \ ChangeLog.0 \ fts.3 \ - README.fts + README.fts \ + rwarray0.c dist_man_MANS = \ filefuncs.3am fnmatch.3am fork.3am inplace.3am \ diff -urN gawk-4.1.1/extension/Makefile.in gawk-4.1.2/extension/Makefile.in --- gawk-4.1.1/extension/Makefile.in 2014-04-08 19:13:03.000000000 +0300 +++ gawk-4.1.2/extension/Makefile.in 2015-04-29 08:35:25.000000000 +0300 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -17,7 +17,7 @@ # # extension/Makefile.am --- automake input file for gawk # -# Copyright (C) 1995-2006, 2012 the Free Software Foundation, Inc. +# Copyright (C) 1995-2006, 2012-2015 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -38,7 +38,17 @@ # VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -102,33 +112,15 @@ build_triplet = @build@ host_triplet = @host@ subdir = . -DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ - $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/configh.in ABOUT-NLS $(top_srcdir)/build-aux/depcomp \ - $(dist_man_MANS) COPYING build-aux/ChangeLog build-aux/ar-lib \ - build-aux/config.guess build-aux/config.rpath \ - build-aux/config.sub build-aux/depcomp build-aux/install-sh \ - build-aux/missing build-aux/ltmain.sh \ - $(top_srcdir)/build-aux/ar-lib \ - $(top_srcdir)/build-aux/config.guess \ - $(top_srcdir)/build-aux/config.rpath \ - $(top_srcdir)/build-aux/config.sub \ - $(top_srcdir)/build-aux/install-sh \ - $(top_srcdir)/build-aux/ltmain.sh \ - $(top_srcdir)/build-aux/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/dirfd.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -166,8 +158,7 @@ "$(DESTDIR)$(man3dir)" LTLIBRARIES = $(pkgextension_LTLIBRARIES) am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) -filefuncs_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +filefuncs_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_filefuncs_la_OBJECTS = filefuncs.lo stack.lo gawkfts.lo filefuncs_la_OBJECTS = $(am_filefuncs_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) @@ -177,67 +168,67 @@ filefuncs_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(filefuncs_la_LDFLAGS) $(LDFLAGS) -o $@ -fnmatch_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +fnmatch_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_fnmatch_la_OBJECTS = fnmatch.lo fnmatch_la_OBJECTS = $(am_fnmatch_la_OBJECTS) fnmatch_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(fnmatch_la_LDFLAGS) $(LDFLAGS) -o $@ -fork_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +fork_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_fork_la_OBJECTS = fork.lo fork_la_OBJECTS = $(am_fork_la_OBJECTS) fork_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(fork_la_LDFLAGS) $(LDFLAGS) -o $@ -inplace_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +inplace_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_inplace_la_OBJECTS = inplace.lo inplace_la_OBJECTS = $(am_inplace_la_OBJECTS) inplace_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(inplace_la_LDFLAGS) $(LDFLAGS) -o $@ -ordchr_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +ordchr_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_ordchr_la_OBJECTS = ordchr.lo ordchr_la_OBJECTS = $(am_ordchr_la_OBJECTS) ordchr_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(ordchr_la_LDFLAGS) $(LDFLAGS) -o $@ -readdir_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +readdir_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_readdir_la_OBJECTS = readdir.lo readdir_la_OBJECTS = $(am_readdir_la_OBJECTS) readdir_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(readdir_la_LDFLAGS) $(LDFLAGS) -o $@ -readfile_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +readfile_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_readfile_la_OBJECTS = readfile.lo readfile_la_OBJECTS = $(am_readfile_la_OBJECTS) readfile_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(readfile_la_LDFLAGS) $(LDFLAGS) -o $@ -revoutput_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +revoutput_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_revoutput_la_OBJECTS = revoutput.lo revoutput_la_OBJECTS = $(am_revoutput_la_OBJECTS) revoutput_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(revoutput_la_LDFLAGS) $(LDFLAGS) -o $@ -revtwoway_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +revtwoway_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_revtwoway_la_OBJECTS = revtwoway.lo revtwoway_la_OBJECTS = $(am_revtwoway_la_OBJECTS) revtwoway_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(revtwoway_la_LDFLAGS) $(LDFLAGS) -o $@ -rwarray_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +rwarray_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_rwarray_la_OBJECTS = rwarray.lo rwarray_la_OBJECTS = $(am_rwarray_la_OBJECTS) rwarray_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(rwarray_la_LDFLAGS) $(LDFLAGS) -o $@ -testext_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +testext_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_testext_la_OBJECTS = testext.lo testext_la_OBJECTS = $(am_testext_la_OBJECTS) testext_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(testext_la_LDFLAGS) $(LDFLAGS) -o $@ -time_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +time_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_time_la_OBJECTS = time.lo time_la_OBJECTS = $(am_time_la_OBJECTS) time_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -333,6 +324,19 @@ CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ + $(srcdir)/configh.in $(top_srcdir)/build-aux/ar-lib \ + $(top_srcdir)/build-aux/compile \ + $(top_srcdir)/build-aux/config.guess \ + $(top_srcdir)/build-aux/config.sub \ + $(top_srcdir)/build-aux/depcomp \ + $(top_srcdir)/build-aux/install-sh \ + $(top_srcdir)/build-aux/ltmain.sh \ + $(top_srcdir)/build-aux/missing ABOUT-NLS AUTHORS COPYING \ + ChangeLog INSTALL NEWS README build-aux/ChangeLog \ + build-aux/ar-lib build-aux/compile build-aux/config.guess \ + build-aux/config.rpath build-aux/config.sub build-aux/depcomp \ + build-aux/install-sh build-aux/ltmain.sh build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -400,35 +404,24 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ -GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ -GMSGFMT = @GMSGFMT@ -GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ -INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ -MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ -MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -443,17 +436,12 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -USE_NLS = @USE_NLS@ VERSION = @VERSION@ -XGETTEXT = @XGETTEXT@ -XGETTEXT_015 = @XGETTEXT_015@ -XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -513,6 +501,9 @@ # correctly after changing configure.ac ACLOCAL_AMFLAGS = -I m4 +# For some make's, e.g. OpenBSD, that don't define this +RM = rm -f + # Note: rwarray does not currently compile. pkgextension_LTLIBRARIES = \ filefuncs.la \ @@ -573,7 +564,8 @@ ChangeLog \ ChangeLog.0 \ fts.3 \ - README.fts + README.fts \ + rwarray0.c dist_man_MANS = \ filefuncs.3am fnmatch.3am fork.3am inplace.3am \ @@ -603,7 +595,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -624,8 +615,8 @@ $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/configh.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -735,14 +726,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -990,10 +981,16 @@ $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -1028,16 +1025,17 @@ esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -1228,15 +1226,20 @@ tags tags-am uninstall uninstall-am uninstall-man \ uninstall-man3 uninstall-pkgextensionLTLIBRARIES +.PRECIOUS: Makefile + install-data-hook: for i in $(pkgextension_LTLIBRARIES) ; do \ - $(RM) $(pkgextensiondir)/$$i ; \ + $(RM) $(DESTDIR)$(pkgextensiondir)/$$i ; \ done # Keep the uninstall check working: uninstall-so: - $(RM) $(pkgextensiondir)/*.so + $(RM) $(DESTDIR)$(pkgextensiondir)/*.so + $(RM) $(DESTDIR)$(pkgextensiondir)/*.dll + $(RM) $(DESTDIR)$(pkgextensiondir)/*.a + $(RM) $(DESTDIR)$(pkgextensiondir)/*.lib uninstall-recursive: uninstall-so diff -urN gawk-4.1.1/extension/aclocal.m4 gawk-4.1.2/extension/aclocal.m4 --- gawk-4.1.1/extension/aclocal.m4 2014-04-08 19:13:02.000000000 +0300 +++ gawk-4.1.2/extension/aclocal.m4 2015-04-29 08:35:24.000000000 +0300 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.13.4 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.13' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.13.4], [], +m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,12 +51,12 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.13.4])dnl +[AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -76,7 +76,8 @@ : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], - [am_cv_ar_interface=ar + [AC_LANG_PUSH([C]) + am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) @@ -93,7 +94,7 @@ fi rm -f conftest.lib libconftest.a ]) - ]) + AC_LANG_POP([C])]) case $am_cv_ar_interface in ar) @@ -117,7 +118,7 @@ # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -162,15 +163,14 @@ # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -201,7 +201,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -392,7 +392,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -468,7 +468,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -477,6 +477,12 @@ # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -552,8 +558,8 @@ # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -585,6 +591,51 @@ AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -593,7 +644,6 @@ m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -615,7 +665,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -626,7 +676,7 @@ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -636,7 +686,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -657,7 +707,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -707,7 +757,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -746,7 +796,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -775,9 +825,73 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -858,7 +972,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -918,7 +1032,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -946,7 +1060,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -965,7 +1079,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1097,17 +1211,8 @@ ]) # _AM_PROG_TAR m4_include([m4/dirfd.m4]) -m4_include([m4/gettext.m4]) -m4_include([m4/iconv.m4]) -m4_include([m4/intlmacosx.m4]) -m4_include([m4/lib-ld.m4]) -m4_include([m4/lib-link.m4]) -m4_include([m4/lib-prefix.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) -m4_include([m4/nls.m4]) -m4_include([m4/po.m4]) -m4_include([m4/progtest.m4]) diff -urN gawk-4.1.1/extension/build-aux/ChangeLog gawk-4.1.2/extension/build-aux/ChangeLog --- gawk-4.1.1/extension/build-aux/ChangeLog 2014-04-08 20:34:21.000000000 +0300 +++ gawk-4.1.2/extension/build-aux/ChangeLog 2015-04-29 08:53:36.000000000 +0300 @@ -1,3 +1,11 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + +2015-03-18 Arnold D. Robbins + + * config.guess, config.sub, ltmain.sh: Updated, from libtool 2.4.6. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff -urN gawk-4.1.1/extension/build-aux/ar-lib gawk-4.1.2/extension/build-aux/ar-lib --- gawk-4.1.1/extension/build-aux/ar-lib 2014-01-20 21:52:59.000000000 +0200 +++ gawk-4.1.2/extension/build-aux/ar-lib 2015-04-27 18:09:07.000000000 +0300 @@ -4,7 +4,7 @@ me=ar-lib scriptversion=2012-03-01.08; # UTC -# Copyright (C) 2010-2012 Free Software Foundation, Inc. +# Copyright (C) 2010-2014 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify diff -urN gawk-4.1.1/extension/build-aux/compile gawk-4.1.2/extension/build-aux/compile --- gawk-4.1.1/extension/build-aux/compile 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/extension/build-aux/compile 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -urN gawk-4.1.1/extension/build-aux/config.guess gawk-4.1.2/extension/build-aux/config.guess --- gawk-4.1.1/extension/build-aux/config.guess 2014-01-20 21:52:59.000000000 +0200 +++ gawk-4.1.2/extension/build-aux/config.guess 2015-04-27 18:09:07.000000000 +0300 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2014-01-01' +timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +149,7 @@ LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac @@ -579,8 +579,9 @@ else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -826,7 +827,7 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -969,10 +970,10 @@ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) @@ -1371,154 +1372,6 @@ exit ;; esac -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -68,7 +68,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -260,7 +260,7 @@ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ - | fido | fr30 | frv \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ @@ -283,8 +283,10 @@ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -296,11 +298,11 @@ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -311,6 +313,7 @@ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -325,6 +328,9 @@ c6x) basic_machine=tic6x-unknown ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none @@ -402,8 +408,10 @@ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -415,6 +423,7 @@ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ @@ -432,6 +441,7 @@ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -769,6 +779,9 @@ basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -824,6 +837,10 @@ basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -1369,14 +1386,14 @@ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1594,9 +1611,6 @@ mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; diff -urN gawk-4.1.1/extension/build-aux/depcomp gawk-4.1.2/extension/build-aux/depcomp --- gawk-4.1.1/extension/build-aux/depcomp 2014-01-20 21:52:59.000000000 +0200 +++ gawk-4.1.2/extension/build-aux/depcomp 2015-04-27 18:09:07.000000000 +0300 @@ -3,7 +3,7 @@ scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -251,6 +251,41 @@ exit 1 ;; +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, diff -urN gawk-4.1.1/extension/build-aux/install-sh gawk-4.1.2/extension/build-aux/install-sh --- gawk-4.1.1/extension/build-aux/install-sh 2014-01-20 21:52:59.000000000 +0200 +++ gawk-4.1.2/extension/build-aux/install-sh 2015-04-27 18:09:07.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2013-10-30.23; # UTC +scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -82,7 +82,7 @@ dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -139,14 +139,16 @@ -s) stripcmd=$stripprog;; - -t) dst_arg=$2 + -t) + is_target_a_directory=always + dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; @@ -161,6 +163,16 @@ shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -192,6 +204,15 @@ fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -253,7 +274,7 @@ # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test -n "$no_target_directory"; then + if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi diff -urN gawk-4.1.1/extension/build-aux/ltmain.sh gawk-4.1.2/extension/build-aux/ltmain.sh --- gawk-4.1.1/extension/build-aux/ltmain.sh 2014-02-20 20:42:25.000000000 +0200 +++ gawk-4.1.2/extension/build-aux/ltmain.sh 2015-04-27 18:09:07.000000000 +0300 @@ -1,10 +1,12 @@ #! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 -# libtool (GNU libtool) 2.4.2.418 +# libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -29,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.2.418 -package_revision=2.4.2.418 +VERSION=2.4.6 +package_revision=2.4.6 ## ------ ## @@ -62,12 +64,12 @@ # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2013-08-23.20; # UTC +scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -147,47 +149,157 @@ ' IFS="$sp $nl" -# There are still modern systems that have problems with 'echo' mis- -# handling backslashes, among others, so make sure $bs_echo is set to a -# command that correctly interprets backslashes. -# (this code from Autoconf 2.68) - -# Printing a long string crashes Solaris 7 /usr/bin/printf. -bs_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo -bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $bs_echo`" = "X$bs_echo") 2>/dev/null; then - bs_echo='print -r --' - bs_echo_n='print -rn --' -elif (test "X`printf %s $bs_echo`" = "X$bs_echo") 2>/dev/null; then - bs_echo='printf %s\n' - bs_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $bs_echo) 2>/dev/null`" = "X-n $bs_echo"; then - bs_echo_body='eval /usr/ucb/echo -n "$1$nl"' - bs_echo_n='/usr/ucb/echo -n' - else - bs_echo_body='eval expr "X$1" : "X\\(.*\\)"' - bs_echo_n_body='eval - arg=$1; - case $arg in #( - *"$nl"*) - expr "X$arg" : "X\\(.*\\)$nl"; - arg=`expr "X$arg" : ".*$nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$nl" - ' - export bs_echo_n_body - bs_echo_n='sh -c $bs_echo_n_body bs_echo' - fi - export bs_echo_body - bs_echo='sh -c $bs_echo_body bs_echo' +# There are apparently some retarded systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi + +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + GREP=$func_path_progs_result +} + + ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## @@ -198,16 +310,14 @@ # in the command search PATH. : ${CP="cp -f"} -: ${ECHO="$bs_echo"} -: ${EGREP="grep -E"} -: ${FGREP="grep -F"} -: ${GREP="grep"} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} @@ -298,13 +408,13 @@ progpath=$0 # The name of this program. -progname=`$bs_echo "$progpath" |$SED "$sed_basename"` +progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) - progdir=`$bs_echo "$progpath" |$SED "$sed_dirname"` + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; @@ -498,7 +608,7 @@ { $debug_cmd - eval _G_current_value='`$bs_echo $'$1'`' + eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in @@ -611,7 +721,7 @@ IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS - $bs_echo "$progname: $_G_line" + $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } @@ -645,17 +755,17 @@ for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { - _G_esc_tc=`$bs_echo "$_G_tc" | sed "$sed_make_literal_regex"` - _G_indent=`$bs_echo "$_G_indent" | sed "s|$_G_esc_tc||g"` + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done - _G_indent="$progname: "`echo "$_G_indent" | sed 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS - $bs_echo "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS @@ -1232,56 +1342,40 @@ { $debug_cmd - ver1=$1 - ver2=$2 + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} - # Split on '.' and compare each component. - i=1 - while :; do - p1=`echo "$ver1" |cut -d. -f$i` - p2=`echo "$ver2" |cut -d. -f$i` - if test ! "$p1"; then - echo "$1 $2" - break - elif test ! "$p2"; then - echo "$2 $1" - break - elif test ! "$p1" = "$p2"; then - if test "$p1" -gt "$p2" 2>/dev/null; then # numeric comparison - echo "$2 $1" - elif test "$p2" -gt "$p1" 2>/dev/null; then # numeric comparison - echo "$1 $2" - else # numeric, then lexicographic comparison - lp=`printf "$p1\n$p2\n" |sort -n |tail -n1` - if test "$lp" = "$p2"; then - echo "$1 $2" - else - echo "$2 $1" - fi - fi - break - fi - i=`expr $i + 1` - done +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. -scriptversion=2012-10-21.11; # UTC +scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2013 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -1421,7 +1515,7 @@ { $debug_cmd - eval ${1}_hooks='`$bs_echo "\$'$1'_hooks" |$SED "s| '$2'||"`' + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } @@ -1698,9 +1792,9 @@ -## ------------------## +## ----------------- ## ## Helper functions. ## -## ------------------## +## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. @@ -1714,8 +1808,8 @@ { $debug_cmd - eval \$bs_echo \""Usage: $usage"\" - eval \$bs_echo \""$fatal_help"\" + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } @@ -1729,7 +1823,7 @@ $debug_cmd func_usage_message - $bs_echo "$long_help_message" + $ECHO "$long_help_message" exit 0 } @@ -1816,7 +1910,7 @@ $debug_cmd func_usage_message - $bs_echo "Run '$progname --help |${PAGER-more}' for full usage" + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } @@ -1828,7 +1922,7 @@ { $debug_cmd - eval \$bs_echo \""Usage: $usage"\" + eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ @@ -1837,7 +1931,7 @@ h /^Written by/q' < "$progpath" echo - eval \$bs_echo \""$usage_message"\" + eval \$ECHO \""$usage_message"\" } @@ -1849,7 +1943,7 @@ $debug_cmd printf '%s\n' "$progname $scriptversion" - $SED -n '/^##/q + $SED -n ' /(C)/!b go :more /\./!{ @@ -1877,13 +1971,13 @@ # Local variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.2.418' +scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... @@ -1900,7 +1994,7 @@ IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS - $bs_echo "$progname${opt_mode+: $opt_mode}: $_G_line" + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } @@ -1945,7 +2039,12 @@ " # Additional text appended to 'usage_message' in response to '--help'. -long_help_message=$long_help_message" +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message MODE must be one of the following: @@ -1969,13 +2068,15 @@ compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.2.418 + version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." + exit 0 +} # func_lo2o OBJECT-NAME @@ -2315,7 +2416,9 @@ test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; @@ -2386,6 +2489,14 @@ _LTECHO_EOF' } +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out @@ -2393,8 +2504,7 @@ func_lalib_p () { test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file @@ -2426,7 +2536,8 @@ # determined imposters. func_ltwrapper_script_p () { - func_lalib_p "$1" + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file @@ -3626,7 +3737,8 @@ -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information @@ -3696,7 +3808,7 @@ for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do @@ -3704,7 +3816,7 @@ func_mode_help done } | - sed '1d + $SED '1d /^When reporting/,/^Report/{ H d @@ -3894,7 +4006,7 @@ else tmpdir=`func_mktempdir` for lib in $libs; do - sed -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done @@ -4208,6 +4320,13 @@ ;; esac ;; + os2*) + case $realname in + *_dll.a) + tstripme= + ;; + esac + ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' @@ -4449,7 +4568,7 @@ my_outputname=$1 my_originator=$2 my_pic_p=${3-false} - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then @@ -5049,7 +5168,7 @@ $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do @@ -5322,7 +5441,7 @@ if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else - $ECHO \"\$relink_command_output\" >&2 + \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi @@ -5554,7 +5673,12 @@ EOF cat <&1 | sed 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= @@ -8598,13 +8805,13 @@ # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|linux|osf|windows|none) + darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; - freebsd-aout|freebsd-elf|qnx|sunos) + freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 @@ -8690,8 +8897,9 @@ ;; freebsd-elf) - major=.$current - versuffix=.$current + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision ;; irix | nonstopux) @@ -8754,6 +8962,11 @@ versuffix=.$current ;; + sco) + major=.$current + versuffix=.$current + ;; + sunos) major=.$current versuffix=.$current.$revision @@ -9906,15 +10119,17 @@ # the extraction. reload_conv_objs= gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - + # if reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" diff -urN gawk-4.1.1/extension/build-aux/missing gawk-4.1.2/extension/build-aux/missing --- gawk-4.1.1/extension/build-aux/missing 2014-01-20 21:52:59.000000000 +0200 +++ gawk-4.1.2/extension/build-aux/missing 2015-04-27 18:09:07.000000000 +0300 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-06-26.16; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -160,7 +160,7 @@ ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." + echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) diff -urN gawk-4.1.1/extension/configh.in gawk-4.1.2/extension/configh.in --- gawk-4.1.1/extension/configh.in 2014-04-08 19:13:08.000000000 +0300 +++ gawk-4.1.2/extension/configh.in 2015-04-29 08:35:29.000000000 +0300 @@ -10,22 +10,6 @@ #endif -/* Define to 1 if translation of program messages to the user's native - language is requested. */ -#undef ENABLE_NLS - -/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the - CoreFoundation framework. */ -#undef HAVE_CFLOCALECOPYCURRENT - -/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in - the CoreFoundation framework. */ -#undef HAVE_CFPREFERENCESCOPYAPPVALUE - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -#undef HAVE_DCGETTEXT - /* Define to 1 if you have the declaration of `dirfd', and to 0 if you don't. */ #undef HAVE_DECL_DIRFD @@ -55,15 +39,9 @@ /* Define to 1 if you have the `GetSystemTimeAsFileTime' function. */ #undef HAVE_GETSYSTEMTIMEASFILETIME -/* Define if the GNU gettext() function is already present or preinstalled. */ -#undef HAVE_GETTEXT - /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY -/* Define if you have the iconv() function and it works. */ -#undef HAVE_ICONV - /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H diff -urN gawk-4.1.1/extension/configure gawk-4.1.2/extension/configure --- gawk-4.1.1/extension/configure 2014-04-08 19:13:02.000000000 +0300 +++ gawk-4.1.2/extension/configure 2015-04-29 08:35:24.000000000 +0300 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for GNU Awk Bundled Extensions 4.1.1. +# Generated by GNU Autoconf 2.69 for GNU Awk Bundled Extensions 4.1.2. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='GNU Awk Bundled Extensions' PACKAGE_TARNAME='gawk-extensions' -PACKAGE_VERSION='4.1.1' -PACKAGE_STRING='GNU Awk Bundled Extensions 4.1.1' +PACKAGE_VERSION='4.1.2' +PACKAGE_STRING='GNU Awk Bundled Extensions 4.1.2' PACKAGE_BUGREPORT='bug-gawk@gnu.org' PACKAGE_URL='http://www.gnu.org/software/gawk-extensions/' @@ -631,12 +631,12 @@ # include #endif" -gt_needs= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS pkgextensiondir +LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO @@ -653,16 +653,6 @@ LD FGREP SED -LIBTOOL -ac_ct_AR -AR -POSUB -LTLIBINTL -LIBINTL -INTLLIBS -LTLIBICONV -LIBICONV -INTL_MACOSX_LIBS host_os host_vendor host_cpu @@ -671,16 +661,9 @@ build_vendor build_cpu build -XGETTEXT_EXTRA_OPTIONS -MSGMERGE -XGETTEXT_015 -XGETTEXT -GMSGFMT_015 -MSGFMT_015 -GMSGFMT -MSGFMT -GETTEXT_MACRO_VERSION -USE_NLS +LIBTOOL +ac_ct_AR +AR AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V @@ -771,16 +754,13 @@ enable_option_checking enable_dependency_tracking enable_silent_rules -enable_nls -with_gnu_ld -enable_rpath -with_libiconv_prefix -with_libintl_prefix enable_largefile enable_static enable_shared with_pic enable_fast_install +with_aix_soname +with_gnu_ld with_sysroot enable_libtool_lock ' @@ -792,7 +772,8 @@ LDFLAGS LIBS CPPFLAGS -CPP' +CPP +LT_SYS_LIBRARY_PATH' # Initialize some variables set by options. @@ -1333,7 +1314,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU Awk Bundled Extensions 4.1.1 to adapt to many kinds of systems. +\`configure' configures GNU Awk Bundled Extensions 4.1.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1403,7 +1384,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU Awk Bundled Extensions 4.1.1:";; + short | recursive ) echo "Configuration of GNU Awk Bundled Extensions 4.1.2:";; esac cat <<\_ACEOF @@ -1417,8 +1398,6 @@ speeds up one-time build --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") - --disable-nls do not use Native Language Support - --disable-rpath do not hardcode runtime library paths --disable-largefile omit support for large files --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] @@ -1429,13 +1408,11 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib - --without-libiconv-prefix don't search for libiconv in includedir and libdir - --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib - --without-libintl-prefix don't search for libintl in includedir and libdir --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). @@ -1449,6 +1426,8 @@ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1518,7 +1497,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU Awk Bundled Extensions configure 4.1.1 +GNU Awk Bundled Extensions configure 4.1.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1771,52 +1750,6 @@ } # ac_fn_c_check_header_compile -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including @@ -1874,6 +1807,52 @@ } # ac_fn_c_check_member +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly @@ -1990,7 +1969,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNU Awk Bundled Extensions $as_me 4.1.1, which was +It was created by GNU Awk Bundled Extensions $as_me 4.1.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2270,7 +2249,6 @@ >$cache_file fi -gt_needs="$gt_needs " # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false @@ -2371,6 +2349,9 @@ +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3160,6 +3141,65 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3623,7 +3663,7 @@ INSTALL="$ac_aux_dir/install-sh -c" export INSTALL -am__api_version='1.13' +am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -3795,9 +3835,6 @@ ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) @@ -3815,7 +3852,7 @@ $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -4172,7 +4209,7 @@ # Define the identity of the package. PACKAGE='gawk-extensions' - VERSION='4.1.1' + VERSION='4.1.2' cat >>confdefs.h <<_ACEOF @@ -4206,8 +4243,8 @@ # mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -4351,117 +4388,125 @@ +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 -$as_echo_n "checking whether NLS is requested... " >&6; } - # Check whether --enable-nls was given. -if test "${enable_nls+set}" = set; then : - enableval=$enable_nls; USE_NLS=$enableval -else - USE_NLS=yes +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 -$as_echo "$USE_NLS" >&6; } - - - - - GETTEXT_MACRO_VERSION=0.18 +ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then : +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 +_ACEOF -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh fi -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" -fi -rm -f conf$$.file -# Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 +if test -n "$ac_tool_prefix"; then + for ac_prog in ar lib "link -lib" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MSGFMT+:} false; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else - case "$MSGFMT" in - [\\/]* | ?:[\\/]*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&5 - if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && - (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" - ;; -esac + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + fi -MSGFMT="$ac_cv_path_MSGFMT" -if test "$MSGFMT" != ":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 -$as_echo "$MSGFMT" >&6; } +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar lib "link -lib" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GMSGFMT+:} false; then : +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else - case $GMSGFMT in - [\\/]* | ?:[\\/]*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4469,2100 +4514,48 @@ done IFS=$as_save_IFS - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac fi -GMSGFMT=$ac_cv_path_GMSGFMT -if test -n "$GMSGFMT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 -$as_echo "$GMSGFMT" >&6; } +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + test -n "$ac_ct_AR" && break +done - case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; - *) MSGFMT_015=$MSGFMT ;; - esac - - case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; - *) GMSGFMT_015=$GMSGFMT ;; - esac - - - -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' + if test "x$ac_ct_AR" = x; then + AR="false" else - PATH_SEPARATOR=: + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR fi - rm -f conf$$.sh fi -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" -fi -rm -f conf$$.file +: ${AR=ar} -# Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XGETTEXT+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +$as_echo_n "checking the archiver ($AR) interface... " >&6; } +if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else - case "$XGETTEXT" in - [\\/]* | ?:[\\/]*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&5 - if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && - (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac -fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test "$XGETTEXT" != ":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 -$as_echo "$XGETTEXT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - rm -f messages.po - - case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; - *) XGETTEXT_015=$XGETTEXT ;; - esac - - - -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" -fi -rm -f conf$$.file - -# Extract the first word of "msgmerge", so it can be a program name with args. -set dummy msgmerge; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MSGMERGE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case "$MSGMERGE" in - [\\/]* | ?:[\\/]*) - ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&5 - if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then - ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" - test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" - ;; -esac -fi -MSGMERGE="$ac_cv_path_MSGMERGE" -if test "$MSGMERGE" != ":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 -$as_echo "$MSGMERGE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$localedir" || localedir='${datadir}/locale' - - - test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= - - - ac_config_commands="$ac_config_commands po-directories" - - - - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 -$as_echo_n "checking for ld used by GCC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${acl_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; - *) - test "$with_gnu_ld" != yes && break ;; - esac - fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi - -LD="$acl_cv_path_LD" -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${acl_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$acl_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$acl_cv_prog_gnu_ld - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 -$as_echo_n "checking for shared library run path origin... " >&6; } -if ${acl_cv_rpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 -$as_echo "$acl_cv_rpath" >&6; } - wl="$acl_cv_wl" - acl_libext="$acl_cv_libext" - acl_shlibext="$acl_cv_shlibext" - acl_libname_spec="$acl_cv_libname_spec" - acl_library_names_spec="$acl_cv_library_names_spec" - acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - acl_hardcode_direct="$acl_cv_hardcode_direct" - acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" - # Check whether --enable-rpath was given. -if test "${enable_rpath+set}" = set; then : - enableval=$enable_rpath; : -else - enable_rpath=yes -fi - - - - - acl_libdirstem=lib - acl_libdirstem2= - case "$host_os" in - solaris*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 -$as_echo_n "checking for 64-bit host... " >&6; } -if ${gl_cv_solaris_64bit+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef _LP64 -sixtyfour bits -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "sixtyfour bits" >/dev/null 2>&1; then : - gl_cv_solaris_64bit=yes -else - gl_cv_solaris_64bit=no -fi -rm -f conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 -$as_echo "$gl_cv_solaris_64bit" >&6; } - if test $gl_cv_solaris_64bit = yes; then - acl_libdirstem=lib/64 - case "$host_cpu" in - sparc*) acl_libdirstem2=lib/sparcv9 ;; - i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; - esac - fi - ;; - *) - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - */../ | */.. ) - # Better ignore directories of this form. They are misleading. - ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; - esac - fi - done - IFS="$acl_save_IFS" - fi - ;; - esac - test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" - - - - - - - - - - - - - use_additional=yes - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - -# Check whether --with-libiconv-prefix was given. -if test "${with_libiconv_prefix+set}" = set; then : - withval=$with_libiconv_prefix; - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi - fi - fi - -fi - - LIBICONV= - LTLIBICONV= - INCICONV= - LIBICONV_PREFIX= - HAVE_LIBICONV= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='iconv ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - eval libname=\"$acl_libname_spec\" # typically: libname=lib$name - if test -n "$acl_shlibext"; then - shrext=".$acl_shlibext" # typically: shrext=.so - else - shrext= - fi - if test $use_additional = yes; then - dir="$additional_libdir" - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "$enable_rpath" = no \ - || test "X$found_dir" = "X/usr/$acl_libdirstem" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$acl_hardcode_direct" = yes; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */$acl_libdirstem | */$acl_libdirstem/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - if test "$name" = 'iconv'; then - LIBICONV_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - */$acl_libdirstem2 | */$acl_libdirstem2/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` - if test "$name" = 'iconv'; then - LIBICONV_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INCICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" - ;; - esac - done - fi - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$acl_hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" - done - fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 -$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } -if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : - $as_echo_n "(cached) " >&6 -else - gt_save_LIBS="$LIBS" - LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -CFPreferencesCopyAppValue(NULL, NULL) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gt_cv_func_CFPreferencesCopyAppValue=yes -else - gt_cv_func_CFPreferencesCopyAppValue=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$gt_save_LIBS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 -$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } - if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then - -$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 -$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } -if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : - $as_echo_n "(cached) " >&6 -else - gt_save_LIBS="$LIBS" - LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -CFLocaleCopyCurrent(); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gt_cv_func_CFLocaleCopyCurrent=yes -else - gt_cv_func_CFLocaleCopyCurrent=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$gt_save_LIBS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 -$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } - if test $gt_cv_func_CFLocaleCopyCurrent = yes; then - -$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h - - fi - INTL_MACOSX_LIBS= - if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then - INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" - fi - - - - - - - LIBINTL= - LTLIBINTL= - POSUB= - - case " $gt_needs " in - *" need-formatstring-macros "*) gt_api_version=3 ;; - *" need-ngettext "*) gt_api_version=2 ;; - *) gt_api_version=1 ;; - esac - gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" - gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" - - if test "$USE_NLS" = "yes"; then - gt_use_preinstalled_gnugettext=no - - - if test $gt_api_version -ge 3; then - gt_revision_test_code=' -#ifndef __GNU_GETTEXT_SUPPORTED_REVISION -#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) -#endif -typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; -' - else - gt_revision_test_code= - fi - if test $gt_api_version -ge 2; then - gt_expression_test_code=' + * ngettext ("", "", 0)' - else - gt_expression_test_code= - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 -$as_echo_n "checking for GNU gettext in libc... " >&6; } -if eval \${$gt_func_gnugettext_libc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -$gt_revision_test_code -extern int _nl_msg_cat_cntr; -extern int *_nl_domain_bindings; -int -main () -{ -bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$gt_func_gnugettext_libc=yes" -else - eval "$gt_func_gnugettext_libc=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$gt_func_gnugettext_libc - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - - if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then - - - - - - am_save_CPPFLAGS="$CPPFLAGS" - - for element in $INCICONV; do - haveit= - for x in $CPPFLAGS; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 -$as_echo_n "checking for iconv... " >&6; } -if ${am_cv_func_iconv+:} false; then : - $as_echo_n "(cached) " >&6 -else - - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - am_cv_func_iconv=yes -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS $LIBICONV" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - am_cv_lib_iconv=yes - am_cv_func_iconv=yes -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" - fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 -$as_echo "$am_cv_func_iconv" >&6; } - if test "$am_cv_func_iconv" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 -$as_echo_n "checking for working iconv... " >&6; } -if ${am_cv_func_iconv_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - - am_save_LIBS="$LIBS" - if test $am_cv_lib_iconv = yes; then - LIBS="$LIBS $LIBICONV" - fi - if test "$cross_compiling" = yes; then : - case "$host_os" in - aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; - *) am_cv_func_iconv_works="guessing yes" ;; - esac -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -int main () -{ - /* Test against AIX 5.1 bug: Failures are not distinguishable from successful - returns. */ - { - iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); - if (cd_utf8_to_88591 != (iconv_t)(-1)) - { - static const char input[] = "\342\202\254"; /* EURO SIGN */ - char buf[10]; - const char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_utf8_to_88591, - (char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - if (res == 0) - return 1; - } - } - /* Test against Solaris 10 bug: Failures are not distinguishable from - successful returns. */ - { - iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); - if (cd_ascii_to_88591 != (iconv_t)(-1)) - { - static const char input[] = "\263"; - char buf[10]; - const char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_ascii_to_88591, - (char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - if (res == 0) - return 1; - } - } -#if 0 /* This bug could be worked around by the caller. */ - /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ - { - iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); - if (cd_88591_to_utf8 != (iconv_t)(-1)) - { - static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; - char buf[50]; - const char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - if ((int)res > 0) - return 1; - } - } -#endif - /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is - provided. */ - if (/* Try standardized names. */ - iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) - /* Try IRIX, OSF/1 names. */ - && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) - /* Try AIX names. */ - && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) - /* Try HP-UX names. */ - && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - return 1; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - am_cv_func_iconv_works=yes -else - am_cv_func_iconv_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - LIBS="$am_save_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 -$as_echo "$am_cv_func_iconv_works" >&6; } - case "$am_cv_func_iconv_works" in - *no) am_func_iconv=no am_cv_lib_iconv=no ;; - *) am_func_iconv=yes ;; - esac - else - am_func_iconv=no am_cv_lib_iconv=no - fi - if test "$am_func_iconv" = yes; then - -$as_echo "#define HAVE_ICONV 1" >>confdefs.h - - fi - if test "$am_cv_lib_iconv" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 -$as_echo_n "checking how to link with libiconv... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 -$as_echo "$LIBICONV" >&6; } - else - CPPFLAGS="$am_save_CPPFLAGS" - LIBICONV= - LTLIBICONV= - fi - - - - - - - - - - - - use_additional=yes - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - -# Check whether --with-libintl-prefix was given. -if test "${with_libintl_prefix+set}" = set; then : - withval=$with_libintl_prefix; - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi - fi - fi - -fi - - LIBINTL= - LTLIBINTL= - INCINTL= - LIBINTL_PREFIX= - HAVE_LIBINTL= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='intl ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - eval libname=\"$acl_libname_spec\" # typically: libname=lib$name - if test -n "$acl_shlibext"; then - shrext=".$acl_shlibext" # typically: shrext=.so - else - shrext= - fi - if test $use_additional = yes; then - dir="$additional_libdir" - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "$enable_rpath" = no \ - || test "X$found_dir" = "X/usr/$acl_libdirstem" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$acl_hardcode_direct" = yes; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */$acl_libdirstem | */$acl_libdirstem/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - if test "$name" = 'intl'; then - LIBINTL_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - */$acl_libdirstem2 | */$acl_libdirstem2/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` - if test "$name" = 'intl'; then - LIBINTL_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INCINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" - ;; - esac - done - fi - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$acl_hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" - done - fi - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 -$as_echo_n "checking for GNU gettext in libintl... " >&6; } -if eval \${$gt_func_gnugettext_libintl+:} false; then : - $as_echo_n "(cached) " >&6 -else - gt_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $INCINTL" - gt_save_LIBS="$LIBS" - LIBS="$LIBS $LIBINTL" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -$gt_revision_test_code -extern int _nl_msg_cat_cntr; -extern -#ifdef __cplusplus -"C" -#endif -const char *_nl_expand_alias (const char *); -int -main () -{ -bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$gt_func_gnugettext_libintl=yes" -else - eval "$gt_func_gnugettext_libintl=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then - LIBS="$LIBS $LIBICONV" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -$gt_revision_test_code -extern int _nl_msg_cat_cntr; -extern -#ifdef __cplusplus -"C" -#endif -const char *_nl_expand_alias (const char *); -int -main () -{ -bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" - eval "$gt_func_gnugettext_libintl=yes" - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - CPPFLAGS="$gt_save_CPPFLAGS" - LIBS="$gt_save_LIBS" -fi -eval ac_res=\$$gt_func_gnugettext_libintl - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - fi - - if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ - || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ - && test "$PACKAGE" != gettext-runtime \ - && test "$PACKAGE" != gettext-tools; }; then - gt_use_preinstalled_gnugettext=yes - else - LIBINTL= - LTLIBINTL= - INCINTL= - fi - - - - if test -n "$INTL_MACOSX_LIBS"; then - if test "$gt_use_preinstalled_gnugettext" = "yes" \ - || test "$nls_cv_use_gnu_gettext" = "yes"; then - LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" - LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" - fi - fi - - if test "$gt_use_preinstalled_gnugettext" = "yes" \ - || test "$nls_cv_use_gnu_gettext" = "yes"; then - -$as_echo "#define ENABLE_NLS 1" >>confdefs.h - - else - USE_NLS=no - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 -$as_echo_n "checking whether to use NLS... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 -$as_echo "$USE_NLS" >&6; } - if test "$USE_NLS" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 -$as_echo_n "checking where the gettext function comes from... " >&6; } - if test "$gt_use_preinstalled_gnugettext" = "yes"; then - if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then - gt_source="external libintl" - else - gt_source="libc" - fi - else - gt_source="included intl directory" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 -$as_echo "$gt_source" >&6; } - fi - - if test "$USE_NLS" = "yes"; then - - if test "$gt_use_preinstalled_gnugettext" = "yes"; then - if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 -$as_echo_n "checking how to link with libintl... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 -$as_echo "$LIBINTL" >&6; } - - for element in $INCINTL; do - haveit= - for x in $CPPFLAGS; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done - - fi - - -$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h - - -$as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h - - fi - - POSUB=po - fi - - - - INTLLIBS="$LIBINTL" - - - - - - - - -ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 -_ACEOF - - -fi - - -if test -n "$ac_tool_prefix"; then - for ac_prog in ar lib "link -lib" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar lib "link -lib" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 -$as_echo_n "checking the archiver ($AR) interface... " >&6; } -if ${am_cv_ar_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else - am_cv_ar_interface=ar + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; @@ -6593,6 +4586,11 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 @@ -6854,8 +4852,8 @@ -macro_version='2.4.2.418' -macro_revision='2.4.2.418' +macro_version='2.4.6' +macro_revision='2.4.6' @@ -6871,6 +4869,77 @@ ltmain=$ac_aux_dir/ltmain.sh +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' @@ -7244,8 +5313,13 @@ # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; @@ -8021,6 +6095,9 @@ tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac fi @@ -9003,6 +7080,86 @@ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +$as_echo_n "checking for a working dd... " >&6; } +if ${ac_cv_path_lt_DD+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in dd; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +$as_echo "$ac_cv_path_lt_DD" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +$as_echo_n "checking how to truncate binary pipes... " >&6; } +if ${lt_cv_truncate_bin+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +$as_echo "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; @@ -9987,7 +8144,7 @@ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) + 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; @@ -10010,6 +8167,41 @@ ;; esac +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default @@ -10129,6 +8321,58 @@ + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test "${with_aix_soname+set}" = set; then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else + if ${lt_cv_with_aix_soname+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +$as_echo "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + @@ -10248,15 +8492,8 @@ test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +func_cc_basename $compiler +cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it @@ -10567,6 +8804,11 @@ # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac ;; darwin* | rhapsody*) @@ -10663,6 +8905,11 @@ # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac ;; hpux9* | hpux10* | hpux11*) @@ -11303,6 +9550,34 @@ link_all_deplibs=yes ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no @@ -11376,6 +9651,9 @@ fi case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' @@ -11505,19 +9783,35 @@ no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then @@ -11525,6 +9819,13 @@ break fi done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -11544,6 +9845,14 @@ hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) @@ -11571,6 +9880,11 @@ if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then @@ -11583,6 +9897,8 @@ else shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi @@ -11590,7 +9906,7 @@ # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes - if test yes = "$aix_use_runtimelinking"; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' @@ -11705,8 +10021,20 @@ whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -12025,6 +10353,16 @@ link_all_deplibs=yes ;; + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out @@ -12070,8 +10408,28 @@ hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes ;; osf3*) @@ -12594,6 +10952,8 @@ # flags to be left without arguments need_version=unknown + + case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor @@ -12630,20 +10990,70 @@ fi ;; esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test yes = "$aix_use_runtimelinking"; then + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - else + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' - fi + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac shlibpath_var=LIBPATH fi ;; @@ -12831,7 +11241,8 @@ version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; @@ -12891,10 +11302,11 @@ soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' @@ -13046,7 +11458,12 @@ # before this can be enabled. hardcode_into_libs=yes - # Append ld.so.conf contents to the search path + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" @@ -13115,11 +11532,32 @@ os2*) libname_spec='$name' + version_type=windows shrext_cmds=.dll + need_version=no need_lib_prefix=no - library_names_spec='$libname$shared_ext $libname.a' + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) @@ -13195,7 +11633,7 @@ ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf + version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' @@ -13250,10 +11688,25 @@ if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi + if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + @@ -13724,7 +12177,7 @@ # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); @@ -13830,7 +12283,7 @@ # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); @@ -13979,8 +12432,12 @@ ;; aix[4-9]*) - if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then - test yes = "$enable_shared" && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -15017,7 +13474,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GNU Awk Bundled Extensions $as_me 4.1.1, which was +This file was extended by GNU Awk Bundled Extensions $as_me 4.1.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15085,7 +13542,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -GNU Awk Bundled Extensions config.status 4.1.1 +GNU Awk Bundled Extensions config.status 4.1.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -15205,13 +13662,6 @@ # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" -# Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it - # from automake < 1.5. - eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' - # Capture the value of LINGUAS because we need it to compute CATALOGS. - LINGUAS="${LINGUAS-%UNSET%}" - # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -15227,6 +13677,7 @@ enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' @@ -15282,6 +13733,7 @@ lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' @@ -15346,7 +13798,8 @@ finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' @@ -15402,6 +13855,7 @@ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ +lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ @@ -15463,7 +13917,8 @@ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec; do +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes @@ -15500,7 +13955,6 @@ do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:configh.in" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; @@ -16192,119 +14646,6 @@ done } ;; - "po-directories":C) - for ac_file in $CONFIG_FILES; do - # Support "outfile[:infile[:infile...]]" - case "$ac_file" in - *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - esac - # PO directories have a Makefile.in generated from Makefile.in.in. - case "$ac_file" in */Makefile.in) - # Adjust a relative srcdir. - ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" - ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` - # In autoconf-2.13 it is called $ac_given_srcdir. - # In autoconf-2.50 it is called $srcdir. - test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" - case "$ac_given_srcdir" in - .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; - /*) top_srcdir="$ac_given_srcdir" ;; - *) top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - # Treat a directory as a PO directory if and only if it has a - # POTFILES.in file. This allows packages to have multiple PO - # directories under different names or in different locations. - if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then - rm -f "$ac_dir/POTFILES" - test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" - POMAKEFILEDEPS="POTFILES.in" - # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend - # on $ac_dir but don't depend on user-specified configuration - # parameters. - if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then - # The LINGUAS file contains the set of available languages. - if test -n "$OBSOLETE_ALL_LINGUAS"; then - test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" - fi - ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assigment from automake < 1.5. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' - POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" - else - # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assigment from automake < 1.5. - eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' - fi - # Compute POFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) - # Compute UPDATEPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) - # Compute DUMMYPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) - # Compute GMOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) - case "$ac_given_srcdir" in - .) srcdirpre= ;; - *) srcdirpre='$(srcdir)/' ;; - esac - POFILES= - UPDATEPOFILES= - DUMMYPOFILES= - GMOFILES= - for lang in $ALL_LINGUAS; do - POFILES="$POFILES $srcdirpre$lang.po" - UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" - DUMMYPOFILES="$DUMMYPOFILES $lang.nop" - GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - done - # CATALOGS depends on both $ac_dir and the user's LINGUAS - # environment variable. - INST_LINGUAS= - if test -n "$ALL_LINGUAS"; then - for presentlang in $ALL_LINGUAS; do - useit=no - if test "%UNSET%" != "$LINGUAS"; then - desiredlanguages="$LINGUAS" - else - desiredlanguages="$ALL_LINGUAS" - fi - for desiredlang in $desiredlanguages; do - # Use the presentlang catalog if desiredlang is - # a. equal to presentlang, or - # b. a variant of presentlang (because in this case, - # presentlang can be used as a fallback for messages - # which are not translated in the desiredlang catalog). - case "$desiredlang" in - "$presentlang"*) useit=yes;; - esac - done - if test $useit = yes; then - INST_LINGUAS="$INST_LINGUAS $presentlang" - fi - done - fi - CATALOGS= - if test -n "$INST_LINGUAS"; then - for lang in $INST_LINGUAS; do - CATALOGS="$CATALOGS $lang.gmo" - done - fi - test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" - sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" - for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do - if test -f "$f"; then - case "$f" in - *.orig | *.bak | *~) ;; - *) cat "$f" >> "$ac_dir/Makefile" ;; - esac - fi - done - fi - ;; - esac - done ;; "libtool":C) # See if we are running on zsh, and set the options that allow our @@ -16319,44 +14660,42 @@ cat <<_LT_EOF >> "$cfgfile" #! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + # ### BEGIN LIBTOOL CONFIG # Whether or not to build static libraries. @@ -16375,6 +14714,9 @@ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + # Shell to use when invoking shell scripts. SHELL=$lt_SHELL @@ -16510,6 +14852,9 @@ # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + # The name of the directory that contains temporary libtool files. objdir=$objdir @@ -16600,8 +14945,11 @@ # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen @@ -16752,6 +15100,65 @@ _LT_EOF + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" diff -urN gawk-4.1.1/extension/configure.ac gawk-4.1.2/extension/configure.ac --- gawk-4.1.1/extension/configure.ac 2014-04-08 19:12:01.000000000 +0300 +++ gawk-4.1.2/extension/configure.ac 2015-04-28 16:49:46.000000000 +0300 @@ -1,7 +1,7 @@ dnl dnl configure.ac --- autoconf input file for gawk dnl -dnl Copyright (C) 2012-2014 the Free Software Foundation, Inc. +dnl Copyright (C) 2012-2015 the Free Software Foundation, Inc. dnl dnl This file is part of GAWK, the GNU implementation of the dnl AWK Programming Language. @@ -23,7 +23,7 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([GNU Awk Bundled Extensions], 4.1.1, bug-gawk@gnu.org, gawk-extensions) +AC_INIT([GNU Awk Bundled Extensions], 4.1.2, bug-gawk@gnu.org, gawk-extensions) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) @@ -33,10 +33,7 @@ INSTALL="$ac_aux_dir/install-sh -c" export INSTALL -AM_INIT_AUTOMAKE([-Wall -Werror]) - -AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION([0.18.1]) +AM_INIT_AUTOMAKE([1.15 -Wall -Werror]) dnl checks for structure members AC_CHECK_MEMBERS([struct stat.st_blksize]) diff -urN gawk-4.1.1/extension/filefuncs.c gawk-4.1.2/extension/filefuncs.c --- gawk-4.1.1/extension/filefuncs.c 2014-03-31 22:17:46.000000000 +0300 +++ gawk-4.1.2/extension/filefuncs.c 2015-04-27 18:09:07.000000000 +0300 @@ -9,7 +9,7 @@ */ /* - * Copyright (C) 2001, 2004, 2005, 2010, 2011, 2012, 2013, 2014 + * Copyright (C) 2001, 2004, 2005, 2010-2015 * the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the @@ -145,7 +145,7 @@ int plugin_is_GPL_compatible; -/* do_chdir --- provide dynamically loaded chdir() builtin for gawk */ +/* do_chdir --- provide dynamically loaded chdir() function for gawk */ static awk_value_t * do_chdir(int nargs, awk_value_t *result) @@ -448,7 +448,7 @@ } } - array_set(array, "type", make_const_string(type, strlen(type), &tmp)); + array_set(array, "type", make_const_string(type, strlen(type), & tmp)); return 0; } @@ -490,7 +490,7 @@ /* always empty out the array */ clear_array(array); - /* stat the file, if error, set ERRNO and return */ + /* stat the file; if error, set ERRNO and return */ ret = statfunc(name, & sbuf); if (ret < 0) { update_ERRNO_int(errno); diff -urN gawk-4.1.1/extension/inplace.3am gawk-4.1.2/extension/inplace.3am --- gawk-4.1.1/extension/inplace.3am 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/extension/inplace.3am 2015-04-27 18:09:07.000000000 +0300 @@ -1,21 +1,10 @@ -.TH INPLACE 3am "Jan 15 2013" "Free Software Foundation" "GNU Awk Extension Modules" +.TH INPLACE 3am "Apr 08 2015" "Free Software Foundation" "GNU Awk Extension Modules" .SH NAME inplace \- emulate sed/perl/ruby in-place editing .SH SYNOPSIS .ft CW .nf -@load "inplace" - -# Please set INPLACE_SUFFIX to make a backup copy. For example, you may -# want to set INPLACE_SUFFIX to .bak on the command line or in a BEGIN rule. - -BEGINFILE { - inplace_begin(FILENAME, INPLACE_SUFFIX) -} - -ENDFILE { - inplace_end(FILENAME, INPLACE_SUFFIX) -} +gawk -i inplace ... .fi .ft R .SH DESCRIPTION @@ -27,8 +16,7 @@ .BR inplace_end() . These functions are meant to be invoked from the .I inplace.awk -wrapper (whose contents are displayed above) -which is installed when +wrapper which is installed when .I gawk is. .PP @@ -68,7 +56,7 @@ Andrew Schorr, .BR schorr@telemetry-investments.com . .SH COPYING PERMISSIONS -Copyright \(co 2012, 2013, +Copyright \(co 2012, 2013, 2015 Free Software Foundation, Inc. .PP Permission is granted to make and distribute verbatim copies of diff -urN gawk-4.1.1/extension/inplace.c gawk-4.1.2/extension/inplace.c --- gawk-4.1.1/extension/inplace.c 2014-03-31 22:17:46.000000000 +0300 +++ gawk-4.1.2/extension/inplace.c 2015-04-27 18:09:07.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2013, 2014 the Free Software Foundation, Inc. + * Copyright (C) 2013-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -170,10 +170,13 @@ state.tname, strerror(errno)); /* N.B. chown/chmod should be more portable than fchown/fchmod */ - if (chown(state.tname, sbuf.st_uid, sbuf.st_gid) < 0) - /* checking chown here shuts up the compiler. bleah */ - if (chown(state.tname, -1, sbuf.st_gid) < 0) - ; + if (chown(state.tname, sbuf.st_uid, sbuf.st_gid) < 0) { + /* jumping through hoops to silence gcc and clang. :-( */ + int junk; + junk = chown(state.tname, -1, sbuf.st_gid); + ++junk; + } + if (chmod(state.tname, sbuf.st_mode) < 0) fatal(ext_id, _("inplace_begin: chmod failed (%s)"), strerror(errno)); diff -urN gawk-4.1.1/extension/m4/libtool.m4 gawk-4.1.2/extension/m4/libtool.m4 --- gawk-4.1.1/extension/m4/libtool.m4 2014-02-20 20:42:25.000000000 +0200 +++ gawk-4.1.2/extension/m4/libtool.m4 2015-04-27 18:09:07.000000000 +0300 @@ -1,6 +1,6 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -8,33 +8,27 @@ # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see . ]) # serial 58 LT_INIT @@ -65,7 +59,7 @@ # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl @@ -109,19 +103,36 @@ dnl AC_DEFUN([AM_PROG_LIBTOOL], []) +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + # _LT_CC_BASENAME(CC) # ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result ]) @@ -175,6 +186,7 @@ m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our @@ -715,15 +727,19 @@ cat <<_LT_EOF >> "$cfgfile" #! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. -# + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + _LT_COPYING _LT_LIBTOOL_TAGS +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS @@ -731,6 +747,17 @@ _LT_EOF + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +_LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" @@ -1047,7 +1074,7 @@ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) + 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; @@ -1844,7 +1871,7 @@ # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated +/* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); @@ -2206,6 +2233,47 @@ ])# _LT_CMD_STRIPLIB +# _LT_PREPARE_MUNGE_PATH_LIST +# --------------------------- +# Make sure func_munge_path_list() is defined correctly. +m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], +[[# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x@S|@2 in + x) + ;; + *:) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" + ;; + x:*) + eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" + ;; + *) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + esac +} +]])# _LT_PREPARE_PATH_LIST + + # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics @@ -2216,6 +2284,7 @@ m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ @@ -2310,6 +2379,9 @@ # flags to be left without arguments need_version=unknown +AC_ARG_VAR([LT_SYS_LIBRARY_PATH], +[User-defined run-time library search path.]) + case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor @@ -2346,20 +2418,70 @@ fi ;; esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. - if test yes = "$aix_use_runtimelinking"; then + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - else + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' - fi + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac shlibpath_var=LIBPATH fi ;; @@ -2547,7 +2669,8 @@ version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; @@ -2607,10 +2730,11 @@ soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' @@ -2743,7 +2867,12 @@ # before this can be enabled. hardcode_into_libs=yes - # Append ld.so.conf contents to the search path + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" @@ -2812,11 +2941,32 @@ os2*) libname_spec='$name' + version_type=windows shrext_cmds=.dll + need_version=no need_lib_prefix=no - library_names_spec='$libname$shared_ext $libname.a' + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' ;; osf3* | osf4* | osf5*) @@ -2892,7 +3042,7 @@ ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf + version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' @@ -2946,10 +3096,20 @@ if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi + if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) @@ -2982,8 +3142,10 @@ [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER @@ -3221,6 +3383,43 @@ ])# _LT_CMD_RELOAD +# _LT_PATH_DD +# ----------- +# find a working dd +m4_defun([_LT_PATH_DD], +[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies @@ -3419,6 +3618,9 @@ tpf*) lt_cv_deplibs_check_method=pass_all ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; esac ]) @@ -3476,8 +3678,13 @@ # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; @@ -4022,6 +4229,11 @@ # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; darwin* | rhapsody*) # PIC is the default on this platform @@ -4341,6 +4553,11 @@ # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; darwin* | rhapsody*) @@ -4438,6 +4655,11 @@ # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac ;; hpux9* | hpux10* | hpux11*) @@ -4687,13 +4909,17 @@ case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -4904,6 +5130,34 @@ _LT_TAGVAR(link_all_deplibs, $1)=yes ;; + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4977,6 +5231,9 @@ fi case $cc_basename in + tcc*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' + ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' @@ -5106,19 +5363,35 @@ no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then @@ -5126,6 +5399,13 @@ break fi done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -5145,6 +5425,14 @@ _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) @@ -5172,6 +5460,11 @@ if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then @@ -5184,6 +5477,8 @@ else shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi @@ -5191,7 +5486,7 @@ # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test yes = "$aix_use_runtimelinking"; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' @@ -5222,8 +5517,20 @@ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -5477,6 +5784,16 @@ _LT_TAGVAR(link_all_deplibs, $1)=yes ;; + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(ld_shlibs, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out @@ -5522,8 +5839,28 @@ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) @@ -5918,8 +6255,12 @@ ;; aix[[4-9]]*) - if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then - test yes = "$enable_shared" && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -6107,7 +6448,19 @@ # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in @@ -6117,6 +6470,13 @@ ;; esac done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi ;; esac @@ -6136,6 +6496,14 @@ _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) @@ -6162,6 +6530,11 @@ if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then @@ -6174,6 +6547,8 @@ else shared_flag='$wl-bM:SRE' fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' fi fi @@ -6182,10 +6557,11 @@ # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes - if test yes = "$aix_use_runtimelinking"; then + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # The "-G" linker flag allows undefined symbols. + _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) @@ -6214,9 +6590,21 @@ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; @@ -6316,6 +6704,34 @@ _LT_DARWIN_LINKER_FEATURES($1) ;; + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + dgux*) case $cc_basename in ec++*) @@ -7029,6 +7445,7 @@ } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -7207,51 +7624,6 @@ _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test yes != "$solaris_use_stlport4"; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test yes != "$solaris_use_stlport4"; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; esac ]) @@ -7369,8 +7741,12 @@ fi ;; aix[[4-9]]*) - if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then - test yes = "$enable_shared" && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac @@ -7503,8 +7879,12 @@ fi ;; aix[[4-9]]*) - if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then - test yes = "$enable_shared" && enable_static=no + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac fi ;; esac diff -urN gawk-4.1.1/extension/m4/ltoptions.m4 gawk-4.1.2/extension/m4/ltoptions.m4 --- gawk-4.1.1/extension/m4/ltoptions.m4 2014-02-20 20:42:25.000000000 +0200 +++ gawk-4.1.2/extension/m4/ltoptions.m4 2015-04-27 18:09:07.000000000 +0300 @@ -1,6 +1,6 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2013 Free Software +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # @@ -82,6 +82,8 @@ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS @@ -319,6 +321,59 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) + with_aix_soname=$lt_cv_with_aix_soname]) + AC_MSG_RESULT([$with_aix_soname]) + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + +_LT_DECL([], [shared_archive_member_spec], [0], + [Shared archive member basename, for filename based shared library versioning on AIX])dnl +])# _LT_WITH_AIX_SONAME + +LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) + + # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' diff -urN gawk-4.1.1/extension/m4/ltsugar.m4 gawk-4.1.2/extension/m4/ltsugar.m4 --- gawk-4.1.1/extension/m4/ltsugar.m4 2014-02-20 20:42:25.000000000 +0200 +++ gawk-4.1.2/extension/m4/ltsugar.m4 2015-04-27 18:09:07.000000000 +0300 @@ -1,6 +1,7 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -33,7 +34,7 @@ # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. +# Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], @@ -44,7 +45,7 @@ # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different diff -urN gawk-4.1.1/extension/m4/ltversion.m4 gawk-4.1.2/extension/m4/ltversion.m4 --- gawk-4.1.1/extension/m4/ltversion.m4 2014-02-20 20:42:25.000000000 +0200 +++ gawk-4.1.2/extension/m4/ltversion.m4 2015-04-27 18:09:07.000000000 +0300 @@ -1,6 +1,6 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +9,15 @@ # @configure_input@ -# serial 4038 ltversion.m4 +# serial 4179 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.2.418]) -m4_define([LT_PACKAGE_REVISION], [2.4.2.418]) +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.2.418' -macro_revision='2.4.2.418' +[macro_version='2.4.6' +macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff -urN gawk-4.1.1/extension/m4/lt~obsolete.m4 gawk-4.1.2/extension/m4/lt~obsolete.m4 --- gawk-4.1.1/extension/m4/lt~obsolete.m4 2014-02-20 20:42:25.000000000 +0200 +++ gawk-4.1.2/extension/m4/lt~obsolete.m4 2015-04-27 18:09:07.000000000 +0300 @@ -1,6 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -11,7 +12,7 @@ # These exist entirely to fool aclocal when bootstrapping libtool. # -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # @@ -25,7 +26,7 @@ # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until diff -urN gawk-4.1.1/extension/rwarray0.c gawk-4.1.2/extension/rwarray0.c --- gawk-4.1.1/extension/rwarray0.c 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/extension/rwarray0.c 2015-04-28 16:49:46.000000000 +0300 @@ -0,0 +1,475 @@ +/* + * rwarray.c - Builtin functions to binary read / write arrays to a file. + * + * Arnold Robbins + * May 2009 + * Redone June 2012 + */ + +/* + * Copyright (C) 2009, 2010, 2011, 2012, 2013 the Free Software Foundation, Inc. + * + * This file is part of GAWK, the GNU implementation of the + * AWK Programming Language. + * + * GAWK is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * GAWK is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "gawkapi.h" + +#include "gettext.h" +#define _(msgid) gettext(msgid) +#define N_(msgid) msgid + +#define MAGIC "awkrulz\n" +#define MAJOR 3 +#define MINOR 0 + +static const gawk_api_t *api; /* for convenience macros to work */ +static awk_ext_id_t *ext_id; +static const char *ext_version = "rwarray0 extension: version 1.0"; +static awk_bool_t (*init_func)(void) = NULL; + +int plugin_is_GPL_compatible; + +static awk_bool_t write_array(int fd, awk_array_t array); +static awk_bool_t write_elem(int fd, awk_element_t *element); +static awk_bool_t write_value(int fd, awk_value_t *val); + +static awk_bool_t read_array(int fd, awk_array_t array); +static awk_bool_t read_elem(int fd, awk_element_t *element); +static awk_bool_t read_value(int fd, awk_value_t *value); + +/* + * Format of array info: + * + * MAGIC 8 bytes + * Major version 4 bytes - network order + * Minor version 4 bytes - network order + * Element count 4 bytes - network order + * Elements + * + * For each element: + * Length of index val: 4 bytes - network order + * Index val as characters (N bytes) + * Value type 4 bytes (0 = string, 1 = number, 2 = array) + * IF string: + * Length of value 4 bytes + * Value as characters (N bytes) + * ELSE IF number: + * 8 bytes as native double + * ELSE + * Element count + * Elements + * END IF + */ + +/* do_writea --- write an array */ + +static awk_value_t * +do_writea(int nargs, awk_value_t *result) +{ + awk_value_t filename, array; + int fd = -1; + uint32_t major = MAJOR; + uint32_t minor = MINOR; + + assert(result != NULL); + make_number(0.0, result); + + if (do_lint && nargs > 2) + lintwarn(ext_id, _("writea: called with too many arguments")); + + if (nargs < 2) + goto out; + + /* directory is first arg, array to dump is second */ + if (! get_argument(0, AWK_STRING, & filename)) { + fprintf(stderr, _("do_writea: argument 0 is not a string\n")); + errno = EINVAL; + goto done1; + } + + if (! get_argument(1, AWK_ARRAY, & array)) { + fprintf(stderr, _("do_writea: argument 1 is not an array\n")); + errno = EINVAL; + goto done1; + } + + /* open the file, if error, set ERRNO and return */ + fd = creat(filename.str_value.str, 0600); + if (fd < 0) + goto done1; + + if (write(fd, MAGIC, strlen(MAGIC)) != strlen(MAGIC)) + goto done1; + + major = htonl(major); + if (write(fd, & major, sizeof(major)) != sizeof(major)) + goto done1; + + minor = htonl(minor); + if (write(fd, & minor, sizeof(minor)) != sizeof(minor)) + goto done1; + + if (write_array(fd, array.array_cookie)) { + make_number(1.0, result); + goto done0; + } + +done1: + update_ERRNO_int(errno); + unlink(filename.str_value.str); + +done0: + close(fd); +out: + return result; +} + + +/* write_array --- write out an array or a sub-array */ + +static awk_bool_t +write_array(int fd, awk_array_t array) +{ + uint32_t i; + uint32_t count; + awk_flat_array_t *flat_array; + + if (! flatten_array(array, & flat_array)) { + fprintf(stderr, _("write_array: could not flatten array\n")); + return awk_false; + } + + count = htonl(flat_array->count); + if (write(fd, & count, sizeof(count)) != sizeof(count)) + return awk_false; + + for (i = 0; i < flat_array->count; i++) { + if (! write_elem(fd, & flat_array->elements[i])) + return awk_false; + } + + if (! release_flattened_array(array, flat_array)) { + fprintf(stderr, _("write_array: could not release flattened array\n")); + return awk_false; + } + + return awk_true; +} + +/* write_elem --- write out a single element */ + +static awk_bool_t +write_elem(int fd, awk_element_t *element) +{ + uint32_t indexval_len; + ssize_t write_count; + + indexval_len = htonl(element->index.str_value.len); + if (write(fd, & indexval_len, sizeof(indexval_len)) != sizeof(indexval_len)) + return awk_false; + + if (element->index.str_value.len > 0) { + write_count = write(fd, element->index.str_value.str, + element->index.str_value.len); + if (write_count != (ssize_t) element->index.str_value.len) + return awk_false; + } + + return write_value(fd, & element->value); +} + +/* write_value --- write a number or a string or a array */ + +static awk_bool_t +write_value(int fd, awk_value_t *val) +{ + uint32_t code, len; + + if (val->val_type == AWK_ARRAY) { + code = htonl(2); + if (write(fd, & code, sizeof(code)) != sizeof(code)) + return awk_false; + return write_array(fd, val->array_cookie); + } + + if (val->val_type == AWK_NUMBER) { + code = htonl(1); + if (write(fd, & code, sizeof(code)) != sizeof(code)) + return awk_false; + + if (write(fd, & val->num_value, sizeof(val->num_value)) != sizeof(val->num_value)) + return awk_false; + } else { + code = 0; + if (write(fd, & code, sizeof(code)) != sizeof(code)) + return awk_false; + + len = htonl(val->str_value.len); + if (write(fd, & len, sizeof(len)) != sizeof(len)) + return awk_false; + + if (write(fd, val->str_value.str, val->str_value.len) + != (ssize_t) val->str_value.len) + return awk_false; + } + + return awk_true; +} + +/* do_reada --- read an array */ + +static awk_value_t * +do_reada(int nargs, awk_value_t *result) +{ + awk_value_t filename, array; + int fd = -1; + uint32_t major; + uint32_t minor; + char magic_buf[30]; + + assert(result != NULL); + make_number(0.0, result); + + if (do_lint && nargs > 2) + lintwarn(ext_id, _("reada: called with too many arguments")); + + if (nargs < 2) + goto out; + + /* directory is first arg, array to read is second */ + if (! get_argument(0, AWK_STRING, & filename)) { + fprintf(stderr, _("do_reada: argument 0 is not a string\n")); + errno = EINVAL; + goto done1; + } + + if (! get_argument(1, AWK_ARRAY, & array)) { + fprintf(stderr, _("do_reada: argument 1 is not an array\n")); + errno = EINVAL; + goto done1; + } + + fd = open(filename.str_value.str, O_RDONLY); + if (fd < 0) + goto done1; + + memset(magic_buf, '\0', sizeof(magic_buf)); + if (read(fd, magic_buf, strlen(MAGIC)) != strlen(MAGIC)) { + errno = EBADF; + goto done1; + } + + if (strcmp(magic_buf, MAGIC) != 0) { + errno = EBADF; + goto done1; + } + + if (read(fd, & major, sizeof(major)) != sizeof(major)) { + errno = EBADF; + goto done1; + } + major = ntohl(major); + + if (major != MAJOR) { + errno = EBADF; + goto done1; + } + + if (read(fd, & minor, sizeof(minor)) != sizeof(minor)) { + /* read() sets errno */ + goto done1; + } + + minor = ntohl(minor); + if (minor != MINOR) { + errno = EBADF; + goto done1; + } + + if (! clear_array(array.array_cookie)) { + errno = ENOMEM; + fprintf(stderr, _("do_reada: clear_array failed\n")); + goto done1; + } + + if (read_array(fd, array.array_cookie)) { + make_number(1.0, result); + goto done0; + } + +done1: + update_ERRNO_int(errno); +done0: + close(fd); +out: + return result; +} + + +/* read_array --- read in an array or sub-array */ + +static awk_bool_t +read_array(int fd, awk_array_t array) +{ + uint32_t i; + uint32_t count; + awk_element_t new_elem; + + if (read(fd, & count, sizeof(count)) != sizeof(count)) { + return awk_false; + } + count = ntohl(count); + + for (i = 0; i < count; i++) { + if (read_elem(fd, & new_elem)) { + /* add to array */ + if (! set_array_element_by_elem(array, & new_elem)) { + fprintf(stderr, _("read_array: set_array_element failed\n")); + return awk_false; + } + } else + break; + } + + if (i != count) + return awk_false; + + return awk_true; +} + +/* read_elem --- read in a single element */ + +static awk_bool_t +read_elem(int fd, awk_element_t *element) +{ + uint32_t index_len; + static char *buffer; + static uint32_t buflen; + ssize_t ret; + + if ((ret = read(fd, & index_len, sizeof(index_len))) != sizeof(index_len)) { + return awk_false; + } + index_len = ntohl(index_len); + + memset(element, 0, sizeof(*element)); + + if (index_len > 0) { + if (buffer == NULL) { + // allocate buffer + emalloc(buffer, char *, index_len, "read_elem"); + buflen = index_len; + } else if (buflen < index_len) { + // reallocate buffer + char *cp = realloc(buffer, index_len); + + if (cp == NULL) + return awk_false; + + buffer = cp; + buflen = index_len; + } + + if (read(fd, buffer, index_len) != (ssize_t) index_len) { + return awk_false; + } + make_const_string(buffer, index_len, & element->index); + } else { + make_null_string(& element->index); + } + + if (! read_value(fd, & element->value)) + return awk_false; + + return awk_true; +} + +/* read_value --- read a number or a string */ + +static awk_bool_t +read_value(int fd, awk_value_t *value) +{ + uint32_t code, len; + + if (read(fd, & code, sizeof(code)) != sizeof(code)) + return awk_false; + + code = ntohl(code); + + if (code == 2) { + awk_array_t array = create_array(); + + if (read_array(fd, array) != 0) + return awk_false; + + /* hook into value */ + value->val_type = AWK_ARRAY; + value->array_cookie = array; + } else if (code == 1) { + double d; + + if (read(fd, & d, sizeof(d)) != sizeof(d)) + return awk_false; + + /* hook into value */ + value->val_type = AWK_NUMBER; + value->num_value = d; + } else { + if (read(fd, & len, sizeof(len)) != sizeof(len)) { + return awk_false; + } + len = ntohl(len); + value->val_type = AWK_STRING; + value->str_value.len = len; + value->str_value.str = malloc(len + 2); + memset(value->str_value.str, '\0', len + 2); + + if (read(fd, value->str_value.str, len) != (ssize_t) len) { + free(value->str_value.str); + return awk_false; + } + } + + return awk_true; +} + +static awk_ext_func_t func_table[] = { + { "writea", do_writea, 2 }, + { "reada", do_reada, 2 }, +}; + + +/* define the dl_load function using the boilerplate macro */ + +dl_load_func(func_table, rwarray, "") diff -urN gawk-4.1.1/extension/testext.c gawk-4.1.2/extension/testext.c --- gawk-4.1.1/extension/testext.c 2014-03-31 22:17:46.000000000 +0300 +++ gawk-4.1.2/extension/testext.c 2015-04-28 16:49:46.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2012, 2013, 2014 + * Copyright (C) 2012, 2013, 2014, 2015 * the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the @@ -302,6 +302,12 @@ goto out; } + /* look up PROCINFO - should succeed fail */ + if (sym_lookup("PROCINFO", AWK_ARRAY, & value)) + printf("var_test: sym_lookup of PROCINFO passed - got a value!\n"); + else + printf("var_test: sym_lookup of PROCINFO failed - did not get a value\n"); + /* look up a reserved variable - should pass */ if (sym_lookup("ARGC", AWK_NUMBER, & value)) printf("var_test: sym_lookup of ARGC passed - got a value!\n"); diff -urN gawk-4.1.1/field.c gawk-4.1.2/field.c --- gawk-4.1.1/field.c 2014-02-20 20:52:05.000000000 +0200 +++ gawk-4.1.2/field.c 2015-04-28 16:49:46.000000000 +0300 @@ -40,7 +40,6 @@ static long (*parse_field)(long, char **, int, NODE *, Regexp *, Setfunc, NODE *, NODE *, bool); -static void rebuild_record(void); static long re_parse_field(long, char **, int, NODE *, Regexp *, Setfunc, NODE *, NODE *, bool); static long def_parse_field(long, char **, int, NODE *, @@ -140,7 +139,7 @@ /* rebuild_record --- Someone assigned a value to $(something). Fix up $0 to be right */ -static void +void rebuild_record() { /* @@ -148,9 +147,7 @@ * a size_t isn't big enough. */ unsigned long tlen; - unsigned long ofslen; NODE *tmp; - NODE *ofs; char *ops; char *cops; long i; @@ -158,14 +155,12 @@ assert(NF != -1); tlen = 0; - ofs = force_string(OFS_node->var_value); - ofslen = ofs->stlen; for (i = NF; i > 0; i--) { tmp = fields_arr[i]; tmp = force_string(tmp); tlen += tmp->stlen; } - tlen += (NF - 1) * ofslen; + tlen += (NF - 1) * OFSlen; if ((long) tlen < 0) tlen = 0; emalloc(ops, char *, tlen + 2, "rebuild_record"); @@ -183,11 +178,11 @@ } /* copy OFS */ if (i != NF) { - if (ofslen == 1) - *cops++ = ofs->stptr[0]; - else if (ofslen != 0) { - memcpy(cops, ofs->stptr, ofslen); - cops += ofslen; + if (OFSlen == 1) + *cops++ = *OFS; + else if (OFSlen != 0) { + memcpy(cops, OFS, OFSlen); + cops += OFSlen; } } } @@ -231,7 +226,7 @@ fields_arr[i] = n; assert((n->flags & WSTRCUR) == 0); } - cops += fields_arr[i]->stlen + ofslen; + cops += fields_arr[i]->stlen + OFSlen; } unref(fields_arr[0]); @@ -282,6 +277,12 @@ /* copy the data */ memcpy(databuf, buf, cnt); + /* + * Add terminating '\0' so that C library routines + * will know when to stop. + */ + databuf[cnt] = '\0'; + /* manage field 0: */ unref(fields_arr[0]); getnode(n); @@ -391,12 +392,10 @@ char *end = scan + len; int regex_flags = RE_NEED_START; char *sep; -#if MBS_SUPPORT size_t mbclen = 0; mbstate_t mbs; - if (gawk_mb_cur_max > 1) - memset(&mbs, 0, sizeof(mbstate_t)); -#endif + + memset(&mbs, 0, sizeof(mbstate_t)); if (in_middle) regex_flags |= RE_NO_BOL; @@ -423,7 +422,6 @@ && nf < up_to) { regex_flags |= RE_NO_BOL; if (REEND(rp, scan) == RESTART(rp, scan)) { /* null match */ -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { mbclen = mbrlen(scan, end-scan, &mbs); if ((mbclen == 1) || (mbclen == (size_t) -1) @@ -433,8 +431,7 @@ } scan += mbclen; } else -#endif - scan++; + scan++; if (scan == end) { (*set)(++nf, field, (long)(scan - field), n); up_to = nf; @@ -635,7 +632,6 @@ if (len == 0) return nf; -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { mbstate_t mbs; memset(&mbs, 0, sizeof(mbstate_t)); @@ -651,12 +647,12 @@ (*set)(++nf, scan, mbclen, n); scan += mbclen; } - } else -#endif - for (; nf < up_to && scan < end; scan++) { - if (sep_arr != NULL && nf > 0) - set_element(nf, scan, 0L, sep_arr); - (*set)(++nf, scan, 1L, n); + } else { + for (; nf < up_to && scan < end; scan++) { + if (sep_arr != NULL && nf > 0) + set_element(nf, scan, 0L, sep_arr); + (*set)(++nf, scan, 1L, n); + } } *buf = scan; @@ -687,12 +683,10 @@ char *field; char *end = scan + len; char sav; -#if MBS_SUPPORT size_t mbclen = 0; mbstate_t mbs; - if (gawk_mb_cur_max > 1) - memset(&mbs, 0, sizeof(mbstate_t)); -#endif + + memset(&mbs, 0, sizeof(mbstate_t)); if (up_to == UNLIMITED) nf = 0; @@ -711,7 +705,6 @@ for (; nf < up_to;) { field = scan; -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { while (*scan != fschar) { mbclen = mbrlen(scan, end-scan, &mbs); @@ -722,10 +715,10 @@ } scan += mbclen; } - } else -#endif - while (*scan != fschar) - scan++; + } else { + while (*scan != fschar) + scan++; + } (*set)(++nf, field, (long)(scan - field), n); if (scan == end) break; @@ -765,7 +758,6 @@ char *scan = *buf; long nf = parse_high_water; char *end = scan + len; -#if MBS_SUPPORT int nmbc; size_t mbclen; size_t mbslen; @@ -774,14 +766,12 @@ mbstate_t mbs; memset(&mbs, 0, sizeof(mbstate_t)); -#endif if (up_to == UNLIMITED) nf = 0; if (len == 0) return nf; for (; nf < up_to && (len = FIELDWIDTHS[nf+1]) != -1; ) { -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { nmbc = 0; mbslen = 0; @@ -804,10 +794,7 @@ } (*set)(++nf, scan, (long) mbslen, n); scan += mbslen; - } - else -#endif - { + } else { if (len > end - scan) len = end - scan; (*set)(++nf, scan, (long) len, n); @@ -1450,13 +1437,8 @@ * Implementation varies if doing MBS or not. */ -#if MBS_SUPPORT #define increment_scan(scanp, len) incr_scan(scanp, len, & mbs) -#else -#define increment_scan(scanp, len) ((*scanp)++) -#endif -#if MBS_SUPPORT /* incr_scan --- MBS version of increment_scan() */ static void @@ -1477,7 +1459,6 @@ } else (*scanp)++; } -#endif /* * fpat_parse_field --- parse fields using a regexp. @@ -1602,12 +1583,9 @@ bool need_to_set_sep; bool non_empty; bool eosflag; -#if MBS_SUPPORT mbstate_t mbs; - if (gawk_mb_cur_max > 1) - memset(&mbs, 0, sizeof(mbstate_t)); -#endif + memset(&mbs, 0, sizeof(mbstate_t)); if (up_to == UNLIMITED) nf = 0; diff -urN gawk-4.1.1/gawkapi.c gawk-4.1.2/gawkapi.c --- gawk-4.1.1/gawkapi.c 2014-03-31 22:17:46.000000000 +0300 +++ gawk-4.1.2/gawkapi.c 2015-04-28 16:49:46.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2012-2014 the Free Software Foundation, Inc. + * Copyright (C) 2012-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -441,7 +441,10 @@ case AWK_UNDEFINED: /* return true and actual type for request of undefined */ - if ((node->flags & NUMBER) != 0) { + if (node == Nnull_string) { + val->val_type = AWK_UNDEFINED; + ret = awk_true; + } else if ((node->flags & NUMBER) != 0) { val->val_type = AWK_NUMBER; val->num_value = get_number_d(node); ret = awk_true; @@ -787,7 +790,6 @@ elem->parent_array = array; elem->vname = estrdup(index->str_value.str, index->str_value.len); - make_aname(elem); } return awk_true; diff -urN gawk-4.1.1/gawkapi.h gawk-4.1.2/gawkapi.h --- gawk-4.1.1/gawkapi.h 2014-03-31 22:17:46.000000000 +0300 +++ gawk-4.1.2/gawkapi.h 2015-04-28 16:49:46.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2012-2014 the Free Software Foundation, Inc. + * Copyright (C) 2012-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -142,8 +142,8 @@ * so there is no need to set it unless an error occurs. * * If an error does occur, the function should return EOF and set - * *errcode to a non-zero value. In that case, if *errcode does not - * equal -1, gawk will automatically update the ERRNO variable based + * *errcode to a positive value. In that case, if *errcode is greater + * than zero, gawk will automatically update the ERRNO variable based * on the value of *errcode (e.g., setting *errcode = errno should do * the right thing). */ @@ -846,7 +846,7 @@ extern int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id); #if 0 -/* Boiler plate code: */ +/* Boilerplate code: */ int plugin_is_GPL_compatible; static gawk_api_t *const api; @@ -865,17 +865,17 @@ /* OR: */ static awk_bool_t -init_my_module(void) +init_my_extension(void) { ... } -static awk_bool_t (*init_func)(void) = init_my_module; +static awk_bool_t (*init_func)(void) = init_my_extension; dl_load_func(func_table, some_name, "name_space_in_quotes") #endif -#define dl_load_func(func_table, module, name_space) \ +#define dl_load_func(func_table, extension, name_space) \ int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id) \ { \ size_t i, j; \ @@ -886,7 +886,7 @@ \ if (api->major_version != GAWK_API_MAJOR_VERSION \ || api->minor_version < GAWK_API_MINOR_VERSION) { \ - fprintf(stderr, #module ": version mismatch with gawk!\n"); \ + fprintf(stderr, #extension ": version mismatch with gawk!\n"); \ fprintf(stderr, "\tmy version (%d, %d), gawk version (%d, %d)\n", \ GAWK_API_MAJOR_VERSION, GAWK_API_MINOR_VERSION, \ api->major_version, api->minor_version); \ @@ -898,7 +898,7 @@ if (func_table[i].name == NULL) \ break; \ if (! add_ext_func(name_space, & func_table[i])) { \ - warning(ext_id, #module ": could not add %s\n", \ + warning(ext_id, #extension ": could not add %s\n", \ func_table[i].name); \ errors++; \ } \ @@ -906,7 +906,7 @@ \ if (init_func != NULL) { \ if (! init_func()) { \ - warning(ext_id, #module ": initialization function failed\n"); \ + warning(ext_id, #extension ": initialization function failed\n"); \ errors++; \ } \ } \ diff -urN gawk-4.1.1/gawkmisc.c gawk-4.1.2/gawkmisc.c --- gawk-4.1.1/gawkmisc.c 2014-02-20 20:18:14.000000000 +0200 +++ gawk-4.1.2/gawkmisc.c 2015-04-27 18:04:11.000000000 +0300 @@ -52,6 +52,8 @@ xmalloc(size_t bytes) { pointer p; + if (bytes == 0) + bytes = 1; /* avoid dfa.c mishegos */ emalloc(p, pointer, bytes, "xmalloc"); return p; } diff -urN gawk-4.1.1/getopt.c gawk-4.1.2/getopt.c --- gawk-4.1.1/getopt.c 2014-02-20 20:49:15.000000000 +0200 +++ gawk-4.1.2/getopt.c 2015-04-27 18:09:07.000000000 +0300 @@ -2,7 +2,7 @@ NOTE: getopt is part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! - Copyright (C) 1987-2014 Free Software Foundation, Inc. + Copyright (C) 1987-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -613,7 +613,7 @@ fputc_unlocked ('\n', fp); - if (__builtin_expect (fclose (fp) != EOF, 1)) + if (__glibc_likely (fclose (fp) != EOF)) { _IO_flockfile (stderr); diff -urN gawk-4.1.1/getopt.h gawk-4.1.2/getopt.h --- gawk-4.1.1/getopt.h 2014-02-20 20:49:15.000000000 +0200 +++ gawk-4.1.2/getopt.h 2015-04-27 18:09:07.000000000 +0300 @@ -1,5 +1,5 @@ /* Declarations for getopt. - Copyright (C) 1989-2014 Free Software Foundation, Inc. + Copyright (C) 1989-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -48,6 +48,21 @@ extern "C" { #endif +#ifdef __KLIBC__ +/* OS/2 kLIBC has already getopt(). So to avoid name clash, rename + them here. */ + +# define optarg gawk_optarg +# define optind gawk_optind +# define opterr gawk_opterr +# define optopt gawk_optopt + +# define getopt gawk_getopt +# define getopt_long gawk_getopt_long +# define getopt_long_only gawk_getopt_long_only +#endif + + /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. diff -urN gawk-4.1.1/getopt1.c gawk-4.1.2/getopt1.c --- gawk-4.1.1/getopt1.c 2014-02-20 20:49:15.000000000 +0200 +++ gawk-4.1.2/getopt1.c 2015-04-27 18:09:07.000000000 +0300 @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987-2014 Free Software Foundation, Inc. + Copyright (C) 1987-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff -urN gawk-4.1.1/getopt_int.h gawk-4.1.2/getopt_int.h --- gawk-4.1.1/getopt_int.h 2014-02-20 20:49:15.000000000 +0200 +++ gawk-4.1.2/getopt_int.h 2015-04-27 18:09:07.000000000 +0300 @@ -1,5 +1,5 @@ /* Internal declarations for getopt. - Copyright (C) 1989-2014 Free Software Foundation, Inc. + Copyright (C) 1989-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff -urN gawk-4.1.1/install-sh gawk-4.1.2/install-sh --- gawk-4.1.1/install-sh 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/install-sh 2015-04-27 18:09:07.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2013-10-30.23; # UTC +scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -82,7 +82,7 @@ dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -139,14 +139,16 @@ -s) stripcmd=$stripprog;; - -t) dst_arg=$2 + -t) + is_target_a_directory=always + dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; @@ -161,6 +163,16 @@ shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -192,6 +204,15 @@ fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -253,7 +274,7 @@ # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test -n "$no_target_directory"; then + if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi diff -urN gawk-4.1.1/interpret.h gawk-4.1.2/interpret.h --- gawk-4.1.1/interpret.h 2014-03-31 22:17:46.000000000 +0300 +++ gawk-4.1.2/interpret.h 2015-04-28 16:49:46.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2014 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -23,7 +23,19 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - +#define UNFIELD(l, r) \ +{ \ + /* if was a field, turn it into a var */ \ + if ((r->flags & FIELD) == 0) { \ + l = r; \ + } else if (r->valref == 1) { \ + r->flags &= ~FIELD; \ + l = r; \ + } else { \ + l = dupnode(r); \ + DEREF(r); \ + } \ +} int r_interpret(INSTRUCTION *code) { @@ -340,7 +352,12 @@ lhs = r_get_field(t1, (Func_ptr *) 0, true); decr_sp(); DEREF(t1); - r = dupnode(*lhs); /* can't use UPREF here */ + /* only for $0, up ref count */ + if (*lhs == fields_arr[0]) { + r = *lhs; + UPREF(r); + } else + r = dupnode(*lhs); PUSH(r); break; @@ -631,7 +648,8 @@ } unref(*lhs); - *lhs = POP_SCALAR(); + r = POP_SCALAR(); + UNFIELD(*lhs, r); /* execute post-assignment routine if any */ if (t1->astore != NULL) @@ -649,11 +667,12 @@ lhs = get_lhs(pc->memory, false); unref(*lhs); r = pc->initval; /* constant initializer */ - if (r == NULL) - *lhs = POP_SCALAR(); - else { + if (r != NULL) { UPREF(r); *lhs = r; + } else { + r = POP_SCALAR(); + UNFIELD(*lhs, r); } break; @@ -669,7 +688,8 @@ decr_sp(); DEREF(t1); unref(*lhs); - *lhs = POP_SCALAR(); + r = POP_SCALAR(); + UNFIELD(*lhs, r); assert(assign != NULL); assign(); } @@ -695,7 +715,6 @@ t1->stptr[nlen] = '\0'; t1->flags &= ~(NUMCUR|NUMBER|NUMINT); -#if MBS_SUPPORT if ((t1->flags & WSTRCUR) != 0 && (t2->flags & WSTRCUR) != 0) { size_t wlen = t1->wstlen + t2->wstlen; @@ -707,7 +726,6 @@ t1->flags |= WSTRCUR; } else free_wstr(*lhs); -#endif } else { size_t nlen = t1->stlen + t2->stlen; char *p; @@ -725,8 +743,8 @@ lhs = POP_ADDRESS(); r = TOP_SCALAR(); unref(*lhs); - *lhs = r; UPREF(r); + UNFIELD(*lhs, r); REPLACE(r); break; @@ -1038,10 +1056,52 @@ f = lookup(t1->stptr); } - if (f == NULL || f->type != Node_func) { - if (f->type == Node_ext_func || f->type == Node_old_ext_func) - fatal(_("cannot (yet) call extension functions indirectly")); + if (f == NULL) { + fatal(_("`%s' is not a function, so it cannot be called indirectly"), + t1->stptr); + } else if (f->type == Node_builtin_func) { + int arg_count = (pc + 1)->expr_count; + builtin_func_t the_func = lookup_builtin(t1->stptr); + + assert(the_func != NULL); + + /* call it */ + if (the_func == (builtin_func_t) do_sub) + r = call_sub(t1->stptr, arg_count); + else if (the_func == do_match) + r = call_match(arg_count); + else if (the_func == do_split || the_func == do_patsplit) + r = call_split_func(t1->stptr, arg_count); else + r = the_func(arg_count); + + PUSH(r); + break; + } else if (f->type != Node_func) { + if ( f->type == Node_ext_func + || f->type == Node_old_ext_func) { + /* code copied from below, keep in sync */ + INSTRUCTION *bc; + char *fname = pc->func_name; + int arg_count = (pc + 1)->expr_count; + static INSTRUCTION npc[2]; + + npc[0] = *pc; + + bc = f->code_ptr; + assert(bc->opcode == Op_symbol); + if (f->type == Node_ext_func) + npc[0].opcode = Op_ext_builtin; /* self modifying code */ + else + npc[0].opcode = Op_old_ext_builtin; /* self modifying code */ + npc[0].extfunc = bc->extfunc; + npc[0].expr_count = arg_count; /* actual argument count */ + npc[1] = pc[1]; + npc[1].func_name = fname; /* name of the builtin */ + npc[1].expr_count = bc->expr_count; /* defined max # of arguments */ + ni = npc; + JUMPTO(ni); + } else fatal(_("function called indirectly through `%s' does not exist"), pc->func_name); } @@ -1065,6 +1125,7 @@ } if (f->type == Node_ext_func || f->type == Node_old_ext_func) { + /* keep in sync with indirect call code */ INSTRUCTION *bc; char *fname = pc->func_name; int arg_count = (pc + 1)->expr_count; @@ -1098,10 +1159,6 @@ JUMPTO(ni); case Op_K_getline_redir: - if ((currule == BEGINFILE || currule == ENDFILE) - && pc->into_var == false - && pc->redir_type == redirect_input) - fatal(_("`getline' invalid inside `%s' rule"), ruletab[currule]); r = do_getline_redir(pc->into_var, pc->redir_type); PUSH(r); break; @@ -1195,10 +1252,13 @@ JUMPTO(ni); } - if (inrec(curfile, & errcode) != 0) { - if (errcode > 0 && (do_traditional || ! pc->has_endfile)) - fatal(_("error reading input file `%s': %s"), + if (! inrec(curfile, & errcode)) { + if (errcode > 0) { + update_ERRNO_int(errcode); + if (do_traditional || ! pc->has_endfile) + fatal(_("error reading input file `%s': %s"), curfile->public.name, strerror(errcode)); + } JUMPTO(ni); } /* else @@ -1261,17 +1321,18 @@ fatal(_("`exit' cannot be called in the current context")); exiting = true; - t1 = POP_NUMBER(); - exit_val = (int) get_number_si(t1); - DEREF(t1); + if ((t1 = POP_NUMBER()) != Nnull_string) { + exit_val = (int) get_number_si(t1); #ifdef VMS - if (exit_val == 0) - exit_val = EXIT_SUCCESS; - else if (exit_val == 1) - exit_val = EXIT_FAILURE; - /* else - just pass anything else on through */ + if (exit_val == 0) + exit_val = EXIT_SUCCESS; + else if (exit_val == 1) + exit_val = EXIT_FAILURE; + /* else + just pass anything else on through */ #endif + } + DEREF(t1); if (currule == BEGINFILE || currule == ENDFILE) { diff -urN gawk-4.1.1/io.c gawk-4.1.2/io.c --- gawk-4.1.1/io.c 2014-03-05 06:00:36.000000000 +0200 +++ gawk-4.1.2/io.c 2015-04-28 16:49:46.000000000 +0300 @@ -110,6 +110,14 @@ #ifdef __EMX__ #include + +#if !defined(_S_IFDIR) && defined(S_IFDIR) +#define _S_IFDIR S_IFDIR +#endif + +#if !defined(_S_IRWXU) && defined(S_IRWXU) +#define _S_IRWXU S_IRWXU +#endif #endif #ifndef ENFILE @@ -166,6 +174,12 @@ # define SOCKET int #endif +#else /* HAVE_SOCKETS */ + +#ifndef closemaybesocket +# define closemaybesocket(fd) close(fd) +#endif + #endif /* HAVE_SOCKETS */ #ifndef HAVE_SETSID @@ -200,6 +214,7 @@ #define at_eof(iop) (((iop)->flag & IOP_AT_EOF) != 0) #define has_no_data(iop) ((iop)->dataend == NULL) #define no_data_left(iop) ((iop)->off >= (iop)->dataend) +#define buffer_has_all_data(iop) ((iop)->dataend - (iop)->off == (iop)->public.sbuf.st_size) /* * The key point to the design is to split out the code that searches through @@ -273,7 +288,23 @@ static int get_a_record(char **out, IOBUF *iop, int *errcode); static void free_rp(struct redirect *rp); -static int inetfile(const char *str, int *length, int *family); + +struct inet_socket_info { + int family; /* AF_UNSPEC, AF_INET, or AF_INET6 */ + int protocol; /* SOCK_STREAM or SOCK_DGRAM */ + /* + * N.B. If we used 'char *' or 'const char *' pointers to the + * substrings, it would trigger compiler warnings about the casts + * in either inetfile() or devopen(). So we use offset/len to + * avoid that. + */ + struct { + int offset; + int len; + } localport, remotehost, remoteport; +}; + +static bool inetfile(const char *str, struct inet_socket_info *isn); static NODE *in_PROCINFO(const char *pidx1, const char *pidx2, NODE **full_idx); static long get_read_timeout(IOBUF *iop); @@ -551,12 +582,12 @@ /* inrec --- This reads in a record from the input file */ -int +bool inrec(IOBUF *iop, int *errcode) { char *begin; int cnt; - int retval = 0; + bool retval = true; if (at_eof(iop) && no_data_left(iop)) cnt = EOF; @@ -566,13 +597,13 @@ cnt = get_a_record(& begin, iop, errcode); if (cnt == EOF) { - retval = 1; - if (*errcode > 0) - update_ERRNO_int(*errcode); + retval = false; } else { INCREMENT_REC(NR); INCREMENT_REC(FNR); set_record(begin, cnt); + if (*errcode > 0) + retval = false; } return retval; @@ -707,7 +738,9 @@ int fd; const char *what = NULL; bool new_rp = false; - int len; /* used with /inet */ +#ifdef HAVE_SOCKETS + struct inet_socket_info isi; +#endif static struct redirect *save_rp = NULL; /* hold onto rp that should * be freed for reuse */ @@ -766,9 +799,9 @@ * Use /inet4 to force IPv4, /inet6 to force IPv6, and plain * /inet will be whatever we get back from the system. */ - if (inetfile(str, & len, NULL)) { + if (inetfile(str, & isi)) { tflag |= RED_SOCKET; - if (strncmp(str + len, "tcp/", 4) == 0) + if (isi.protocol == SOCK_STREAM) tflag |= RED_TCP; /* use shutdown when closing */ } #endif /* HAVE_SOCKETS */ @@ -895,7 +928,7 @@ direction = "to/from"; if (! two_way_open(str, rp)) { #ifdef HAVE_SOCKETS - if (inetfile(str, NULL, NULL)) { + if (inetfile(str, NULL)) { *errflg = errno; /* do not free rp, saving it for reuse (save_rp = rp) */ return NULL; @@ -1518,31 +1551,40 @@ } #endif /* HAVE_SOCKETS */ -/* devopen --- handle /dev/std{in,out,err}, /dev/fd/N, regular files */ + +/* devopen_simple --- handle "-", /dev/std{in,out,err}, /dev/fd/N */ /* - * Strictly speaking, "name" is not a "const char *" because we temporarily - * change the string. + * 9/2014: Flow here is a little messy. + * + * For do_posix, we don't allow any of the special filenames. + * + * For do_traditional, we allow /dev/{stdin,stdout,stderr} since BWK awk + * (and mawk) support them. But we don't allow /dev/fd/N or /inet. + * + * Note that for POSIX systems os_devopen() is a no-op. */ int -devopen(const char *name, const char *mode) +devopen_simple(const char *name, const char *mode, bool try_real_open) { int openfd; char *cp; char *ptr; int flag = 0; - int len; - int family; - if (strcmp(name, "-") == 0) - return fileno(stdin); + if (strcmp(name, "-") == 0) { + if (mode[0] == 'r') + return fileno(stdin); + else + return fileno(stdout); + } flag = str2mode(mode); openfd = INVALID_HANDLE; - if (do_traditional) - goto strictopen; + if (do_posix) + goto done; if ((openfd = os_devopen(name, flag)) != INVALID_HANDLE) { os_close_on_exec(openfd, name, "file", ""); @@ -1558,6 +1600,8 @@ openfd = fileno(stdout); else if (strcmp(cp, "stderr") == 0 && (flag & O_ACCMODE) == O_WRONLY) openfd = fileno(stderr); + else if (do_traditional) + goto done; else if (strncmp(cp, "fd/", 3) == 0) { struct stat sbuf; @@ -1568,76 +1612,45 @@ openfd = INVALID_HANDLE; } /* do not set close-on-exec for inherited fd's */ - if (openfd != INVALID_HANDLE) - return openfd; - } else if (inetfile(name, & len, & family)) { -#ifdef HAVE_SOCKETS - /* /inet/protocol/localport/hostname/remoteport */ - int protocol; - char *hostname; - char *hostnameslastcharp; - char *localpname; - char *localpnamelastcharp; - - cp = (char *) name + len; - /* which protocol? */ - if (strncmp(cp, "tcp/", 4) == 0) - protocol = SOCK_STREAM; - else if (strncmp(cp, "udp/", 4) == 0) - protocol = SOCK_DGRAM; - else { - protocol = SOCK_STREAM; /* shut up the compiler */ - fatal(_("no (known) protocol supplied in special filename `%s'"), - name); - } - cp += 4; - - /* which localport? */ - localpname = cp; - while (*cp != '/' && *cp != '\0') - cp++; - /* - * Require a port, let them explicitly put 0 if - * they don't care. - */ - if (*cp != '/' || cp == localpname) - fatal(_("special file name `%s' is incomplete"), name); + } +done: + if (try_real_open) + openfd = open(name, flag, 0666); - /* - * We change the special file name temporarily because we - * need a 0-terminated string here for conversion with atoi(). - * By using atoi() the use of decimal numbers is enforced. - */ - *cp = '\0'; - localpnamelastcharp = cp; + return openfd; +} - /* which hostname? */ - cp++; - hostname = cp; - while (*cp != '/' && *cp != '\0') - cp++; - if (*cp != '/' || cp == hostname) { - *localpnamelastcharp = '/'; - fatal(_("must supply a remote hostname to `/inet'")); - } - *cp = '\0'; - hostnameslastcharp = cp; +/* devopen --- handle /dev/std{in,out,err}, /dev/fd/N, /inet, regular files */ - /* which remoteport? */ - cp++; - /* - * The remote port ends the special file name. - * This means there already is a '\0' at the end of the string. - * Therefore no need to patch any string ending. - * - * Here too, require a port, let them explicitly put 0 if - * they don't care. - */ - if (*cp == '\0') { - *localpnamelastcharp = '/'; - *hostnameslastcharp = '/'; - fatal(_("must supply a remote port to `/inet'")); - } +/* + * Strictly speaking, "name" is not a "const char *" because we temporarily + * change the string. + */ + +int +devopen(const char *name, const char *mode) +{ + int openfd; + char *cp; + int flag; + struct inet_socket_info isi; + + openfd = devopen_simple(name, mode, false); + if (openfd != INVALID_HANDLE) + return openfd; + + flag = str2mode(mode); + + if (do_traditional) { + goto strictopen; + } else if (inetfile(name, & isi)) { +#ifdef HAVE_SOCKETS + cp = (char *) name; + + /* socketopen requires NUL-terminated strings */ + cp[isi.localport.offset+isi.localport.len] = '\0'; + cp[isi.remotehost.offset+isi.remotehost.len] = '\0'; + /* remoteport comes last, so already NUL-terminated */ { #define DEFAULT_RETRIES 20 @@ -1674,13 +1687,14 @@ retries = def_retries; do { - openfd = socketopen(family, protocol, localpname, cp, hostname); + openfd = socketopen(isi.family, isi.protocol, name+isi.localport.offset, name+isi.remoteport.offset, name+isi.remotehost.offset); retries--; } while (openfd == INVALID_HANDLE && retries > 0 && usleep(msleep) == 0); } - *localpnamelastcharp = '/'; - *hostnameslastcharp = '/'; + /* restore original name string */ + cp[isi.localport.offset+isi.localport.len] = '/'; + cp[isi.remotehost.offset+isi.remotehost.len] = '/'; #else /* ! HAVE_SOCKETS */ fatal(_("TCP/IP communications are not supported")); #endif /* HAVE_SOCKETS */ @@ -1694,9 +1708,8 @@ /* On OS/2 and Windows directory access via open() is not permitted. */ struct stat buf; - int l, f; - if (!inetfile(name, &l, &f) + if (! inetfile(name, NULL) && stat(name, & buf) == 0 && S_ISDIR(buf.st_mode)) errno = EISDIR; } @@ -1718,7 +1731,7 @@ #ifdef HAVE_SOCKETS /* case 1: socket */ - if (inetfile(str, NULL, NULL)) { + if (inetfile(str, NULL)) { int fd, newfd; fd = devopen(str, "rw"); @@ -2115,6 +2128,7 @@ || close(ctop[0]) == -1 || close(ctop[1]) == -1) fatal(_("close of pipe failed (%s)"), strerror(errno)); /* stderr does NOT get dup'ed onto child's stdout */ + signal(SIGPIPE, SIG_DFL); execl("/bin/sh", "sh", "-c", str, NULL); _exit(errno == ENOENT ? 127 : 126); } @@ -2308,6 +2322,7 @@ fatal(_("moving pipe to stdout in child failed (dup: %s)"), strerror(errno)); if (close(p[0]) == -1 || close(p[1]) == -1) fatal(_("close of pipe failed (%s)"), strerror(errno)); + signal(SIGPIPE, SIG_DFL); execl("/bin/sh", "sh", "-c", cmd, NULL); _exit(errno == ENOENT ? 127 : 126); } @@ -2524,7 +2539,6 @@ typedef struct { const char *envname; char **dfltp; /* pointer to address of default path */ - char try_cwd; /* always search current directory? */ char **awkpath; /* array containing library search paths */ int max_pathlen; /* length of the longest item in awkpath */ } path_info; @@ -2532,13 +2546,11 @@ static path_info pi_awkpath = { /* envname */ "AWKPATH", /* dfltp */ & defpath, - /* try_cwd */ true, }; static path_info pi_awklibpath = { /* envname */ "AWKLIBPATH", /* dfltp */ & deflibpath, - /* try_cwd */ false, }; /* init_awkpath --- split path(=$AWKPATH) into components */ @@ -2596,30 +2608,6 @@ #undef INC_PATH } -/* get_cwd -- get current working directory */ - -static char * -get_cwd () -{ -#define BSIZE 100 - char *buf; - size_t bsize = BSIZE; - - emalloc(buf, char *, bsize * sizeof(char), "get_cwd"); - while (true) { - if (getcwd(buf, bsize) == buf) - return buf; - if (errno != ERANGE) { - efree(buf); - return NULL; - } - bsize *= 2; - erealloc(buf, char *, bsize * sizeof(char), "get_cwd"); - } -#undef BSIZE -} - - /* do_find_source --- search $AWKPATH for file, return NULL if not found */ static char * @@ -2641,24 +2629,6 @@ return NULL; } - /* try current directory before $AWKPATH search */ - if (pi->try_cwd && stat(src, stb) == 0) { - path = get_cwd(); - if (path == NULL) { - *errcode = errno; - return NULL; - } - erealloc(path, char *, strlen(path) + strlen(src) + 2, "do_find_source"); -#ifdef VMS - if (strcspn(path,">]:") == strlen(path)) - strcat(path, "/"); -#else - strcat(path, "/"); -#endif - strcat(path, src); - return path; - } - if (pi->awkpath == NULL) init_awkpath(pi); @@ -3129,10 +3099,8 @@ { char *bp; char rs; -#if MBS_SUPPORT size_t mbclen = 0; mbstate_t mbs; -#endif memset(recm, '\0', sizeof(struct recmatch)); rs = RS->stptr[0]; @@ -3143,7 +3111,6 @@ if (*state == INDATA) /* skip over data we've already seen */ bp += iop->scanoff; -#if MBS_SUPPORT /* * From: Bruno Haible * To: Aharon Robbins , gnits@gnits.org @@ -3240,7 +3207,7 @@ return NOTERM; } } -#endif + while (*bp != rs) bp++; @@ -3507,9 +3474,18 @@ ret = (*matchrec)(iop, & recm, & state); iop->flag &= ~IOP_AT_START; + /* found the record, we're done, break the loop */ if (ret == REC_OK) break; + /* + * Likely found the record; if there's no more data + * to be had (like from a tiny regular file), break the + * loop. Otherwise, see if we can read more. + */ + if (ret == TERMNEAREND && buffer_has_all_data(iop)) + break; + /* need to add more data to buffer */ /* shift data down in buffer */ dataend_off = iop->dataend - iop->off; @@ -3559,10 +3535,14 @@ break; } else if (iop->count == 0) { /* - * hit EOF before matching RS, so end - * the record and set RT to "" + * Hit EOF before being certain that we've matched + * the end of the record. If ret is TERMNEAREND, + * we need to pull out what we've got in the buffer. + * Eventually we'll come back here and see the EOF, + * end the record and set RT to "". */ - iop->flag |= IOP_AT_EOF; + if (ret != TERMNEAREND) + iop->flag |= IOP_AT_EOF; break; } else iop->dataend += iop->count; @@ -3744,35 +3724,92 @@ /* inetfile --- return true for a /inet special file, set other values */ -static int -inetfile(const char *str, int *length, int *family) +static bool +inetfile(const char *str, struct inet_socket_info *isi) { - bool ret = false; +#ifndef HAVE_SOCKETS + return false; +#else + const char *cp = str; + struct inet_socket_info buf; + + /* syntax: /inet/protocol/localport/hostname/remoteport */ + if (strncmp(cp, "/inet", 5) != 0) + /* quick exit */ + return false; + if (! isi) + isi = & buf; + cp += 5; + switch (*cp) { + case '/': + isi->family = AF_UNSPEC; + break; + case '4': + if (*++cp != '/') + return false; + isi->family = AF_INET; + break; + case '6': + if (*++cp != '/') + return false; + isi->family = AF_INET6; + break; + default: + return false; + } + cp++; /* skip past '/' */ + + /* which protocol? */ + if (strncmp(cp, "tcp/", 4) == 0) + isi->protocol = SOCK_STREAM; + else if (strncmp(cp, "udp/", 4) == 0) + isi->protocol = SOCK_DGRAM; + else + return false; + cp += 4; + + /* which localport? */ + isi->localport.offset = cp-str; + while (*cp != '/' && *cp != '\0') + cp++; + /* + * Require a port, let them explicitly put 0 if + * they don't care. + */ + if (*cp != '/' || ((isi->localport.len = (cp-str)-isi->localport.offset) == 0)) + return false; + + /* which hostname? */ + cp++; + isi->remotehost.offset = cp-str; + while (*cp != '/' && *cp != '\0') + cp++; + if (*cp != '/' || ((isi->remotehost.len = (cp-str)-isi->remotehost.offset) == 0)) + return false; + + /* which remoteport? */ + cp++; + /* + * The remote port ends the special file name. + * This means there already is a '\0' at the end of the string. + * Therefore no need to patch any string ending. + * + * Here too, require a port, let them explicitly put 0 if + * they don't care. + */ + isi->remoteport.offset = cp-str; + while (*cp != '/' && *cp != '\0') + cp++; + if (*cp != '\0' || ((isi->remoteport.len = (cp-str)-isi->remoteport.offset) == 0)) + return false; - if (strncmp(str, "/inet/", 6) == 0) { - ret = true; - if (length != NULL) - *length = 6; - if (family != NULL) - *family = AF_UNSPEC; - } else if (strncmp(str, "/inet4/", 7) == 0) { - ret = true; - if (length != NULL) - *length = 7; - if (family != NULL) - *family = AF_INET; - } else if (strncmp(str, "/inet6/", 7) == 0) { - ret = true; - if (length != NULL) - *length = 7; - if (family != NULL) - *family = AF_INET6; #ifndef HAVE_GETADDRINFO + /* final check for IPv6: */ + if (isi->family == AF_INET6) fatal(_("IPv6 communication is not supported")); #endif - } - - return ret; + return true; +#endif /* HAVE_SOCKETS */ } /* diff -urN gawk-4.1.1/m4/ChangeLog gawk-4.1.2/m4/ChangeLog --- gawk-4.1.1/m4/ChangeLog 2014-04-08 20:34:46.000000000 +0300 +++ gawk-4.1.2/m4/ChangeLog 2015-04-29 08:54:16.000000000 +0300 @@ -1,3 +1,29 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + +2015-01-24 gettextize + + * iconv.m4: Upgrade to gettext-0.19.4. + * po.m4: Upgrade to gettext-0.19.4. + +2014-11-19 gettextize + + * gettext.m4: Upgrade to gettext-0.19.3. + * iconv.m4: Upgrade to gettext-0.19.3. + * lib-ld.m4: Upgrade to gettext-0.19.3. + * lib-link.m4: Upgrade to gettext-0.19.3. + * lib-prefix.m4: Upgrade to gettext-0.19.3. + * nls.m4: Upgrade to gettext-0.19.3. + * po.m4: Upgrade to gettext-0.19.3. + * progtest.m4: Upgrade to gettext-0.19.3. + +2014-10-30 Arnold D. Robbins + + * readline.m4: Enable cross compiling. Thanks to + Christer Solskogen for + motivating and testing. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff -urN gawk-4.1.1/m4/gettext.m4 gawk-4.1.2/m4/gettext.m4 --- gawk-4.1.1/m4/gettext.m4 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/m4/gettext.m4 2015-04-27 18:01:59.000000000 +0300 @@ -1,5 +1,5 @@ -# gettext.m4 serial 63 (gettext-0.18) -dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. +# gettext.m4 serial 66 (gettext-0.18.2) +dnl Copyright (C) 1995-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -35,7 +35,7 @@ dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, -dnl the value `$(top_builddir)/intl/' is used. +dnl the value '$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled @@ -97,7 +97,7 @@ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) - dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. + dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. @@ -157,12 +157,18 @@ fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], - [AC_TRY_LINK([#include + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include $gt_revision_test_code extern int _nl_msg_cat_cntr; -extern int *_nl_domain_bindings;], - [bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], +extern int *_nl_domain_bindings; + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) @@ -183,35 +189,47 @@ gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. - AC_TRY_LINK([#include + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif -const char *_nl_expand_alias (const char *);], - [bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], +const char *_nl_expand_alias (const char *); + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" - AC_TRY_LINK([#include + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif -const char *_nl_expand_alias (const char *);], - [bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], - [LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" - eval "$gt_func_gnugettext_libintl=yes" - ]) +const char *_nl_expand_alias (const char *); + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ]])], + [LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) diff -urN gawk-4.1.1/m4/iconv.m4 gawk-4.1.2/m4/iconv.m4 --- gawk-4.1.1/m4/iconv.m4 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/m4/iconv.m4 2015-04-27 18:09:07.000000000 +0300 @@ -1,5 +1,5 @@ -# iconv.m4 serial 11 (gettext-0.18.1) -dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. +# iconv.m4 serial 19 (gettext-0.18.2) +dnl Copyright (C) 2000-2002, 2007-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -30,27 +30,35 @@ dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first - dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" @@ -58,33 +66,43 @@ ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ - dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. + dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, + dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi - AC_TRY_RUN([ + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[ #include #include -int main () -{ + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + ]], + [[int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\342\202\254"; /* EURO SIGN */ + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 1; + iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from @@ -93,17 +111,37 @@ iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\263"; + static ICONV_CONST char input[] = "\263"; char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ @@ -112,17 +150,18 @@ iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { - static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) - return 1; + result |= 8; + iconv_close (cd_88591_to_utf8); } } #endif @@ -136,13 +175,16 @@ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - return 1; - return 0; -}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], - [case "$host_os" in - aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; - *) am_cv_func_iconv_works="guessing yes" ;; - esac]) + result |= 16; + return result; +]])], + [am_cv_func_iconv_works=yes], , + [case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac]) + test "$am_cv_func_iconv_works" = no || break + done LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in @@ -183,32 +225,47 @@ m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], - [[AC_DEFUN( - [$1], [$2])]])) + [m4_ifdef([gl_00GNULIB], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [[AC_DEFUN( + [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ #include #include extern #ifdef __cplusplus "C" #endif -#if defined(__STDC__) || defined(__cplusplus) +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif -], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) + ]], + [[]])], + [am_cv_proto_iconv_arg1=""], + [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) + dnl Also substitute ICONV_CONST in the gnulib generated . + m4_ifdef([gl_ICONV_H_DEFAULTS], + [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + ]) fi ]) diff -urN gawk-4.1.1/m4/lib-ld.m4 gawk-4.1.2/m4/lib-ld.m4 --- gawk-4.1.1/m4/lib-ld.m4 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/m4/lib-ld.m4 2015-04-27 18:01:59.000000000 +0300 @@ -1,50 +1,56 @@ -# lib-ld.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. +# lib-ld.m4 serial 6 +dnl Copyright (C) 1996-2003, 2009-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. +dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid +dnl collision with libtool.m4. -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +[# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi + ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) + AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -54,11 +60,11 @@ esac case $ac_prog in # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` + while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" @@ -79,23 +85,26 @@ fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do + IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. + # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + case `"$acl_cv_path_LD" -v 2>&1 = 2.61 supports dots in --with options. - pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)]) + pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ @@ -242,7 +245,7 @@ names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then diff -urN gawk-4.1.1/m4/lib-prefix.m4 gawk-4.1.2/m4/lib-prefix.m4 --- gawk-4.1.1/m4/lib-prefix.m4 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/m4/lib-prefix.m4 2015-04-27 18:01:59.000000000 +0300 @@ -1,5 +1,5 @@ # lib-prefix.m4 serial 7 (gettext-0.18) -dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2005, 2008-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -urN gawk-4.1.1/m4/nls.m4 gawk-4.1.2/m4/nls.m4 --- gawk-4.1.1/m4/nls.m4 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/m4/nls.m4 2015-04-27 18:01:59.000000000 +0300 @@ -1,5 +1,5 @@ # nls.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff -urN gawk-4.1.1/m4/po.m4 gawk-4.1.2/m4/po.m4 --- gawk-4.1.1/m4/po.m4 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/m4/po.m4 2015-04-27 18:09:07.000000000 +0300 @@ -1,5 +1,5 @@ -# po.m4 serial 17 (gettext-0.18) -dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. +# po.m4 serial 24 (gettext-0.19) +dnl Copyright (C) 1995-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -17,7 +17,7 @@ dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. -AC_PREREQ([2.50]) +AC_PREREQ([2.60]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], @@ -25,11 +25,12 @@ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl + AC_REQUIRE([AC_PROG_SED])dnl AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. - AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) + AC_SUBST([GETTEXT_MACRO_VERSION], [0.19]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. @@ -102,7 +103,7 @@ case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. @@ -118,7 +119,8 @@ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration @@ -129,12 +131,12 @@ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assigment from automake < 1.5. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assigment from automake < 1.5. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES @@ -226,7 +228,7 @@ changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. @@ -254,6 +256,7 @@ fi # A sed script that extracts the value of VARIABLE from a Makefile. + tab=`printf '\t'` sed_x_variable=' # Test if the hold space is empty. x @@ -261,9 +264,9 @@ x ta # Yes it was empty. Look if we have the expected variable definition. -/^[ ]*VARIABLE[ ]*=/{ +/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{ # Seen the first line of the variable definition. - s/^[ ]*VARIABLE[ ]*=// + s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=// ba } bd @@ -315,7 +318,7 @@ sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'` ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` fi - # Hide the ALL_LINGUAS assigment from automake < 1.5. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) @@ -405,14 +408,15 @@ fi sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp" + tab=`printf '\t'` if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi # Find out how to test for executable files. Don't use a zero-byte file, diff -urN gawk-4.1.1/m4/readline.m4 gawk-4.1.2/m4/readline.m4 --- gawk-4.1.1/m4/readline.m4 2014-03-31 22:17:46.000000000 +0300 +++ gawk-4.1.2/m4/readline.m4 2015-04-05 13:19:19.000000000 +0300 @@ -62,7 +62,28 @@ dnl action if false: [_found_readline=no], dnl action if cross compiling: - [_found_readline=no] + AC_TRY_LINK([#include +#include +#include ], dnl includes + dnl function body + [ + int fd; + char *line; + + close(0); + close(1); + fd = open("/dev/null", 2); /* should get fd 0 */ + dup(fd); + line = readline("giveittome> "); + + /* some printfs don't handle NULL for %s */ + printf("got <%s>\n", line ? line : "(NULL)"); +], +dnl action if found: + [_found_readline=yes], +dnl action if not found: + [_found_readline=no] + ) ) AC_MSG_RESULT([$_found_readline]) diff -urN gawk-4.1.1/main.c gawk-4.1.2/main.c --- gawk-4.1.1/main.c 2014-04-03 21:55:27.000000000 +0300 +++ gawk-4.1.2/main.c 2015-04-28 16:49:46.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2014 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -24,7 +24,7 @@ */ /* FIX THIS BEFORE EVERY RELEASE: */ -#define UPDATE_YEAR 2014 +#define UPDATE_YEAR 2015 #include "awk.h" #include "getopt.h" @@ -33,6 +33,16 @@ #include #endif +#ifdef HAVE_LIBSIGSEGV +#include +#else +typedef void *stackoverflow_context_t; +/* the argument to this macro is purposely not used */ +#define sigsegv_install_handler(catchsegv) signal(SIGSEGV, catchsig) +/* define as 0 rather than empty so that (void) cast on it works */ +#define stackoverflow_install_handler(catchstackoverflow, extra_stack, STACK_SIZE) 0 +#endif + #define DEFAULT_PROFILE "awkprof.out" /* where to put profile */ #define DEFAULT_VARFILE "awkvars.out" /* where to put vars */ #define DEFAULT_PREC 53 @@ -132,17 +142,20 @@ static void add_preassign(enum assign_type type, char *val); +static void parse_args(int argc, char **argv); +static void set_locale_stuff(void); +static bool stopped_early = false; + int do_flags = false; bool do_optimize = false; /* apply default optimizations */ static int do_nostalgia = false; /* provide a blast from the past */ static int do_binary = false; /* hands off my data! */ static int do_version = false; /* print version info */ +static const char *locale = ""; /* default value to setlocale */ int use_lc_numeric = false; /* obey locale for decimal point */ -#if MBS_SUPPORT int gawk_mb_cur_max; /* MB_CUR_MAX value, see comment in main() */ -#endif FILE *output_fp; /* default gawk output, can be redirected in the debugger */ bool output_is_tty = false; /* control flushing of output */ @@ -176,6 +189,9 @@ { "lint", optional_argument, NULL, 'L' }, { "lint-old", no_argument, NULL, 't' }, { "load", required_argument, NULL, 'l' }, +#if defined(LOCALEDEBUG) + { "locale", required_argument, NULL, 'Z' }, +#endif { "non-decimal-data", no_argument, NULL, 'n' }, { "nostalgia", no_argument, & do_nostalgia, 1 }, { "optimize", no_argument, NULL, 'O' }, @@ -199,15 +215,7 @@ int main(int argc, char **argv) { - /* - * The + on the front tells GNU getopt not to rearrange argv. - */ - const char *optlist = "+F:f:v:W;bcCd::D::e:E:gh:i:l:L:nNo::Op::MPrStVY"; - bool stopped_early = false; - int old_optind; int i; - int c; - char *scan, *src; char *extra_stack; int have_srcfile = 0; SRCFILE *s; @@ -223,60 +231,11 @@ #endif /* HAVE_MTRACE */ #endif /* HAVE_MCHECK_H */ -#if defined(LC_CTYPE) - setlocale(LC_CTYPE, ""); -#endif -#if defined(LC_COLLATE) - setlocale(LC_COLLATE, ""); -#endif -#if defined(LC_MESSAGES) - setlocale(LC_MESSAGES, ""); -#endif -#if defined(LC_NUMERIC) && defined(HAVE_LOCALE_H) - /* - * Force the issue here. According to POSIX 2001, decimal - * point is used for parsing source code and for command-line - * assignments and the locale value for processing input, - * number to string conversion, and printing output. - * - * 10/2005 --- see below also; we now only use the locale's - * decimal point if do_posix in effect. - * - * 9/2007: - * This is a mess. We need to get the locale's numeric info for - * the thousands separator for the %'d flag. - */ - setlocale(LC_NUMERIC, ""); - init_locale(& loc); - setlocale(LC_NUMERIC, "C"); -#endif -#if defined(LC_TIME) - setlocale(LC_TIME, ""); -#endif - -#if MBS_SUPPORT - /* - * In glibc, MB_CUR_MAX is actually a function. This value is - * tested *a lot* in many speed-critical places in gawk. Caching - * this value once makes a speed difference. - */ - gawk_mb_cur_max = MB_CUR_MAX; - /* Without MBS_SUPPORT, gawk_mb_cur_max is 1. */ -#ifdef LIBC_IS_BORKED -{ - const char *env_lc; - - env_lc = getenv("LC_ALL"); - if (env_lc == NULL) - env_lc = getenv("LANG"); - if (env_lc != NULL && env_lc[1] == '\0' && tolower(env_lc[0]) == 'c') - gawk_mb_cur_max = 1; -} -#endif + myname = gawk_name(argv[0]); + os_arg_fixup(&argc, &argv); /* emulate redirection, expand wildcards */ - /* init the cache for checking bytes if they're characters */ - init_btowc_cache(); -#endif + if (argc < 2) + usage(EXIT_FAILURE, stderr); (void) bindtextdomain(PACKAGE, LOCALEDIR); (void) textdomain(PACKAGE); @@ -308,12 +267,6 @@ (void) stackoverflow_install_handler(catchstackoverflow, extra_stack, STACK_SIZE); #undef STACK_SIZE - myname = gawk_name(argv[0]); - os_arg_fixup(&argc, &argv); /* emulate redirection, expand wildcards */ - - if (argc < 2) - usage(EXIT_FAILURE, stderr); - /* initialize the null string */ Nnull_string = make_string("", 0); @@ -328,307 +281,111 @@ output_fp = stdout; - /* we do error messages ourselves on invalid options */ - opterr = false; - - /* copy argv before getopt gets to it; used to restart the debugger */ - save_argv(argc, argv); - /* initialize global (main) execution context */ push_context(new_context()); - /* option processing. ready, set, go! */ - for (optopt = 0, old_optind = 1; - (c = getopt_long(argc, argv, optlist, optab, NULL)) != EOF; - optopt = 0, old_optind = optind) { - if (do_posix) - opterr = true; - - switch (c) { - case 'F': - add_preassign(PRE_ASSIGN_FS, optarg); - break; + parse_args(argc, argv); - case 'E': - disallow_var_assigns = true; - /* fall through */ - case 'f': - /* - * Allow multiple -f options. - * This makes function libraries real easy. - * Most of the magic is in the scanner. - * - * The following is to allow for whitespace at the end - * of a #! /bin/gawk line in an executable file - */ - scan = optarg; - if (argv[optind-1] != optarg) - while (isspace((unsigned char) *scan)) - scan++; - src = (*scan == '\0' ? argv[optind++] : optarg); - (void) add_srcfile((src && src[0] == '-' && src[1] == '\0') ? - SRC_STDIN : SRC_FILE, - src, srcfiles, NULL, NULL); + set_locale_stuff(); - break; + /* + * In glibc, MB_CUR_MAX is actually a function. This value is + * tested *a lot* in many speed-critical places in gawk. Caching + * this value once makes a speed difference. + */ + gawk_mb_cur_max = MB_CUR_MAX; +#ifdef LIBC_IS_BORKED +{ + const char *env_lc; - case 'v': - add_preassign(PRE_ASSIGN, optarg); - break; + env_lc = getenv("LC_ALL"); + if (env_lc == NULL) + env_lc = getenv("LANG"); + if (env_lc != NULL && env_lc[1] == '\0' && tolower(env_lc[0]) == 'c') + gawk_mb_cur_max = 1; +} +#endif - case 'b': - do_binary = true; - break; + /* init the cache for checking bytes if they're characters */ + init_btowc_cache(); - case 'c': - do_flags |= DO_TRADITIONAL; - break; - case 'C': - copyleft(); - break; + if (do_nostalgia) + nostalgia(); - case 'd': - do_flags |= DO_DUMP_VARS; - if (optarg != NULL && optarg[0] != '\0') - varfile = optarg; - break; + /* check for POSIXLY_CORRECT environment variable */ + if (! do_posix && getenv("POSIXLY_CORRECT") != NULL) { + do_flags |= DO_POSIX; + if (do_lint) + lintwarn( + _("environment variable `POSIXLY_CORRECT' set: turning on `--posix'")); + } - case 'D': - do_flags |= DO_DEBUG; - if (optarg != NULL && optarg[0] != '\0') - command_file = optarg; - break; + if (do_posix) { + use_lc_numeric = true; + if (do_traditional) /* both on command line */ + warning(_("`--posix' overrides `--traditional'")); + else + do_flags |= DO_TRADITIONAL; + /* + * POSIX compliance also implies + * no GNU extensions either. + */ + } - case 'e': - if (optarg[0] == '\0') - warning(_("empty argument to `-e/--source' ignored")); - else - (void) add_srcfile(SRC_CMDLINE, optarg, srcfiles, NULL, NULL); - break; + if (do_traditional && do_non_decimal_data) { + do_flags &= ~DO_NON_DEC_DATA; + warning(_("`--posix'/`--traditional' overrides `--non-decimal-data'")); + } - case 'g': - do_flags |= DO_INTL; - break; + if (do_lint && os_is_setuid()) + warning(_("running %s setuid root may be a security problem"), myname); - case 'h': - /* write usage to stdout, per GNU coding stds */ - usage(EXIT_SUCCESS, stdout); - break; + if (do_binary) { + if (do_posix) + warning(_("`--posix' overrides `--characters-as-bytes'")); + else + gawk_mb_cur_max = 1; /* hands off my data! */ +#if defined(LC_ALL) + setlocale(LC_ALL, "C"); +#endif + } - case 'i': - (void) add_srcfile(SRC_INC, optarg, srcfiles, NULL, NULL); - break; + if (do_debug) /* Need to register the debugger pre-exec hook before any other */ + init_debug(); - case 'l': - (void) add_srcfile(SRC_EXTLIB, optarg, srcfiles, NULL, NULL); - break; +#ifdef HAVE_MPFR + /* Set up MPFR defaults, and register pre-exec hook to process arithmetic opcodes */ + if (do_mpfr) + init_mpfr(DEFAULT_PREC, DEFAULT_ROUNDMODE); +#endif -#ifndef NO_LINT - case 'L': - do_flags |= DO_LINT_ALL; - if (optarg != NULL) { - if (strcmp(optarg, "fatal") == 0) - lintfunc = r_fatal; - else if (strcmp(optarg, "invalid") == 0) { - do_flags &= ~DO_LINT_ALL; - do_flags |= DO_LINT_INVALID; - } - } - break; + /* load group set */ + init_groupset(); - case 't': - do_flags |= DO_LINT_OLD; - break; -#else - case 'L': - case 't': - break; +#ifdef HAVE_MPFR + if (do_mpfr) { + mpz_init(Nnull_string->mpg_i); + Nnull_string->flags = (MALLOC|STRCUR|STRING|MPZN|NUMCUR|NUMBER); + } else #endif + { + Nnull_string->numbr = 0.0; + Nnull_string->flags = (MALLOC|STRCUR|STRING|NUMCUR|NUMBER); + } - case 'n': - do_flags |= DO_NON_DEC_DATA; - break; + /* + * Tell the regex routines how they should work. + * Do this before initializing variables, since + * they could want to do a regexp compile. + */ + resetup(); - case 'N': - use_lc_numeric = true; - break; + /* Set up the special variables */ + init_vars(); - case 'O': - do_optimize = true; - break; - - case 'p': - do_flags |= DO_PROFILE; - /* fall through */ - case 'o': - do_flags |= DO_PRETTY_PRINT; - if (optarg != NULL) - set_prof_file(optarg); - else - set_prof_file(DEFAULT_PROFILE); - break; - - case 'M': -#ifdef HAVE_MPFR - do_flags |= DO_MPFR; -#endif - break; - - case 'P': - do_flags |= DO_POSIX; - break; - - case 'r': - do_flags |= DO_INTERVALS; - break; - - case 'S': - do_flags |= DO_SANDBOX; - break; - - case 'V': - do_version = true; - break; - - case 'W': /* gawk specific options - now in getopt_long */ - fprintf(stderr, _("%s: option `-W %s' unrecognized, ignored\n"), - argv[0], optarg); - break; - - case 0: - /* - * getopt_long found an option that sets a variable - * instead of returning a letter. Do nothing, just - * cycle around for the next one. - */ - break; - - case 'Y': -#if defined(YYDEBUG) || defined(GAWKDEBUG) - if (c == 'Y') { - yydebug = 2; - break; - } -#endif - /* if not debugging, fall through */ - case '?': - default: - /* - * If not posix, an unrecognized option stops argument - * processing so that it can go into ARGV for the awk - * program to see. This makes use of ``#! /bin/gawk -f'' - * easier. - * - * However, it's never simple. If optopt is set, - * an option that requires an argument didn't get the - * argument. We care because if opterr is 0, then - * getopt_long won't print the error message for us. - */ - if (! do_posix - && (optopt == '\0' || strchr(optlist, optopt) == NULL)) { - /* - * can't just do optind--. In case of an - * option with >= 2 letters, getopt_long - * won't have incremented optind. - */ - optind = old_optind; - stopped_early = true; - goto out; - } else if (optopt != '\0') { - /* Use POSIX required message format */ - fprintf(stderr, - _("%s: option requires an argument -- %c\n"), - myname, optopt); - usage(EXIT_FAILURE, stderr); - } - /* else - let getopt print error message for us */ - break; - } - if (c == 'E') /* --exec ends option processing */ - break; - } -out: - - if (do_nostalgia) - nostalgia(); - - /* check for POSIXLY_CORRECT environment variable */ - if (! do_posix && getenv("POSIXLY_CORRECT") != NULL) { - do_flags |= DO_POSIX; - if (do_lint) - lintwarn( - _("environment variable `POSIXLY_CORRECT' set: turning on `--posix'")); - } - - if (do_posix) { - use_lc_numeric = true; - if (do_traditional) /* both on command line */ - warning(_("`--posix' overrides `--traditional'")); - else - do_flags |= DO_TRADITIONAL; - /* - * POSIX compliance also implies - * no GNU extensions either. - */ - } - - if (do_traditional && do_non_decimal_data) { - do_flags &= ~DO_NON_DEC_DATA; - warning(_("`--posix'/`--traditional' overrides `--non-decimal-data'")); - } - - if (do_lint && os_is_setuid()) - warning(_("running %s setuid root may be a security problem"), myname); - -#if MBS_SUPPORT - if (do_binary) { - if (do_posix) - warning(_("`--posix' overrides `--characters-as-bytes'")); - else - gawk_mb_cur_max = 1; /* hands off my data! */ -#if defined(LC_ALL) - setlocale(LC_ALL, "C"); -#endif - } -#endif - - if (do_debug) /* Need to register the debugger pre-exec hook before any other */ - init_debug(); - -#ifdef HAVE_MPFR - /* Set up MPFR defaults, and register pre-exec hook to process arithmetic opcodes */ - if (do_mpfr) - init_mpfr(DEFAULT_PREC, DEFAULT_ROUNDMODE); -#endif - - /* load group set */ - init_groupset(); - -#ifdef HAVE_MPFR - if (do_mpfr) { - mpz_init(Nnull_string->mpg_i); - Nnull_string->flags = (MALLOC|STRCUR|STRING|MPZN|NUMCUR|NUMBER); - } else -#endif - { - Nnull_string->numbr = 0.0; - Nnull_string->flags = (MALLOC|STRCUR|STRING|NUMCUR|NUMBER); - } - - /* - * Tell the regex routines how they should work. - * Do this before initializing variables, since - * they could want to do a regexp compile. - */ - resetup(); - - /* Set up the special variables */ - init_vars(); - - /* Set up the field variables */ - init_fields(); + /* Set up the field variables */ + init_fields(); /* Now process the pre-assignments */ for (i = 0; i <= numassigns; i++) { @@ -703,6 +460,8 @@ if (do_intl) exit(EXIT_SUCCESS); + install_builtins(); + if (do_lint) shadow_funcs(); @@ -731,9 +490,9 @@ * data using the local decimal point. */ if (use_lc_numeric) - setlocale(LC_NUMERIC, ""); + setlocale(LC_NUMERIC, locale); #endif - + init_io(); output_fp = stdout; @@ -753,6 +512,11 @@ if (do_dump_vars) dump_vars(varfile); +#ifdef HAVE_MPFR + if (do_mpfr) + cleanup_mpfr(); +#endif + if (do_tidy_mem) release_all_vars(); @@ -819,10 +583,14 @@ fputs(_("\t-h\t\t\t--help\n"), fp); fputs(_("\t-i includefile\t\t--include=includefile\n"), fp); fputs(_("\t-l library\t\t--load=library\n"), fp); - fputs(_("\t-L [fatal]\t\t--lint[=fatal]\n"), fp); - fputs(_("\t-n\t\t\t--non-decimal-data\n"), fp); + /* + * TRANSLATORS: the "fatal" and "invalid" here are literal + * values, they should not be translated. Thanks. + */ + fputs(_("\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n"), fp); fputs(_("\t-M\t\t\t--bignum\n"), fp); fputs(_("\t-N\t\t\t--use-lc-numeric\n"), fp); + fputs(_("\t-n\t\t\t--non-decimal-data\n"), fp); fputs(_("\t-o[file]\t\t--pretty-print[=file]\n"), fp); fputs(_("\t-O\t\t\t--optimize\n"), fp); fputs(_("\t-p[file]\t\t--profile[=file]\n"), fp); @@ -1043,10 +811,10 @@ (*(vp->assign))(); } - /* Set up deferred variables (loaded only when accessed). */ + /* Load PROCINFO and ENVIRON */ if (! do_traditional) - register_deferred_variable("PROCINFO", load_procinfo); - register_deferred_variable("ENVIRON", load_environ); + load_procinfo(); + load_environ(); } /* path_environ --- put path variable into environment if not already there */ @@ -1059,18 +827,23 @@ NODE *tmp; tmp = make_string(pname, strlen(pname)); - if (! in_array(ENVIRON_node, tmp)) { - /* - * On VMS, environ[] only holds a subset of what getenv() can - * find, so look AWKPATH up before resorting to default path. - */ - val = getenv(pname); - if (val == NULL) - val = dflt; - aptr = assoc_lookup(ENVIRON_node, tmp); + /* + * On VMS, environ[] only holds a subset of what getenv() can + * find, so look AWKPATH up before resorting to default path. + */ + val = getenv(pname); + if (val == NULL || *val == '\0') + val = dflt; + aptr = assoc_lookup(ENVIRON_node, tmp); + /* + * If original value was the empty string, set it to + * the default value. + */ + if ((*aptr)->stlen == 0) { unref(*aptr); *aptr = make_string(val, strlen(val)); } + unref(tmp); } @@ -1117,6 +890,11 @@ /* * Put AWKPATH and AWKLIBPATH into ENVIRON if not already there. * This allows querying it from within awk programs. + * + * October 2014: + * If their values are "", override with the default values; + * since 2.10 AWKPATH used default value if environment's + * value was "". */ path_environ("AWKPATH", defpath); path_environ("AWKLIBPATH", deflibpath); @@ -1318,11 +1096,11 @@ /* first check that the variable name has valid syntax */ badvar = false; - if (! isalpha((unsigned char) arg[0]) && arg[0] != '_') + if (! is_alpha((unsigned char) arg[0]) && arg[0] != '_') badvar = true; else for (cp2 = arg+1; *cp2; cp2++) - if (! isalnum((unsigned char) *cp2) && *cp2 != '_') { + if (! is_identchar((unsigned char) *cp2)) { badvar = true; break; } @@ -1358,7 +1136,7 @@ setlocale(LC_NUMERIC, "C"); (void) force_number(it); if (do_posix) - setlocale(LC_NUMERIC, ""); + setlocale(LC_NUMERIC, locale); #endif /* LC_NUMERIC */ /* @@ -1622,3 +1400,285 @@ } return -1; } + +/* parse_args --- do the getopt_long thing */ + +static void +parse_args(int argc, char **argv) +{ + /* + * The + on the front tells GNU getopt not to rearrange argv. + */ + const char *optlist = "+F:f:v:W;bcCd::D::e:E:ghi:l:L:nNo::Op::MPrStVYZ:"; + int old_optind; + int c; + char *scan; + char *src; + + /* we do error messages ourselves on invalid options */ + opterr = false; + + /* copy argv before getopt gets to it; used to restart the debugger */ + save_argv(argc, argv); + + /* option processing. ready, set, go! */ + for (optopt = 0, old_optind = 1; + (c = getopt_long(argc, argv, optlist, optab, NULL)) != EOF; + optopt = 0, old_optind = optind) { + if (do_posix) + opterr = true; + + switch (c) { + case 'F': + add_preassign(PRE_ASSIGN_FS, optarg); + break; + + case 'E': + disallow_var_assigns = true; + /* fall through */ + case 'f': + /* + * Allow multiple -f options. + * This makes function libraries real easy. + * Most of the magic is in the scanner. + * + * The following is to allow for whitespace at the end + * of a #! /bin/gawk line in an executable file + */ + scan = optarg; + if (argv[optind-1] != optarg) + while (isspace((unsigned char) *scan)) + scan++; + src = (*scan == '\0' ? argv[optind++] : optarg); + (void) add_srcfile((src && src[0] == '-' && src[1] == '\0') ? + SRC_STDIN : SRC_FILE, + src, srcfiles, NULL, NULL); + + break; + + case 'v': + add_preassign(PRE_ASSIGN, optarg); + break; + + case 'b': + do_binary = true; + break; + + case 'c': + do_flags |= DO_TRADITIONAL; + break; + + case 'C': + copyleft(); + break; + + case 'd': + do_flags |= DO_DUMP_VARS; + if (optarg != NULL && optarg[0] != '\0') + varfile = optarg; + break; + + case 'D': + do_flags |= DO_DEBUG; + if (optarg != NULL && optarg[0] != '\0') + command_file = optarg; + break; + + case 'e': + if (optarg[0] == '\0') + warning(_("empty argument to `-e/--source' ignored")); + else + (void) add_srcfile(SRC_CMDLINE, optarg, srcfiles, NULL, NULL); + break; + + case 'g': + do_flags |= DO_INTL; + break; + + case 'h': + /* write usage to stdout, per GNU coding stds */ + usage(EXIT_SUCCESS, stdout); + break; + + case 'i': + (void) add_srcfile(SRC_INC, optarg, srcfiles, NULL, NULL); + break; + + case 'l': + (void) add_srcfile(SRC_EXTLIB, optarg, srcfiles, NULL, NULL); + break; + +#ifndef NO_LINT + case 'L': + do_flags |= DO_LINT_ALL; + if (optarg != NULL) { + if (strcmp(optarg, "fatal") == 0) + lintfunc = r_fatal; + else if (strcmp(optarg, "invalid") == 0) { + do_flags &= ~DO_LINT_ALL; + do_flags |= DO_LINT_INVALID; + } + } + break; + + case 't': + do_flags |= DO_LINT_OLD; + break; +#else + case 'L': + case 't': + break; +#endif + + case 'n': + do_flags |= DO_NON_DEC_DATA; + break; + + case 'N': + use_lc_numeric = true; + break; + + case 'O': + do_optimize = true; + break; + + case 'p': + do_flags |= DO_PROFILE; + /* fall through */ + case 'o': + do_flags |= DO_PRETTY_PRINT; + if (optarg != NULL) + set_prof_file(optarg); + else + set_prof_file(DEFAULT_PROFILE); + break; + + case 'M': +#ifdef HAVE_MPFR + do_flags |= DO_MPFR; +#else + warning(_("-M ignored: MPFR/GMP support not compiled in")); +#endif + break; + + case 'P': + do_flags |= DO_POSIX; + break; + + case 'r': + do_flags |= DO_INTERVALS; + break; + + case 'S': + do_flags |= DO_SANDBOX; + break; + + case 'V': + do_version = true; + break; + + case 'W': /* gawk specific options - now in getopt_long */ + fprintf(stderr, _("%s: option `-W %s' unrecognized, ignored\n"), + argv[0], optarg); + break; + + case 0: + /* + * getopt_long found an option that sets a variable + * instead of returning a letter. Do nothing, just + * cycle around for the next one. + */ + break; + + case 'Y': + case 'Z': +#if defined(YYDEBUG) || defined(GAWKDEBUG) + if (c == 'Y') { + yydebug = 2; + break; + } +#endif +#if defined(LOCALEDEBUG) + if (c == 'Z') { + locale = optarg; + break; + } +#endif + /* if not debugging, fall through */ + case '?': + default: + /* + * If not posix, an unrecognized option stops argument + * processing so that it can go into ARGV for the awk + * program to see. This makes use of ``#! /bin/gawk -f'' + * easier. + * + * However, it's never simple. If optopt is set, + * an option that requires an argument didn't get the + * argument. We care because if opterr is 0, then + * getopt_long won't print the error message for us. + */ + if (! do_posix + && (optopt == '\0' || strchr(optlist, optopt) == NULL)) { + /* + * can't just do optind--. In case of an + * option with >= 2 letters, getopt_long + * won't have incremented optind. + */ + optind = old_optind; + stopped_early = true; + goto out; + } else if (optopt != '\0') { + /* Use POSIX required message format */ + fprintf(stderr, + _("%s: option requires an argument -- %c\n"), + myname, optopt); + usage(EXIT_FAILURE, stderr); + } + /* else + let getopt print error message for us */ + break; + } + if (c == 'E') /* --exec ends option processing */ + break; + } +out: + return; +} + +/* set_locale_stuff --- setup the locale stuff */ + +static void +set_locale_stuff(void) +{ +#if defined(LC_CTYPE) + setlocale(LC_CTYPE, locale); +#endif +#if defined(LC_COLLATE) + setlocale(LC_COLLATE, locale); +#endif +#if defined(LC_MESSAGES) + setlocale(LC_MESSAGES, locale); +#endif +#if defined(LC_NUMERIC) && defined(HAVE_LOCALE_H) + /* + * Force the issue here. According to POSIX 2001, decimal + * point is used for parsing source code and for command-line + * assignments and the locale value for processing input, + * number to string conversion, and printing output. + * + * 10/2005 --- see below also; we now only use the locale's + * decimal point if do_posix in effect. + * + * 9/2007: + * This is a mess. We need to get the locale's numeric info for + * the thousands separator for the %'d flag. + */ + setlocale(LC_NUMERIC, locale); + init_locale(& loc); + setlocale(LC_NUMERIC, "C"); +#endif +#if defined(LC_TIME) + setlocale(LC_TIME, locale); +#endif +} diff -urN gawk-4.1.1/mbsupport.h gawk-4.1.2/mbsupport.h --- gawk-4.1.1/mbsupport.h 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/mbsupport.h 2015-04-27 18:01:59.000000000 +0300 @@ -23,81 +23,25 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/* - * This file is needed because we test for i18n support in 3 different - * places, and we want a consistent definition in all of them. Following - * the ``Don't Repeat Yourself'' principle from "The Pragmatic Programmer", - * we centralize the tests here. - * - * This test is the union of all the current tests. - */ - -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifndef NO_MBSUPPORT - -#if defined(HAVE_ISWCTYPE) \ - && defined(HAVE_LOCALE_H) \ - && (defined(HAVE_BTOWC) || defined(ZOS_USS)) \ - && defined(HAVE_MBRLEN) \ - && defined(HAVE_MBRTOWC) \ - && defined(HAVE_WCHAR_H) \ - && defined(HAVE_WCRTOMB) \ - && defined(HAVE_WCSCOLL) \ - && defined(HAVE_WCTYPE) \ - && defined(HAVE_WCTYPE_H) \ - && defined(HAVE_WCTYPE_T) \ - && defined(HAVE_WINT_T) \ - && defined(HAVE_ISWLOWER) \ - && defined(HAVE_ISWUPPER) \ - && defined(HAVE_TOWLOWER) \ - && defined(HAVE_TOWUPPER) \ - && (defined(HAVE_STDLIB_H) && defined(MB_CUR_MAX)) \ -/* We can handle multibyte strings. */ -# define MBS_SUPPORT 1 -#else -# define MBS_SUPPORT 0 -#endif - -#else /* NO_MBSUPPORT is defined */ -# define MBS_SUPPORT 0 -#endif -#if ! MBS_SUPPORT +#ifdef __DJGPP__ # undef MB_CUR_MAX # define MB_CUR_MAX 1 -/* All this glop is for dfa.c. Bleah. */ +/* All this glop is for DGJPP */ -#ifndef __DJGPP__ -#define wchar_t char -#endif - -#define wctype_t int -#define wint_t int -#define mbstate_t int -#define WEOF EOF #define towupper toupper #define towlower tolower -#ifndef __DJGPP__ -#define btowc(x) ((int)x) -#endif #define iswalnum isalnum #define iswalpha isalpha #define iswupper isupper -#if defined(ZOS_USS) -#undef towupper -#undef towlower -#undef btowc -#undef iswalnum -#undef iswalpha -#undef iswupper -#undef wctype -#undef iswctype -#undef wcscoll -#endif +#define iswlower islower + +#define mbrtowc(wcp, s, e, mbs) (-1) +#define mbrlen(s, e, mbs) strlen(s) +#define wcrtomb(wc, b, mbs) (-1) +#define wcslen strlen +#define wctob(wc) (EOF) extern wctype_t wctype(const char *name); extern int iswctype(wint_t wc, wctype_t desc); diff -urN gawk-4.1.1/missing gawk-4.1.2/missing --- gawk-4.1.1/missing 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/missing 2015-04-27 18:09:07.000000000 +0300 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-06-26.16; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -160,7 +160,7 @@ ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." + echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) diff -urN gawk-4.1.1/missing_d/ChangeLog gawk-4.1.2/missing_d/ChangeLog --- gawk-4.1.1/missing_d/ChangeLog 2014-04-08 20:34:50.000000000 +0300 +++ gawk-4.1.2/missing_d/ChangeLog 2015-04-29 08:53:11.000000000 +0300 @@ -1,3 +1,7 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff -urN gawk-4.1.1/mpfr.c gawk-4.1.2/mpfr.c --- gawk-4.1.1/mpfr.c 2014-02-20 20:52:05.000000000 +0200 +++ gawk-4.1.2/mpfr.c 2015-04-28 16:49:46.000000000 +0300 @@ -89,6 +89,15 @@ register_exec_hook(mpg_interpret, 0); } +/* cleanup_mpfr --- clean stuff up, mainly for valgrind */ + +void +cleanup_mpfr(void) +{ + mpfr_clear(_mpf_t1); + mpfr_clear(_mpf_t2); +} + /* mpg_node --- allocate a node to store MPFR float or GMP integer */ NODE * @@ -112,10 +121,8 @@ r->flags |= MALLOC|NUMBER|NUMCUR; r->stptr = NULL; r->stlen = 0; -#if MBS_SUPPORT r->wstptr = NULL; r->wstlen = 0; -#endif /* defined MBS_SUPPORT */ return r; } @@ -688,22 +695,35 @@ return res; } +/* do_mpfr_func --- run an MPFR function - not inline, for debugging */ -#define SPEC_MATH(X) \ -NODE *t1, *res; \ -mpfr_ptr p1; \ -int tval; \ -t1 = POP_SCALAR(); \ -if (do_lint && (t1->flags & (NUMCUR|NUMBER)) == 0) \ - lintwarn(_("%s: received non-numeric argument"), #X); \ -force_number(t1); \ -p1 = MP_FLOAT(t1); \ -res = mpg_float(); \ -tval = mpfr_##X(res->mpg_numbr, p1, ROUND_MODE); \ -IEEE_FMT(res->mpg_numbr, tval); \ -DEREF(t1); \ -return res +static inline NODE * +do_mpfr_func(const char *name, + int (*mpfr_func)(), /* putting argument types just gets the compiler confused */ + int nargs) +{ + NODE *t1, *res; + mpfr_ptr p1; + int tval; + t1 = POP_SCALAR(); + if (do_lint && (t1->flags & (NUMCUR|NUMBER)) == 0) + lintwarn(_("%s: received non-numeric argument"), name); + + force_number(t1); + p1 = MP_FLOAT(t1); + res = mpg_float(); + mpfr_set_prec(res->mpg_numbr, mpfr_get_prec(p1)); /* needed at least for sqrt() */ + tval = mpfr_func(res->mpg_numbr, p1, ROUND_MODE); + IEEE_FMT(res->mpg_numbr, tval); + DEREF(t1); + return res; +} + +#define SPEC_MATH(X) \ +NODE *result; \ +result = do_mpfr_func(#X, mpfr_##X, nargs); \ +return result /* do_mpfr_sin --- do the sin function */ @@ -1354,8 +1374,27 @@ int tval; if (is_mpg_integer(t1) && is_mpg_integer(t2)) { + /* + * 8/2014: Originally, this was just + * + * r = mpg_integer(); + * mpz_mod(r->mpg_i, t1->mpg_i, t2->mpg_i); + * + * But that gave very strange results with negative numerator: + * + * $ ./gawk -M 'BEGIN { print -15 % 7 }' + * 6 + * + * So instead we use mpz_tdiv_qr() to get the correct result + * and just throw away the quotient. We could not find any + * reason why mpz_mod() wasn't working correctly. + */ + NODE *dummy_quotient; + r = mpg_integer(); - mpz_mod(r->mpg_i, t1->mpg_i, t2->mpg_i); + dummy_quotient = mpg_integer(); + mpz_tdiv_qr(dummy_quotient->mpg_i, r->mpg_i, t1->mpg_i, t2->mpg_i); + unref(dummy_quotient); } else { mpfr_ptr p1, p2; p1 = MP_FLOAT(t1); diff -urN gawk-4.1.1/node.c gawk-4.1.2/node.c --- gawk-4.1.1/node.c 2014-02-20 20:52:05.000000000 +0200 +++ gawk-4.1.2/node.c 2015-04-28 16:49:46.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2001, 2003-2013, + * Copyright (C) 1986, 1988, 1989, 1991-2001, 2003-2015, * the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the @@ -72,7 +72,7 @@ * This also allows hexadecimal floating point. Ugh. */ if (! do_posix) { - if (isalpha((unsigned char) *cp)) { + if (is_alpha((unsigned char) *cp)) { return n; } else if (n->stlen == 4 && is_ieee_magic_val(n->stptr)) { if ((n->flags & MAYBE_NUM) != 0) @@ -94,7 +94,7 @@ if ( cp == cpend /* only spaces, or */ || (! do_posix /* not POSIXLY paranoid and */ - && (isalpha((unsigned char) *cp) /* letter, or */ + && (is_alpha((unsigned char) *cp) /* letter, or */ /* CANNOT do non-decimal and saw 0x */ || (! do_non_decimal_data && cp[0] == '0' && (cp[1] == 'x' || cp[1] == 'X'))))) { @@ -138,11 +138,20 @@ ptr++; *cpend = save; finish: - if (errno == 0 && ptr == cpend) { - n->flags |= newflags; - n->flags |= NUMCUR; + if (errno == 0) { + if (ptr == cpend) { + n->flags |= newflags; + n->flags |= NUMCUR; + } + /* else keep the leading numeric value without updating flags */ } else { errno = 0; + /* + * N.B. For subnormal values, strtod may return the + * floating-point representation while setting errno to ERANGE. + * We force the numeric value to 0 in such cases. + */ + n->numbr = 0; } return n; @@ -281,7 +290,6 @@ r->flags &= ~FIELD; r->flags |= MALLOC; r->valref = 1; -#if MBS_SUPPORT /* * DON'T call free_wstr(r) here! * r->wstptr still points at n->wstptr's value, and we @@ -289,13 +297,11 @@ */ r->wstptr = NULL; r->wstlen = 0; -#endif /* MBS_SUPPORT */ if ((n->flags & STRCUR) != 0) { emalloc(r->stptr, char *, n->stlen + 2, "r_dupnode"); memcpy(r->stptr, n->stptr, n->stlen); r->stptr[n->stlen] = '\0'; -#if MBS_SUPPORT if ((n->flags & WSTRCUR) != 0) { r->wstlen = n->wstlen; emalloc(r->wstptr, wchar_t *, sizeof(wchar_t) * (n->wstlen + 2), "r_dupnode"); @@ -303,7 +309,6 @@ r->wstptr[n->wstlen] = L'\0'; r->flags |= WSTRCUR; } -#endif /* MBS_SUPPORT */ } return r; @@ -322,10 +327,8 @@ r->valref = 1; r->stptr = NULL; r->stlen = 0; -#if MBS_SUPPORT r->wstptr = NULL; r->wstlen = 0; -#endif /* defined MBS_SUPPORT */ return r; } @@ -368,11 +371,8 @@ r->flags = (MALLOC|STRING|STRCUR); r->valref = 1; r->stfmt = -1; - -#if MBS_SUPPORT r->wstptr = NULL; r->wstlen = 0; -#endif /* MBS_SUPPORT */ if ((flags & ALREADY_MALLOCED) != 0) r->stptr = (char *) s; @@ -387,15 +387,12 @@ char *ptm; int c; const char *end; -#if MBS_SUPPORT mbstate_t cur_state; memset(& cur_state, 0, sizeof(cur_state)); -#endif end = &(r->stptr[len]); for (pf = ptm = r->stptr; pf < end;) { -#if MBS_SUPPORT /* * Keep multibyte characters together. This avoids * problems if a subsequent byte of a multibyte @@ -412,7 +409,7 @@ continue; } } -#endif + c = *pf++; if (c == '\\') { c = parse_escape(&pf); @@ -642,7 +639,6 @@ return 8; } -#if MBS_SUPPORT /* str2wstr --- convert a multibyte string to a wide string */ NODE * @@ -891,7 +887,6 @@ return NULL; } -#endif /* MBS_SUPPORT */ /* is_ieee_magic_val --- return true for +inf, -inf, +nan, -nan */ @@ -938,7 +933,6 @@ return v; } -#if MBS_SUPPORT wint_t btowc_cache[256]; /* init_btowc_cache --- initialize the cache */ @@ -951,7 +945,6 @@ btowc_cache[i] = btowc(i); } } -#endif #define BLOCKCHUNK 100 diff -urN gawk-4.1.1/pc/ChangeLog gawk-4.1.2/pc/ChangeLog --- gawk-4.1.1/pc/ChangeLog 2014-04-08 20:35:16.000000000 +0300 +++ gawk-4.1.2/pc/ChangeLog 2015-04-29 08:53:06.000000000 +0300 @@ -1,3 +1,74 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + +2015-04-22 Scott Deifik + + * Makefile.tst: Don't do 'make diffout' after pass-fail. + * negtime: Add expect failure for DJGPP. + +2015-04-17 Eli Zaretskii + + * testoutcmp.awk (END): Attempt a series of massages on the actual + output to match it to the expected result, when the number of + exponent digits is different. Also, edit "nul" into "null", to + account for the difference in the null device name. This removes + "failures" due to Windows-specific issues that do not indicate + real problems in Gawk, just some non-portable assumptions about + the expected results. + + * Makefile.tst (abs_top_builddir): Define. + (negtime): Mark this test as an expected failure with MinGW. + (profile5, exit, hsprint, posix, double2, fmttest): Remove the + "expect to fail" message for MinGW, and use the testoutcmp.awk + script to loosely compare actual output to expected one. + + * Makefile.ext ($(SIMPLE_EXTENSIONS)): Really use -static-libgcc. + +2015-04-16 Arnold D. Robbins + + * Makefile.tst: Sync with mainline. + * config.h: Sync with mainline. + +2015-04-08 Eli Zaretskii + + * Makefile.ext (fnmatch.$(SOEXT), readdir.$(SOEXT), rwarray.$(SOEXT)) + (filefuncs.$(SOEXT), time.$(SOEXT), $(SIMPLE_EXTENSIONS)): Use + -static-libgcc, to avoid run-time dependency on libgcc DLL. This + makes the extensions independent of non-system DLLs, and also + prevents an abort at exit due to a known upstream bug in + libgcc_s_dw2-1.dll. + + * Makefile.tst (mpfrmemok1): Use -p- instead of -p/dev/stdout, for + more portability. + +2015-04-07 Arnold D. Robbins + + * Makefile.tst: Sync with mainline. + * config.h: Sync with mainline. + +2014-11-21 Arnold D. Robbins + + * Makefile.tst (id): Add an 'expect to fail for DJGPP' message. + +2014-11-13 Scott Deifik + + * Makefile.tst: Sync with mainline. + +2014-10-12 KO Myung-Hun + + Fixes for OS/2: + + * gawkmisc.pc (init_sockets): Add additional checks for __EMX__. + +2014-09-23 Scott Deifik + + * Makefile.tst: Sync with mainline. + +2014-04-17 Scott Deifik + + * Makefile.tst: Add readfile2 test. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff -urN gawk-4.1.1/pc/Makefile.ext gawk-4.1.2/pc/Makefile.ext --- gawk-4.1.1/pc/Makefile.ext 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/pc/Makefile.ext 2015-04-27 18:09:07.000000000 +0300 @@ -32,22 +32,22 @@ extensions: $(ALL_EXTENSIONS) fnmatch.$(SOEXT): fnmatch.c - gcc -I.. -I../missing_d -DHAVE_FNMATCH_H -shared -gdwarf-2 -g3 -o $@ fnmatch.c + gcc -I.. -I../missing_d -DHAVE_FNMATCH_H -shared -gdwarf-2 -g3 -static-libgcc -o $@ fnmatch.c readdir.$(SOEXT): readdir.c gawkdirfd.h - gcc -I.. -DHAVE_DIRENT_H -shared -gdwarf-2 -g3 -o $@ readdir.c + gcc -I.. -DHAVE_DIRENT_H -shared -gdwarf-2 -g3 -static-libgcc -o $@ readdir.c rwarray.$(SOEXT): rwarray.c - gcc -I.. -shared -gdwarf-2 -g3 -o $@ rwarray.c -lws2_32 + gcc -I.. -shared -gdwarf-2 -g3 -static-libgcc -o $@ rwarray.c -lws2_32 filefuncs.$(SOEXT): filefuncs.c stack.c stack.h gawkfts.h - gcc -I.. -shared -gdwarf-2 -g3 -o $@ filefuncs.c stack.c + gcc -I.. -shared -gdwarf-2 -g3 -static-libgcc -o $@ filefuncs.c stack.c time.$(SOEXT): time.c - gcc -DHAVE_GETSYSTEMTIMEASFILETIME -I.. -shared -gdwarf-2 -g3 -o $@ time.c + gcc -DHAVE_GETSYSTEMTIMEASFILETIME -I.. -shared -gdwarf-2 -g3 -static-libgcc -o $@ time.c $(SIMPLE_EXTENSIONS): - gcc -I.. -shared -gdwarf-2 -g3 -o $@ $(@:.$(SOEXT)=.c) + gcc -I.. -shared -gdwarf-2 -g3 -static-libgcc -o $@ $(@:.$(SOEXT)=.c) $(ALL_EXTENSIONS): ../gawkapi.h ../gettext.h diff -urN gawk-4.1.1/pc/Makefile.tst gawk-4.1.2/pc/Makefile.tst --- gawk-4.1.1/pc/Makefile.tst 2014-03-31 22:17:46.000000000 +0300 +++ gawk-4.1.2/pc/Makefile.tst 2015-04-27 18:09:07.000000000 +0300 @@ -1,6 +1,6 @@ # Makefile for GNU Awk test suite. # -# Copyright (C) 1988-2014 the Free Software Foundation, Inc. +# Copyright (C) 1988-2015 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -131,6 +131,7 @@ abs_srcdir = . abs_builddir = . top_srcdir = "$(srcdir)"/.. +abs_top_builddir = "$(top_srcdir)" # Get rid of core files when cleaning and generated .ok file CLEANFILES = core core.* fmtspcl.ok @@ -141,12 +142,11 @@ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 arysubnm asgext awkpath \ - back89 backgsub \ - badassign1 \ - childin clobber closebad clsflnam compare compare2 concat1 concat2 \ + back89 backgsub badassign1 badbuild \ + callparam childin clobber closebad clsflnam compare compare2 concat1 concat2 \ concat3 concat4 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ - eofsplit exit2 exitval1 exitval2 \ + eofsplit exit2 exitval1 exitval2 exitval3 \ fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \ fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \ fstabplus funsemnl funsmnam funstack \ @@ -161,13 +161,14 @@ nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \ noparms nors nulrsend numindex numsubstr \ octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofs1 onlynl opasnidx opasnslf \ + paramasfunc1 paramasfunc2 \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval \ - rand range1 rebt8b1 redfilnm regeq regexprange regrange reindops \ + rand range1 rebt8b1 redfilnm regeq regexpbrack regexprange regrange reindops \ reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ - scalar sclforin sclifin sortempty splitargv splitarr splitdef \ + scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \ splitvar splitwht strcat1 strnum1 strtod subamp subi18n \ subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \ @@ -181,19 +182,19 @@ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way delsub devfd devfd1 devfd2 dumpvars exit \ - fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ + colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ + fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ - gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ + genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ - include include2 indirectcall \ + include include2 indirectbuiltin indirectcall indirectcall2 \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ - nastyparm next nondec nondec2 \ - patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ - profile1 profile2 profile3 profile4 profile5 pty1 \ - rebuf regx8bit reginttrad reint reint2 rsstart1 \ + nastyparm negtime next nondec nondec2 \ + patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ + profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ + rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ @@ -202,8 +203,9 @@ EXTRA_TESTS = inftest regtest INET_TESTS = inetdayu inetdayt inetechu inetecht MACHINE_TESTS = double1 double2 fmtspcl intformat -MPFR_TESTS = mpfrnr mpfrnegzero mpfrrnd mpfrieee mpfrexprange \ - mpfrsort mpfrbigint +MPFR_TESTS = mpfrnr mpfrnegzero mpfrmemok1 mpfrrem mpfrrnd mpfrieee \ + mpfrexprange mpfrsort mpfrsqrt mpfrbigint + LOCALE_CHARSET_TESTS = \ asort asorti backbigs1 backsmalls1 backsmalls2 \ fmttest fnarydel fnparydl jarebug lc_num1 mbfw1 \ @@ -211,7 +213,7 @@ SHLIB_TESTS = \ fnmatch filefuncs fork fork2 fts functab4 inplace1 inplace2 inplace3 \ - ordchr ordchr2 readdir readfile revout revtwoway rwarray testext time + ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time # List of the tests which should be run with --lint option: NEED_LINT = \ @@ -246,7 +248,7 @@ unix-msg-start unix-tests unix-msg-end \ extend-msg-start gawk-extensions extend-msg-end \ machine-msg-start machine-tests machine-msg-end \ - charset-msg-start charset-tests charset-msg-end \ + charset-tests-all \ shlib-msg-start shlib-tests shlib-msg-end \ mpfr-msg-start mpfr-tests mpfr-msg-end \ pass-fail @@ -257,6 +259,16 @@ gawk-extensions: $(GAWK_EXT_TESTS) +charset-tests-all: + @if locale -a | grep -i 'en_US.UTF.*8' > /dev/null && \ + locale -a | grep -i 'ru_RU.UTF.*8' > /dev/null && \ + locale -a | grep -i 'ja_JP.UTF.*8' > /dev/null ; \ + then \ + $(MAKE) charset-msg-start charset-tests charset-msg-end; \ + else \ + echo %%%%%%%%%% Inadequate locale support: skipping charset tests. ; \ + fi + charset-tests: $(LOCALE_CHARSET_TESTS) extra: $(EXTRA_TESTS) inet @@ -319,6 +331,12 @@ charset-msg-start: @echo "======== Starting tests that can vary based on character set or locale support ========" + @echo "**************************************************************************" + @echo "* Some or all of these tests may fail if you have inadequate or missing *" + @echo "* locale support At least en_US.UTF-8, ru_RU.UTF-8 and ja_JP.UTF-8 are *" + @echo "* needed. However, if you see this message, the Makefile thinks you have *" + @echo "* what you need ... *" + @echo "**************************************************************************" charset-msg-end: @echo "======== Done with tests that can vary based on character set or locale support ========" @@ -353,7 +371,7 @@ @if ./_pbd.awk "$(srcdir)"/poundbang.awk > _`basename $@` ; \ then : ; \ else \ - sed "s;/tmp/gawk;../$(AWKPROG);" < "$(srcdir)"/poundbang.awk > ./_pbd.awk ; \ + sed "s;/tmp/gawk;$(AWKPROG);" < "$(srcdir)"/poundbang.awk > ./_pbd.awk ; \ chmod +x ./_pbd.awk ; \ LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} ./_pbd.awk "$(srcdir)"/poundbang.awk > _`basename $@`; \ fi @@ -504,6 +522,16 @@ $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ fi +rebuf:: + @echo $@ + @AWKBUFSIZE=4096 AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +rsglstdin:: + @echo $@ + @cat "$(srcdir)"/rsgetline.in | AWKPATH="$(srcdir)" $(AWK) -f rsgetline.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + reint:: @echo $@ @$(AWK) --re-interval -f "$(srcdir)"/reint.awk "$(srcdir)"/reint.in >_$@ @@ -840,14 +868,19 @@ dumpvars:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --dump-variables 1 < "$(srcdir)"/$@.in >/dev/null 2>&1 || echo EXIT CODE: $$? >>_$@ -# @mv awkvars.out _$@ - @$(MV) awkvars.out _$@ + @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +profile0: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ profile1: @echo $@ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1 - @$(AWK) -f ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out + @$(AWK) -f ./ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out @$(CMP) _$@.out1 _$@.out2 && rm _$@.out[12] || { echo EXIT CODE: $$? >>_$@ ; \ cp "$(srcdir)"/dtdgport.awk > $@.ok ; } @@ -871,9 +904,21 @@ profile5: @echo $@ - @echo Expect profile5 to fail with MinGW due to 3 digits in %e output @GAWK_NO_PP_RUN=1 $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out +# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(TESTOUTCMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +profile6: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +profile7: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ posix2008sub: @@ -890,7 +935,8 @@ @echo $@ @echo Expect exit to fail with MinGW due to null vs nul difference @-AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(TESTOUTCMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ rri1:: @echo $@ @@ -933,6 +979,21 @@ @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +mpfrsqrt: + @echo $@ + @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +mpfrrem: + @echo $@ + @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +mpfrmemok1: + @echo $@ + @$(AWK) -p- -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + jarebug:: @echo $@ @echo Expect jarebug to fail with DJGPP and MinGW. @@ -950,6 +1011,11 @@ @$(AWK) -l readfile 'BEGIN {printf "%s", readfile("Makefile")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) Makefile _$@ && rm -f _$@ || cp -p Makefile $@.ok +readfile2:: + @echo $@ + @$(AWK) -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.awk "$(srcdir)"/readdir.awk > _$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + include2:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --include inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1026,7 +1092,7 @@ @echo $@ # @$(AWK) '/^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk @$(AWK) ' /^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk - @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk readdir: @@ -1131,6 +1197,43 @@ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +dbugeval:: + @echo $@ + @$(AWK) --debug -f /dev/null < "$(srcdir)"/$@.in > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +printhuge:: + @echo $@ + @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ + AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +filefuncs: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -v builddir="$(abs_top_builddir)" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +genpot: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --gen-pot >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +paramasfunc1:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +paramasfunc2:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +negtime:: + @echo $@ + @echo Expect negtime to fail with MinGW and DJGPP + @TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: @@ -1258,6 +1361,16 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +badbuild: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +callparam: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + childin: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1354,6 +1467,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +exitval3: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fcall_exit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1521,9 +1639,9 @@ hsprint: @echo $@ - @echo Expect hsprint to fail with MinGW due to 3 digits in %e output @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(TESTOUTCMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ inputred: @echo $@ @@ -1828,6 +1946,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +regexpbrack: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + regexprange: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1915,6 +2038,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +sortglos: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + splitargv: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -2082,6 +2210,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +crlf: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + delsub: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -2107,6 +2240,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +fpat4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fpatnull: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -2195,6 +2333,7 @@ id: @echo $@ + @echo Expect id to fail with DJGPP. @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ @@ -2218,11 +2357,21 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +indirectbuiltin: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + indirectcall: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +indirectcall2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + lint: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -2270,9 +2419,9 @@ posix: @echo $@ - @echo Expect posix to fail with MinGW due to 3 digits in e+NNN exponent @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(TESTOUTCMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ printfbad1: @echo $@ @@ -2284,6 +2433,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +printfbad4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + procinfs: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -2295,9 +2449,14 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -rebuf: +regnul1: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +regnul2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ regx8bit: @@ -2305,6 +2464,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +rsgetline: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + rstest6: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -2382,9 +2546,9 @@ double2: @echo $@ - @echo Expect double2 to fail with MinGW due to 3 digits in e+NNN exponents @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(TESTOUTCMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ intformat: @echo $@ @@ -2403,9 +2567,9 @@ fmttest: @echo $@ - @echo Expect fmttest to fail with MinGW due to 3 digits in e+NNN exponents @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(TESTOUTCMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ fnarydel: @echo $@ @@ -2441,11 +2605,6 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -filefuncs: - @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - fork: @echo $@ @echo Expect $@ to fail with MinGW because fork.dll is not available @@ -2510,6 +2669,7 @@ fi # This target for my convenience to look at all the results +# Don't use POSIX or bash-isms so that it'll work on !@#$%^&*() Solaris. diffout: for i in _* ; \ do \ @@ -2522,7 +2682,7 @@ diff -c "$(srcdir)"/$${base}.ok $$i ; \ fi ; \ fi ; \ - done | more + done | less # convenient way to scan valgrind results for errors valgrind-scan: diff -urN gawk-4.1.1/pc/config.h gawk-4.1.2/pc/config.h --- gawk-4.1.1/pc/config.h 2014-04-08 20:36:37.000000000 +0300 +++ gawk-4.1.2/pc/config.h 2015-04-29 08:55:53.000000000 +0300 @@ -117,9 +117,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H -/* Define to 1 if you have the `m' library (-lm). */ -#define HAVE_LIBM 1 - /* Define to 1 if you have a fully functional readline library. */ /* #undef HAVE_LIBREADLINE */ @@ -242,6 +239,9 @@ #define HAVE_STDLIB_H 1 #endif +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + /* Define to 1 if you have the `strchr' function. */ #define HAVE_STRCHR 1 @@ -407,6 +407,9 @@ /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL +/* enable severe portability problems */ +#undef I_DONT_KNOW_WHAT_IM_DOING + /* libc is broken for regex handling */ #undef LIBC_IS_BORKED @@ -423,7 +426,7 @@ #define PACKAGE_NAME "GNU Awk" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "GNU Awk 4.1.1" +#define PACKAGE_STRING "GNU Awk 4.1.2" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "gawk" @@ -432,7 +435,7 @@ #define PACKAGE_URL "http://www.gnu.org/software/gawk/" /* Define to the version of this package. */ -#define PACKAGE_VERSION "4.1.1" +#define PACKAGE_VERSION "4.1.2" /* Define to 1 if *printf supports %F format */ #undef PRINTF_HAS_F_FORMAT @@ -494,7 +497,7 @@ /* Version number of package */ -#define VERSION "4.1.1" +#define VERSION "4.1.2" /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE diff -urN gawk-4.1.1/pc/gawkmisc.pc gawk-4.1.2/pc/gawkmisc.pc --- gawk-4.1.1/pc/gawkmisc.pc 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/pc/gawkmisc.pc 2015-04-27 18:01:59.000000000 +0300 @@ -850,12 +850,12 @@ #endif /* __MINGW32__ */ -#if defined(__DJGPP__) || defined(__MINGW32__) +#if defined(__DJGPP__) || defined(__MINGW32__) || defined(__EMX__) void init_sockets(void) { -#ifdef HAVE_SOCKETS +#if defined(HAVE_SOCKETS) && !defined(__EMX__) WSADATA winsockData; int errcode; diff -urN gawk-4.1.1/pc/testoutcmp.awk gawk-4.1.2/pc/testoutcmp.awk --- gawk-4.1.1/pc/testoutcmp.awk 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/pc/testoutcmp.awk 2015-04-27 18:09:07.000000000 +0300 @@ -1,7 +1,8 @@ # cmp replacement program for PC where the error messages aren't -# exactly the same. should run even on old awk +# exactly the same, and neither are e+NNN exponents. +# should run even on old awk # -# Copyright (C) 2011 the Free Software Foundation, Inc. +# Copyright (C) 2011-2015 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -35,6 +36,7 @@ exit 1 } + status = 0; for (i = 1; i <= FNR; i++) { good = lines[0, i] actual = lines[1, i] @@ -46,12 +48,33 @@ l-- if (substr(good, 1, l) == substr(actual, 1, l)) continue + + # For exponents + actual1 = gensub(/( ?)([-+]?[0-9.][0-9.]?+e[-+])0([0-9][0-9])/, " \\1\\2\\3", "g", actual) + if (good == actual1) + continue + actual1 = gensub(/([-+]?0)([0-9.]+e[-+])0([0-9][0-9])/, "\\10\\2\\3", "g", actual) + if (good == actual1) + continue + actual1 = gensub(/( ?)([-+]?)([1-9.][0-9.]?+e[-+])0([0-9][0-9])/, "\\1\\20\\3\\4", "g", actual) + if (good == actual1) + continue + actual1 = gensub(/([-+]?[0-9.]+e[-+])0([0-9][0-9])/, "\\1\\2 ", "g", actual) + if (good == actual1) + continue + actual1 = gensub(/([-+]?[0-9.]+e[-+])0([0-9][0-9])/, "\\1\\2", "g", actual) + if (good == actual1) + continue + # For exit test + actual1 = gensub(/([01]) nul/, "\\1 null", "g", actual) + if (good == actual1) + continue else { - printf("%s and %s are not equal\n", ARGV[1], - ARGV[2]) > "/dev/stderr" - exit 1 + printf("-%s\n", good) > "/dev/stderr" + printf("+%s\n", actual) > "/dev/stderr" + status = 1 } } - exit 0 + exit status } diff -urN gawk-4.1.1/po/ChangeLog gawk-4.1.2/po/ChangeLog --- gawk-4.1.1/po/ChangeLog 2014-04-08 20:35:20.000000000 +0300 +++ gawk-4.1.2/po/ChangeLog 2015-04-29 08:53:21.000000000 +0300 @@ -1,3 +1,16 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + +2015-01-24 Arnold D. Robbins + + * POTFILES.in: Brought up to date. + +2014-11-19 gettextize + + * Makefile.in.in: Upgrade to gettext-0.19.3. + * Rules-quot: Upgrade to gettext-0.19.3. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff -urN gawk-4.1.1/po/Makefile.in.in gawk-4.1.2/po/Makefile.in.in --- gawk-4.1.1/po/Makefile.in.in 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/po/Makefile.in.in 2015-04-27 18:01:59.000000000 +0300 @@ -8,13 +8,14 @@ # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # -# Origin: gettext-0.18 -GETTEXT_MACRO_VERSION = 0.18 +# Origin: gettext-0.19 +GETTEXT_MACRO_VERSION = 0.19 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +SED = @SED@ SHELL = /bin/sh @SET_MAKE@ @@ -76,6 +77,16 @@ CATALOGS = @CATALOGS@ +POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot +POFILESDEPS_yes = $(POFILESDEPS_) +POFILESDEPS_no = +POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) + +DISTFILESDEPS_ = update-po +DISTFILESDEPS_yes = $(DISTFILESDEPS_) +DISTFILESDEPS_no = +DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) + # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: @@ -96,14 +107,14 @@ mv t-$@ $@ -all: check-macro-version all-@USE_NLS@ +all: all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. -check-macro-version: - @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ +CHECK_MACRO_VERSION = \ + test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } @@ -123,6 +134,7 @@ # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot + @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ @@ -137,11 +149,29 @@ # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed - if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ - package_gnu='GNU '; \ + package_gnu="$(PACKAGE_GNU)"; \ + test -n "$$package_gnu" || { \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \ + -size -10000000c -exec grep 'GNU @PACKAGE@' \ + /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ + package_gnu=yes; \ + else \ + package_gnu=no; \ + fi; \ + }; \ + if test "$$package_gnu" = "yes"; then \ + package_prefix='GNU '; \ else \ - package_gnu=''; \ + package_prefix=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ @@ -161,7 +191,7 @@ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ - --package-name="$${package_gnu}@PACKAGE@" \ + --package-name="$${package_prefix}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ @@ -189,9 +219,10 @@ # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. -$(POFILES): $(srcdir)/$(DOMAIN).pot +$(POFILES): $(POFILESDEPS) @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ + test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ @@ -352,7 +383,7 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: - $(MAKE) update-po + test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) diff -urN gawk-4.1.1/po/Makevars gawk-4.1.2/po/Makevars --- gawk-4.1.1/po/Makevars 2012-05-03 21:13:57.000000000 +0300 +++ gawk-4.1.2/po/Makevars 2015-04-27 18:01:59.000000000 +0300 @@ -20,6 +20,13 @@ # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. +# This tells whether or not to prepend "GNU " prefix to the package +# name that gets inserted into the header of the $(DOMAIN).pot file. +# Possible values are "yes", "no", or empty. If it is empty, try to +# detect it automatically by scanning the files in $(top_srcdir) for +# "GNU packagename" string. +PACKAGE_GNU = + # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines @@ -34,8 +41,38 @@ # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. -MSGID_BUGS_ADDRESS = arnold@skeeve.com +MSGID_BUGS_ADDRESS = bug-gawk@gnu.org # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = + +# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' +# context. Possible values are "yes" and "no". Set this to yes if the +# package uses functions taking also a message context, like pgettext(), or +# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. +USE_MSGCTXT = no + +# These options get passed to msgmerge. +# Useful options are in particular: +# --previous to keep previous msgids of translated messages, +# --quiet to reduce the verbosity. +MSGMERGE_OPTIONS = + +# These options get passed to msginit. +# If you want to disable line wrapping when writing PO files, add +# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and +# MSGINIT_OPTIONS. +MSGINIT_OPTIONS = + +# This tells whether or not to regenerate a PO file when $(DOMAIN).pot +# has changed. Possible values are "yes" and "no". Set this to no if +# the POT file is checked in the repository and the version control +# program ignores timestamps. +PO_DEPENDS_ON_POT = yes + +# This tells whether or not to forcibly update $(DOMAIN).pot and +# regenerate PO files on "make dist". Possible values are "yes" and +# "no". Set this to no if the POT file and PO files are maintained +# externally. +DIST_DEPENDS_ON_UPDATE_PO = yes diff -urN gawk-4.1.1/po/POTFILES.in gawk-4.1.2/po/POTFILES.in --- gawk-4.1.1/po/POTFILES.in 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/po/POTFILES.in 2015-04-27 18:09:07.000000000 +0300 @@ -13,11 +13,17 @@ extension/filefuncs.c extension/fnmatch.c extension/fork.c +extension/gawkfts.c extension/inplace.c extension/ordchr.c extension/readdir.c extension/readfile.c +extension/revoutput.c +extension/revtwoway.c extension/rwarray.c +extension/rwarray0.c +extension/stack.c +extension/testext.c extension/time.c field.c floatcomp.c diff -urN gawk-4.1.1/po/Rules-quot gawk-4.1.2/po/Rules-quot --- gawk-4.1.1/po/Rules-quot 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/po/Rules-quot 2015-04-27 18:01:59.000000000 +0300 @@ -1,3 +1,4 @@ +# This file, Rules-quot, can be copied and used freely without restrictions. # Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot @@ -14,13 +15,23 @@ .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ - if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ - if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ + if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ + | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \ + { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ + $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ + ;; \ + *) \ + $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ + ;; \ + esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ + ; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ diff -urN gawk-4.1.1/po/ca.po gawk-4.1.2/po/ca.po --- gawk-4.1.1/po/ca.po 2014-04-08 19:23:36.000000000 +0300 +++ gawk-4.1.2/po/ca.po 2015-04-29 08:36:40.000000000 +0300 @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" "PO-Revision-Date: 2014-02-26 20:18+0100\n" "Last-Translator: Walter Garcia-Fontes \n" "Language-Team: Catalan \n" @@ -36,9 +36,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "s'ha intentat usar la dada escalar `%s' com a una matriu" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "s'ha intentat usar la matriu `%s' en un context escalar" @@ -97,415 +97,420 @@ "asorti: no es pot usar una submatriu com a segon argument per al primer " "argument" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "`%s' no s vlid com a nom de funci" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "la funci de comparaci d'ordenaci `%s' no est definida" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "%s blocs han de tenir una part d'acci" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "cada regla ha de tenir un patr o una part d'acci" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "l'antic awk no suporta mltiples regles `BEGIN' i `END'" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "`%s' s una funci interna, no pot ser redefinida" -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" "la constant d'expressi regular `//' sembla un comentari en C++, per no ho " "s" -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" "la constant d'expressi regular `/%s/' sembla un comentari en C, per no ho " "s" -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "valors duplicats de casos al cos de l'expressi switch: %s" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "" "s'ha detectat el cas predeterminat `default' duplicat a l'expressi switch " -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "no es permet `break' a fora d'un bucle o bifurcaci" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "no es permet `continue' a fora d'un bucle" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "`next' usat a l'acci %s" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "`nextfile' usat a l'acci %s" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "`return' s usat fora del context d'una funci" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "el `print' simple en la regla BEGIN o END probablement ha de ser `print " "\"\"'" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" msgstr "no es permet `delete' amb SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" msgstr "no es permet `delete' a FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(array)' s una extensi tawk no portable" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "les canonades bidireccionals multi-etapes no funcionen" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "expressi regular a la dreta d'una assignaci" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "expressi regular a l'esquerra de l'operador `~' o `!~'" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" msgstr "" "l'antic awk no dna suport a la paraula clau `in' excepte desprs de `for'" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "expressi regular a la dreta de la comparaci" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "`getline var' no s vlid a dins de la regla `%s'" - -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" +#: awkgram.y:1410 +#, fuzzy, c-format +msgid "non-redirected `getline' invalid inside `%s' rule" msgstr "`getline' no s vlid a dins de la regla `%s'" -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" msgstr "`getline' no redirigit sense definir dintre de l'acci FINAL" -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "l'antic awk no suporta matrius multidimensionals" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "la crida de `length' sense parntesis no s portable" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "les crides a funcions indirectes sn una extensi gawk" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "no es pot usar la variable especial `%s' per a una crida indirecta de funci" +#: awkgram.y:1634 +#, fuzzy, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "s'ha intentat usar la funci %s com a una matriu" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "expressi de subndex no vlida" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "advertiment: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fatal: " -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "nova lnia inesperada o final d'una cadena de carcters" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "no es pot obrir el fitxer font `%s' per a lectura (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2392 awkgram.y:2517 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "no es pot obrir la llibreria compartida `%s' per a lectura (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "motiu desconegut" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "no es pot incloure `%s' i usar-lo com un fitxer de programa" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "ja s'ha incls el fitxer font `%s'" -#: awkgram.y:2409 +#: awkgram.y:2417 #, c-format msgid "already loaded shared library `%s'" msgstr "ja s'ha carregat la biblioteca compartida `%s'" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "@include s una extensi de gawk" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "nom de fitxer buit desprs de @include" -#: awkgram.y:2494 +#: awkgram.y:2502 msgid "@load is a gawk extension" msgstr "@load s una extensi de gawk" -#: awkgram.y:2500 +#: awkgram.y:2508 msgid "empty filename after @load" msgstr "fitxer buit desprs de @load" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "el text del programa en la lnia de comandaments est buit" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "no es pot llegir el fitxer font `%s' (%s)" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "el fitxer font `%s' est buit" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2958 msgid "source file does not end in newline" msgstr "el fitxer font no finalitza amb un retorn de carro" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "expressi regular sense finalitzar acaba amb `\\' al final del fitxer" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "%s: %d: el modificador regex tawk `/.../%c' no funciona a gawk" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "el modificador regex tawk `/.../%c' no funciona a gawk" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "expressi regular sense finalitzar" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "expressi regular sense finalitzar al final del fitxer" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" msgstr "l's de `\\ #...' com a continuaci de lnia no s portable" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "la barra invertida no s l'ltim carcter en la lnia" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "POSIX no permet l'operador `**='" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "l'antic awk no suporta l'operador `**='" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "POSIX no permet l'operador `**'" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "l'antic awk no suporta l'operador `**='" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "l'operador `^=' no est suportat en l'antic awk" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "l'operador `^' no est suportat en l'antic awk" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "cadena sense finalitzar" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "carcter `%c' no vlid en l'expressi" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' s una extensi de gawk" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX no permet %s" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "`%s' no est suportat en l'antic awk" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "`goto' es considera perjudicial!\n" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d no s vlid com a nombre d'arguments per a %s" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: la cadena literal com a ltim argument de substituci no t efecte" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s el tercer parmetre no s un objecte intercanviable" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "match: el tercer argument s una extensi de gawk" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "close: el segon argument s una extensi de gawk" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "l's de dcgettext(_\"...\") no s correcte: elimineu el gui baix inicial" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "l's de dcgettext(_\"...\") no s correcte: elimineu el gui baix inicial" -#: awkgram.y:4016 +#: awkgram.y:4050 msgid "index: regexp constant as second argument is not allowed" msgstr "ndex: no es permet una constant regexp com a segon argument" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funci `%s': parmetre `%s' ofusca la variable global" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "no es pot obrir `%s' per a escriptura (%s)" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "s'est enviant la llista de variables a l'eixida d'error estndard" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "%s: tancament erroni (%s)" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() s'ha cridat dues vegades!" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "hi ha hagut variables a l'ombra" -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "nom de la funci `%s' definida prviament" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "funci `%s: no pot usar el nom de la funci com a parmetre" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "funci `%s': no es pot usar la variable especial `%s' com a un parmetre de " "funci" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funci `%s': parmetre #%d, `%s', duplica al parmetre #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "es crida a la funci `%s' per no s'ha definit" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "la funci `%s' est definida per no s'ha cridat mai directament" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "l'expressi regular constant per al parmetre #%d condueix a un valor boole" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -514,23 +519,23 @@ "s'ha cridat a la funci `%s' amb espai entre el nom i el '(',\n" "o s'ha usat com a variable o matriu" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "s'ha intentat una divisi per zero" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "s'ha intentat una divisi per zero en `%%'" -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" "no es pot assignar un valor al resultat d'una expressi post-increment de " "camp" -#: awkgram.y:5052 +#: awkgram.y:5012 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "dest no vlid d'assignaci (opcode %s)" @@ -572,193 +577,203 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' no s un fitxer obert, canonada o co-procs" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "ndex: el primer argument rebut no s una cadena" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "ndex: el segon argument rebut no s una cadena" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: s'ha rebut un argument no numric" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: s'ha rebut un argument de matriu" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "`length(array)' s una extensi de gawk" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: s'ha rebut un argument que no s una cadena" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: s'ha rebut un argument no numric" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: s'ha rebut l'argument negatiu %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "fatal: s'ha d'usar `count$' a tots els format o a cap" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "l'amplada de camp s'ignorar per a l'especificador `%%'" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "la precisi s'ignorar per a l'especificador `%%'" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "l'amplada de camp i la precisi s'ignoraran per a l'especificador `%%'" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "fatal: no es permeten `$' en els formats awk" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fatal: el recompte d'arguments amb `$' ha de ser > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" "fatal: el recompte d'arguments %ld s major que el nombre total d'arguments " "proporcionats" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "fatal: no es permet `$' desprs d'un punt en el format" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "fatal: no es proporciona `$' per a l'ample o precisi del camp de posici" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "`l' manca de significat en els formats awk; ser ignorat" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "fatal: `l' no est perms en els formats POSIX de awk" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "`L' manca de significat en els formats awk; ser ignorat" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "fatal: `L' no est perms en els formats POSIX de awk" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "`h' manca de significat en els formats awk; ser ignorat" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "fatal: `h' no est perms en els formats POSIX de awk" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: el valor %g est fora de rang per al format `%%%c'" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: el valor %g est fora de rang per al format `%%%c'" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: el valor %g est fora de rang per al format `%%%c'" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "s'ignorar el carcter especificador de format `%c': no s'ha convertit cap " "argument" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "fatal: no hi ha prou arguments per a satisfer el format d'una cadena" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ desbordament per a aquest" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: l'especificador de format no cont lletra de control" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "s'han proporcionat masses arguments per a la cadena de format" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: sense arguments" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: sense arguments" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: s'ha rebut un argument no numric" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: cridat amb l'argument negatiu %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: la longitud %g no s >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: la longitud %g no s >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: la longitud sobre un nombre no enter %g ser truncada" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: la llargada %g s massa gran per a la indexaci de cadenes de " "carcters, es truncar a %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: l'ndex d'inici %g no s vlid, usant 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: l'ndex d'inici no enter %g ser truncat" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: la cadena font s de longitud zero" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: l'ndex d'inici %g sobrepassa l'acabament de la cadena" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -766,189 +781,211 @@ "substr: la longitud %g a l'ndex d'inici %g excedeix la longitud del primer " "argument (%lu)" -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "strftime: el valor de format a PROCINFO[\"strftime\"] t tipus numric" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" msgstr "strftime: s'ha rebut un segon argument no numric" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "" "strftime: el segon argument s ms petit que 0 o massa gran per a time_t" -#: builtin.c:1934 +#: builtin.c:1932 +#, fuzzy +msgid "strftime: second argument out of range for time_t" +msgstr "" +"strftime: el segon argument s ms petit que 0 o massa gran per a time_t" + +#: builtin.c:1941 msgid "strftime: received non-string first argument" msgstr "strftime: el primer argument rebut no s una cadena" -#: builtin.c:1941 +#: builtin.c:1948 msgid "strftime: received empty format string" msgstr "strftime: s'ha rebut una cadena de format buida" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" msgstr "mktime: s'ha rebut un argument que no s una cadena" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: almenys un dels valors est forra del rang predeterminat" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "la funci 'system' no es permet fora del mode entorn de proves" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" msgstr "system: s'ha rebut un argument que no s una cadena" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "referncia a una variable sense inicialitzar `$%d'" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" msgstr "tolower: s'ha rebut un argument que no s una cadena" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" msgstr "toupper: s'ha rebut un argument que no s una cadena" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: el primer argument rebut no s numric" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: el segon argument rebut no s numric" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" msgstr "sin: s'ha rebut un argument que no s numric" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" msgstr "cos: s'ha rebut un argument que no s numric" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: s'ha rebut un argument que no s numric" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "match: el tercer argument no s una matriu" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2725 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" msgstr "gensub: el tercer argument de 0 s tractat com a 1" -#: builtin.c:3030 +#: builtin.c:2740 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: el tercer argument de 0 s tractat com a 1" + +#: builtin.c:3038 +#, fuzzy, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "and: cridat amb menys de dos arguments" + +#: builtin.c:3128 +#, fuzzy, c-format +msgid "indirect call to %s requires at least two arguments" +msgstr "and: cridat amb menys de dos arguments" + +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" msgstr "lshift: el primer argument rebut no s numric" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" msgstr "lshift: el segon argument rebut no s numric" -#: builtin.c:3038 +#: builtin.c:3188 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): els valors negatius donaran resultats estranys" -#: builtin.c:3040 +#: builtin.c:3190 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): els valors fraccionaris sernn truncats" -#: builtin.c:3042 +#: builtin.c:3192 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "" "lshift(%f, %f): un valor de desplaament massa gran donar resultats estranys" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" msgstr "rshift: el primer argument rebut no s numric" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" msgstr "rshift: el segon argument rebut no s numric" -#: builtin.c:3075 +#: builtin.c:3225 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): els valors negatius donaran resultats estranys" -#: builtin.c:3077 +#: builtin.c:3227 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): els valors fraccionaris seran truncats" -#: builtin.c:3079 +#: builtin.c:3229 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" "rshift(%f, %f): un valor de desplaament massa gran donar resultats estranys" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3254 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: cridat amb menys de dos arguments" -#: builtin.c:3109 +#: builtin.c:3259 #, c-format msgid "and: argument %d is non-numeric" msgstr "exp: l'argument %d no s numric" -#: builtin.c:3113 +#: builtin.c:3263 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and: l'argument %d amb valor negatiu %g donar resultats estranys" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3286 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: cridat amb menys de dos arguments" -#: builtin.c:3141 +#: builtin.c:3291 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: l'argument %d no s numric" -#: builtin.c:3145 +#: builtin.c:3295 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "or: l'argument %d amb valor negatiu %g donar resultats estranys" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3317 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xort: cridat amb menys de dos arguments" -#: builtin.c:3173 +#: builtin.c:3323 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: l'argument %d no s numric" -#: builtin.c:3177 +#: builtin.c:3327 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: l'argument %d del valor negatiu %g donar resultats estranys" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: s'ha rebut un argument que no s numric" -#: builtin.c:3208 +#: builtin.c:3358 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): el valor negatiu donar resultats estranys" -#: builtin.c:3210 +#: builtin.c:3360 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): el valor fraccionari ser truncat" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' no s una categoria local vlida" @@ -1272,40 +1309,49 @@ msgid "watch var - set a watchpoint for a variable." msgstr "watch var - estableix un punt d'inspecci per a una variable." -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +#, fuzzy +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"backtrace [N] - imprimeix la traa de tot els N marcs interiors (exteriors " +"si N < 0)." + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "error: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "no es pot llegir l'ordre (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "no es pot llegir l'ordre (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "carcter no vlida en la instucci" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "ordre desconeguda - \"%.*s\", prova l'ajuda" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "carcter no vlid" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "ordre no definida: %s\n" @@ -1846,68 +1892,70 @@ msgid "`return' not allowed in current context; statement ignored" msgstr "`return' no est perms al context actual; s'ignorar la declaraci" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "No hi ha un smbol `%s' al context actual" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 msgid "unbalanced [" msgstr "[ sense aparellar" -#: dfa.c:1174 +#: dfa.c:1118 msgid "invalid character class" msgstr "classe no vlida de carcters" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "la sintaxi de la classe de carcters s [[:espai:]], no [:espai:]" -#: dfa.c:1366 +#: dfa.c:1326 msgid "unfinished \\ escape" msgstr "seqncia d'escapada \\ sense finalitzar" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1473 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "Contingut no vlid de \\{\\}" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1476 +#, fuzzy +msgid "regular expression too big" msgstr "L'expressi regular s massa gran" -#: dfa.c:1936 +#: dfa.c:1911 msgid "unbalanced (" msgstr "( sense aparellar" -#: dfa.c:2062 +#: dfa.c:2037 msgid "no syntax specified" msgstr "no s'ha especificat una sintaxi" -#: dfa.c:2070 +#: dfa.c:2045 msgid "unbalanced )" msgstr ") sense aparellar" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "tipus de node %d desconegut" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "opcode %d desconegut" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "l'opcode %s no s un operador o una paraula clau" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "desbordament del cau temporal en genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1918,217 +1966,217 @@ "\t# Pila de crida a les funcions:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' s una extensi de gawk" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' s una extensi de gawk" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "El valor BINMODE `%s' no s vlid, es tractar com 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "`%sFMT' especificaci errnia `%s'" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "desactivant `--lint' degut a una assignaci a `LINT'" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "referncia a un argument sense inicialitzar `%s'" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "referncia a una variable sense inicialitzar `%s'" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "s'ha intentat una referncia de camp a partir d'un valor no numric" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "s'ha intentat entrar una referncia a partir d'una cadena nulla" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "s'ha intentat accedir al camp %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "referncia a una variable sense inicialitzar `$%ld'" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "s'ha cridat a la funci `%s' amb ms arguments dels declarats" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: tipus no esperat `%s'" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "s'ha intentat una divisi per zero en `/='" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "s'ha intentat una divisi per zero en `%%='" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "les extensions no estan permeses en mode de proves" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load sn extensions gawk" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext: s'ha rebut lib_name nul" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: no es pot obrir la llibreria `%s' (%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: biblioteca `%s': no defineix `plugin_is_GPL_compatible' (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: biblioteca `%s': no es pot cridar a la funci `%s' (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" "load_ext: la biblioteca `%s' amb rutina d'inicialitzaci `%s' ha fallat\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "`extension' s una extensi gawk" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "extension: s'ha rebut lib_name nul" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension: no es pot obrir la biblioteca `%s' (%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "extension: biblioteca `%s': no defineix `plugin_is_GPL_compatible' (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "extension: biblioteca `%s': no es pot cridar a la funci `%s' (%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: nom absent de funci" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: no es pot redefinir la funci `%s'" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: la funci `%s' ja est definida" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: nom de la funci `%s' definida prviament" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "make_builtin: no es pot usar el nom intern `%s' com a nom de funci" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: recompte negatiu d'arguments per a la funci `%s'" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: nom absent de funci" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: carcter `%c' illegal al nom de funci `%s'" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: no es pot redefinir la funci `%s'" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: la funci `%s' ja est definida" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: nom de la funci `%s' definida prviament" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "extension: no es pot usar el nom intern `%s' com a nom de funci" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "la funci `%s' est definida per agafar no ms de %d argument(s)" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "funci `%s': falta l'argument #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "" "funci `%s': argument #%d: s'ha intentat usar una dada escalar com a una " "matriu" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "" "funci `%s': argument #%d: s'ha intentat usar una matriu com a un escalar" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "no est suportada la crrega dinmica de la biblioteca" @@ -2272,7 +2320,7 @@ msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin: l'edici in situ ja est activa" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin: s'esperaven 2 arguments per s'ha cridat amb %d" @@ -2305,57 +2353,57 @@ msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin: mkstemp(`%s') ha fallat (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin: ha fallat chmod (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin: dup(stdout) ha fallat(%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin: dup2(%d, stdout) ha fallat (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace begin: close(%d) ha fallat (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" "inplace_end: no es pot obtenir el primer argument com un nom de fitxer " "cadena de carcters" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end: no est activa l'edici in situ" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end: dup2(%d, stdout) ha fallat (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end: close(%d) ha fallat (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end: fsetpos(stdout) ha fallat (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end: link(`%s', `%s') ha fallat (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end: rename(`%s', `%s') ha fallat (%s)" @@ -2397,50 +2445,54 @@ msgid "readfile: called with no arguments" msgstr "readfile: s'ha cridat amb cap argument" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: s'ha cridat amb massa arguments" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: l'argument 0 no s una cadena de carcters\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: l'argument 1 no s una matriu\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: no s'ha pogut aplanar la matriu\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: no s'ha pogut alliberar la matriu aplanada\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: s'ha cridat amb massa arguments" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: l'argument 0 no s una cadena de carcters\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: l'argument 1 no s una matriu\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array ha fallat\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element ha fallat\n" @@ -2469,86 +2521,86 @@ msgid "sleep: not supported on this platform" msgstr "sleep: no est suportat en aquesta plataforma" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF s'inicialitza sobre un valor negatiu" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: el quart argument s una extensi gawk" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: el quart argument no s una matriu" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: el segon argument no s una matriu" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: no es pot usar una submatriu de segon argument per a quart argument" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: no es pot usar una submatriu de segon argument per a quart argument" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: no est pot usar una submatriu de quart argument per a segon argument" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: la cadena nulla per al tercer argument s una extensi de gawk" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: el quart argument no s una matriu" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: el tercer argument no s una matriu" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: el segon argument no s una matriu" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: no es pot usar la mateixa matriu per a segon i quart argument" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: no es pot usar una submatriu de segon argument per a quart argument" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: no es pot usar una submatriu de quart argument per a segon argument" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' s una extensi de gawk" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "valor FIELDWIDTHS no vlid, a prop de `%s'" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "la cadena nulla per a `FS' s una extensi de gawk" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "l'antic awk no suporta expressions regulars com a valor de `FS'" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "`FPAT' s una extensi gawk" @@ -2564,20 +2616,20 @@ msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: s'ha rebut un valor nul" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element: s'ha rebut una matriu nulla" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element: s'ha rebut un subndex nul" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: no s'ha pogut convertir l'ndex %d\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: no s'ha pogut convertir el valor %d\n" @@ -2637,299 +2689,281 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: l'opci `-W %s' requereix un argument\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "l'argument `%s' de lnia d'ordres s un directori: s'ignorar" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "no es pot obrir el fitxer `%s' per a lectura (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "la finalitzaci del descriptor fd %d (`%s') ha fallat (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "no est permeten redireccions en mode de proves" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "l'expressi en la redirecci `%s' solt t un valor numric" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "l'expressi per a la redirecci `%s' t un valor de cadena nulla" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "el fitxer `%s' per a la redirecci `%s' pot ser resultat d'una expressi " "lgica" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "mescla innecessria de `>' i `>>' per al fitxer `%.*s'" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "no es pot obrir la canonada `%s' per a l'eixida (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "no es pot obrir la canonada `%s' per a l'entrada (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" "no es pot obrir una canonada bidireccional `%s' per a les entrades/eixides " "(%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "no es pot redirigir des de `%s' (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "no es pot redirigir cap a `%s' (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "s'ha arribat al lmit del sistema per a fitxers oberts: es comenar a " "multiplexar els descriptors de fitxer" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "la finalitzaci de `%s' ha fallat (%s)" -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "masses canonades o fitxers d'entrada oberts" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: el segon argument hauria de ser `to' o `from'" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: `%.*s' no s un fitxer obert, canonada o co-procs" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "finalitzaci d'una redirecci que no s'ha obert" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: la redirecci `%s' no s'obre amb `|&', s'ignora el segon argument" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "estat de fallada (%d) en la finalitzaci de la canonada `%s' (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "estat de falla (%d) en la finalitzaci del fitxer `%s' (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "no s'aporta la finalitzaci explcita del socket `%s'" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "no s'aporta la finalitzaci explcita del co-procs `%s'" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "no s'aporta la finalitzaci explcita de la canonada `%s'" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "no s'aporta la finalitzaci explcita del fitxer `%s'" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "error en escriure a la sortida estndard (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "error en escriure a la sortida d'error estndard (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "la neteja de la canonada de `%sx' ha fallat (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "la neteja de la canonada per al co-procs de `%sx' ha fallat (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "la neteja del fitxer `%s' ha fallat (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "port local %s no vlid a `/inet'" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "amfitri remot i informaci de port (%s, %s) no vlids" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "no s'aporta cap protocol (conegut) en el nom del fitxer especial `%s'" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "el nom del fitxer especial `%s' est incomplet" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "s'ha de subministrar un nom de sistema remot a `/inet'" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "s'ha de subministrar un port remot a `/inet'" - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "les comunicacions TCP/IP no estan suportades" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "no es pot obrir `%s', mode `%s'" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "ha fallat el tancament del pty mestre (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "" "ha fallat la finalitzaci de la sortida estndard en els processos fills (%s)" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "ha fallat el trasllat del pty esclau cap a l'eixida estndard dels processos " "fills (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "" "ha fallat la finalitzaci de l'entrada estndard en els processos fills (%s)" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "ha fallat el trasllat del pty esclau cap a l'entrada estndard dels " "processos fills (dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "ha fallat el tancament del pty esclau (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "ha fallat la redirecci cap a l'eixida estndard dels processos fills (dup: " "%s)" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "ha fallat la redirecci cap a l'entrada estndard dels processos fills (dup: " "%s)" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" msgstr "ha fallat la restauraci de l'eixida estndard en el procs pare\n" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" msgstr "ha fallat la restauraci de l'entrada estndard en el procs pare\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "ha fallat la finalitzaci de la canonada (%s)" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "`|&' no est suportat" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "no es pot obrir la canonada `%s' (%s)" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "no es pot crear el procs fill per a `%s' (fork: %s)" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser: s'ha rebut un punter nul" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "l'analitzador d'entrades `%s' est en conflicte amb analitzador d'entrades `" "%s' installat prviament" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "l'analitzador d'entrada `%s' no ha pogut obrir `%s'" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper: s'ha rebut un punter nul" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" @@ -2937,16 +2971,16 @@ "l'embolcall de sortida `%s' est en conflicte amb l'embolcall de sortida `" "%s' installat prviament" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "l'embolcall de sortida `%s' no ha pogut obrir `%s'" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor: s'ha rebut un punter nul" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2955,210 +2989,200 @@ "el processsador de dues vies `%s' est en conflicte amb el processador de " "dues vies `%s' installat prviament" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "el processador de dues vies `%s' no ha pogut obrir `%s'" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "el fitxer de dades `%s' est buit" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "no s'ha pogut assignar ms memria d'entrada" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "el valor multicarcter de `RS' s una extensi de gawk" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "la comunicaci IPv6 no est suportada" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "s'ignonar l'argument buit de `-e/--source'" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: no es reconeix l'opci `-W %s', ser ignorada\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: l'opci requereix un argument -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "la variable d'entorn `POSIXLY_CORRECT' est establerta: usant `--posix'" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "`--posix' solapa a `--traditional'" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--posix' i `--traditional' solapen a `--non-decimal-data'" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "executar %s com a setuid root pot ser un problema de seguretat" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "`--posix' anulla a `--characters-as-bytes'" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "no es pot establir el mode binari en l'entrada estndard (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "no es pot establir el mode en l'eixida estndard (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "no es pot establir el mode en l'eixida d'error estndard (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "no hi ha cap text per al programa!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "s: %s [opcions d'estil POSIX o GNU] -f fitx_prog [--] fitxer ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "s: %s [opcions d'estil POSIX o GNU] [--] %cprograma%c fitxer ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "Opcions POSIX:\t\tOpcions llargues GNU: (estndard)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f fitx_prog\t\t--file=fitx_prog\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs (fs=sep_camp)\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=valor\t\t--assign=var=valor\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Opcions curtes:\t\tOpcions llargues GNU: (extensions)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[file]\t\t--dump-variables[=file]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[file]\t\t--debug[=file]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'program-text'\t--source='program-text'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E file\t\t\t--exec=file\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i includefile\t\t--include=fitxer a incloure\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l library\t\t--load=biblioteca\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:591 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:594 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[file]\t\t--pretty-print[=file]\n" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[file]\t\t--profile[=file]\n" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3167,7 +3191,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3179,7 +3203,7 @@ "s la secci `Informant sobre problemes i errors' a la versi impresa.\n" "Informeu dels errors de traducci a \n" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3189,7 +3213,7 @@ "De forma predeterminada llegeix l'entrada estndard i escriu a la sortida " "estndar.\n" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3199,7 +3223,7 @@ "\tgawk '{ sum += $1 }; END { print sum }' fitxer\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3218,7 +3242,7 @@ "Llicncia, o (a la vostra elecci) qualsevol versi posterior.\n" "\n" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3232,7 +3256,7 @@ "Per a ms detalls consulteu la Llicncia Pblica General de GNU.\n" "\n" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3240,16 +3264,16 @@ "Junt amb aquest programa haureu d'haver rebut una cpia de la Llicncia\n" "Pblica General de GNU; si no s aix, vegeu http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft no permet inicialitzar FS a un tabulador en la versi POSIX de awk" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "valor desconegut per a l'especificaci de camp: %d\n" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3258,99 +3282,117 @@ "%s: `%s' l'argument per a `-v' no est en forma `var=valor'\n" "\n" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' no s nom legal de variable" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' no s un valor de variable, s'esperava fitxer `%s=%s'" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "" "no es pot usar el nom de la funci integrada `%s' com a nom de variable" -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "no es pot usar el nom de la funci interna `%s' com nom de variable" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "excepci de coma flotant" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "error fatal: error intern" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "error fatal: error intern: segfault" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "error fatal: error intern: sobreeiximent de pila" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "no s'ha pre-obert el descriptor fd per a %d" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "no es pot pre-obrir /dev/null per al descriptor fd %d" -#: mpfr.c:550 +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "s'ignonar l'argument buit de `-e/--source'" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: no es reconeix l'opci `-W %s', ser ignorada\n" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: l'opci requereix un argument -- %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "Valor PREC `%.*s' no s vlid" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "Valor RNDMODE `%.*s' no s vlid" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s: s'ha rebut un argument que no s numric" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): el valor negatiu donar resultats estranys" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg): el valor fraccionari ser truncat" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "cmpl(%Zd): els valors negatius donaran resultats estranys" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s: s'ha rebut un argument no numric #%d" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: l'argument #%d t valor no vlid %Rg, s'usar 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: l'argument #%d amb valor negatiu %Rg donar resultats estranys" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s: l'argument #%d amb valor fraccional %Rg ser truncat" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%s: l'argument #%d amb valor negatiu %Zd donar resultats estranys" @@ -3360,24 +3402,24 @@ msgid "cmd. line:" msgstr "lnia cmd.:" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "barra invertida al final de la cadena" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "l'antic awk no dna suport a la seqencia d'escapada `\\%c'" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX no permet seqncies d'escapada `\\x'" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "no hi ha dgits hexadecimals en la seqncia d'escapada `\\x'" -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3386,12 +3428,12 @@ "probablement no s'han interpretat els carcters hex escape \\x%.*s of %d de " "la manera que esperveu" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "la seqncia d'escapada `\\%c' s tractada com a una simple `%c'" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3410,25 +3452,25 @@ msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)" msgstr "%s %s `%s': no s'ha pogut establir close-on-exec: (fcntl F_SETFD: %s)" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "no es pot obrir `%s' per a escriptura: %s" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" msgstr "enviant el perfil a l'eixida d'error estndard" -#: profile.c:193 -#, c-format +#: profile.c:213 +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s bloc(s)\n" +"\t# Regla(es)\n" "\n" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" @@ -3437,16 +3479,16 @@ "\t# Regla(es)\n" "\n" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "error intern: %s amb vname nul" -#: profile.c:537 +#: profile.c:558 msgid "internal error: builtin with null fname" msgstr "error intern: funci integrada amb fname nul" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3455,12 +3497,12 @@ "\t# Extensions carregades (-l i/o @load)\n" "\n" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# perfil gawk, creat %s\n" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" @@ -3469,7 +3511,7 @@ "\n" "\t# Funcions, llistades alfabticament\n" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: tipus desconegut de redireccionament %d" @@ -3479,74 +3521,111 @@ msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "el component regexp `%.*s' probablement hauria de ser `[%.*s]'" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "xit" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "No hi ha concordana" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Expressi regular no vlida" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Carcter de comparaci no vlid" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Nom de classe de carcters no vlid" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Barra invertida extra al final" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Referncia cap endarrere no vlida" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "[ o [^ desemparellats" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "( o \\( desemparellats" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "\\{ desemparellat" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Contingut no vlid de \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Final de rang no vlid" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Memria exhaurida" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Expressi regular precedent no vlida" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "F prematura de l'expressi regular" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "L'expressi regular s massa gran" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr ") o \\) desemparellats" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "No hi ha una expressi regular prvia" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "funci `%s: no pot usar el nom de la funci com a parmetre" + +#: symbol.c:809 msgid "can not pop main context" msgstr "no es pot mostrar el context principal" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "`getline var' no s vlid a dins de la regla `%s'" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "" +#~ "no s'aporta cap protocol (conegut) en el nom del fitxer especial `%s'" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "el nom del fitxer especial `%s' est incomplet" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "s'ha de subministrar un nom de sistema remot a `/inet'" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "s'ha de subministrar un port remot a `/inet'" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s bloc(s)\n" +#~ "\n" + #~ msgid "reference to uninitialized element `%s[\"%s\"]'" #~ msgstr "referncia a un element sense valor inicial `%s[\"%s\"]'" @@ -3633,9 +3712,6 @@ #~ msgid "illegal type (%s) in tree_eval" #~ msgstr "tipus illegal (%s) en tree_eval" -#~ msgid "attempt to use function `%s' as array" -#~ msgstr "s'ha intentat usar la funci %s com a una matriu" - #~ msgid "`%s' is a function, assignment is not allowed" #~ msgstr "%s s una funci, l'assignaci no s permesa" diff -urN gawk-4.1.1/po/da.po gawk-4.1.2/po/da.po --- gawk-4.1.1/po/da.po 2014-04-08 19:23:36.000000000 +0300 +++ gawk-4.1.2/po/da.po 2015-04-29 08:36:40.000000000 +0300 @@ -8,10 +8,10 @@ # Review by Ask Hjorth Larsen , 2011. msgid "" msgstr "" -"Project-Id-Version: gawk 4.0.0h\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" -"PO-Revision-Date: 2012-02-06 10:37+0100\n" +"Project-Id-Version: gawk 4.1.1d\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" +"PO-Revision-Date: 2015-04-26 12:37+0200\n" "Last-Translator: Keld Simonsen \n" "Language-Team: Danish \n" "Language: da\n" @@ -40,9 +40,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "forsg p at bruge skalar '%s' som et array" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "forsg p at bruge array '%s' i skalarsammenhng" @@ -58,9 +58,8 @@ msgstr "forsg p at bruge skalaren '%s[\"%.*s\"]' som array" #: array.c:776 -#, fuzzy msgid "adump: first argument not an array" -msgstr "adump: argument er ikke et array" +msgstr "adump: frste argument er ikke et array" #: array.c:815 msgid "asort: second argument not an array" @@ -98,415 +97,418 @@ msgstr "" "asorti: kan ikke bruge et underarray af andet argument for frste argument" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "'%s' er ugyldigt som funktionsnavn" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "funktionen for sorteringssammenligning '%s' er ikke defineret" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "%s-blokke skal have en handlingsdel" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "hver regel skal have et mnster eller en handlingsdel" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "" "gamle versioner af awk understtter ikke flere 'BEGIN'- eller 'END'-regler" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "'%s' er en indbygget funktion, den kan ikke omdefineres" -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "regexp-konstanten '//' ser ud som en C++-kommentar, men er det ikke" -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "regexp-konstanten '/%s/' ser ud som en C-kommentar, men er det ikke" -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "dublet case-vrdier i switch-krop %s" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "dublet 'default' opdaget i switch-krop" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "'break' uden for en lkke eller switch er ikke tilladt" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "'continue' uden for en lkke er ikke tilladt" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "'next' brugt i %s-handling" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "'nextfile' brugt i %s-handling" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "'return' brugt uden for funktion" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "alenestende 'print' i BEGIN eller END-regel skulle muligvis vre 'print " "\"\"'" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" msgstr "" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" msgstr "" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" msgstr "'delete array' er en ikke-portabel udvidelse fra tawk" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "flertrins dobbeltrettede datakanaler fungerer ikke" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "regulrt udtryk i hjreleddet af en tildeling" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "regulrt udtryk p venstre side af en '~'- eller '!~'-operator" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" msgstr "" "gamle versioner af awk understtter ikke ngleordet 'in' undtagen efter 'for'" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "regulrt udtryk i hjreleddet af en sammenligning" -#: awkgram.y:1417 +#: awkgram.y:1410 #, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "'getline var' ugyldig inden i '%s' regel" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "ikke-omdirigeret 'getline' ugyldig inden i '%s'-regel" -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "'getline' ugyldig inden i '%s' regel" - -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" msgstr "ikke-omdirigeret 'getline' udefineret inden i END-handling" -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "gamle versioner af awk understtter ikke flerdimensionale array" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "kald af 'length' uden parenteser er ikke portabelt" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "indirekte funktionskald er en gawk-udvidelse" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "kan ikke bruge specialvariabel '%s' til indirekte funktionskald" +#: awkgram.y:1634 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "forsg p at bruge ikke-funktionen '%s' som et funktionskald" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "ugyldigt indeksudtryk" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "advarsel: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fatal: " -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "uventet nylinjetegn eller strengafslutning" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "kan ikke bne kildefilen '%s' for lsning (%s)" -#: awkgram.y:2384 awkgram.y:2509 -#, fuzzy, c-format +#: awkgram.y:2392 awkgram.y:2517 +#, c-format msgid "can't open shared library `%s' for reading (%s)" -msgstr "kan ikke bne kildefilen '%s' for lsning (%s)" +msgstr "kan ikke bne delt bibliotek '%s' for lsning (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "ukendt rsag" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "allerede inkluderet kildefil '%s'" -#: awkgram.y:2409 -#, fuzzy, c-format +#: awkgram.y:2417 +#, c-format msgid "already loaded shared library `%s'" -msgstr "allerede inkluderet kildefil '%s'" +msgstr "allerede indlst delt bibliotek '%s'" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "@include er en gawk-udvidelse" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "tomt filnavn efter @include" -#: awkgram.y:2494 -#, fuzzy +#: awkgram.y:2502 msgid "@load is a gawk extension" -msgstr "@include er en gawk-udvidelse" +msgstr "@load er en gawk-udvidelse" -#: awkgram.y:2500 -#, fuzzy +#: awkgram.y:2508 msgid "empty filename after @load" -msgstr "tomt filnavn efter @include" +msgstr "tomt filnavn efter @load" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "tom programtekst p kommandolinjen" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "kan ikke lse kildefilen '%s' (%s)" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "kildefilen '%s' er tom" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2958 msgid "source file does not end in newline" msgstr "kildefilen slutter ikke med en ny linje" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "uafsluttet regulrt udtryk slutter med '\\' i slutningen af filen" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "%s: %d: regex-ndringstegn '/.../%c' fra tawk virker ikke i gawk" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "regex-ndringstegn '/.../%c' fra tawk virker ikke i gawk" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "uafsluttet regulrt udtryk" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "uafsluttet regulrt udtryk i slutningen af filen" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" msgstr "brug af '\\ #...' for linjefortsttelse er ikke portabelt" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "sidste tegn p linjen er ikke en omvendt skrstreg" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "POSIX tillader ikke operatoren '**='" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "gamle versioner af awk understtter ikke operatoren '**='" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "POSIX tillader ikke operatoren '**'" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "gamle versioner af awk understtter ikke operatoren '**'" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "operatoren '^=' understttes ikke i gamle versioner af awk" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "operatoren '^' understttes ikke i gamle versioner af awk" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "uafsluttet streng" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "ugyldigt tegn '%c' i udtryk" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "'%s' er en gawk-udvidelse" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX tillader ikke '%s'" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "'%s' understttes ikke i gamle versioner af awk" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "'goto' anses for skadelig!\n" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d er et ugyldigt antal argumenter for %s" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: bogstavelig streng som sidste argument til erstatning har ingen effekt" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s: tredje argument er ikke et ndringsbart objekt" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "match: tredje argument er en gawk-udvidelse" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "close: andet argument er en gawk-udvidelse" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "brug af dcgettext(_\"...\") er forkert: fjern det indledende " "understregningstegn" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "brug af dcgettext(_\"...\") er forkert: fjern det indledende " "understregningstegn" -#: awkgram.y:4016 +#: awkgram.y:4050 #, fuzzy msgid "index: regexp constant as second argument is not allowed" msgstr "indeks: andet argument er ikke en streng" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funktionen '%s': parameteren '%s' overskygger en global variabel" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "kunne ikke bne '%s' for skrivning (%s)" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "sender variabelliste til standard fejl" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "%s: lukning mislykkedes (%s)" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() kaldt to gange!" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "der var skyggede variable." -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "funktionsnavnet '%s' er allerede defineret" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "funktionen '%s': kan ikke bruge funktionsnavn som parameternavn" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "funktionen '%s': kan ikke bruge specialvariabel '%s' som en " "funktionsparameter" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funktionen '%s': parameter %d, '%s', er samme som parameter %d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "funktionen '%s' kaldt, men aldrig defineret" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "funktionen '%s' defineret, men aldrig kaldt direkte" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "konstant regulrt udtryk for parameter %d giver en boolesk vrdi" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -515,21 +517,21 @@ "funktionen '%s' kaldt med blanktegn mellem navnet og '(',\n" "eller brugt som en variabel eller et array" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "forsgte at dividere med nul" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "forsgte at dividere med nul i '%%'" -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" -#: awkgram.y:5052 +#: awkgram.y:5012 #, fuzzy, c-format msgid "invalid target of assignment (opcode %s)" msgstr "%d er et ugyldigt antal argumenter for %s" @@ -568,189 +570,198 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: '%s' er ikke en ben fil, datakanal eller ko-proces" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "indeks: frste argument er ikke en streng" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "indeks: andet argument er ikke en streng" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: fik et ikke-numerisk argument" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: fik et array-argument" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "'length(array)' er en gawk-udvidelse" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: fik et argument som ikke er en streng" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: fik et ikke-numerisk argument" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: fik et negativt argument %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "fatal: skal bruge 'count$' p alle formater eller ikke nogen" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "feltbredde ignoreret for '%%'-angivelse" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "prcision ignoreret for '%%'-angivelse" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "feltbredde og prcision ignoreret for '%%'-angivelse" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "fatal: '$' tillades ikke i awk-formater" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fatal: argumentantallet med '$' skal vre > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "fatal: argumentantallet %ld er strre end antal givne argumenter" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "fatal: '$' tillades ikke efter et punktum i formatet" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "fatal: intet '$' angivet for bredde eller prcision af positionsangivet felt" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "'l' er meningslst i awk-formater, ignoreret" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "fatal: 'l' tillades ikke i POSIX awk-formater" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "'L' er meningslst i awk-formater, ignoreret" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "fatal: 'L' tillades ikke i POSIX awk-formater" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "'h' er meningslst i awk-formater, ignoreret" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "fatal: 'h' tillades ikke i POSIX awk-formater" -#: builtin.c:1463 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: vrdi %g er for stor for %%c-format" + +#: builtin.c:1068 +#, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: vrdi %g er ikke et gyldigt bredt tegn" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: vrdi %g er uden for omrde for '%%%c'-format" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "ignorerer ukendt formatspecificeringstegn '%c': intet argument konverteret" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "fatal: for f argumenter til formatstrengen" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ sluttede her" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: formatspecifikation har intet kommandobogstav" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "for mange argumenter til formatstrengen" -#: builtin.c:1634 -#, fuzzy +#: builtin.c:1625 msgid "sprintf: no arguments" -msgstr "printf: ingen argumenter" +msgstr "sprintf: ingen argumenter" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: ingen argumenter" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: fik ikke-numerisk argument" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: kaldt med negativt argument %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: lngden %g er ikke >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: lngden %g er ikke >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: lngden %g som ikke er et heltal vil blive trunkeret" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: lngden %g for stor til strengindeksering, trunkerer til %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: startindeks %g er ugyldigt, bruger 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: startindeks %g som ikke er et heltal vil blive trunkeret" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: kildestrengen er tom" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: startindeks %g er forbi slutningen p strengen" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -758,191 +769,206 @@ "substr: lngden %g ved startindeks %g overskrider lngden af frste argument " "(%lu)" -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "strftime: formatvrdi i PROCINFO[\"strftime\"] har numerisk type" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" msgstr "strftime: fik et ikke-numerisk andet argument" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "strftime: andet argument mindre end 0 eller for stort til time_t" -#: builtin.c:1934 +#: builtin.c:1932 +msgid "strftime: second argument out of range for time_t" +msgstr "strftime: andet argument uden for omrde for time_t" + +#: builtin.c:1941 msgid "strftime: received non-string first argument" msgstr "strftime: fik et frste argument som ikke er en streng" -#: builtin.c:1941 +#: builtin.c:1948 msgid "strftime: received empty format string" msgstr "strftime: fik en tom formatstreng" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" msgstr "mktime: fik et argument som ikke er en streng" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: mindst n af vrdierne er udenfor standardomrdet" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "'system'-funktion ikke tilladt i sandkasse-tilstand" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" msgstr "system: fik et argument som ikke er en streng" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "reference til ikke-initieret felt '$%d'" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" msgstr "tolower: fik et argument som ikke er en streng" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" msgstr "toupper: fik et argument som ikke er en streng" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: fik et ikke-numerisk frste argument" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: fik et ikke-numerisk andet argument" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" msgstr "sin: fik et ikke-numerisk argument" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" msgstr "cos: fik et ikke-numerisk argument" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: fik et ikke-numerisk argument" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "match: tredje argument er ikke et array" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" -msgstr "gensub: 0 i tredje argument behandlet som 1" +#: builtin.c:2725 +#, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "gensub: tredje argument '%.*s' behandlet som 1" -#: builtin.c:3030 +#: builtin.c:2740 +#, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: tredje argument %g behandlet som 1" + +#: builtin.c:3038 +#, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "%s: kan kun kaldes indirekte med to argumenter" + +#: builtin.c:3128 +#, c-format +msgid "indirect call to %s requires at least two arguments" +msgstr "indirekte kald til %s krver mindst to argumenter" + +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" msgstr "lshift: fik et ikke-numerisk frste argument" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" msgstr "lshift: fik et ikke-numerisk andet argument" -#: builtin.c:3038 -#, fuzzy, c-format +#: builtin.c:3188 +#, c-format msgid "lshift(%f, %f): negative values will give strange results" -msgstr "lshift(%lf, %lf): negative vrdier vil give mrkelige resultater" +msgstr "lshift(%f, %f): negative vrdier vil give mrkelige resultater" -#: builtin.c:3040 -#, fuzzy, c-format +#: builtin.c:3190 +#, c-format msgid "lshift(%f, %f): fractional values will be truncated" -msgstr "lshift(%lf, %lf): kommatalsvrdier vil blive trunkeret" +msgstr "lshift(%f, %f): kommatalsvrdier vil blive trunkeret" -#: builtin.c:3042 -#, fuzzy, c-format +#: builtin.c:3192 +#, c-format msgid "lshift(%f, %f): too large shift value will give strange results" -msgstr "" -"lshift(%lf, %lf): for store skiftevrdier vil give mrkelige resultater" +msgstr "lshift(%f, %f): for stor skiftevrdi vil give mrkelige resultater" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" msgstr "rshift: fik et ikke-numerisk frste argument" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" msgstr "rshift: fik et ikke-numerisk andet argument" -#: builtin.c:3075 -#, fuzzy, c-format +#: builtin.c:3225 +#, c-format msgid "rshift(%f, %f): negative values will give strange results" -msgstr "rshift(%lf, %lf): negative vrdier vil give mrkelige resultater" +msgstr "rshift(%f, %f): negative vrdier vil give mrkelige resultater" -#: builtin.c:3077 -#, fuzzy, c-format +#: builtin.c:3227 +#, c-format msgid "rshift(%f, %f): fractional values will be truncated" -msgstr "rshift(%lf, %lf): kommatalsvrdier vil blive trunkeret" +msgstr "rshift(%f, %f): kommatalsvrdier vil blive trunkeret" -#: builtin.c:3079 -#, fuzzy, c-format +#: builtin.c:3229 +#, c-format msgid "rshift(%f, %f): too large shift value will give strange results" -msgstr "" -"rshift(%lf, %lf): for store skiftevrdier vil give mrkelige resultater" +msgstr "rshift(%f, %f): for stor skiftevrdi vil give mrkelige resultater" -#: builtin.c:3104 mpfr.c:968 -#, fuzzy +#: builtin.c:3254 mpfr.c:988 msgid "and: called with less than two arguments" -msgstr "sqrt: kaldt med negativt argument %g" +msgstr "and: kaldt med mindre end to argumenter" -#: builtin.c:3109 -#, fuzzy, c-format +#: builtin.c:3259 +#, c-format msgid "and: argument %d is non-numeric" -msgstr "exp: argumentet %g er uden for det tilladte omrde" +msgstr "and: argumentet %d er ikke-numerisk" -#: builtin.c:3113 +#: builtin.c:3263 #, fuzzy, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and(%lf, %lf): negative vrdier vil give mrkelige resultater" -#: builtin.c:3136 mpfr.c:1000 -#, fuzzy +#: builtin.c:3286 mpfr.c:1020 msgid "or: called with less than two arguments" -msgstr "sqrt: kaldt med negativt argument %g" +msgstr "or: kaldt med mindre end to argumenter" -#: builtin.c:3141 -#, fuzzy, c-format +#: builtin.c:3291 +#, c-format msgid "or: argument %d is non-numeric" -msgstr "exp: argumentet %g er uden for det tilladte omrde" +msgstr "or: argumentet %d er ikke-numerisk" -#: builtin.c:3145 -#, fuzzy, c-format +#: builtin.c:3295 +#, c-format msgid "or: argument %d negative value %g will give strange results" -msgstr "compl(%lf): negative vrdier vil give mrkelige resultater" +msgstr "or: argument %d negativ vrdi %g vil give mrkelige resultater" -#: builtin.c:3167 mpfr.c:1031 -#, fuzzy +#: builtin.c:3317 mpfr.c:1051 msgid "xor: called with less than two arguments" -msgstr "sqrt: kaldt med negativt argument %g" +msgstr "zor: kaldt med mindre end to argumenter" -#: builtin.c:3173 -#, fuzzy, c-format +#: builtin.c:3323 +#, c-format msgid "xor: argument %d is non-numeric" -msgstr "exp: argumentet %g er uden for det tilladte omrde" +msgstr "xor: argumentet %d er ikke-numerisk" -#: builtin.c:3177 -#, fuzzy, c-format +#: builtin.c:3327 +#, c-format msgid "xor: argument %d negative value %g will give strange results" -msgstr "xor(%lf, %lf): negative vrdier vil give mrkelige resultater" +msgstr "xor: argument %d negativ vrdi %g vil give mrkelige resultater" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: fik et ikke-numerisk argument" -#: builtin.c:3208 -#, fuzzy, c-format +#: builtin.c:3358 +#, c-format msgid "compl(%f): negative value will give strange results" -msgstr "compl(%lf): negative vrdier vil give mrkelige resultater" +msgstr "compl(%f): negativ vrdi vil give mrkelige resultater" -#: builtin.c:3210 +#: builtin.c:3360 #, fuzzy, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%lf): kommatalsvrdier vil blive trunkeret" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: '%s' er ikke en gyldig lokalitetskategori" @@ -958,9 +984,9 @@ msgstr "Ugyldig intervalslutning" #: command.y:295 -#, fuzzy, c-format +#, c-format msgid "info: invalid option - \"%s\"" -msgstr "%s: ugyldigt flag - '%c'\n" +msgstr "info: ugyldigt flag - '%s'" #: command.y:321 #, c-format @@ -1003,18 +1029,17 @@ msgstr "" #: command.y:373 -#, fuzzy, c-format +#, c-format msgid "trace: invalid option - \"%s\"" -msgstr "%s: ugyldigt flag - '%c'\n" +msgstr "trace: ugyldigt flag - '%s'" #: command.y:387 msgid "condition: invalid breakpoint/watchpoint number" msgstr "" #: command.y:449 -#, fuzzy msgid "argument not a string" -msgstr "exp: argumentet %g er uden for det tilladte omrde" +msgstr "argument er ikke en streng" #: command.y:459 command.y:464 #, c-format @@ -1224,42 +1249,48 @@ msgid "watch var - set a watchpoint for a variable." msgstr "" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "fejl: " -#: command.y:1051 +#: command.y:1053 #, fuzzy, c-format msgid "can't read command (%s)\n" msgstr "kan ikke omdirigere fra '%s' (%s)" -#: command.y:1065 +#: command.y:1067 #, fuzzy, c-format msgid "can't read command (%s)" msgstr "kan ikke omdirigere fra '%s' (%s)" -#: command.y:1116 +#: command.y:1118 #, fuzzy msgid "invalid character in command" msgstr "Ugyldigt tegnklassenavn" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "" -#: command.y:1284 +#: command.y:1286 #, fuzzy msgid "invalid character" msgstr "Ugyldigt sorteringstegn" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "" @@ -1721,7 +1752,7 @@ #: debug.c:3424 #, fuzzy, c-format msgid "element not in array\n" -msgstr "delete: indeks '%s' findes ikke i array '%s'" +msgstr "adump: argument er ikke et array" #: debug.c:3424 #, c-format @@ -1775,69 +1806,71 @@ msgid "`return' not allowed in current context; statement ignored" msgstr "'exit' kan ikke kaldes i den aktuelle kontekst" -#: debug.c:5590 +#: debug.c:5604 #, fuzzy, c-format msgid "No symbol `%s' in current context" msgstr "forsg p at bruge array '%s' i skalarsammenhng" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 msgid "unbalanced [" msgstr "" -#: dfa.c:1174 +#: dfa.c:1118 #, fuzzy msgid "invalid character class" msgstr "Ugyldigt tegnklassenavn" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "" -#: dfa.c:1366 +#: dfa.c:1326 msgid "unfinished \\ escape" msgstr "" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1473 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "Ugyldigt indhold i \\{\\}" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1476 +#, fuzzy +msgid "regular expression too big" msgstr "Regulrt udtryk for stort" -#: dfa.c:1936 +#: dfa.c:1911 msgid "unbalanced (" msgstr "" -#: dfa.c:2062 +#: dfa.c:2037 msgid "no syntax specified" msgstr "" -#: dfa.c:2070 +#: dfa.c:2045 msgid "unbalanced )" msgstr "" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "ukendt nodetype %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "ukendt opkode %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "opkode %s er ikke en operator eller et ngleord" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "bufferoverlb i genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1848,94 +1881,94 @@ "\t# Funktionskaldsstak:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "'IGNORECASE' er en gawk-udvidelse" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "'BINMODE' er en gawk-udvidelse" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "BINMODE vrdi '%s' er ugyldig, behandles som 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "forkert '%sFMT'-specifikation '%s'" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "deaktiverer '--lint' p grund af en tildeling til 'LINT'" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "reference til ikke-initieret argument '%s'" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "reference til ikke-initieret variabel '%s'" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "forsg p at referere til et felt fra ikke-numerisk vrdi" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "forsg p at referere til et felt fra tom streng" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "forsg p at f adgang til felt %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "reference til ikke-initieret felt '$%ld'" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "funktionen '%s' kaldt med flere argumenter end deklareret" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: uventet type `%s'" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "forsgte at dividere med nul i '/='" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "forsgte at dividere med nul i '%%='" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "udvidelser er ikke tilladt i sandkasse-tilstand" -#: ext.c:92 +#: ext.c:68 #, fuzzy msgid "-l / @load are gawk extensions" msgstr "@include er en gawk-udvidelse" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "" -#: ext.c:98 +#: ext.c:74 #, fuzzy, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "atalt: extension: kan ikke bne '%s' (%s)\n" -#: ext.c:104 +#: ext.c:80 #, fuzzy, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" @@ -1943,31 +1976,31 @@ "fatalt: extension: bibliotek '%s': definer ikke " "'plugin_is_GPL_compatible' (%s)\n" -#: ext.c:110 +#: ext.c:86 #, fuzzy, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "" "fatalt: extension: bibliotek '%s': kan ikke kalde funktionen '%s' (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "'extension' er en gawk-udvidelse" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "" -#: ext.c:180 +#: ext.c:156 #, fuzzy, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "atalt: extension: kan ikke bne '%s' (%s)\n" -#: ext.c:186 +#: ext.c:162 #, fuzzy, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" @@ -1975,95 +2008,94 @@ "fatalt: extension: bibliotek '%s': definer ikke " "'plugin_is_GPL_compatible' (%s)\n" -#: ext.c:190 +#: ext.c:166 #, fuzzy, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "" "fatalt: extension: bibliotek '%s': kan ikke kalde funktionen '%s' (%s)\n" -#: ext.c:221 +#: ext.c:197 #, fuzzy msgid "make_builtin: missing function name" msgstr "extension: mangler funktionsnavn" -#: ext.c:236 +#: ext.c:212 #, fuzzy, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "extension: kan ikke omdefinere funktion '%s'" -#: ext.c:240 +#: ext.c:216 #, fuzzy, c-format msgid "make_builtin: function `%s' already defined" msgstr "extension: funktionen '%s' er allerede defineret" -#: ext.c:244 +#: ext.c:220 #, fuzzy, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "extension: funktionsnavnet '%s' er defineret tidligere" -#: ext.c:246 +#: ext.c:222 #, fuzzy, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "extension: kan ikke bruge gawk's indbyggede '%s' som funktionsnavn" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: negativt argumentantal for funktion '%s'" -#: ext.c:276 -#, fuzzy +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: mangler funktionsnavn" -#: ext.c:279 ext.c:283 -#, fuzzy, c-format +#: ext.c:255 ext.c:259 +#, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: ugyldigt tegn '%c' i funktionsnavn '%s'" -#: ext.c:291 -#, fuzzy, c-format +#: ext.c:267 +#, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: kan ikke omdefinere funktion '%s'" -#: ext.c:295 -#, fuzzy, c-format +#: ext.c:271 +#, c-format msgid "extension: function `%s' already defined" msgstr "extension: funktionen '%s' er allerede defineret" -#: ext.c:299 -#, fuzzy, c-format +#: ext.c:275 +#, c-format msgid "extension: function name `%s' previously defined" -msgstr "funktionsnavnet '%s' er allerede defineret" +msgstr "extension: funktionsnavnet '%s' er defineret tidligere" -#: ext.c:301 -#, fuzzy, c-format +#: ext.c:277 +#, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "extension: kan ikke bruge gawk's indbyggede '%s' som funktionsnavn" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "funktionen '%s' defineret til at tage ikke mere end %d argumenter" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "funktion '%s': mangler argument nummer %d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "" "funktion '%s': argument nummer %d: forsg p at bruge skalar som et array" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "" "funktion '%s': argument nummer %d: forsg p at bruge array som en skalar" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "" @@ -2088,9 +2120,9 @@ msgstr "%s: er parameter\n" #: extension/filefuncs.c:533 -#, fuzzy, c-format +#, c-format msgid "fts init: could not create variable %s" -msgstr "indeks: andet argument er ikke en streng" +msgstr "" #: extension/filefuncs.c:554 #, fuzzy @@ -2106,9 +2138,8 @@ msgstr "" #: extension/filefuncs.c:597 -#, fuzzy msgid "fill_path_element: could not set element" -msgstr "indeks: andet argument er ikke en streng" +msgstr "" #: extension/filefuncs.c:613 msgid "fill_error_element: could not set element" @@ -2120,9 +2151,8 @@ #: extension/filefuncs.c:670 extension/filefuncs.c:717 #: extension/filefuncs.c:735 -#, fuzzy msgid "fts-process: could not set element" -msgstr "indeks: andet argument er ikke en streng" +msgstr "" #: extension/filefuncs.c:784 #, fuzzy @@ -2145,9 +2175,8 @@ msgstr "%s: er parameter\n" #: extension/filefuncs.c:806 -#, fuzzy msgid "fts: could not flatten array\n" -msgstr "'%s' er ikke et gyldigt variabelnavn" +msgstr "" #: extension/filefuncs.c:824 msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah." @@ -2226,7 +2255,7 @@ msgid "inplace_begin: in-place editing already active" msgstr "" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "" @@ -2246,64 +2275,64 @@ msgstr "atalt: extension: kan ikke bne '%s' (%s)\n" #: extension/inplace.c:158 -#, fuzzy, c-format +#, c-format msgid "inplace_begin: `%s' is not a regular file" -msgstr "'%s' er ikke et gyldigt variabelnavn" +msgstr "" #: extension/inplace.c:169 #, c-format msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, fuzzy, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "%s: lukning mislykkedes (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, fuzzy, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "%s: lukning mislykkedes (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, fuzzy, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "%s: lukning mislykkedes (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, fuzzy, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "datakanalsrensning af '%s' mislykkedes (%s)." -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, fuzzy, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "lukning af fd %d ('%s') mislykkedes (%s)" @@ -2353,52 +2382,56 @@ msgid "readfile: called with no arguments" msgstr "sqrt: kaldt med negativt argument %g" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 #, fuzzy msgid "writea: called with too many arguments" msgstr "sqrt: kaldt med negativt argument %g" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, fuzzy, c-format msgid "do_writea: argument 0 is not a string\n" -msgstr "exp: argumentet %g er uden for det tilladte omrde\n" +msgstr "exp: argumentet %g er uden for det tilladte omrde" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, fuzzy, c-format msgid "do_writea: argument 1 is not an array\n" -msgstr "split: fjerde argument er ikke et array\n" +msgstr "split: fjerde argument er ikke et array" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 #, fuzzy msgid "reada: called with too many arguments" msgstr "sqrt: kaldt med negativt argument %g" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, fuzzy, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "exp: argumentet %g er uden for det tilladte omrde" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, fuzzy, c-format msgid "do_reada: argument 1 is not an array\n" -msgstr "match: tredje argument er ikke et array" +msgstr "adump: argument er ikke et array" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "" @@ -2431,84 +2464,84 @@ msgid "sleep: not supported on this platform" msgstr "" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF sat til en negativ vrdi" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: fjerde argument er en gawk-udvidelse" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: fjerde argument er ikke et array" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: andet argument er ikke et array" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "split: kan ikke bruge det samme array som andet og fjerde argument" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: kan ikke bruge et underarray af andet argument som fjerde argument" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: kan ikke bruge et underarray af fjerde argument som andet argument" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: tom streng som tredje argument er en gawk-udvidelse" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: fjerde argument er ikke et array" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: andet argument er ikke et array" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patmatch: tredje argument er ikke et array" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "patsplit: kan ikke bruge det samme array som andet og fjerde argument" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: kan ikke bruge et underarray af andet argument som fjerde argument" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: kan ikke bruge et underarray af fjerde argument som andet argument" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "'FIELDWIDTHS' er en gawk-udvidelse" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "ugyldig FIELDWIDTHS vrdi, nr '%s" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "tom streng som 'FS' er en gawk-udvidelse" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "gamle versioner af awk understtter ikke regexp'er som vrdi for 'FS'" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "'FPAT' er en gawk-udvidelse" @@ -2524,21 +2557,21 @@ msgid "node_to_awk_value: received null val" msgstr "" -#: gawkapi.c:807 +#: gawkapi.c:809 #, fuzzy msgid "remove_element: received null array" msgstr "length: fik et array-argument" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "" @@ -2598,516 +2631,488 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: flaget '-W %s' krver et argument\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "kommandolinjeargument '%s' er et katalog, oversprunget" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "kan ikke bne filen '%s' for lsning (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "lukning af fd %d ('%s') mislykkedes (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "omdirigering ikke tilladt i sandkasse-tilstand" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "udtrykket i '%s'-omdirigering har kun numerisk vrdi" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "udtrykket for '%s'-omdirigering har en tom streng som vrdi" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "filnavnet '%s' for '%s'-omdirigering kan vre resultatet af et logisk udtryk" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "undig blanding af '>' og '>>' for filen '%.*s'" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "kan ikke bne datakanalen '%s' for udskrivning (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "kan ikke bne datakanalen '%s' for indtastning (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "kan ikke bne tovejsdatakanalen '%s' for ind-/uddata (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "kan ikke omdirigere fra '%s' (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "kan ikke omdirigere til '%s' (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "nede systembegrnsningen for bne filer: begynder at multiplekse " "fildeskriptorer" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "lukning af '%s' mislykkedes (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "for mange datakanaler eller inddatafiler bne" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: andet argument skal vre 'to' eller 'from'" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: '%.*s' er ikke en ben fil, datakanal eller ko-proces" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "lukning af omdirigering som aldrig blev bnet" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: omdirigeringen '%s' blev ikke bnet med '|&', andet argument ignoreret" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "fejlstatus (%d) fra lukning af datakanalen '%s' (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "fejlstatus (%d) fra fillukning af '%s' (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "ingen eksplicit lukning af soklen '%s' angivet" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "ingen eksplicit lukning af ko-processen '%s' angivet" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "ingen eksplicit lukning af datakanalen '%s' angivet" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "ingen eksplicit lukning af filen '%s' angivet" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "fejl ved skrivning til standard ud (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "fejl ved skrivning til standard fejl (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "datakanalsrensning af '%s' mislykkedes (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "ko-procesrensning af datakanalen til '%s' mislykkedes (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "filrensning af '%s' mislykkedes (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "lokal port %s ugyldig i '/inet'" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "fjernvrt og portinformation (%s, %s) ugyldige" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "ingen (kendt) protokol opgivet i special-filnavn '%s'" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "special-filnavn '%s' er ufuldstndigt" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "fjernmaskinenavn til '/inet' skal angives" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "fjernport til '/inet' skal angives" - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "TCP/IP-kommunikation understttes ikke" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "kunne ikke bne '%s', tilstand '%s'" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "lukning af master-pty mislykkedes (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "lukning af standard ud i underproces mislykkedes (%s)" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "flytning af slave-pty til standard ud i underproces mislykkedes (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "lukning af standard ind i underproces mislykkedes (%s)" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "flytning af slave-pty til standard ind i underproces mislykkedes (dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "lukning af slave-pty mislykkedes (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "flytning af datakanal til standard ud i underproces mislykkedes (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "flytning af datakanalen til standard ind i underproces mislykkedes (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" msgstr "genskabelse af standard ud i forlderprocessen mislykkedes\n" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" msgstr "genskabelse af standard ind i forlderprocessen mislykkedes\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "lukning af datakanalen mislykkedes (%s)" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "'|&' understttes ikke" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "kan ikke bne datakanalen '%s' (%s)" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "kan ikke oprette barneproces for '%s' (fork: %s)" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" msgstr "" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" msgstr "" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" msgstr "" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " "`%s'" msgstr "" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "datafilen '%s' er tom" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "kunne ikke allokere mere hukommelse til inddata" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "'RS' som flertegnsvrdi er en gawk-udvidelse" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "IPv6-kommunikation understttes ikke" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "tomt argument til '-e/--source' ignoreret" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: flaget '-W %s' ukendt, ignoreret\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: flaget krver et argument -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "miljvariablen 'POSIXLY_CORRECT' sat: aktiverer '--posix'" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "'--posix' tilsidestter '--traditional'" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "'--posix'/'--traditional' tilsidestter '--non-decimal-data'" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "at kre %s setuid root kan vre et sikkerhedsproblem" -#: main.c:588 +#: main.c:346 #, fuzzy msgid "`--posix' overrides `--characters-as-bytes'" msgstr "'--posix' tilsidestter '--binary'" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "kan ikke stte binr tilstand p standard ind (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "kan ikke stte binr tilstand p standard ud (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "kan ikke stte binr tilstand p standard fejl (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "ingen programtekst overhovedet!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Brug: %s [flag i POSIX- eller GNU-stil] -f progfil [--] fil ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Brug: %s [flag i POSIX- eller GNU-stil] %cprogram%c fil ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "POSIX-flag:\t\tlange GNU-flag: (standard)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f progfil\t\t--file=progfil\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=vrdi\t\t--assign=var=vrdi\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "POSIX-flag:\t\tlange GNU-flag: (udvidelser)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[fil]\t\t--dump-variables[=fil]\n" -#: main.c:815 +#: main.c:579 #, fuzzy msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-p[fil]\t\t--profile[=fil]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'programtekst'\t--source='programtekst'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E fil\t\t\t--exec=fil\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:591 #, fuzzy msgid "\t-M\t\t\t--bignum\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:594 #, fuzzy msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-p[fil]\t\t--profile[=fil]\n" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[fil]\t\t--profile[=fil]\n" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3116,7 +3121,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3129,7 +3134,7 @@ "\n" "Rapportr kommentarer til oversttelsen til .\n" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3139,7 +3144,7 @@ "Almindeligvis lser gawk fra standard ind og skriver til standard ud.\n" "\n" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3149,7 +3154,7 @@ "\tgawk '{ sum += $1 }; END { print sum }' fil\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3169,7 +3174,7 @@ "enhver senere version.\n" "\n" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3183,7 +3188,7 @@ "General Public License for yderligere information.\n" "\n" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3191,16 +3196,16 @@ "Du br have fet en kopi af GNU General Public License sammen\n" "med dette program. Hvis ikke, s se http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft stter ikke FS til tab i POSIX-awk" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "ukendt vrdi for felt-spec: %d\n" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3209,129 +3214,147 @@ "%s: '%s' argument til '-v' ikke p formen 'var=vrdi'\n" "\n" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "'%s' er ikke et gyldigt variabelnavn" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "'%s' er ikke et variabelnavn, leder efter fil '%s=%s'" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "kan ikke bruge gawk's indbyggede '%s' som variabelnavn" -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "kan ikke bruge funktion '%s' som variabelnavn" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "flydendetalsundtagelse" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "fatal fejl: intern fejl" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "fatal fejl: intern fejl: segmentfejl" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "fatal fejl: intern fejl: stakoverlb" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "ingen fd %d bnet i forvejen" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "kunne ikke i forvejen bne /dev/null for fd %d" -#: mpfr.c:550 +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "tomt argument til '-e/--source' ignoreret" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: flaget '-W %s' ukendt, ignoreret\n" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: flaget krver et argument -- %c\n" + +#: mpfr.c:557 #, fuzzy, c-format msgid "PREC value `%.*s' is invalid" msgstr "BINMODE vrdi '%s' er ugyldig, behandles som 3" -#: mpfr.c:608 +#: mpfr.c:615 #, fuzzy, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "BINMODE vrdi '%s' er ugyldig, behandles som 3" -#: mpfr.c:698 +#: mpfr.c:711 #, fuzzy, c-format msgid "%s: received non-numeric argument" msgstr "cos: fik et ikke-numerisk argument" -#: mpfr.c:800 +#: mpfr.c:820 #, fuzzy msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%lf): negative vrdier vil give mrkelige resultater" -#: mpfr.c:804 +#: mpfr.c:824 #, fuzzy msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%lf): kommatalsvrdier vil blive trunkeret" -#: mpfr.c:816 +#: mpfr.c:836 #, fuzzy, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "compl(%lf): negative vrdier vil give mrkelige resultater" -#: mpfr.c:835 +#: mpfr.c:855 #, fuzzy, c-format msgid "%s: received non-numeric argument #%d" msgstr "cos: fik et ikke-numerisk argument" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "" -#: mpfr.c:857 +#: mpfr.c:877 #, fuzzy msgid "%s: argument #%d negative value %Rg will give strange results" -msgstr "compl(%lf): negative vrdier vil give mrkelige resultater" +msgstr "and(%lf, %lf): negative vrdier vil give mrkelige resultater" -#: mpfr.c:863 +#: mpfr.c:883 #, fuzzy msgid "%s: argument #%d fractional value %Rg will be truncated" -msgstr "or(%lf, %lf): kommatalsvrdier vil blive trunkeret" +msgstr "and(%lf, %lf): kommatalsvrdier vil blive trunkeret" -#: mpfr.c:878 +#: mpfr.c:898 #, fuzzy, c-format msgid "%s: argument #%d negative value %Zd will give strange results" -msgstr "compl(%lf): negative vrdier vil give mrkelige resultater" +msgstr "and(%lf, %lf): negative vrdier vil give mrkelige resultater" #: msg.c:68 #, c-format msgid "cmd. line:" msgstr "kommandolinje:" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "omvendt skrstreg i slutningen af strengen" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "gamle versioner af awk understtter ikke '\\%c' undvigesekvens" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX tillader ikke '\\x'-kontrolsekvenser" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "ingen heksadecimale cifre i '\\x'-kontrolsekvenser" -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3340,12 +3363,12 @@ "den heksadecimale sekvens \\x%.*s p %d tegn nok ikke forstet som du " "forventer det" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "kontrolsekvensen '\\%c' behandlet som kun '%c'" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3363,25 +3386,25 @@ msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)" msgstr "%s %s '%s': kunne ikke stte luk-ved-exec (fcntl F_SETFD: %s)" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "kunne ikke bne '%s' for skrivning: %s" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" msgstr "sender profilen til standard fejl" -#: profile.c:193 -#, c-format +#: profile.c:213 +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s blokke\n" +"\t# Regler\n" "\n" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" @@ -3390,29 +3413,29 @@ "\t# Regler\n" "\n" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "intern fejl: %s med null vname" -#: profile.c:537 +#: profile.c:558 #, fuzzy msgid "internal error: builtin with null fname" msgstr "intern fejl: %s med null vname" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" "\n" msgstr "" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# profil til gawk oprettet %s\n" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" @@ -3421,7 +3444,7 @@ "\n" "\t# Funktioner, listede alfabetisk\n" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: uykendt omdirigeringstype %d" @@ -3431,132 +3454,141 @@ msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "regexp-komponent `%.*s' skulle nok vre `[%.*s]'" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Lykkedes" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Mislykkedes" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Ugyldigt regulrt udtryk" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Ugyldigt sorteringstegn" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Ugyldigt tegnklassenavn" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Efterflgende omvendt skrstreg" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Ugyldig bagudreference" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "Ubalanceret [ eller [^" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "Ubalanceret ( eller \\(" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "Ubalanceret \\{" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Ugyldigt indhold i \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Ugyldig intervalslutning" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Hukommelsen opbrugt" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Ugyldigt foregende regulrt udtryk" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "For tidligt slut p regulrt udtryk" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Regulrt udtryk for stort" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "Ubalanceret ) eller \\)" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Intet foregende regulrt udtryk" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "funktionen '%s': kan ikke bruge funktionsnavn som parameternavn" + +#: symbol.c:809 msgid "can not pop main context" msgstr "" -#~ msgid "range of the form `[%c-%c]' is locale dependent" -#~ msgstr "omrde p formen `[%c-%c]' er locale-afhngig" +#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" +#~ msgstr "reference til ikke-initieret element '%s[\"%.*s\"]'" -#, fuzzy -#~ msgid "[s]printf called with no arguments" -#~ msgstr "sqrt: kaldt med negativt argument %g" +#~ msgid "subscript of array `%s' is null string" +#~ msgstr "indeks i array '%s' er en tom streng" -#~ msgid "`-m[fr]' option irrelevant in gawk" -#~ msgstr "'-m[fr]'-flaget er irrelevant i gawk" +#~ msgid "%s: empty (null)\n" +#~ msgstr "%s: tom (null)\n" -#~ msgid "-m option usage: `-m[fr] nnn'" -#~ msgstr "brug af flaget -m: '-m[fr] nnn'" +#~ msgid "%s: empty (zero)\n" +#~ msgstr "%s: tom (nul)\n" -#, fuzzy -#~ msgid "%s: received non-numeric first argument" -#~ msgstr "or: fik et ikke-numerisk frste argument" +#~ msgid "%s: table_size = %d, array_size = %d\n" +#~ msgstr "%s: tabelstrrelse = %d, arraystrrelse = %d\n" -#, fuzzy -#~ msgid "%s: received non-numeric second argument" -#~ msgstr "or: fik et ikke-numerisk andet argument" +#~ msgid "%s: array_ref to %s\n" +#~ msgstr "%s: arrayreference til %s\n" -#, fuzzy -#~ msgid "%s(%Rg, ..): negative values will give strange results" -#~ msgstr "or(%lf, %lf): negative vrdier vil give mrkelige resultater" +#~ msgid "`nextfile' is a gawk extension" +#~ msgstr "'nextfile' er en gawk-udvidelse" -#, fuzzy -#~ msgid "%s(%Rg, ..): fractional values will be truncated" -#~ msgstr "or(%lf, %lf): kommatalsvrdier vil blive trunkeret" +#~ msgid "`delete array' is a gawk extension" +#~ msgstr "'delete array' er en gawk-udvidelse" -#, fuzzy -#~ msgid "%s(%Zd, ..): negative values will give strange results" -#~ msgstr "or(%lf, %lf): negative vrdier vil give mrkelige resultater" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "'getline var' ugyldig inden i '%s' regel" -#, fuzzy -#~ msgid "%s(.., %Rg): negative values will give strange results" -#~ msgstr "or(%lf, %lf): negative vrdier vil give mrkelige resultater" +#~ msgid "`getline' invalid inside `%s' rule" +#~ msgstr "'getline' ugyldig inden i '%s' regel" -#, fuzzy -#~ msgid "%s(.., %Zd): negative values will give strange results" -#~ msgstr "or(%lf, %lf): negative vrdier vil give mrkelige resultater" +#~ msgid "use of non-array as array" +#~ msgstr "brug af ikke-array som array" #~ msgid "`%s' is a Bell Labs extension" #~ msgstr "'%s' er en Bell Labs-udvidelse" -#~ msgid "`nextfile' is a gawk extension" -#~ msgstr "'nextfile' er en gawk-udvidelse" - -#~ msgid "`delete array' is a gawk extension" -#~ msgstr "'delete array' er en gawk-udvidelse" - #~ msgid "and: received non-numeric first argument" #~ msgstr "and: fik et ikke-numerisk frste argument" #~ msgid "and: received non-numeric second argument" #~ msgstr "and: fik et ikke-numerisk andet argument" -#~ msgid "and(%lf, %lf): fractional values will be truncated" -#~ msgstr "and(%lf, %lf): kommatalsvrdier vil blive trunkeret" +#~ msgid "or: received non-numeric first argument" +#~ msgstr "or: fik et ikke-numerisk frste argument" + +#~ msgid "or: received non-numeric second argument" +#~ msgstr "or: fik et ikke-numerisk andet argument" + +#~ msgid "or(%lf, %lf): negative values will give strange results" +#~ msgstr "or(%lf, %lf): negative vrdier vil give mrkelige resultater" + +#~ msgid "or(%lf, %lf): fractional values will be truncated" +#~ msgstr "or(%lf, %lf): kommatalsvrdier vil blive trunkeret" #~ msgid "xor: received non-numeric first argument" #~ msgstr "xor: fik et ikke-numerisk frste argument" @@ -3567,33 +3599,6 @@ #~ msgid "xor(%lf, %lf): fractional values will be truncated" #~ msgstr "xor(%lf, %lf): kommatalsvrdier vil blive trunkeret" -#~ msgid "Operation Not Supported" -#~ msgstr "Operationen understttes ikke" - -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "forsg p at bruge funktionen '%s' som et array" - -#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" -#~ msgstr "reference til ikke-initieret element '%s[\"%.*s\"]'" - -#~ msgid "subscript of array `%s' is null string" -#~ msgstr "indeks i array '%s' er en tom streng" - -#~ msgid "%s: empty (null)\n" -#~ msgstr "%s: tom (null)\n" - -#~ msgid "%s: empty (zero)\n" -#~ msgstr "%s: tom (nul)\n" - -#~ msgid "%s: table_size = %d, array_size = %d\n" -#~ msgstr "%s: tabelstrrelse = %d, arraystrrelse = %d\n" - -#~ msgid "%s: array_ref to %s\n" -#~ msgstr "%s: arrayreference til %s\n" - -#~ msgid "use of non-array as array" -#~ msgstr "brug af ikke-array som array" - #~ msgid "can't use function name `%s' as variable or array" #~ msgstr "kan ikke bruge funktionsnavnet '%s' som variabel eller array" @@ -3615,9 +3620,6 @@ #~ msgid "function `%s' not defined" #~ msgstr "funktionen '%s' er ikke defineret" -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "ikke-omdirigeret 'getline' ugyldig inden i '%s'-regel" - #~ msgid "`nextfile' cannot be called from a `%s' rule" #~ msgstr "'nextfile' kan ikke kaldes fra en '%s'-regel" @@ -3627,12 +3629,43 @@ #~ msgid "Sorry, don't know how to interpret `%s'" #~ msgstr "Vd desvrre ikke hvordan '%s' skal fortolkes" +#~ msgid "Operation Not Supported" +#~ msgstr "Operationen understttes ikke" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "ingen (kendt) protokol opgivet i special-filnavn '%s'" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "special-filnavn '%s' er ufuldstndigt" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "fjernmaskinenavn til '/inet' skal angives" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "fjernport til '/inet' skal angives" + +#~ msgid "`-m[fr]' option irrelevant in gawk" +#~ msgstr "'-m[fr]'-flaget er irrelevant i gawk" + +#~ msgid "-m option usage: `-m[fr] nnn'" +#~ msgstr "brug af flaget -m: '-m[fr] nnn'" + #~ msgid "\t-R file\t\t\t--command=file\n" #~ msgstr "\t-R file\t\t\t--command=fil\n" #~ msgid "could not find groups: %s" #~ msgstr "kunne ikke finde grupper: %s" +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s blokke\n" +#~ "\n" + +#~ msgid "range of the form `[%c-%c]' is locale dependent" +#~ msgstr "omrde p formen `[%c-%c]' er locale-afhngig" + #~ msgid "assignment is not allowed to result of builtin function" #~ msgstr "tildeling er ikke tilladt til resultatet fra en indbygget funktion" diff -urN gawk-4.1.1/po/de.po gawk-4.1.2/po/de.po --- gawk-4.1.1/po/de.po 2014-04-08 19:23:36.000000000 +0300 +++ gawk-4.1.2/po/de.po 2015-04-29 08:36:41.000000000 +0300 @@ -2,14 +2,14 @@ # Copyright (C) 2000 Free Software Foundation, Inc. # This file is distributed under the same license as the gawk package. # -# Philipp Thomas , 2011 2012 +# Philipp Thomas , 2011, 2012, 2014, 2015 # msgid "" msgstr "" -"Project-Id-Version: gawk 4.0.0h\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" -"PO-Revision-Date: 2012-01-30 16:21+0100\n" +"Project-Id-Version: gawk 4.1.1d\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" +"PO-Revision-Date: 2015-04-17 08:17+0200\n" "Last-Translator: Philipp Thomas \n" "Language-Team: German \n" "Language: de\n" @@ -36,9 +36,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "Es wird versucht, den Skalar »%s« als Array zu verwenden" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "Es wird versucht, das Feld »%s« in einem Skalarkontext zu verwenden" @@ -54,9 +54,8 @@ msgstr "Es wird versucht, den Skalar »%s[\"%.*s\"]« als Feld zu verwenden" #: array.c:776 -#, fuzzy msgid "adump: first argument not an array" -msgstr "adump: Das Argument ist kein Feld" +msgstr "adump: Das erste Argument ist kein Feld" #: array.c:815 msgid "asort: second argument not an array" @@ -98,427 +97,430 @@ "asorti: ein untergeordnetes Feld des zweiten Arguments kann nicht als erstes " "Argument verwendet werden" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "»%s« ist ein unzulässiger Funktionsname" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "Die Vergleichsfunktion »%s« für das Sortieren ist nicht definiert" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "%s-Blöcke müssen einen Aktionsteil haben" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "Jede Regel muss entweder ein Muster oder einen Aktionsteil haben" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "Das alte awk erlaubt keine mehrfachen »BEGIN«- oder »END«-Regeln" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "»%s« ist eine eingebaute Funktion und kann nicht umdefiniert werden" -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" "Die Regulärer-Ausdruck-Konstante »//« sieht wie ein C-Kommentar aus, ist " "aber keiner" -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" "Die Regulärer-Ausdruck-Konstante »/%s/« sieht wie ein C-Kommentar aus, ist " "aber keiner" -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "doppelte Case-Werte im Switch-Block: %s" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "doppeltes »default« im Switch-Block gefunden" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "" "»break« ist außerhalb einer Schleife oder eines Switch-Blocks nicht zulässig" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "»continue« ist außerhalb einer Schleife nicht zulässig" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "»next« wird in %s-Aktion verwendet" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "»nextfile« wird in %s-Aktion verwendet" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "»return« wird außerhalb einer Funktion verwendet" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "Einfaches »print« in BEGIN- oder END-Regel soll vermutlich »print \"\"« sein" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" -msgstr "" +msgstr "»delete« ist in Zusammenhang mit SYMTAB nicht zulässig" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" -msgstr "" +msgstr "»delete« ist in Zusammenhang mit FUNCTAB nicht zulässig" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" msgstr "»delete(array)« ist eine gawk-Erweiterung" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "mehrstufige Zweiwege-Pipes funktionieren nicht" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "Regulärer Ausdruck auf der rechten Seite einer Zuweisung" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "Regulärer Ausdruck links vom »~«- oder »!~«-Operator" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" msgstr "Das alte awk unterstützt das Schlüsselwort »in« nur nach »for«" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "Regulärer Ausdruck rechts von einem Vergleich" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "»getline var« ist ungültig innerhalb der »%s«-Regel" - -#: awkgram.y:1420 +#: awkgram.y:1410 #, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "»getline« ist ungültig innerhalb der »%s«-Regel" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "nicht umgeleitetes »getline« ist ungültig innerhalb der »%s«-Regel" -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" msgstr "" "Nicht-umgelenktes »getline« ist innerhalb der END-Aktion nicht definiert" -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "Das alte awk unterstützt keine mehrdimensionalen Felder" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "Aufruf von »length« ohne Klammern ist nicht portabel" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "indirekte Funktionsaufrufe sind eine gawk-Erweiterung" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "die besondere Variable »%s« kann nicht für den indirekten Funktionsaufruf " "verwendet werden" +#: awkgram.y:1634 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "es wird versucht, „%s“ als Funktion aufzurufen, obwohl es keine ist" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "Ungültiger Index-Ausdruck" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "Warnung: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "Fatal: " -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "Unerwarteter Zeilenumbruch oder Ende der Zeichenkette" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "Quelldatei »%s« kann nicht zum Lesen geöffnet werden (%s)" -#: awkgram.y:2384 awkgram.y:2509 -#, fuzzy, c-format +#: awkgram.y:2392 awkgram.y:2517 +#, c-format msgid "can't open shared library `%s' for reading (%s)" -msgstr "Quelldatei »%s« kann nicht zum Lesen geöffnet werden (%s)" +msgstr "" +"Die dynamische Bibliothek »%s« kann nicht zum Lesen geöffnet werden (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "Unbekannte Ursache" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" -msgstr "" +msgstr "»%s« kann nicht eingebunden und als Programmdatei verwendet werden" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "Quelldatei »%s« wurde bereits eingebunden" -#: awkgram.y:2409 -#, fuzzy, c-format +#: awkgram.y:2417 +#, c-format msgid "already loaded shared library `%s'" -msgstr "Quelldatei »%s« wurde bereits eingebunden" +msgstr "Die dynamische Bibliothek »%s« wurde bereits eingebunden" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "»@include« ist eine gawk-Erweiterung" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "leerer Dateiname nach @include" -#: awkgram.y:2494 -#, fuzzy +#: awkgram.y:2502 msgid "@load is a gawk extension" -msgstr "»@include« ist eine gawk-Erweiterung" +msgstr "»@load« ist eine Gawk-Erweiterung" -#: awkgram.y:2500 -#, fuzzy +#: awkgram.y:2508 msgid "empty filename after @load" -msgstr "leerer Dateiname nach @include" +msgstr "leerer Dateiname nach @load" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "Kein Programmtext auf der Kommandozeile" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "Die Quelldatei »%s« kann nicht gelesen werden (%s)" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "Die Quelldatei »%s« ist leer" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "PEBKAC Fehler: ungültiges Zeichen „\\%03o“ im Quellcode" + +#: awkgram.y:2958 msgid "source file does not end in newline" msgstr "Die Quelldatei hört nicht mit einem Zeilenende auf" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" "Nicht beendeter regulärer Ausdruck (hört mit '\\' auf) am Ende der Datei" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "%s: %d: der tawk-Modifizierer für reguläre Ausdrücke »/.../%c« funktioniert " "nicht in gawk" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "Der tawk-Modifizierer für reguläre Ausdrücke »/.../%c« funktioniert nicht in " "gawk" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "Nicht beendeter regulärer Ausdruck" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "Nicht beendeter regulärer Ausdruck am Dateiende" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" msgstr "" "Die Verwendung von »\\#...« zur Fortsetzung von Zeilen ist nicht portabel" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "das letzte Zeichen auf der Zeile ist kein Backslash (»\\«)" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "POSIX erlaubt den Operator »**=« nicht" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "Das alte awk unterstützt den Operator »**=« nicht" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "POSIX erlaubt den Operator »**« nicht" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "Das alte awk unterstützt den Operator »**« nicht" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "Das alte awk unterstützt den Operator »^=« nicht" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "Das alte awk unterstützt den Operator »^« nicht" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "Nicht beendete Zeichenkette" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "Ungültiges Zeichen »%c« in einem Ausdruck" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "»%s« ist eine gawk-Erweiterung" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX erlaubt »%s« nicht" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "»%s« wird im alten awk nicht unterstützt" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "»goto« gilt als schlechter Stil!\n" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "Unzulässige Argumentzahl %d für %s" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: Ein String als letztes Argument von substitute hat keinen Effekt" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "Der dritte Parameter von %s ist ein unveränderliches Objekt" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "match: Das dritte Argument ist eine gawk-Erweiterung" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "close: Das zweite Argument ist eine gawk-Erweiterung" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "Fehlerhafte Verwendung von dcgettext(_\"...\"): \n" "Entfernen Sie den führenden Unterstrich" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "Fehlerhafte Verwendung von dcngettext(_\"...\"): \n" "Entfernen Sie den führenden Unterstrich" -#: awkgram.y:4016 -#, fuzzy +#: awkgram.y:4050 msgid "index: regexp constant as second argument is not allowed" -msgstr "index: Zweites Argument ist kein string" +msgstr "index: eine Regexp-Konstante als zweites Argument ist unzulässig" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "Funktion »%s«: Parameter »%s« verdeckt eine globale Variable" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "»%s« kann nicht zum Schreiben geöffne werden(%s)" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "Die Liste der Variablen wird auf der Standardfehlerausgabe ausgegeben" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "%s: close ist gescheitert (%s)" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() zweimal aufgerufen!" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "es sind verdeckte Variablen vorhanden" -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "Funktion »%s« wurde bereits definiert" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "Funktion »%s«: Funktionsnamen können nicht als Parameternamen benutzen" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "Funktion »%s«: die spezielle Variable »%s« kann nicht als Parameter " "verwendet werden" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "Funktion »%s«: Parameter #%d, »%s« wiederholt Parameter #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "Aufgerufene Funktion »%s« ist nirgends definiert" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "Funktion »%s« wurde definiert aber nirgends aufgerufen" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "Regulärer-Ausdruck-Konstante für Parameter #%d ergibt einen \n" "logischen Wert" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -527,24 +529,26 @@ "Funktion »%s« wird mit Leerzeichen zwischen Name und »(« aufgerufen, \n" "oder als Variable oder Feld verwendet" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "Division durch Null wurde versucht" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "Division durch Null versucht in »%%«" -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" +"dem Ergebnis eines Feld-Postinkrementausdruck kann kein Wert zugewiesen " +"werden" -#: awkgram.y:5052 -#, fuzzy, c-format +#: awkgram.y:5012 +#, c-format msgid "invalid target of assignment (opcode %s)" -msgstr "Unzulässige Argumentzahl %d für %s" +msgstr "Unzulässiges Ziel für eine Zuweisung (Opcode %s)" #: builtin.c:133 #, c-format @@ -582,193 +586,202 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: »%s« ist keine geöffnete Datei, Pipe oder Prozess" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: Erstes Argument ist kein String" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: Zweites Argument ist kein string" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "Argument ist keine Zahl" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: Argument ist ein Feld" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "»length(array)« ist eine gawk-Erweiterung" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: Argument ist kein String" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: Argument ist keine Zahl" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: Negatives Argument %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "Fatal: »count$« muss auf alle Formate angewandt werden oder auf keines" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "Feldbreite wird für die »%%«-Angabe ignoriert" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "Genauigkeit wird für die »%%«-Angabe ignoriert" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "Feldbreite und Genauigkeit werden für die »%%«-Angabe ignoriert" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "Fatal: »$« ist in awk-Formaten nicht zulässig" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "Fatal: die Anzahl der Argumen bei »$« muss > 0 sein" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" "Fatal: Argumentenanzahl %ld ist größer als die Gesamtzahl angegebener " "Argumente" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "Fatal: »$« nach Punkt in Formatangabe nicht zulässig" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "Fatal: »$« fehlt in positionsabhängiger Feldbreite oder Genauigkeit" # -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "»l« ist in awk-Formaten bedeutungslos, ignoriert" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "Fatal: »l« ist in POSIX-awk-Formaten nicht zulässig" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "»L« ist in awk-Formaten bedeutungslos, ignoriert" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "Fatal: »L« ist in POSIX-awk-Formaten nicht zulässig" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "»h« ist in awk-Formaten bedeutungslos, ignoriert" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "Fatal: »h« ist in POSIX-awk-Formaten nicht zulässig" -#: builtin.c:1463 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: Wert %g ist außerhalb des Bereichs für Format »%%c«" + +#: builtin.c:1068 +#, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: Wert %g ist kein gultiges Wide-Zeichen" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: Wert %g ist außerhalb des Bereichs für Format »%%%c«" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "das unbekannte Zeichen »%c« in der Formatspezifikation wird ignoriert: keine " "Argumente umgewandelt" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "Fatal: Nicht genügend Argumente für die Formatangabe" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ hierfür fehlte es" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: Format-Spezifikation hat keinen Controlcode" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "Zu viele Argumente für den Formatstring" -#: builtin.c:1634 -#, fuzzy +#: builtin.c:1625 msgid "sprintf: no arguments" -msgstr "printf: Keine Argumente" +msgstr "sprintf: Keine Argumente" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: Keine Argumente" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: das Argument ist keine Zahl" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: das Argument %g ist negativ" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: Länge %g ist nicht >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: Länge %g ist nicht >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: Nicht ganzzahlige Länge %g wird abgeschnitten" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: Länge %g ist zu groß für Stringindizierung, wird auf %g gekürzt" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: Start-Index %g ist ungültig, 1 wird verwendet" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: Nicht ganzzahliger Start-Wert %g wird abgeschnitten" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: Quellstring ist leer" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: Start-Wert %g liegt hinter dem Ende des Strings" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -776,197 +789,221 @@ "substr: Länge %g am Start-Wert %g überschreitet die Länge des ersten " "Arguments (%lu)" -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "strftime: Formatwert in PROCINFO[\"strftime\"] ist numerischen Typs" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" msgstr "strftime: Das zweite Argument ist keine Zahl" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "" "strftime: das zweite Argument ist kleiner als 0 oder zu groß für time_t" -#: builtin.c:1934 +#: builtin.c:1932 +msgid "strftime: second argument out of range for time_t" +msgstr "" +"strftime: das zweite Argument ist ausserhalb des Gültigkeitsbereichs von " +"time_t" + +#: builtin.c:1941 msgid "strftime: received non-string first argument" msgstr "strftime: Das erste Argument ist kein String" -#: builtin.c:1941 +#: builtin.c:1948 msgid "strftime: received empty format string" msgstr "strftime: Der Format-String ist leer" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" msgstr "mktime: Das Argument ist kein String" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: mindestens einer der Werte ist außerhalb des normalen Bereichs" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "Die Funktion »system« ist im Sandbox-Modus nicht erlaubt" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" msgstr "system: Das Argument ist kein String" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "Referenz auf das nicht initialisierte Feld »$%d«" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" msgstr "tolower: das Argument ist kein String" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" msgstr "toupper: das Argument ist kein String" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: das erste Argument ist keine Zahl" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: das zweite Argument ist keine Zahl" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" msgstr "sin: das Argument ist keine Zahl" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" msgstr "cos: das Argument ist keine Zahl" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: das Argument ist keine Zahl" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "match: das dritte Argument ist kein Array" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" -msgstr "gensub: 0 als drittes Argument wird als 1 interpretiert" +#: builtin.c:2725 +#, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "gensub: das dritte Argument „%.*s“ wird als 1 interpretiert" + +#: builtin.c:2740 +#, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: das dritte Argument %g wird als 1 interpretiert" -#: builtin.c:3030 +#: builtin.c:3038 +#, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "%s: kann indirekt nur mit zwei Argumenten aufgerufen werden" + +#: builtin.c:3128 +#, c-format +msgid "indirect call to %s requires at least two arguments" +msgstr "der indirekte Aufruf von %s erfordert mindestens zwei Argumente" + +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" msgstr "lshift: das erste Argument ist keine Zahl" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" msgstr "lshift: das zweite Argument ist keine Zahl" -#: builtin.c:3038 -#, fuzzy, c-format +#: builtin.c:3188 +#, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "" -"lshift(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" +"lshift(%f, %f): Negative Werte werden zu merkwürdigen Ergebnissen führen" -#: builtin.c:3040 -#, fuzzy, c-format +#: builtin.c:3190 +#, c-format msgid "lshift(%f, %f): fractional values will be truncated" -msgstr "lshift(%lf, %lf): Dezimalteil wird abgeschnitten" +msgstr "lshift(%f, %f): Dezimalteil wird abgeschnitten" -#: builtin.c:3042 -#, fuzzy, c-format +#: builtin.c:3192 +#, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "" -"lshift(%lf, %lf): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen " +"lshift(%f, %f): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen " "führen" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" msgstr "rshift: das erste Argument ist keine Zahl" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" msgstr "rshift: das zweite Argument ist keine Zahl" -#: builtin.c:3075 -#, fuzzy, c-format +#: builtin.c:3225 +#, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "" -"rshift (%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" +"rshift (%f, %f): Negative Werte werden zu merkwürdigen Ergebnissen führen" -#: builtin.c:3077 -#, fuzzy, c-format +#: builtin.c:3227 +#, c-format msgid "rshift(%f, %f): fractional values will be truncated" -msgstr "rshift(%lf, %lf): Dezimalteil wird abgeschnitten" +msgstr "rshift(%f, %f): Dezimalteil wird abgeschnitten" -#: builtin.c:3079 -#, fuzzy, c-format +#: builtin.c:3229 +#, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" -"rshift(%lf, %lf): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen " +"rshift(%f, %f): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen " "führen" -#: builtin.c:3104 mpfr.c:968 -#, fuzzy +#: builtin.c:3254 mpfr.c:988 msgid "and: called with less than two arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "and: wird mit weniger als zwei Argumenten aufgerufen" -#: builtin.c:3109 -#, fuzzy, c-format +#: builtin.c:3259 +#, c-format msgid "and: argument %d is non-numeric" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "and: das Argument %d ist nicht numerisch" -#: builtin.c:3113 -#, fuzzy, c-format +#: builtin.c:3263 +#, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "" -"and(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" +"and: der negative Wert %2$g von Argument %1$d wird zu merkwürdigen " +"Ergebnissen führen" -#: builtin.c:3136 mpfr.c:1000 -#, fuzzy +#: builtin.c:3286 mpfr.c:1020 msgid "or: called with less than two arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "or: wird mit weniger als zwei Argumenten aufgerufen" -#: builtin.c:3141 -#, fuzzy, c-format +#: builtin.c:3291 +#, c-format msgid "or: argument %d is non-numeric" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "or: das Argument %d ist nicht numerisch" -#: builtin.c:3145 -#, fuzzy, c-format +#: builtin.c:3295 +#, c-format msgid "or: argument %d negative value %g will give strange results" -msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen" +msgstr "" +"or: der negative Wert %2$g von Argument %1$d wird zu merkwürdigen " +"Ergebnissen führen" -#: builtin.c:3167 mpfr.c:1031 -#, fuzzy +#: builtin.c:3317 mpfr.c:1051 msgid "xor: called with less than two arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "xor: wird mit weniger als zwei Argumenten aufgerufen" -#: builtin.c:3173 -#, fuzzy, c-format +#: builtin.c:3323 +#, c-format msgid "xor: argument %d is non-numeric" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "xor: das Argument %d ist nicht numerisch" -#: builtin.c:3177 -#, fuzzy, c-format +#: builtin.c:3327 +#, c-format msgid "xor: argument %d negative value %g will give strange results" -msgstr "xor(%lf, %lf: Negative Werte werden zu merkwürdigen Ergebnissen führen" +msgstr "" +"xor: der negative Wert %2$g von Argument %1$d wird zu merkwürdigen " +"Ergebnissen führen" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: das erste Argument ist keine Zahl" -#: builtin.c:3208 -#, fuzzy, c-format +#: builtin.c:3358 +#, c-format msgid "compl(%f): negative value will give strange results" -msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen" +msgstr "compl(%f): Der negative Wert wird zu merkwürdigen Ergebnissen führen" -#: builtin.c:3210 -#, fuzzy, c-format +#: builtin.c:3360 +#, c-format msgid "compl(%f): fractional value will be truncated" -msgstr "compl(%lf): Dezimalteil wird abgeschnitten" +msgstr "compl(%f): der Dezimalteil wird abgeschnitten" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: »%s« ist keine gültige Locale-Kategorie" @@ -974,557 +1011,610 @@ #: command.y:225 #, c-format msgid "Type (g)awk statement(s). End with the command \"end\"\n" -msgstr "" +msgstr "Geben Sie »(g)awk Ausdrücke« und zum Abschluss \"end\" ein\n" #: command.y:289 -#, fuzzy, c-format +#, c-format msgid "invalid frame number: %d" -msgstr "Ungültiges Bereichsende" +msgstr "Ungültige Frame-Nummer: %d" #: command.y:295 -#, fuzzy, c-format +#, c-format msgid "info: invalid option - \"%s\"" -msgstr "%s: Ungültige Option -- »%c«\n" +msgstr "info: Ungültige Option - »%s«" #: command.y:321 #, c-format msgid "source \"%s\": already sourced." -msgstr "" +msgstr "Quelle »%s«: wurde bereits eingelesen." #: command.y:326 #, c-format msgid "save \"%s\": command not permitted." -msgstr "" +msgstr "save »%s«: Der Befehl ist nicht zulässig." #: command.y:339 msgid "Can't use command `commands' for breakpoint/watchpoint commands" msgstr "" +"Der Befehl »commands« kann nicht für Break- bzw. Watchpoints verwendet werden" #: command.y:341 msgid "no breakpoint/watchpoint has been set yet" -msgstr "" +msgstr "es wurden noch keine Break-/Watchpoints gesetzt" #: command.y:343 msgid "invalid breakpoint/watchpoint number" -msgstr "" +msgstr "ungültige Break-/Watchpoint/Nummer" #: command.y:348 #, c-format msgid "Type commands for when %s %d is hit, one per line.\n" msgstr "" +"Befehle eingeben, die bei Erreichen von %s %d ausgeführt werden sollen, " +"einer pro Zeile.\n" #: command.y:350 #, c-format msgid "End with the command \"end\"\n" -msgstr "" +msgstr "Abschließen mit dem Befehl »end«\n" #: command.y:357 msgid "`end' valid only in command `commands' or `eval'" -msgstr "" +msgstr "»end« ist nur innerhalb der Befehle »commands« oder »eval« zulässig" #: command.y:367 msgid "`silent' valid only in command `commands'" -msgstr "" +msgstr "»silent« ist nur innerhalb des Befehls »commands« zuzlässig" #: command.y:373 -#, fuzzy, c-format +#, c-format msgid "trace: invalid option - \"%s\"" -msgstr "%s: Ungültige Option -- »%c«\n" +msgstr "trace: Ungültige Option - »%s«" #: command.y:387 msgid "condition: invalid breakpoint/watchpoint number" -msgstr "" +msgstr "condition: Unzulässige Break-/Watchpoint-Nummer" #: command.y:449 -#, fuzzy msgid "argument not a string" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "Das Argument ist keine Zeichenkette" #: command.y:459 command.y:464 #, c-format msgid "option: invalid parameter - \"%s\"" -msgstr "" +msgstr "option: ungültiger Parameter - »%s«" #: command.y:474 #, c-format msgid "no such function - \"%s\"" -msgstr "" +msgstr "Unbekannte Funktion - »%s«" #: command.y:531 -#, fuzzy, c-format +#, c-format msgid "enable: invalid option - \"%s\"" -msgstr "%s: Ungültige Option -- »%c«\n" +msgstr "enable: Ungültige Option - »%s«" #: command.y:597 -#, fuzzy, c-format +#, c-format msgid "invalid range specification: %d - %d" -msgstr "Ungültiges Bereichsende" +msgstr "Ungültige Bereichsangabe: %d - %d" #: command.y:659 -#, fuzzy msgid "non-numeric value for field number" -msgstr "unbekannter Wert für eine Feldangabe: %d\n" +msgstr "nichtnumerischer Wert als Feldnummer" #: command.y:680 command.y:687 msgid "non-numeric value found, numeric expected" -msgstr "" +msgstr "nichtnumerischer Wert wo ein numerischer erwartet wurde" #: command.y:712 command.y:718 msgid "non-zero integer value" -msgstr "" +msgstr "ganyzahliger Wert ungleich Null" #: command.y:817 msgid "" "backtrace [N] - print trace of all or N innermost (outermost if N < 0) " "frames." msgstr "" +"backtrace [N] - log von allen oder den N innersten (äußersten wenn N < 0) " +"Rahmen." #: command.y:819 msgid "" "break [[filename:]N|function] - set breakpoint at the specified location." msgstr "" +"break [[Dateiname:]N|funktion - Breakpoint an der angegebenen Stelle setzen.]" #: command.y:821 msgid "clear [[filename:]N|function] - delete breakpoints previously set." -msgstr "" +msgstr "clear [[Dateiname:]N|Funktion - zuvor gesetzte Breakpoints löschen." #: command.y:823 msgid "" "commands [num] - starts a list of commands to be executed at a " "breakpoint(watchpoint) hit." msgstr "" +"commands [Nr] - startet eine Liste von Befehlen, die bei Erreichen eines " +"Break- bzw. Watchpoints ausgeführt werden." #: command.y:825 msgid "condition num [expr] - set or clear breakpoint or watchpoint condition." msgstr "" +"condition Nr [Ausdruck] - Bedingungen für einen Break-/Watchpoint setzen " +"oder löschen." #: command.y:827 msgid "continue [COUNT] - continue program being debugged." -msgstr "" +msgstr "continue [ANZAHL] - zu debuggendes Programm fortsetzen." #: command.y:829 msgid "delete [breakpoints] [range] - delete specified breakpoints." -msgstr "" +msgstr "delete [Breakpoints] [Bereich] - angegebene Breakpoints entfernen." #: command.y:831 msgid "disable [breakpoints] [range] - disable specified breakpoints." -msgstr "" +msgstr "disable [Breakpoints] [Bereich] - angegebene Breakpoints deaktivieren." #: command.y:833 msgid "display [var] - print value of variable each time the program stops." msgstr "" +"display [Var] - den Wert der Variablen bei jedem Programmstop ausgeben." #: command.y:835 msgid "down [N] - move N frames down the stack." -msgstr "" +msgstr "down [N] - N Rahmen nach unten im Stack gehen." #: command.y:837 msgid "dump [filename] - dump instructions to file or stdout." msgstr "" +"dump [Dateiname] - Befehle in eine Datei oder auf der Standardausgabe " +"ausgeben" #: command.y:839 msgid "enable [once|del] [breakpoints] [range] - enable specified breakpoints." msgstr "" +"enable [once|del] [Breakpoints] [Bereich] - die angegebenen Breakpoints " +"aktivieren." #: command.y:841 msgid "end - end a list of commands or awk statements." -msgstr "" +msgstr "end - beendet eine Liste von Befehlen oder AWK/Ausdrücken." #: command.y:843 msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)." -msgstr "" +msgstr "eval stmt[p1, p2, ...] - Awk-Ausdrücke auswerten." #: command.y:845 msgid "finish - execute until selected stack frame returns." msgstr "" +"finish - mit Ausführung fortfahren bis auisgewählter Rahmen verlassen wird." #: command.y:847 msgid "frame [N] - select and print stack frame number N." -msgstr "" +msgstr "frame [N] - den Stackrahmen Nummer N auswählen und ausgeben." #: command.y:849 msgid "help [command] - print list of commands or explanation of command." msgstr "" +"help [Befehl] - gibt eine Liste der Befehle oder die Beschreibung eines " +"einzelnen Befehls aus." #: command.y:851 msgid "ignore N COUNT - set ignore-count of breakpoint number N to COUNT." msgstr "" +"ignore N ZÄHLER - setzt den Ignorieren-Zähler von Breakpoint N auf ZÄHLER" #: command.y:853 msgid "" "info topic - source|sources|variables|functions|break|frame|args|locals|" "display|watch." msgstr "" +"info Thema - source|sources|variables|functions|break|frame|args|locals|" +"display|watch." #: command.y:855 msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)." msgstr "" +"list [-|+|[Dateiname:]Zeilennr|Funktion|Breich] - die angegebenen Zeilen " +"ausgeben" #: command.y:857 msgid "next [COUNT] - step program, proceeding through subroutine calls." msgstr "" +"next [ZÄHLER] - Programm schrittweise ausführen aber Subroutinen in einem " +"Rutsch ausführen" #: command.y:859 msgid "" "nexti [COUNT] - step one instruction, but proceed through subroutine calls." msgstr "" +"nexti [ZÄHLER] - einen Befehl abarbeiten. aber Subroutinen in einem Rutsch " +"ausführen" #: command.y:861 msgid "option [name[=value]] - set or display debugger option(s)." -msgstr "" +msgstr "option [Name[=Wer]] - Debuggeroptionen setzen oder anzeigen." #: command.y:863 msgid "print var [var] - print value of a variable or array." -msgstr "" +msgstr "print Var [Var] - den Wert einer Variablen oder eines Feldes ausgeben." #: command.y:865 msgid "printf format, [arg], ... - formatted output." -msgstr "" +msgstr "printf Format, [Arg], ... - formatierte Ausgabe." #: command.y:867 msgid "quit - exit debugger." -msgstr "" +msgstr "quit - Debugger verlassen" #: command.y:869 msgid "return [value] - make selected stack frame return to its caller." msgstr "" +"return [Wert] - den ausgewählten Stapelrahmen yu seinem Aufrufer zurück " +"kehren lassen" #: command.y:871 msgid "run - start or restart executing program." -msgstr "" +msgstr "run - startet die (erneute) Ausführung des Programms." #: command.y:874 msgid "save filename - save commands from the session to file." -msgstr "" +msgstr "save Dateineme - sichert die Befehle der Sitzung in einer Datei." #: command.y:877 msgid "set var = value - assign value to a scalar variable." -msgstr "" +msgstr "set Var = Wert - einer skalaren Variablen einen Wert zuweisen" #: command.y:879 msgid "" "silent - suspends usual message when stopped at a breakpoint/watchpoint." msgstr "" +"silent - unterdrückt die übliche Nachricht, wenn ein Break- bzw. Watchpoint " +"erreicht wird." #: command.y:881 msgid "source file - execute commands from file." -msgstr "" +msgstr "source Datei - die Befehle in Datei ausführen" #: command.y:883 msgid "step [COUNT] - step program until it reaches a different source line." msgstr "" +"step [ZÄHLER - Programm schrittweise ausführen bis es eine andere Quellzeile " +"erricht." #: command.y:885 msgid "stepi [COUNT] - step one instruction exactly." -msgstr "" +msgstr "stepi [ZÄHLER - genau eine Instruktion ausführen" #: command.y:887 msgid "tbreak [[filename:]N|function] - set a temporary breakpoint." -msgstr "" +msgstr "tbreak [[Dateinem:]N|Funktion] - einen temporären Breakpoint setzen." #: command.y:889 msgid "trace on|off - print instruction before executing." -msgstr "" +msgstr "trace on|off - Instruktionen vor der Ausführung ausgeben." #: command.y:891 msgid "undisplay [N] - remove variable(s) from automatic display list." msgstr "" +"undisplay [N] - Variablen von der Liste der automatisch Anzuzeigenden " +"entfernen." #: command.y:893 msgid "" "until [[filename:]N|function] - execute until program reaches a different " "line or line N within current frame." msgstr "" +"until [[Dateiname:]N|Funktion - Ausführen bis das Programm eine andere Zeile " +"erreicht oder N Zeilen im aktuellen Rahmen." #: command.y:895 msgid "unwatch [N] - remove variable(s) from watch list." -msgstr "" +msgstr "unwatch [N} - Variablen von der Beobachtungsliste löschen" #: command.y:897 msgid "up [N] - move N frames up the stack." -msgstr "" +msgstr "up [N] - N Rahmen im Kellerspeicher nach oben gehen." #: command.y:899 msgid "watch var - set a watchpoint for a variable." +msgstr "watch Var - einen Watchpoint für eine Variable setzen." + +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." msgstr "" +"where [N] - (wie bei backtrace) Liste von allen oder den N innersten " +"(äußersten wenn N <0> Stackframes" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "Fehler: " -#: command.y:1051 -#, fuzzy, c-format +#: command.y:1053 +#, c-format msgid "can't read command (%s)\n" -msgstr "Von »%s« kann nicht umgelenkt werden (%s)" +msgstr "der Befehl kann nicht gelesen werden (»%s«)\n" -#: command.y:1065 -#, fuzzy, c-format +#: command.y:1067 +#, c-format msgid "can't read command (%s)" -msgstr "Von »%s« kann nicht umgelenkt werden (%s)" +msgstr "der Befehl kann nicht gelesen werden (»%s«)" -#: command.y:1116 -#, fuzzy +#: command.y:1118 msgid "invalid character in command" -msgstr "Ungültiger Name für eine Zeichenklasse" +msgstr "Ungültiges Zeichen im Befehl" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" -msgstr "" +msgstr "unbekannter Befehl - »%.*s«, versuchen Sie es mit help" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" -msgstr "" +msgstr "%s" -#: command.y:1284 -#, fuzzy +#: command.y:1286 msgid "invalid character" msgstr "Ungültiges Zeichen" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" -msgstr "" +msgstr "undefinierter Befehl: %s\n" #: debug.c:252 msgid "set or show the number of lines to keep in history file." msgstr "" +"die Anzahl von Zeilen setzen oder anzeigen, die in der Historydatei " +"gespeichert werden sollen." #: debug.c:254 msgid "set or show the list command window size." -msgstr "" +msgstr "die Größe des Fensters für den Befehl list setzen oder anzeigen." #: debug.c:256 msgid "set or show gawk output file." -msgstr "" +msgstr "die gawk Ausgabedatei setzen oder anzeigen." #: debug.c:258 msgid "set or show debugger prompt." -msgstr "" +msgstr "das Debugger-Prompt setzen oder anzeigen." #: debug.c:260 msgid "(un)set or show saving of command history (value=on|off)." -msgstr "" +msgstr "(rück)setzen des Sicherns der Befehlshistorie (on oder off)." #: debug.c:262 msgid "(un)set or show saving of options (value=on|off)." -msgstr "" +msgstr "(rück)setzen des Sicherns von Optionen (on oder off)." #: debug.c:264 msgid "(un)set or show instruction tracing (value=on|off)." -msgstr "" +msgstr "(rück)setzen des Verfolgens von Instruktionen (on oder off)." #: debug.c:345 msgid "program not running." -msgstr "" +msgstr "Das Programm läuft nicht." #: debug.c:448 debug.c:606 -#, fuzzy, c-format +#, c-format msgid "can't read source file `%s' (%s)" msgstr "Die Quelldatei »%s« kann nicht gelesen werden (%s)" #: debug.c:453 -#, fuzzy, c-format +#, c-format msgid "source file `%s' is empty.\n" -msgstr "Die Quelldatei »%s« ist leer" +msgstr "Die Quelldatei »%s« ist leer.\n" #: debug.c:480 msgid "no current source file." -msgstr "" +msgstr "keine aktuelle Quelldatei" #: debug.c:505 -#, fuzzy, c-format +#, c-format msgid "cannot find source file named `%s' (%s)" -msgstr "Die Quelldatei »%s« kann nicht gelesen werden (%s)" +msgstr "Die Quelldatei »%s« kann nicht gefunden werden (%s)" #: debug.c:529 #, c-format msgid "WARNING: source file `%s' modified since program compilation.\n" msgstr "" +"WARNUNG: Quelldatei »%s« wurde seit der Programmübersetzung verändert.\n" #: debug.c:551 #, c-format msgid "line number %d out of range; `%s' has %d lines" msgstr "" +"die Zeilennummer %d ist außerhalb des gültigen Bereichs: »%s« hat %d Zeilen" #: debug.c:611 -#, fuzzy, c-format +#, c-format msgid "unexpected eof while reading file `%s', line %d" -msgstr "Unerwarteter Zeilenumbruch oder Ende der Zeichenkette" +msgstr "Unerwartetes Dateiende beim Lesen von Datei »%s<<, Zeile %d" #: debug.c:620 #, c-format msgid "source file `%s' modified since start of program execution" -msgstr "" +msgstr "Quelldatei »%s« wurde seit dem Start des Programmes verändert" #: debug.c:732 -#, fuzzy, c-format +#, c-format msgid "Current source file: %s\n" -msgstr "Quelldatei »%s« wurde bereits eingebunden" +msgstr "Derzeitige Quelldatei: %s\n" #: debug.c:733 #, c-format msgid "Number of lines: %d\n" -msgstr "" +msgstr "Anzahl von Zeilen: %d\n" #: debug.c:740 #, c-format msgid "Source file (lines): %s (%d)\n" -msgstr "" +msgstr "Quelldatei (Zeilen): %s (%d)\n" #: debug.c:754 msgid "" "Number Disp Enabled Location\n" "\n" msgstr "" +"Nummer Anz. Aktiv Ort\n" +"\n" #: debug.c:765 #, c-format msgid "\tno of hits = %ld\n" -msgstr "" +msgstr "\tAnzahl Treffer = %ld\n" #: debug.c:767 #, c-format msgid "\tignore next %ld hit(s)\n" -msgstr "" +msgstr "\tdie nächsten %ld Treffer\n" #: debug.c:769 debug.c:909 #, c-format msgid "\tstop condition: %s\n" -msgstr "" +msgstr "\tStopbedingung: %s\n" #: debug.c:771 debug.c:911 msgid "\tcommands:\n" -msgstr "" +msgstr "\tBefehle:\n" #: debug.c:793 #, c-format msgid "Current frame: " -msgstr "" +msgstr "Derzeitiger Stapelrahmen" #: debug.c:796 #, c-format msgid "Called by frame: " -msgstr "" +msgstr "Aufgerufen aus Rahmen: " #: debug.c:800 #, c-format msgid "Caller of frame: " -msgstr "" +msgstr "Aufrufer des Rahmens: " #: debug.c:818 #, c-format msgid "None in main().\n" -msgstr "" +msgstr "Keine in main().\n" #: debug.c:848 -#, fuzzy msgid "No arguments.\n" -msgstr "printf: Keine Argumente" +msgstr "Keine Argumente.\n" #: debug.c:849 msgid "No locals.\n" -msgstr "" +msgstr "Keine lokalen.\n" #: debug.c:857 msgid "" "All defined variables:\n" "\n" msgstr "" +"Alle definierten Variablen:\n" +"\n" #: debug.c:867 msgid "" "All defined functions:\n" "\n" msgstr "" +"Alle definierten Funktionen:\n" +"\n" #: debug.c:886 msgid "" "Auto-display variables:\n" "\n" msgstr "" +"Auto-display-Variablen:\n" +"\n" #: debug.c:889 msgid "" "Watch variables:\n" "\n" msgstr "" +"Yu überwachende Variablen:\n" +"\n" #: debug.c:1029 -#, fuzzy, c-format +#, c-format msgid "no symbol `%s' in current context\n" -msgstr "»exit« kann im aktuellen Kontext nicht aufgerufen werden" +msgstr "im aktuellen Kontext gibt es kein Symbol mit Namen »%s«\n" #: debug.c:1041 debug.c:1427 -#, fuzzy, c-format +#, c-format msgid "`%s' is not an array\n" -msgstr "»%s« ist kein gültiger Variablenname" +msgstr "»%s« ist kein Feld\n" #: debug.c:1055 -#, fuzzy, c-format +#, c-format msgid "$%ld = uninitialized field\n" -msgstr "Referenz auf das nicht initialisierte Feld »$%d«" +msgstr "$%ld = nicht initialisiertes Feld\n" #: debug.c:1076 -#, fuzzy, c-format +#, c-format msgid "array `%s' is empty\n" -msgstr "Die Datei »%s« ist leer" +msgstr "Das Feld »%s« ist leer\n" #: debug.c:1119 debug.c:1171 -#, fuzzy, c-format +#, c-format msgid "[\"%s\"] not in array `%s'\n" -msgstr "delete: Index »%s« ist in Feld »%s« nicht vorhanden" +msgstr "[\"%s\"] ist in Feld »%s« nicht vorhanden\n" #: debug.c:1175 #, c-format msgid "`%s[\"%s\"]' is not an array\n" -msgstr "" +msgstr "»%s[\"%s\"]« ist kein Feld\n" #: debug.c:1236 debug.c:4964 -#, fuzzy, c-format +#, c-format msgid "`%s' is not a scalar variable" -msgstr "»%s« ist kein gültiger Variablenname" +msgstr "»%s« ist keine skalare Variable" #: debug.c:1258 debug.c:4994 -#, fuzzy, c-format +#, c-format msgid "attempt to use array `%s[\"%s\"]' in a scalar context" msgstr "" -"Es wird versucht, das Feld »%s[\"%.*s\"]« in einem Skalarkontext zu verwenden" +"Es wird versucht, das Feld »%s[\"%s\"]« in einem Skalarkontext zu verwenden" #: debug.c:1280 debug.c:5005 -#, fuzzy, c-format +#, c-format msgid "attempt to use scalar `%s[\"%s\"]' as array" -msgstr "Es wird versucht, den Skalar »%s[\"%.*s\"]« als Feld zu verwenden" +msgstr "Es wird versucht, den Skalar »%s[\"%s\"]« als Feld zu verwenden" #: debug.c:1423 -#, fuzzy, c-format +#, c-format msgid "`%s' is a function" -msgstr "»%s« ist ein unzulässiger Funktionsname" +msgstr "»%s« ist eine Funktion" #: debug.c:1465 #, c-format msgid "watchpoint %d is unconditional\n" -msgstr "" +msgstr "Watchpoint %d ist bedingungslos\n" #: debug.c:1499 #, c-format msgid "No display item numbered %ld" -msgstr "" +msgstr "Kein anzuzeigendes Element mit Nummer %ld" #: debug.c:1502 #, c-format msgid "No watch item numbered %ld" -msgstr "" +msgstr "Kein zu beobachtendes Element mit Nummer %ld" #: debug.c:1528 -#, fuzzy, c-format +#, c-format msgid "%d: [\"%s\"] not in array `%s'\n" -msgstr "delete: Index »%s« ist in Feld »%s« nicht vorhanden" +msgstr "%d: [\"%s\"] ist in Feld »%s« nicht vorhanden\n" #: debug.c:1767 -#, fuzzy msgid "attempt to use scalar value as array" msgstr "Es wird versucht, einen Skalar als Feld zu verwenden" @@ -1532,337 +1622,350 @@ #, c-format msgid "Watchpoint %d deleted because parameter is out of scope.\n" msgstr "" +"Watchpoint %d wurde gelöscht, weil der Parameter außerhalb des " +"Gültigkeitsbereichs ist.\n" #: debug.c:1867 #, c-format msgid "Display %d deleted because parameter is out of scope.\n" msgstr "" +"Anzuzeigendes Element %d wurde gelöscht, weil der Parameter außerhalb des " +"Gültigkeitsbereichs ist.\n" #: debug.c:1900 #, c-format msgid " in file `%s', line %d\n" -msgstr "" +msgstr " in Datei »%s«, Zeile %d\n" #: debug.c:1921 #, c-format msgid " at `%s':%d" -msgstr "" +msgstr " bei »%s«:%d" #: debug.c:1937 debug.c:2000 #, c-format msgid "#%ld\tin " -msgstr "" +msgstr "#%ld\tin " #: debug.c:1974 #, c-format msgid "More stack frames follow ...\n" -msgstr "" +msgstr "Weitere Stapelrahmen folgen ...\n" #: debug.c:2017 -#, fuzzy msgid "invalid frame number" -msgstr "Ungültiges Bereichsende" +msgstr "Ungültige Rahmennummer" #: debug.c:2200 #, c-format msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d" msgstr "" +"Hinweis: Breakpont %d (aktiv, ignoriert für die nächsten %ld Treffer) wird " +"auch an %s:%d gesetzt" #: debug.c:2207 #, c-format msgid "Note: breakpoint %d (enabled), also set at %s:%d" -msgstr "" +msgstr "Hinweis: Breakpont %d (aktiv) wird auch an %s:%d gesetzt" #: debug.c:2214 #, c-format msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d" msgstr "" +"Hinweis: Breakpont %d (inaktiv, ignoriert für die nächsten %ld Treffer) wird " +"auch von %s:%d gesetzt" #: debug.c:2221 #, c-format msgid "Note: breakpoint %d (disabled), also set at %s:%d" -msgstr "" +msgstr "Hinweis: Breakpont %d (inaktiv) wird auch an %s:%d gesetzt" #: debug.c:2238 #, c-format msgid "Breakpoint %d set at file `%s', line %d\n" -msgstr "" +msgstr "Breakpont %d wird auf Datei %s, Zeile %d gesetzt\n" #: debug.c:2340 #, c-format msgid "Can't set breakpoint in file `%s'\n" -msgstr "" +msgstr "In Datei »%s« kann kein Breakpoint gesetzt werden\n" #: debug.c:2369 debug.c:2492 debug.c:3350 -#, fuzzy, c-format +#, c-format msgid "line number %d in file `%s' out of range" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "Zeile Nummer %d in Datei »%s« liegt außerhalb des gültigen Bereichs" #: debug.c:2373 #, c-format msgid "Can't find rule!!!\n" -msgstr "" +msgstr "Die Regel kann nicht gefunden werden!!!\n" #: debug.c:2375 #, c-format msgid "Can't set breakpoint at `%s':%d\n" -msgstr "" +msgstr "In »%s«:%d kann kein Breakpoint gesetzt werden\n" #: debug.c:2387 #, c-format msgid "Can't set breakpoint in function `%s'\n" -msgstr "" +msgstr "In Funktion »%s« kann kein Breakpoint gesetzt werden\n" #: debug.c:2403 #, c-format msgid "breakpoint %d set at file `%s', line %d is unconditional\n" -msgstr "" +msgstr "Breakpoint %d gestzt auf Datei »%s« Zeile %d ist bedingungslos\n" #: debug.c:2508 debug.c:2530 #, c-format msgid "Deleted breakpoint %d" -msgstr "" +msgstr "Breakpoint %d wurde gelöscht" #: debug.c:2514 #, c-format msgid "No breakpoint(s) at entry to function `%s'\n" -msgstr "" +msgstr "Am Beginn von Funktion »%s« gibt es keine Breakpoints\n" #: debug.c:2541 -#, fuzzy, c-format +#, c-format msgid "No breakpoint at file `%s', line #%d\n" -msgstr "Fehler beim Lesen der Eingabedatei »%s«: %s" +msgstr "Bei Datei »%s« Zeile %d gibt es keine Breakpoints\n" #: debug.c:2596 debug.c:2637 debug.c:2657 debug.c:2700 msgid "invalid breakpoint number" -msgstr "" +msgstr "Ungtige Breakpoint/Nummer" #: debug.c:2612 msgid "Delete all breakpoints? (y or n) " -msgstr "" +msgstr "Alle Breakpoints löschen? (j oder n) " #: debug.c:2613 debug.c:2923 debug.c:2976 msgid "y" -msgstr "" +msgstr "j" #: debug.c:2662 #, c-format msgid "Will ignore next %ld crossing(s) of breakpoint %d.\n" msgstr "" +"die nächsten %ld Überschreitungen von Breakpoint %d werden ignoriert.\n" #: debug.c:2666 #, c-format msgid "Will stop next time breakpoint %d is reached.\n" -msgstr "" +msgstr "wenn Breakpoint %d das nächste mal erreicht wird, wird angehalten\n" #: debug.c:2783 #, c-format msgid "Can only debug programs provided with the `-f' option.\n" msgstr "" +"Es können nur Programme untersucht werden, die mittels der Option »-f« " +"übergeben wurden.\n" #: debug.c:2908 #, c-format msgid "Failed to restart debugger" -msgstr "" +msgstr "Der Debugger konnte nicht neu gestartet werden" #: debug.c:2922 msgid "Program already running. Restart from beginning (y/n)? " -msgstr "" +msgstr "das Programm läfut bereits. Neu starten (j/n}? " #: debug.c:2926 #, c-format msgid "Program not restarted\n" -msgstr "" +msgstr "Das Programm wurde nicht neu gestartet\n" #: debug.c:2936 #, c-format msgid "error: cannot restart, operation not allowed\n" -msgstr "" +msgstr "Fehler: Neustart nicht möglich da die Operation verboten ist\n" #: debug.c:2942 #, c-format msgid "error (%s): cannot restart, ignoring rest of the commands\n" msgstr "" +"Fehler (%s): Neustart nicht möglich, der Rest der Befehle wird ignoriert\n" #: debug.c:2950 #, c-format msgid "Starting program: \n" -msgstr "" +msgstr "Das Programm wird gestartet: \n" #: debug.c:2959 #, c-format msgid "Program exited %s with exit value: %d\n" -msgstr "" +msgstr "Das Programm verließ %s mit einem Rückgabewert: %d\n" #: debug.c:2975 msgid "The program is running. Exit anyway (y/n)? " -msgstr "" +msgstr "Das Prgramm läuft. Trotzdem beenden (j/n) " #: debug.c:3010 #, c-format msgid "Not stopped at any breakpoint; argument ignored.\n" -msgstr "" +msgstr "Es wird an keinem Breakpoint gestoppt; das Argument wird ignoriert.\n" #: debug.c:3015 #, c-format msgid "invalid breakpoint number %d." -msgstr "" +msgstr "ungültige Breakpointnummer %d." #: debug.c:3020 #, c-format msgid "Will ignore next %ld crossings of breakpoint %d.\n" msgstr "" +"Die nächsten %ld Überschreitungen von Breakpoint %d werden ignoriert.\n" #: debug.c:3207 #, c-format msgid "'finish' not meaningful in the outermost frame main()\n" -msgstr "" +msgstr "»finish« hat in main() des äußersten Rahmens keine Bedeutung\n" #: debug.c:3212 #, c-format msgid "Run till return from " -msgstr "" +msgstr "Laufen bis zur Rückkehr von " #: debug.c:3255 #, c-format msgid "'return' not meaningful in the outermost frame main()\n" -msgstr "" +msgstr "»return« hat in main() des äußersten Rahmens keine Bedeutung\n" #: debug.c:3369 #, c-format msgid "Can't find specified location in function `%s'\n" -msgstr "" +msgstr "Die angegebene Position in Funktion »%s« kann nicht gefunden werden\n" #: debug.c:3377 -#, fuzzy, c-format +#, c-format msgid "invalid source line %d in file `%s'" -msgstr "Quelldatei »%s« wurde bereits eingebunden" +msgstr "ungültige Quellzeilennummer %d in Datei »%s«" #: debug.c:3392 #, c-format msgid "Can't find specified location %d in file `%s'\n" -msgstr "" +msgstr "Der Zielpunkt %d in Datei »%s« ist nicht auffindbar\n" #: debug.c:3424 -#, fuzzy, c-format +#, c-format msgid "element not in array\n" -msgstr "delete: Index »%s« ist in Feld »%s« nicht vorhanden" +msgstr "Das Element ist kein Feld\n" #: debug.c:3424 #, c-format msgid "untyped variable\n" -msgstr "" +msgstr "untypisierte Variable\n" #: debug.c:3466 #, c-format msgid "Stopping in %s ...\n" -msgstr "" +msgstr "Stopp in %s ...\n" #: debug.c:3543 #, c-format msgid "'finish' not meaningful with non-local jump '%s'\n" -msgstr "" +msgstr "»finish« hat bei dem nichtlokalen Sprung »%s« keine Bedeutung\n" #: debug.c:3550 #, c-format msgid "'until' not meaningful with non-local jump '%s'\n" -msgstr "" +msgstr "»finish« hat bei dem nichtlokalen Sprung »%s« keine Bedeutung\n" #: debug.c:4185 msgid "\t------[Enter] to continue or q [Enter] to quit------" -msgstr "" +msgstr "\t-[Eingabe] um fort zu fahren oder b [Eingabe] für geenden -" #: debug.c:4186 msgid "q" -msgstr "" +msgstr "b" #: debug.c:5001 -#, fuzzy, c-format +#, c-format msgid "[\"%s\"] not in array `%s'" -msgstr "delete: Index »%s« ist in Feld »%s« nicht vorhanden" +msgstr "[\"%s\"] ist in Feld »%s« nicht vorhanden" #: debug.c:5207 #, c-format msgid "sending output to stdout\n" -msgstr "" +msgstr "Ausgabe wird an die Standardausgabe geschickt\n" #: debug.c:5247 msgid "invalid number" -msgstr "" +msgstr "ungültige Zahl" #: debug.c:5381 -#, fuzzy, c-format +#, c-format msgid "`%s' not allowed in current context; statement ignored" -msgstr "»exit« kann im aktuellen Kontext nicht aufgerufen werden" +msgstr "" +"»%s« ist im aktuellen Kontext nicht zulässig; der Ausdruck wird ignoriert" #: debug.c:5389 -#, fuzzy msgid "`return' not allowed in current context; statement ignored" -msgstr "»exit« kann im aktuellen Kontext nicht aufgerufen werden" +msgstr "" +"»reeturn« ist im aktuellen Kontext nicht zulässig; der Ausdruck wird " +"ignoriert" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" -msgstr "" +msgstr "Im aktuelln Kontext gibt es kein Symbol »%s«" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 msgid "unbalanced [" -msgstr "" +msgstr "nicht geschlossene [" -#: dfa.c:1174 -#, fuzzy +#: dfa.c:1118 msgid "invalid character class" -msgstr "Ungültiger Name für eine Zeichenklasse" +msgstr "ungültige Zeichenklasse" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" -msgstr "" +msgstr "Die Syntax für Zeichenklassen ist [[:space:]], nicht [:space:]" -#: dfa.c:1366 +#: dfa.c:1326 msgid "unfinished \\ escape" -msgstr "" +msgstr "nicht beendetes \\ Escape" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1473 +msgid "invalid content of \\{\\}" msgstr "Ungültiger Inhalt von \\{\\}" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1476 +msgid "regular expression too big" msgstr "Regulärer Ausdruck ist zu groß" -#: dfa.c:1936 +#: dfa.c:1911 msgid "unbalanced (" -msgstr "" +msgstr "nicht geschlossene (" -#: dfa.c:2062 +#: dfa.c:2037 msgid "no syntax specified" -msgstr "" +msgstr "keine Syntax angegeben" -#: dfa.c:2070 +#: dfa.c:2045 msgid "unbalanced )" -msgstr "" +msgstr "nicht geöffnete )" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "Unbekannter Knotentyp %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "Unbekannter Opcode %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "Opcode %s ist weder ein Operator noch ein Schlüsselwort" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "Pufferüberlauf in genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1873,723 +1976,693 @@ "\t# Funktions-Aufruf-Stack\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "»IGNORECASE« ist eine gawk-Erweiterung" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "»BINMODE« ist eine gawk-Erweiterung" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "BINMODE Wert »%s« ist ungültig und wird als 3 behandelt" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "Falsche »%sFMT«-Angabe »%s«" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "»--lint« wird abgeschaltet, da an »LINT« zugewiesen wird" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "Referenz auf nicht initialisiertes Argument »%s«" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "Referenz auf die nicht initialisierte Variable »%s«" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "Nicht numerischer Wert für Feldreferenz verwendet" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "Referenz auf ein Feld von einem Null-String" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "Versuch des Zugriffs auf Feld %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "Referenz auf das nicht initialisierte Feld »$%ld«" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "Funktion »%s« mit zu vielen Argumenten aufgerufen" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: unerwarteter Typ »%s«" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "Division durch Null versucht in »/=«" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "Division durch Null versucht in »%%=«" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "Erweiterungen sind im Sandbox-Modus nicht erlaubt" -#: ext.c:92 -#, fuzzy +#: ext.c:68 msgid "-l / @load are gawk extensions" -msgstr "»@include« ist eine gawk-Erweiterung" +msgstr "-l / @load sind gawk-Erweiterungen" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" -msgstr "" +msgstr "load_ext: NULL lib_name erhalten" -#: ext.c:98 -#, fuzzy, c-format +#: ext.c:74 +#, c-format msgid "load_ext: cannot open library `%s' (%s)\n" -msgstr "Fatal: extension: »%s« kann nicht geöffnet werden (%s)\n" +msgstr "load_ext: Bibliothek »%s« kann nicht geöffnet werden (%s)\n" -#: ext.c:104 -#, fuzzy, c-format +#: ext.c:80 +#, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" -"Fatal: Erweiterung: Bibliothek »%s«: definiert »plugin_is_GPL_compatible« " -"nicht (%s)\n" +"load_ext: Bibliothek »%s«: definiert »plugin_is_GPL_compatible« nicht (%s)\n" -#: ext.c:110 -#, fuzzy, c-format +#: ext.c:86 +#, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "" -"Fatal: Erweiterung: Bibliothek »%s«: Funktion »%s« kann nicht aufgerufen " -"werden (%s)\n" +"load_ext: Bibliothek »%s«: Funktion »%s« kann nicht aufgerufen werden (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" +"load_ext: die Initialisierungsroutine %2$s von Bibliothek »%1$s« ist " +"gescheitert\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "»extension« ist eine gawk-Erweiterung" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" -msgstr "" +msgstr "extension: NULL lib_name erhalten" -#: ext.c:180 -#, fuzzy, c-format +#: ext.c:156 +#, c-format msgid "extension: cannot open library `%s' (%s)" -msgstr "Fatal: extension: »%s« kann nicht geöffnet werden (%s)\n" +msgstr "extension: Bibliothek »%s« kann nicht geöffnet werden (%s)" -#: ext.c:186 -#, fuzzy, c-format +#: ext.c:162 +#, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" -"Fatal: Erweiterung: Bibliothek »%s«: definiert »plugin_is_GPL_compatible« " -"nicht (%s)\n" +"extension: Bibliothek »%s«: definiert »plugin_is_GPL_compatible« nicht (%s)" -#: ext.c:190 -#, fuzzy, c-format +#: ext.c:166 +#, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "" -"Fatal: Erweiterung: Bibliothek »%s«: Funktion »%s« kann nicht aufgerufen " -"werden (%s)\n" +"extension: Bibliothek »%s«: Funktion »%s« kann nicht aufgerufen werden (%s)" -#: ext.c:221 -#, fuzzy +#: ext.c:197 msgid "make_builtin: missing function name" -msgstr "Erweiterung: Funktionsname fehlt" +msgstr "make_builtin: Funktionsname fehlt" -#: ext.c:236 -#, fuzzy, c-format +#: ext.c:212 +#, c-format msgid "make_builtin: can't redefine function `%s'" -msgstr "Erweiterung: Funktion »%s« kann nicht neu definiert werden" +msgstr "make_builtin: Funktion »%s« kann nicht neu definiert werden" -#: ext.c:240 -#, fuzzy, c-format +#: ext.c:216 +#, c-format msgid "make_builtin: function `%s' already defined" -msgstr "Erweiterung: Funktion »%s« wurde bereits definiert" +msgstr "make_builtin: Funktion »%s« wurde bereits definiert" -#: ext.c:244 -#, fuzzy, c-format +#: ext.c:220 +#, c-format msgid "make_builtin: function name `%s' previously defined" -msgstr "Erweiterung: Funktion »%s« wurde bereits vorher definiert" +msgstr "make_builtin: Funktion »%s« wurde bereits vorher definiert" -#: ext.c:246 -#, fuzzy, c-format +#: ext.c:222 +#, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" -"Erweiterung: die eingebaute Funktion »%s« kann nicht als Funktionsname " -"verwendet werden" +"make_builtin: die in gawk eingebaute Funktion »%s« kann nicht als " +"Funktionsname verwendet werden" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: negative Anzahl von Argumenten für Funktion »%s«" -#: ext.c:276 -#, fuzzy +#: ext.c:252 msgid "extension: missing function name" msgstr "Erweiterung: Funktionsname fehlt" -#: ext.c:279 ext.c:283 -#, fuzzy, c-format +#: ext.c:255 ext.c:259 +#, c-format msgid "extension: illegal character `%c' in function name `%s'" -msgstr "Erweiterung: unzulässiges Zeichen »%c« in Funktionsname »%s«" +msgstr "extension: unzulässiges Zeichen »%c« in Funktionsname »%s«" -#: ext.c:291 -#, fuzzy, c-format +#: ext.c:267 +#, c-format msgid "extension: can't redefine function `%s'" -msgstr "Erweiterung: Funktion »%s« kann nicht neu definiert werden" +msgstr "extension: Funktion »%s« kann nicht neu definiert werden" -#: ext.c:295 -#, fuzzy, c-format +#: ext.c:271 +#, c-format msgid "extension: function `%s' already defined" -msgstr "Erweiterung: Funktion »%s« wurde bereits definiert" +msgstr "extension: Funktion »%s« wurde bereits definiert" -#: ext.c:299 -#, fuzzy, c-format +#: ext.c:275 +#, c-format msgid "extension: function name `%s' previously defined" -msgstr "Funktion »%s« wurde bereits definiert" +msgstr "extension: Funktion »%s« wurde bereits vorher definiert" -#: ext.c:301 -#, fuzzy, c-format +#: ext.c:277 +#, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" -"Erweiterung: die eingebaute Funktion »%s« kann nicht als Funktionsname " +"extension: die eingebaute Funktion »%s« kann nicht als Funktionsname " "verwendet werden" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "" "Funktion »%s« wird als Funktion definiert, die nie mehr als %d Argument(e) " "akzeptiert" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "Funktion »%s«: fehlendes Argument #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "" "Funktion »%s«: Argument #%d: Es wird versucht, einen Skalar als Feld zu " "verwenden" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "" "Funktion »%s«: Argument #%d: Es wird versucht, ein Feld als Skalar zu " "verwenden" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" -msgstr "" +msgstr "das dynamische Laden von Bibliotheken wird nicht unterstützt" #: extension/filefuncs.c:159 -#, fuzzy msgid "chdir: called with incorrect number of arguments, expecting 1" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "" +"chdir: Aufgruf mit einer ungültigen Anzahl von Argumenten, 1 wird erwartet" #: extension/filefuncs.c:439 #, c-format msgid "stat: unable to read symbolic link `%s'" -msgstr "" +msgstr "stst: die symbolische Verknüpfung »%s« kann nicht gelesenb werden" #: extension/filefuncs.c:472 -#, fuzzy msgid "stat: called with wrong number of arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "stat: Aufruf mit falscher Anzahl Argumenten" #: extension/filefuncs.c:479 -#, fuzzy msgid "stat: bad parameters" -msgstr "%s: ist ein Parameter\n" +msgstr "stat: ungültige Parameter" #: extension/filefuncs.c:533 -#, fuzzy, c-format +#, c-format msgid "fts init: could not create variable %s" -msgstr "index: Zweites Argument ist kein string" +msgstr "fts_init: Variable %s konnte nicht angelegt werden" #: extension/filefuncs.c:554 -#, fuzzy msgid "fts is not supported on this system" -msgstr "»%s« wird im alten awk nicht unterstützt" +msgstr "fts wird auf diesem System nicht unterstützt" #: extension/filefuncs.c:573 msgid "fill_stat_element: could not create array" -msgstr "" +msgstr "fill_stat_element: das Feld konnte nicht angelegt werden" #: extension/filefuncs.c:582 msgid "fill_stat_element: could not set element" -msgstr "" +msgstr "fill_stat_element: das Element konnte nicht gesetzt werden" #: extension/filefuncs.c:597 -#, fuzzy msgid "fill_path_element: could not set element" -msgstr "index: Zweites Argument ist kein string" +msgstr "fill_path_element: das Element konnte nicht gesetzt werden" #: extension/filefuncs.c:613 msgid "fill_error_element: could not set element" -msgstr "" +msgstr "fill_error_element: das Element konnte nicht gesetzt werden" #: extension/filefuncs.c:660 extension/filefuncs.c:707 msgid "fts-process: could not create array" -msgstr "" +msgstr "fts-process: das Feld konnte nicht anglegt werden" #: extension/filefuncs.c:670 extension/filefuncs.c:717 #: extension/filefuncs.c:735 -#, fuzzy msgid "fts-process: could not set element" -msgstr "index: Zweites Argument ist kein string" +msgstr "fts-process: das Element konnte nicht gesetzt werden" #: extension/filefuncs.c:784 -#, fuzzy msgid "fts: called with incorrect number of arguments, expecting 3" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "fts: Aufruf mit falscher Anzahl an Argumenten, es werden 3 erwartet" #: extension/filefuncs.c:787 -#, fuzzy msgid "fts: bad first parameter" -msgstr "%s: ist ein Parameter\n" +msgstr "fts: ungültiger Parameter" #: extension/filefuncs.c:793 -#, fuzzy msgid "fts: bad second parameter" -msgstr "%s: ist ein Parameter\n" +msgstr "fts: ungültiger zweiter Parameter" #: extension/filefuncs.c:799 -#, fuzzy msgid "fts: bad third parameter" -msgstr "%s: ist ein Parameter\n" +msgstr "%s: ist ein Parameter" #: extension/filefuncs.c:806 -#, fuzzy msgid "fts: could not flatten array\n" -msgstr "»%s« ist kein gültiger Variablenname" +msgstr "fts: ungültiger dritter Parameter\n" #: extension/filefuncs.c:824 msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah." msgstr "" +"fts: die heimtückische Kennung FTS_NOSTAT wird ignoriert, ätsch bätsch." #: extension/filefuncs.c:841 msgid "fts: clear_array() failed\n" -msgstr "" +msgstr "fts: clear_array() ist gescheitert\n" #: extension/fnmatch.c:112 -#, fuzzy msgid "fnmatch: called with less than three arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "fnmatch: Aufruf mit weniger als drei Argumenten" #: extension/fnmatch.c:115 -#, fuzzy msgid "fnmatch: called with more than three arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "fnmatch: Aufruf mit mehr als drei Argumenten" #: extension/fnmatch.c:118 -#, fuzzy msgid "fnmatch: could not get first argument" -msgstr "strftime: Das erste Argument ist kein String" +msgstr "fnmatch: Das erste Argument konnte nicht gelesen werden" #: extension/fnmatch.c:123 -#, fuzzy msgid "fnmatch: could not get second argument" -msgstr "index: Zweites Argument ist kein string" +msgstr "fnmatch: Das zweite Argument konnte nicht gelesen werden" #: extension/fnmatch.c:128 msgid "fnmatch: could not get third argument" -msgstr "" +msgstr "fnmatch: Das dritte Argument konnte nicht gelesen werden" #: extension/fnmatch.c:141 msgid "fnmatch is not implemented on this system\n" -msgstr "" +msgstr "fnmatch ist auf diesem System nicht implementiert\n" #: extension/fnmatch.c:173 msgid "fnmatch init: could not add FNM_NOMATCH variable" msgstr "" +"fnmatch_init: eine FNM_NOMATCH-Variable konnte nicht hinzu gefügt werden" #: extension/fnmatch.c:183 #, c-format msgid "fnmatch init: could not set array element %s" -msgstr "" +msgstr "fnmatch_init: das Feldelement %s konnte nicht initialisiert werden" #: extension/fnmatch.c:193 msgid "fnmatch init: could not install FNM array" -msgstr "" +msgstr "fnmatch_init: das FNM-Feld konnte nicht gesetzt werden." #: extension/fork.c:81 -#, fuzzy msgid "fork: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "fork: Aufruf mit zu vielen Argumenten" #: extension/fork.c:94 msgid "fork: PROCINFO is not an array!" -msgstr "" +msgstr "fork: PROCINFO ist kein Feld!" #: extension/fork.c:118 -#, fuzzy msgid "waitpid: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "waitpid: Aufruf mit zu vielen Argumenten" #: extension/fork.c:126 -#, fuzzy msgid "wait: called with no arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "wait: Aufruf ohne Argumente" #: extension/fork.c:143 -#, fuzzy msgid "wait: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "wait: Aufruf mit zu vielen Argumenten" #: extension/inplace.c:130 msgid "inplace_begin: in-place editing already active" -msgstr "" +msgstr "inplace_begin: direktes Editieren ist bereits aktiv" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" -msgstr "" +msgstr "inplace_begin: erwartet 2 Argumente aber wurde aufgerufen mit %d" #: extension/inplace.c:136 msgid "inplace_begin: cannot retrieve 1st argument as a string filename" -msgstr "" +msgstr "inplace_begin: das erste Argument ist kein Dateiname" #: extension/inplace.c:144 #, c-format msgid "inplace_begin: disabling in-place editing for invalid FILENAME `%s'" msgstr "" +"inplace_begin: direktes Editieren wird deaktiviert wegen des ungültigen " +"Dateinamens »%s«" #: extension/inplace.c:151 -#, fuzzy, c-format +#, c-format msgid "inplace_begin: Cannot stat `%s' (%s)" -msgstr "Fatal: extension: »%s« kann nicht geöffnet werden (%s)\n" +msgstr "inplace_begin: Status von »%s« kann nicht ermittelt werden (%s)" #: extension/inplace.c:158 -#, fuzzy, c-format +#, c-format msgid "inplace_begin: `%s' is not a regular file" -msgstr "»%s« ist kein gültiger Variablenname" +msgstr "inplace_begin: »%s« ist keine reguläre Datei" #: extension/inplace.c:169 #, c-format msgid "inplace_begin: mkstemp(`%s') failed (%s)" -msgstr "" +msgstr "inplace_begin: mkstemp(»%s«) ist gescheitert (%s)" -#: extension/inplace.c:178 -#, fuzzy, c-format +#: extension/inplace.c:181 +#, c-format msgid "inplace_begin: chmod failed (%s)" -msgstr "%s: close ist gescheitert (%s)" +msgstr "inplace_begin:: chmod ist gescheitert (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" -msgstr "" +msgstr "inplace_begin: dup(stdout) ist gescheitert (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" -msgstr "" +msgstr "inplace_begin: dup2(%d, stdout) ist gescheitert (%s)" -#: extension/inplace.c:191 -#, fuzzy, c-format +#: extension/inplace.c:194 +#, c-format msgid "inplace_begin: close(%d) failed (%s)" -msgstr "%s: close ist gescheitert (%s)" +msgstr "inplace_begin: close(%d) ist gescheitert (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" -msgstr "" +msgstr "inplace_end: das erste Argument ist kein Dateiname" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" -msgstr "" +msgstr "inplace_end: direktes Editieren ist nicht aktiv" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" -msgstr "" +msgstr "inplace_end: dup2(%d, stdout) ist gescheitert (%s)" -#: extension/inplace.c:226 -#, fuzzy, c-format +#: extension/inplace.c:229 +#, c-format msgid "inplace_end: close(%d) failed (%s)" -msgstr "%s: close ist gescheitert (%s)" +msgstr "inplace_end: close(%d) ist gescheitert (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" -msgstr "" +msgstr "inplace_end: fsetpos(stdout) ist gescheitert (%s)" -#: extension/inplace.c:243 -#, fuzzy, c-format +#: extension/inplace.c:246 +#, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" -msgstr "Das Leeren der Pipe »%s« ist gescheitert (%s)" +msgstr "inplace_end: link(»%s«, »%s«) ist gescheitert (%s)" -#: extension/inplace.c:253 -#, fuzzy, c-format +#: extension/inplace.c:256 +#, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" -msgstr "Das Schließen des Dateideskriptors %d (»%s«) ist gescheitert (%s)" +msgstr "inplace_end: rename(»%s«, »%s«) ist gescheitert (%s)" #: extension/ordchr.c:69 -#, fuzzy msgid "ord: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "ord: Aufruf mit yu vielen Argumenten" #: extension/ordchr.c:75 -#, fuzzy msgid "ord: called with no arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "ord: Aufruf ohne Argumente" #: extension/ordchr.c:77 -#, fuzzy msgid "ord: called with inappropriate argument(s)" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "ord: Aufruf mit ungeeigneten Argumenten" #: extension/ordchr.c:99 -#, fuzzy msgid "chr: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "chr: Aufruf mit zu vielen Argumenten" #: extension/ordchr.c:109 -#, fuzzy msgid "chr: called with no arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "chr: Aufruf ohne Argumente" #: extension/ordchr.c:111 -#, fuzzy msgid "chr: called with inappropriate argument(s)" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "chr: Aufruf mit ungeeigneten Argumenten" #: extension/readdir.c:281 #, c-format msgid "dir_take_control_of: opendir/fdopendir failed: %s" -msgstr "" +msgstr "dir_take_control_of: opendir/fdopendir ist gescheitert: %s" #: extension/readfile.c:113 -#, fuzzy msgid "readfile: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "readfile: Aufruf mit zu vielen Argumenten" #: extension/readfile.c:137 -#, fuzzy msgid "readfile: called with no arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "readfile: Aufruf ohen Argumente" -#: extension/rwarray.c:124 -#, fuzzy +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "revoutput: die Variable REVOUT konnte nicht initialisiert werden" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "writea: Aufruf mit zu vielen Argumenten" -#: extension/rwarray.c:131 -#, fuzzy, c-format +#: extension/rwarray.c:131 extension/rwarray0.c:116 +#, c-format msgid "do_writea: argument 0 is not a string\n" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "do_writea: das Argument 0 ist keine Zeichenkette\n" -#: extension/rwarray.c:137 -#, fuzzy, c-format +#: extension/rwarray.c:137 extension/rwarray0.c:122 +#, c-format msgid "do_writea: argument 1 is not an array\n" -msgstr "split: das vierte Argument ist kein Feld" +msgstr "do_writea: das Argument 1 ist kein Feld\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" -msgstr "" +msgstr "write_array: das Feld konnte nicht niveliert werden\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" -msgstr "" +msgstr "write_array: das nivelierte Feld konnte nicht frei gegeben werden\n" -#: extension/rwarray.c:280 -#, fuzzy +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "reada: Aufruf mit zu vielen Argumenten" -#: extension/rwarray.c:287 -#, fuzzy, c-format +#: extension/rwarray.c:287 extension/rwarray0.c:272 +#, c-format msgid "do_reada: argument 0 is not a string\n" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "do_reada: Argument 0 ist keine Zeichenkette\n" -#: extension/rwarray.c:293 -#, fuzzy, c-format +#: extension/rwarray.c:293 extension/rwarray0.c:278 +#, c-format msgid "do_reada: argument 1 is not an array\n" -msgstr "match: das dritte Argument ist kein Array" +msgstr "do_reada: Argument 1 ist kein Feld\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" -msgstr "" +msgstr "do_reada: clear_array ist gescheitert\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" -msgstr "" +msgstr "read_array: set_array_element ist gescheitert\n" #: extension/time.c:113 -#, fuzzy msgid "gettimeofday: ignoring arguments" -msgstr "mktime: Das Argument ist kein String" +msgstr "gettimeofday: die Argumente werden ignoriert" #: extension/time.c:144 msgid "gettimeofday: not supported on this platform" -msgstr "" +msgstr "gettimeofday: wird auf dieser Plattform nicht unterstützt" #: extension/time.c:165 -#, fuzzy msgid "sleep: called with too many arguments" -msgstr "sqrt: das Argument %g ist negativ" +msgstr "sleep: Aufruf mit zu vielen Argumenten" #: extension/time.c:168 -#, fuzzy msgid "sleep: missing required numeric argument" -msgstr "exp: das Argument ist keine Zahl" +msgstr "sleep: das erforderliche numerische Argument fehlt" #: extension/time.c:174 -#, fuzzy msgid "sleep: argument is negative" -msgstr "exp: das Argument %g liegt außerhalb des gültigen Bereichs" +msgstr "sleep: das Argument ist negativ" #: extension/time.c:208 msgid "sleep: not supported on this platform" -msgstr "" +msgstr "sleep: wird auf dieser Plattform nicht unterstützt" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF wird ein negativer Wert zugewiesen" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: das vierte Argument ist eine gawk-Erweiterung" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: das vierte Argument ist kein Feld" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: das zweite Argument ist kein Feld" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: als zweites und viertes Argument kann nicht das gleiche Feld " "verwendet werden" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: Ein untergeordnetes Feld des zweiten Arguments kann nicht als viertes " "Argument verwendet werden" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: Ein untergeordnetes Feld des vierten Arguments kann nicht als zweites " "Argument verwendet werden" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: Null-String als drittes Argument ist eine gawk-Erweiterung" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: Das vierte Argument ist kein Feld" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: Das zweite Argument ist kein Feld" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: Das dritte Argument darf nicht Null sein" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: als zweites und viertes Argument kann nicht das gleiche Feld " "verwendet werden" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: Ein untergeordnetes Feld des zweiten Arguments kann nicht als " "viertes Argument verwendet werden" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: Ein untergeordnetes Feld des vierten Arguments kann nicht als " "zweites Argument verwendet werden" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "»FIELDWIDTHS« ist eine gawk-Erweiterung" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "ungültiger FIELDWIDTHS-Wert nah bei »%s«" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "Null-String für »FS« ist eine gawk-Erweiterung" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "Das alte awk unterstützt keine regulären Ausdrücke als Wert von »FS«" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "»FPAT« ist eine gawk-Erweiterung" #: gawkapi.c:146 msgid "awk_value_to_node: received null retval" -msgstr "" +msgstr "awk_value_to_node: Rückgabewert Null erhalten" #: gawkapi.c:384 msgid "node_to_awk_value: received null node" -msgstr "" +msgstr "node_to_awk_value: Null-Knoten erhalten" #: gawkapi.c:387 msgid "node_to_awk_value: received null val" -msgstr "" +msgstr "node_to_awk_value: Null-Wert erhalten" -#: gawkapi.c:807 -#, fuzzy +#: gawkapi.c:809 msgid "remove_element: received null array" -msgstr "length: Argument ist ein Feld" +msgstr "remove_element: Null-Feld erhalten" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" -msgstr "" +msgstr "remove_element: Null-Index erhalten" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" -msgstr "" +msgstr "api_flatten_array: Index %d konnte nicht umgewandelt werden\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" -msgstr "" +msgstr "api_flatten_array: Wert %d konnte nicht umgewandelt werden\n" #: getopt.c:604 getopt.c:633 -#, fuzzy, c-format +#, c-format msgid "%s: option '%s' is ambiguous; possibilities:" -msgstr "%s: Option »%s« ist mehrdeutig\n" +msgstr "%s: Option »%s« ist mehrdeutig; Mögliche Bedautung:" #: getopt.c:679 getopt.c:683 #, c-format @@ -2641,536 +2714,505 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: Die Option »-W %s« erfordert ein Argument\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "" "das Kommandozeilen-Argument »%s« ist ein Verzeichnis: wird übersprungen" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "Die Datei »%s« kann nicht zum Lesen geöffnet werden (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "Das Schließen des Dateideskriptors %d (»%s«) ist gescheitert (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "Umlenkungen sind im Sandbox-Modus nicht erlaubt" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "" "Der Ausdruck in einer Umlenkung mittels »%s« hat nur einen numerischen Wert" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "Der Ausdruck für eine Umlenkung mittels »%s« ist ein leerer String" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "Der Dateiname »%s« für eine Umlenkung mittels »%s« kann das Ergebnis eines " "logischen Ausdrucks sein" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "Unnötige Kombination von »>« und »>>« für Datei »%.*s«" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "Die Pipe »%s« kann nicht für die Ausgabe geöffnet werden (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "Die Pipe »%s« kann nicht für die Eingabe geöffnet werden (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" "Die bidirektionale Pipe »%s« kann nicht für die Ein-/Ausgabe geöffnet werden " "(%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "Von »%s« kann nicht umgelenkt werden (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "Zu »%s« kann nicht umgelenkt werden (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "Die Systemgrenze offener Dateien ist erreicht, daher werden nun " "Dateideskriptoren mehrfach verwendet" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "Das Schließen von »%s« ist gescheitert (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "Zu viele Pipes oder Eingabedateien offen" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: Das zweite Argument muss »to« oder »from« sein" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: »%.*s« ist weder offene Datei, noch Pipe oder Ko-Prozess" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "»close« für eine Umlenkung, die nie geöffnet wurde" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: Umlenkung »%s« wurde nicht mit »[&« geöffnet, das zweite Argument " "wird ignoriert" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "Fehlerstatus (%d) beim Schließen der Pipe »%s« (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "Fehlerstatus (%d) beim Schließen der Datei »%s« (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "Das explizite Schließen des Sockets »%s« fehlt" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "Das explizite Schließen des Ko-Prozesses »%s« fehlt" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "Das explizite Schließen der Pipe »%s« fehlt" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "Das explizite Schließen der Datei »%s« fehlt" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "Fehler beim Schreiben auf die Standardausgabe (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "Fehler beim Schreiben auf die Standardfehlerausgabe (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "Das Leeren der Pipe »%s« ist gescheitert (%s)" -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "Ko-Prozess: Das Leeren der Pipe zu »%s« ist gescheitert (%s)" -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "Das Leeren der Datei »%s« ist gescheitert (%s)" -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "Der lokale Port »%s« ist ungültig in »/inet«" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "Die Angaben zu entferntem Host und Port (%s, %s) sind ungültig" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "Es wurde kein (bekanntes) Protokoll im Dateinamen »%s« angegeben" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "Der Dateiname »%s« ist unvollständig" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "Sie müssen in /inet einen Rechnernamen angeben" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "Sie müssen in »/inet« einen Port angeben" - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "TCP/IP-Verbindungen werden nicht unterstützt" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "»%s« konnte nicht geöffnet werden, Modus »%s«" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "" "Das Schließen der übergeordneten Terminal-Gerätedatei ist gescheitert (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "Das Schließen der Standardausgabe im Kindprozess ist gescheitert (%s)" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "Das Verschieben der untergeordneten Terminal-Gerätedatei zur Standardausgabe " "im Kindprozess ist gescheitert (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "Schließen von stdin im Kindprozess gescheitert (%s)" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "Das Verschieben der untergeordneten Terminal-Gerätedatei zur Standardeingabe " "im Kindprozess ist gescheitert (dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "" "Das Schließen der untergeordneten Terminal-Gerätedatei ist gescheitert (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "Das Verschieben der Pipe zur Standardausgabe im Kindprozess ist gescheitert " "(dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "Das Verschieben der Pipe zur Standardeingabe im Kindprozess ist gescheitert " "(dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" msgstr "" "Das Wiederherstellen der Standardausgabe im Elternprozess ist gescheitert\n" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" msgstr "" "Das Wiederherstellen der Standardeingabe im Elternprozess ist gescheitert\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "Das Schließen der Pipe ist gescheitert (%s)" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "»|&« wird nicht unterstützt" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "Pipe »%s« kann nicht geöffnet werden (%s)" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "Kindprozess für »%s« kann nicht erzeugt werden (fork: %s)" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" -msgstr "" +msgstr "register_input_parser: NULL-Zeiger erhalten" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" +"Eingabeparser »%s« steht im Konflikt mit dem vorher installierten " +"Eingabeparser »%s«" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" -msgstr "" +msgstr "Eingabeparser »%s« konnte »%s« nicht öffnen" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" -msgstr "" +msgstr "register_output_wrapper: NULL-Zeiger erhalten" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" -msgstr "" +msgstr "Ausgabeverpackung »%s« steht im Konflikt mit Ausgabeverpackung »%s«" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" -msgstr "" +msgstr "Ausgabeverpackung »%s« konnte »%s« nicht öffnen" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" -msgstr "" +msgstr "register_output_processor: NULL-Zeiger erhalten" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " "`%s'" -msgstr "" +msgstr "Zweiwegeprozessor »%s« steht im Konflikt mit Zweiwegeprozessor »%s«" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" -msgstr "" +msgstr "Zweiwegeprozessor »%s« konnte »%s« nicht öffnen" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "Die Datei »%s« ist leer" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "Es konnte kein weiterer Speicher für die Eingabe beschafft werden" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "Multicharacter-Wert von »RS« ist eine gawk-Erweiterung" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "IPv6-Verbindungen werden nicht unterstützt" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "Das leere Argument für »--source« wird ignoriert" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: Die Option »-W %s« ist unbekannt und wird ignoriert\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: Die Option %c erfordert ein Argument\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "Die Umgebungsvariable »POSIXLY_CORRECT« ist gesetzt: »--posix« wird " "eingeschaltet" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "»--posix« hat Vorrang vor »--traditional«" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "»--posix« /»--traditional« hat Vorrang vor »--non-decimal-data«" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "%s als setuid root auszuführen kann zu Sicherheitsproblemen führen" -#: main.c:588 -#, fuzzy +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" -msgstr "»--posix« hat Vorrang vor »--binary«" +msgstr "»--posix« hat Vorrang vor »--characters-as-bytes«" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "" "Das Setzen des Binärermodus für die Standardeingabe ist nicht möglich (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "" "Das Setzen des Binärermodus für die Standardausgabe ist nicht möglich (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "" "Das Setzen des Binärermodus für die Standardfehlerausgabe ist nicht möglich " "(%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "Es wurde überhaupt kein Programmtext angegeben!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Aufruf: %s [POSIX- oder GNU-Optionen] -f PROGRAMM [--] Datei ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Aufruf: %s [POSIX- oder GNU-Optionen] -- %cPROGRAMM%c Datei ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "POSIX-Optionen\t\tlange GNU-Optionen: (standard)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f PROGRAMM\t\t--file=PROGRAMM\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F Feldtrenner\t\t\t--field-separator=Feldtrenner\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=Wert\t\t--assign=var=Wert\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "POSIX-Optionen\t\tGNU-Optionen (lang): (Erweiterungen)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d [Datei]\t\t--dump-variables[=Datei]\n" -#: main.c:815 -#, fuzzy +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" -msgstr "\t-p [Datei]\t\t--profile[=Datei]\n" +msgstr "\t-D[Datei]\t\t--debug[=Datei]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'Programmtext'\t--source=Programmtext\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E Datei\t\t\t--exec=Datei\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" -msgstr "" +msgstr "\t-i einzubindende_datei\t\t--include=einzubindende_datei\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" -msgstr "" - -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" -msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" +msgstr "\t-l Bibliothek\t\t--load=Bibliothek\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" +msgstr "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" -#: main.c:824 -#, fuzzy +#: main.c:591 msgid "\t-M\t\t\t--bignum\n" -msgstr "\t-g\t\t\t--gen-pot\n" +msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 -#, fuzzy +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:594 msgid "\t-o[file]\t\t--pretty-print[=file]\n" -msgstr "\t-p [Datei]\t\t--profile[=Datei]\n" +msgstr "\t-o[Datei]\t\t--pretty-print[=Datei]\n" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p [Datei]\t\t--profile[=Datei]\n" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3179,7 +3221,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3191,11 +3233,11 @@ "in »gawk.info«, den Sie als Kapitel »Reporting Problems and Bugs«\n" "in der gedruckten Version finden.\n" "\n" -"Fehler in der Übersetzuung senden Sie bitte als E-Mail an\n" -"an translation-team-de@lists.sourceforge.net\n" +"Fehler in der Übersetzung senden Sie bitte als E-Mail an\n" +"translation-team-de@lists.sourceforge.net\n" "\n" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3206,7 +3248,7 @@ "auf der Standardausgabe aus.\n" "\n" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3216,7 +3258,7 @@ "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3236,7 +3278,7 @@ "spätere Version.\n" "\n" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3249,7 +3291,7 @@ "leistung einer HANDELBARKEIT oder der EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.\n" "Sehen Sie bitte die GNU General Public License für weitere Details.\n" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3258,16 +3300,16 @@ "diesem Programm erhalten haben. Wenn nicht, lesen Sie bitte\n" "http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft setzt FS im POSIX-awk nicht auf Tab" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "unbekannter Wert für eine Feldangabe: %d\n" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3276,131 +3318,152 @@ "%s: Argument »%s« von »-v« ist nicht in der Form »Variable=Wert«\n" "\n" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "»%s« ist kein gültiger Variablenname" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "»%s« ist kein Variablenname, es wird nach der Datei »%s=%s« gesucht" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "" "die eingebaute Funktion »%s« kann nicht als Variablenname verwendet werden" # c-format -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "Funktion »%s« kann nicht als Name einer Variablen verwendet werden" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "Fließkomma-Ausnahme" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "Fataler Fehler: interner Fehler" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "Fataler Fehler: interner Fehler: Speicherbegrenzungsfehler" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "Fataler Fehler: interner Fehler: Stapelüberlauf" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "Kein bereits geöffneter Dateideskriptor %d" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "/dev/null konnte nicht für Dateideskriptor %d geöffnet werden" -#: mpfr.c:550 -#, fuzzy, c-format +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "Das leere Argument für »--source« wird ignoriert" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" +"-M wurde ignoriert: die Unterstützung von MPFR/GMP wurde nicht eingebaut" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: Die Option »-W %s« ist unbekannt und wird ignoriert\n" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: Die Option %c erfordert ein Argument\n" + +#: mpfr.c:557 +#, c-format msgid "PREC value `%.*s' is invalid" -msgstr "BINMODE Wert »%s« ist ungültig und wird als 3 behandelt" +msgstr "PREC Wert »%.*s« ist ungültig" -#: mpfr.c:608 -#, fuzzy, c-format +#: mpfr.c:615 +#, c-format msgid "RNDMODE value `%.*s' is invalid" -msgstr "BINMODE Wert »%s« ist ungültig und wird als 3 behandelt" +msgstr "BINMODE Wert »%.*s« ist ungültig" -#: mpfr.c:698 -#, fuzzy, c-format +#: mpfr.c:711 +#, c-format msgid "%s: received non-numeric argument" -msgstr "cos: das Argument ist keine Zahl" +msgstr "%s: das Argument ist keine Zahl" -#: mpfr.c:800 -#, fuzzy +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" -msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen" +msgstr "compl(%Rg): ein negativer Wert wird zu merkwürdigen Ergebnissen führen" -#: mpfr.c:804 -#, fuzzy +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" -msgstr "compl(%lf): Dezimalteil wird abgeschnitten" +msgstr "compl(%Rg): Dezimalteil wird abgeschnitten" -#: mpfr.c:816 -#, fuzzy, c-format +#: mpfr.c:836 +#, c-format msgid "cmpl(%Zd): negative values will give strange results" -msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen" +msgstr "cmpl(%Zd): Negative Werte führen zu merkwürdigen Ergebnissen" -#: mpfr.c:835 -#, fuzzy, c-format +#: mpfr.c:855 +#, c-format msgid "%s: received non-numeric argument #%d" -msgstr "cos: das Argument ist keine Zahl" +msgstr "%s: das Argument Nr. %d ist keine Zahl" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "" +"%s: Argument Nr. %d hat den ungültigen Wert %Rg, es wird stattdessen 0 " +"verwendet" -#: mpfr.c:857 -#, fuzzy +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" -msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen" +msgstr "" +"%s: der negative Wert %2$Rg in Argument Nr. %1$d wird zu merkwürdigen " +"Ergebnissen führen" -#: mpfr.c:863 -#, fuzzy +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" -msgstr "or(%lf, %lf): Dezimalteil wird abgeschnitten" +msgstr "%s: der Nachkommateil %2$Rg in Argument Nr. %1$d wird abgeschnitten" -#: mpfr.c:878 -#, fuzzy, c-format +#: mpfr.c:898 +#, c-format msgid "%s: argument #%d negative value %Zd will give strange results" -msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen" +msgstr "" +"%1$s: der negative Wert %3$Zd in Argument Nr. %2$d wird zu merkwürdigen " +"Ergebnissen führen" #: msg.c:68 #, c-format msgid "cmd. line:" msgstr "Kommandozeile:" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "Backslash am Ende der Zeichenkette" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" -msgstr "Das alte awk unterstützt die Fluchsequenz »\\%c« nicht" +msgstr "Das alte awk unterstützt die Escapesequenz »\\%c« nicht" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX erlaubt keine »\\x«-Escapes" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "In der »\\x«-Fluchtsequenz sind keine hexadezimalen Zahlen" -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3409,12 +3472,12 @@ "Die Hex-Sequenz \\x%.*s aus %d Zeichen wird wahrscheinlich nicht wie " "gewünscht interpretiert" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "Fluchtsequenz »\\%c« wird wie ein normales »%c« behandelt" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3435,56 +3498,57 @@ msgstr "" "%s %s »%s«: close-on-exec konnte nicht gesetzt werden: (fcntl F_SETFD: %s)" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "»%s« konnte nicht zum Schreiben geöffnet werden: %s" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" msgstr "Das Profil wird auf der Standardfehlerausgabe ausgegeben" -#: profile.c:193 +#: profile.c:213 #, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s Blöcke\n" +"\t# %s Regel(n)\n" "\n" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" "\n" msgstr "" -"\t# Regeln(s)\n" +"\t# Regel(n)\n" "\n" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "Interner Fehler: %s mit null vname" -#: profile.c:537 -#, fuzzy +#: profile.c:558 msgid "internal error: builtin with null fname" -msgstr "Interner Fehler: %s mit null vname" +msgstr "Interner Fehler: eingebaute Fuktion mit leerem fname" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" "\n" msgstr "" +"\t# Erweiterungen geladen (-l und/oder @load)\n" +"\n" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawk-Profil, erzeugt %s\n" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" @@ -3493,7 +3557,7 @@ "\n" "\t# Funktionen in alphabetischer Reihenfolge\n" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: unbekannter Umlenkungstyp %d" @@ -3504,214 +3568,84 @@ msgstr "" "Regulärer-Ausdruck-Komponente »%.*s« sollte wahrscheinlich »[%.*s]« sein" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Erfolg" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Kein Treffer" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Ungültiger Regulärer Ausdruck" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Ungültiges Zeichen" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Ungültiger Name für eine Zeichenklasse" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Angehängter Backslash" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Ungültige Rück-Referenz" -#: regcomp.c:152 -msgid "Unmatched [ or [^" -msgstr "[ oder [^ werden nicht geschlossen" +#: regcomp.c:160 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[, [^, [:, [., oder [= werden nicht geschlossen" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "( oder \\( werden nicht geschlossen" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "\\{ wird nicht geschlossen" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Ungültiger Inhalt von \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Ungültiges Bereichsende" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Kein freier Speicher mehr vorhanden" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Vorangehender regulärer Ausdruck ist ungültig" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Vorzeitiges Ende des regulären Ausdrucks" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Regulärer Ausdruck ist zu groß" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr ") oder \\) werden nicht geöffnet" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Kein vorangehender regulärer Ausdruck" -#: symbol.c:741 -msgid "can not pop main context" +#: symbol.c:677 +#, c-format +msgid "function `%s': can't use function `%s' as a parameter name" msgstr "" +"Funktion „%s“: Funktionsname „%s“ kann nicht als Parametername benutzt werden" -#~ msgid "range of the form `[%c-%c]' is locale dependent" -#~ msgstr "" -#~ "Ein Bereich in der Form »[%c-%c]« ist abhängig von der gesetzten Locale" - -#, fuzzy -#~ msgid "[s]printf called with no arguments" -#~ msgstr "sqrt: das Argument %g ist negativ" - -#~ msgid "`-m[fr]' option irrelevant in gawk" -#~ msgstr "Die Option »-m[fr]« ist in gawk bedeutungslos" - -#~ msgid "-m option usage: `-m[fr] nnn'" -#~ msgstr "Anwendung der Option -m: »-m[fr] nnn«" - -#, fuzzy -#~ msgid "%s: received non-numeric first argument" -#~ msgstr "or: das erste Argument ist keine Zahl" - -#, fuzzy -#~ msgid "%s: received non-numeric second argument" -#~ msgstr "or: das zweite Argument ist keine Zahl" - -#, fuzzy -#~ msgid "%s(%Rg, ..): negative values will give strange results" -#~ msgstr "" -#~ "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" - -#, fuzzy -#~ msgid "%s(%Rg, ..): fractional values will be truncated" -#~ msgstr "or(%lf, %lf): Dezimalteil wird abgeschnitten" - -#, fuzzy -#~ msgid "%s(%Zd, ..): negative values will give strange results" -#~ msgstr "" -#~ "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" - -#, fuzzy -#~ msgid "%s(.., %Rg): negative values will give strange results" -#~ msgstr "" -#~ "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" - -#, fuzzy -#~ msgid "%s(.., %Zd): negative values will give strange results" -#~ msgstr "" -#~ "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen" - -#~ msgid "`%s' is a Bell Labs extension" -#~ msgstr "»%s« ist eine Erweiterung der Bell Labs" - -#~ msgid "`nextfile' is a gawk extension" -#~ msgstr "»nextfile« ist eine gawk-Erweiterung" - -#~ msgid "`delete array' is a gawk extension" -#~ msgstr "»delete array« ist eine gawk-Erweiterung" - -#~ msgid "and: received non-numeric first argument" -#~ msgstr "and: das erste Argument ist keine Zahl" - -#~ msgid "and: received non-numeric second argument" -#~ msgstr "and: das zweite Argument ist keine Zahl" - -#~ msgid "and(%lf, %lf): fractional values will be truncated" -#~ msgstr "and(%lf, %lf): Dezimalteil wird abgeschnitten" - -#~ msgid "xor: received non-numeric first argument" -#~ msgstr "xor: das erste Argument ist keine Zahl" - -#~ msgid "xor: received non-numeric second argument" -#~ msgstr "xor: das zweite Argument ist keine Zahl" - -#~ msgid "xor(%lf, %lf): fractional values will be truncated" -#~ msgstr "xor(%lf, %lf): Dezimalteil wird abgeschnitten" - -#~ msgid "Operation Not Supported" -#~ msgstr "Die Operation wird nicht unterstützt" - -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "Es wird versucht, die Funktion »%s« als Feld zu verwenden" - -#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" -#~ msgstr "Bezug auf ein nicht initialisiertes Element »%s[\"%.*s\"]«" - -#~ msgid "subscript of array `%s' is null string" -#~ msgstr "Der Index von Feld »%s« ist ein Nullstring" - -#~ msgid "%s: empty (null)\n" -#~ msgstr "%s: leer (Null)\n" - -#~ msgid "%s: empty (zero)\n" -#~ msgstr "%s: leer (0)\n" - -#~ msgid "%s: table_size = %d, array_size = %d\n" -#~ msgstr "%s: Tabellengröße = %d, Feldgröße = %d\n" - -#~ msgid "%s: array_ref to %s\n" -#~ msgstr "%s: Feld-Referenz auf %s\n" - -#~ msgid "use of non-array as array" -#~ msgstr "Verwendung eines Nicht-Feldes als Feld" - -#~ msgid "can't use function name `%s' as variable or array" -#~ msgstr "Funktion »%s« kann nicht als Variable oder Feld verwendet werden" - -#~ msgid "assignment used in conditional context" -#~ msgstr "Zuweisung in einer Bedingung" - -#~ msgid "statement has no effect" -#~ msgstr "Anweisung hat keinen Effekt" - -#~ msgid "" -#~ "for loop: array `%s' changed size from %ld to %ld during loop execution" -#~ msgstr "" -#~ "for-Schleife: Feld »%s« ändert seine Größe von %ld innerhalb der Schleife " -#~ "zu %ld" - -#~ msgid "function called indirectly through `%s' does not exist" -#~ msgstr "die durch »%s« indirekt aufgerufene Funktion existiert nicht" - -#~ msgid "function `%s' not defined" -#~ msgstr "Funktion »%s« ist nicht definiert" - -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "Nicht umgelenktes »getline« ist innerhalb der »%s«-Aktion unzuässig" - -#~ msgid "`nextfile' cannot be called from a `%s' rule" -#~ msgstr "»nextfile« kann nicht aus einer »«%s-Regel aufgerufen werden" - -#~ msgid "`next' cannot be called from a `%s' rule" -#~ msgstr "»next« kann nicht in einer »%s«-Regel verwendet werden" - -#~ msgid "Sorry, don't know how to interpret `%s'" -#~ msgstr "" -#~ "Entschuldigung, aber es ist unbekannt, wie »%s« zu interpretieren ist" - -#~ msgid "\t-R file\t\t\t--command=file\n" -#~ msgstr "\t-R Datei\t\t\t--command=Datei\n" - -#~ msgid "could not find groups: %s" -#~ msgstr "Die Gruppen konnten nicht gefunden werden: %s" - -#~ msgid "assignment is not allowed to result of builtin function" -#~ msgstr "" -#~ "Zuweisungen an das Ergebnis einer eingebauten Funktion sind nicht erlaubt" +#: symbol.c:809 +msgid "can not pop main context" +msgstr "der Hauptkontext kann nicht entfernt werden" diff -urN gawk-4.1.1/po/es.po gawk-4.1.2/po/es.po --- gawk-4.1.1/po/es.po 2014-04-08 19:23:36.000000000 +0300 +++ gawk-4.1.2/po/es.po 2015-04-29 08:36:41.000000000 +0300 @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.0.0h\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" "PO-Revision-Date: 2012-01-30 07:42-0600\n" "Last-Translator: Cristian Othón Martínez Vera \n" "Language-Team: Spanish \n" @@ -35,9 +35,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "se intentó usar el escalar `%s' como una matriz" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "se intentó usar la matriz `%s' en un contexto escalar" @@ -97,421 +97,426 @@ "asorti: no se puede usar una submatriz del segundo argumento para el primer " "argumento" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "`%s' es inválido como un nombre de función" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "la función de comparación de ordenamiento `%s' no está definida" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "los bloques %s deben tener una parte de acción" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "cada regla debe tener un patrón o una parte de acción" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "el awk antiguo no admite múltiples reglas `BEGIN' o `END'" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "`%s' es una función interna, no se puede redefinir" -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" "la constante de expresión regular `//' parece un comentario de C++, pero no " "lo es" -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" "la constante de expresión regular `/%s/' parece un comentario de C, pero no " "lo es" -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "valores case duplicados en el cuerpo de un switch: %s" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "se detectó un `default' duplicado en el cuerpo de un switch" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "no se permite `break' fuera de un bucle o switch" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "no se permite `continue' fuera de un bucle" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "se usó `next' en la acción %s" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "se usó `nextfile' en la acción %s" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "se usó `return' fuera del contexto de la función" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "el `print' simple en la regla BEGIN o END probablemente debe ser `print \"\"'" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" msgstr "" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" msgstr "" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(array)' es una extensión de tawk que no es transportable" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "las líneas de trabajo de dos vías multiestado no funcionan" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "expresión regular del lado derecho de una asignación" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "expresión regular a la izquierda del operador `~' o `!~'" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" msgstr "" "el awk antiguo no admite la palabra clave `in' excepto después de `for'" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "expresión regular a la derecha de una comparación" -#: awkgram.y:1417 +#: awkgram.y:1410 #, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "`getline var' inválido dentro de la regla `%s'" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "`getline' no redirigido es inválido dentro de la regla `%s'" -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "`getline' inválido dentro de la regla `%s'" - -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" msgstr "`getline' no redirigido indefinido dentro de la acción de END" -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "el awk antiguo no admite matrices multidimensionales" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "la llamada de `length' sin paréntesis no es transportable" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "las llamadas indirectas a función son una extensión de gawk" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "no se puede usar la variable especial `%s' como llamada indirecta a función" +#: awkgram.y:1634 +#, fuzzy, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "se intentó usar la función `%s' como una matriz" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "expresión de subíndice inválida" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "aviso: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fatal: " -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "nueva línea o fin de la cadena inesperados" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "no se puede abrir el fichero fuente `%s' para lectura (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2392 awkgram.y:2517 #, fuzzy, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "no se puede abrir el fichero fuente `%s' para lectura (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "razón desconocida" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "ya se incluyó el fichero fuente `%s'" -#: awkgram.y:2409 +#: awkgram.y:2417 #, fuzzy, c-format msgid "already loaded shared library `%s'" msgstr "ya se incluyó el fichero fuente `%s'" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "@include es una extensión de gawk" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "nombre de fichero vacío después de @include" -#: awkgram.y:2494 +#: awkgram.y:2502 #, fuzzy msgid "@load is a gawk extension" msgstr "@include es una extensión de gawk" -#: awkgram.y:2500 +#: awkgram.y:2508 #, fuzzy msgid "empty filename after @load" msgstr "nombre de fichero vacío después de @include" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "texto de programa vacío en la linea de órdenes" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "no se puede leer el fichero fuente `%s' (%s)" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "el fichero fuente `%s' está vacío" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2958 msgid "source file does not end in newline" msgstr "el fichero fuente no termina con línea nueva" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "expresión regular sin terminar termina con `\\` al final del fichero" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "%s: %d: el modificador de expresión regular `/.../%c` de tawk no funciona en " "gawk" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "el modificador de expresión regular `/.../%c` de tawk no funciona en gawk" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "expresión regular sin terminar" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "expresión regular sin terminar al final del fichero" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" msgstr "el uso de la continuación de línea `\\ #...' no es transportable" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "la barra invertida no es el último caracter en la línea" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "POSIX no permite el operador `**='" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "el awk antiguo no admite el operador `**='" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "POSIX no permite el operador `**'" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "el awk antiguo no admite el operador `**='" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "el operador `^=' no se admite en el awk antiguo" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "el operador `^' no se admite en el awk antiguo" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "cadena sin terminar" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "caracter '%c' inválido en la expresión" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' es una extensión de gawk" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX no permite `%s'" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "`%s' no se admite en el awk antiguo" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "¡`goto' se considera dañino!\n" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d es inválido como número de argumentos para %s" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: la literal de cadena como último argumento de substitute no tiene efecto" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "el tercer argumento de %s no es un objecto modificable" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "match: el tercer argumento es una extensión de gawk" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "close: el segundo argumento es una extensión de gawk" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "el uso de dcgettext(_\"...\") es incorrecto: quite el subrayado inicial" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "el uso de dcngettext(_\"...\") es incorrecto: quite el subrayado inicial" -#: awkgram.y:4016 +#: awkgram.y:4050 #, fuzzy msgid "index: regexp constant as second argument is not allowed" msgstr "index: el segundo argumento recibido no es una cadena" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "función `%s': parámetro `%s' oscurece la variable global" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "no se puede abrir `%s' para escritura (%s)" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "se envía la lista de variables a la salida estándar de error" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "%s: falló close (%s)" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "¡se llamó shadow_funcs() dos veces!" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "hay variables opacadas." -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "el nombre de función `%s' se definió previamente" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" "función `%s': no se puede usar un nombre de función como nombre de parámetro" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "función `%s': no se puede usar la variable especial `%s' como un parámetro " "de función" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "función `%s': parámetro #%d, `%s', duplica el parámetro #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "se llamó a la función `%s' pero nunca se definió" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "se definió la función `%s' pero nunca se llamó directamente" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "la constante de expresión regular para el parámetro #%d da un valor booleano" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -520,21 +525,21 @@ "se llamó la función `%s' con espacio entre el nombre y el `(',\n" "o se usó como una variable o una matriz" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "se intentó una división por cero" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "se intentó una división por cero en `%%'" -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" -#: awkgram.y:5052 +#: awkgram.y:5012 #, fuzzy, c-format msgid "invalid target of assignment (opcode %s)" msgstr "%d es inválido como número de argumentos para %s" @@ -576,197 +581,207 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' no es un fichero abierto, tubería o co-proceso" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: el primer argumento recibido no es una cadena" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: el segundo argumento recibido no es una cadena" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: se recibió un argumento que no es númerico" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: se recibió un argumento de matriz" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "`length(array)' es una extensión de gawk" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: se recibió un argumento que no es una cadena" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: se recibió un argumento que no es númerico" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: se recibió el argumento negativo %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "fatal: se debe utilizar `count$' en todos los formatos o en ninguno" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "se descarta la anchura del campo para el especificador `%%'" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "se descarta la precisión para el especificador `%%'" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "" "se descartan la anchura del campo y la precisión para el especificador `%%'" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "fatal: no se permite `$' en los formatos de awk" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fatal: la cuenta de argumentos con `$' debe ser > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" "fatal: la cuenta de argumentos %ld es mayor que el número total de " "argumentos proporcionados" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "fatal: no se permite `$' después de un punto en el formato" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "fatal: no se proporciona `$' para la anchura o la precisión del campo " "posicional" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "`l' no tiene significado en los formatos de awk; se descarta" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "fatal: no se permite `l' en los formatos POSIX de awk" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "`L' no tiene significado en los formatos de awk; se descarta" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "fatal: no se permite `L' en los formatos POSIX de awk" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "`h' no tiene significado en los formatos de awk; se descarta" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "fatal: no se permite `h' en los formatos POSIX de awk" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: el valor %g está fuera del rango para el formato `%%%c'" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: el valor %g está fuera del rango para el formato `%%%c'" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: el valor %g está fuera del rango para el formato `%%%c'" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "se descarta el carácter especificador de formato `%c' desconocido: no se " "convirtió ningún argumento" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "" "fatal: no hay suficientes argumentos para satisfacer a la cadena de formato" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "se acabó ^ para éste" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: el especificador de formato no tiene letras de control" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "se proporcionaron demasiados argumentos para la cadena de formato" -#: builtin.c:1634 +#: builtin.c:1625 #, fuzzy msgid "sprintf: no arguments" msgstr "printf: sin argumentos" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: sin argumentos" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: se recibió un argumento que no es un númerico" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: se llamó con el argumento negativo %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: la longitud %g no es >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: la longitud %g no es >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: se truncará la longitud no entera %g" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: la longitud %g es demasiado grande para ser índice de cadena, se " "trunca a %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: el índice de inicio %g es inválido, se usa 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: se truncará el índice de inicio no entero %g" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: la cadena de origen es de longitud cero" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: el índice de inicio %g está después del fin de la cadena" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -774,196 +789,218 @@ "substr: la cadena %g en el índice de inicio %g excede la longitud del primer " "argumento (%lu)" -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" "strftime: el valor de formato en PROCINFO[\"strftime\"] tiene tipo numérico" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" msgstr "strftime: el segundo argumento recibido no es númerico" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "" "strftime: el segundo argumento es menor que 0 o demasiado grande para time_t" -#: builtin.c:1934 +#: builtin.c:1932 +#, fuzzy +msgid "strftime: second argument out of range for time_t" +msgstr "" +"strftime: el segundo argumento es menor que 0 o demasiado grande para time_t" + +#: builtin.c:1941 msgid "strftime: received non-string first argument" msgstr "strftime: el primer argumento recibido no es una cadena" -#: builtin.c:1941 +#: builtin.c:1948 msgid "strftime: received empty format string" msgstr "strftime: se recibió una cadena de formato vacía" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" msgstr "mktime: se recibió un argumento que no es una cadena" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "" "mktime: por lo menos uno de los valores está fuera del rango por defecto" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "no se permite la función 'system' en modo sandbox" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" msgstr "system: se recibió un argumento que no es una cadena" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "referencia al campo sin inicializar `$%d'" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" msgstr "tolower: se recibió un argumento que no es una cadena" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" msgstr "toupper: se recibió un argumento que no es una cadena" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: el primer argumento recibido no es númerico" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: el segundo argumento recibido no es númerico" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" msgstr "sin: se recibió un argumento que no es númerico" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" msgstr "cos: se recibió un argumento que no es númerico" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: se recibió un argumento que no es númerico" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "match: el tercer argumento no es una matriz" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2725 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "gensub: el tercer argumento de 0 se trata como 1" + +#: builtin.c:2740 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" msgstr "gensub: el tercer argumento de 0 se trata como 1" -#: builtin.c:3030 +#: builtin.c:3038 +#, fuzzy, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "sqrt: se llamó con el argumento negativo %g" + +#: builtin.c:3128 +#, fuzzy, c-format +msgid "indirect call to %s requires at least two arguments" +msgstr "sqrt: se llamó con el argumento negativo %g" + +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" msgstr "lshift: el primer argumento recibido no es númerico" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" msgstr "lshift: el segundo argumento recibido no es númerico" -#: builtin.c:3038 +#: builtin.c:3188 #, fuzzy, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%lf, %lf): los valores negativos darán resultados extraños" -#: builtin.c:3040 +#: builtin.c:3190 #, fuzzy, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%lf, %lf): los valores fraccionarios se truncarán" -#: builtin.c:3042 +#: builtin.c:3192 #, fuzzy, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "" "lshift(%lf, %lf): un valor de desplazamiento muy grande dará resultados " "extraños" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" msgstr "rshift: el primer argumento recibido no es númerico" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" msgstr "rshift: el segundo argumento recibido no es númerico" -#: builtin.c:3075 +#: builtin.c:3225 #, fuzzy, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%lf, %lf): los valores negativos darán resultados extraños" -#: builtin.c:3077 +#: builtin.c:3227 #, fuzzy, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%lf, %lf): los valores fraccionarios serán truncados" -#: builtin.c:3079 +#: builtin.c:3229 #, fuzzy, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" "rshift(%lf, %lf): un valor de desplazamiento muy grande dará resultados " "extraños" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3254 mpfr.c:988 #, fuzzy msgid "and: called with less than two arguments" msgstr "sqrt: se llamó con el argumento negativo %g" -#: builtin.c:3109 +#: builtin.c:3259 #, fuzzy, c-format msgid "and: argument %d is non-numeric" msgstr "exp: el argumento %g está fuera de rango" -#: builtin.c:3113 +#: builtin.c:3263 #, fuzzy, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and(%lf, %lf): los valores negativos darán resultados extraños" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3286 mpfr.c:1020 #, fuzzy msgid "or: called with less than two arguments" msgstr "sqrt: se llamó con el argumento negativo %g" -#: builtin.c:3141 +#: builtin.c:3291 #, fuzzy, c-format msgid "or: argument %d is non-numeric" msgstr "exp: el argumento %g está fuera de rango" -#: builtin.c:3145 +#: builtin.c:3295 #, fuzzy, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "compl(%lf): el valor negativo dará resultados extraños" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3317 mpfr.c:1051 #, fuzzy msgid "xor: called with less than two arguments" msgstr "sqrt: se llamó con el argumento negativo %g" -#: builtin.c:3173 +#: builtin.c:3323 #, fuzzy, c-format msgid "xor: argument %d is non-numeric" msgstr "exp: el argumento %g está fuera de rango" -#: builtin.c:3177 +#: builtin.c:3327 #, fuzzy, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor(%lf, %lf): los valores negativos darán resultados extraños" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: se recibió un argumento que no es númerico" -#: builtin.c:3208 +#: builtin.c:3358 #, fuzzy, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%lf): el valor negativo dará resultados extraños" -#: builtin.c:3210 +#: builtin.c:3360 #, fuzzy, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%lf): el valor fraccionario se truncará" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' no es una categoría local válida" @@ -1245,42 +1282,48 @@ msgid "watch var - set a watchpoint for a variable." msgstr "" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "error: " -#: command.y:1051 +#: command.y:1053 #, fuzzy, c-format msgid "can't read command (%s)\n" msgstr "no se puede redirigir desde `%s' (%s)" -#: command.y:1065 +#: command.y:1067 #, fuzzy, c-format msgid "can't read command (%s)" msgstr "no se puede redirigir desde `%s' (%s)" -#: command.y:1116 +#: command.y:1118 #, fuzzy msgid "invalid character in command" msgstr "Nombre de clase de caracter inválido" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "" -#: command.y:1284 +#: command.y:1286 #, fuzzy msgid "invalid character" msgstr "Caracter de ordenación inválido" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "" @@ -1796,74 +1839,76 @@ msgid "`return' not allowed in current context; statement ignored" msgstr "`exit' no se puede llamar en el contexto actual" -#: debug.c:5590 +#: debug.c:5604 #, fuzzy, c-format msgid "No symbol `%s' in current context" msgstr "se intentó usar la matriz `%s' en un contexto escalar" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 #, fuzzy msgid "unbalanced [" msgstr "[ desbalanceado" -#: dfa.c:1174 +#: dfa.c:1118 #, fuzzy msgid "invalid character class" msgstr "Nombre de clase de caracter inválido" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "" -#: dfa.c:1366 +#: dfa.c:1326 #, fuzzy msgid "unfinished \\ escape" msgstr "Escape \\ sin terminar" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1473 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "Contenido inválido de \\{\\}" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1476 +#, fuzzy +msgid "regular expression too big" msgstr "La expresión regular es demasiado grande" -#: dfa.c:1936 +#: dfa.c:1911 #, fuzzy msgid "unbalanced (" msgstr "( desbalanceado" -#: dfa.c:2062 +#: dfa.c:2037 #, fuzzy msgid "no syntax specified" msgstr "No se especifican los bits de sintaxis de la expresión regular" -#: dfa.c:2070 +#: dfa.c:2045 #, fuzzy msgid "unbalanced )" msgstr ") desbalanceado" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "tipo de nodo %d desconocido" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "código de operación %d desconocido" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "el código de operación %s no es un operador o una palabra clave" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "desbordamiento de almacenamiento temporal en genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1874,94 +1919,94 @@ "\t# Pila de Llamadas de Funciones:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' es una extensión de gawk" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' es una extensión de gawk" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "el valor BINMODE `%s' es inválido; se trata como 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "especificación `%sFMT' `%s' errónea" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "se desactiva `--lint' debido a una asignación a `LINT'" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "referencia al argumento sin inicializar `%s'" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "referencia a la variable sin inicializar `%s'" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "se intentó una referencia de campo desde un valor que no es númerico" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "se intentó una referencia de campo desde una cadena nula" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "se intentó acceder al campo %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "referencia al campo sin inicializar `$%ld'" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "se llamó a la función `%s' con más argumentos de los declarados" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: tipo `%s' inesperado" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "se intentó una división por cero en `/='" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "se intentó una división por cero en `%%='" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "no se permiten las extensiones en modo sandbox" -#: ext.c:92 +#: ext.c:68 #, fuzzy msgid "-l / @load are gawk extensions" msgstr "@include es una extensión de gawk" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "" -#: ext.c:98 +#: ext.c:74 #, fuzzy, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "fatal: extension: no se puede abrir `%s' (%s)\n" -#: ext.c:104 +#: ext.c:80 #, fuzzy, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" @@ -1969,32 +2014,32 @@ "fatal: extension: la biblioteca `%s': no define " "`plugin_is_GPL_compatible' (%s)\n" -#: ext.c:110 +#: ext.c:86 #, fuzzy, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "" "fatal: extension: la biblioteca `%s': no puede llamar a la función `" "%s' (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "`extension' es una extensión de gawk" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "" -#: ext.c:180 +#: ext.c:156 #, fuzzy, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "fatal: extension: no se puede abrir `%s' (%s)\n" -#: ext.c:186 +#: ext.c:162 #, fuzzy, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" @@ -2002,100 +2047,100 @@ "fatal: extension: la biblioteca `%s': no define " "`plugin_is_GPL_compatible' (%s)\n" -#: ext.c:190 +#: ext.c:166 #, fuzzy, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "" "fatal: extension: la biblioteca `%s': no puede llamar a la función `" "%s' (%s)\n" -#: ext.c:221 +#: ext.c:197 #, fuzzy msgid "make_builtin: missing function name" msgstr "extension: falta el nombre de la función" -#: ext.c:236 +#: ext.c:212 #, fuzzy, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "extension: no se puede redefinir la función `%s'" -#: ext.c:240 +#: ext.c:216 #, fuzzy, c-format msgid "make_builtin: function `%s' already defined" msgstr "extension: la función `%s' ya está definida" -#: ext.c:244 +#: ext.c:220 #, fuzzy, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "extension: el nombre de función `%s' se definió previamente" -#: ext.c:246 +#: ext.c:222 #, fuzzy, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "extension: no se puede utilizar la orden interna de gawk `%s' como nombre de " "función" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: cuenta de argumento negativa para la función `%s'" -#: ext.c:276 +#: ext.c:252 #, fuzzy msgid "extension: missing function name" msgstr "extension: falta el nombre de la función" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, fuzzy, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: carácter ilegal `%c' en el nombre de la función `%s'" -#: ext.c:291 +#: ext.c:267 #, fuzzy, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: no se puede redefinir la función `%s'" -#: ext.c:295 +#: ext.c:271 #, fuzzy, c-format msgid "extension: function `%s' already defined" msgstr "extension: la función `%s' ya está definida" -#: ext.c:299 +#: ext.c:275 #, fuzzy, c-format msgid "extension: function name `%s' previously defined" msgstr "el nombre de función `%s' se definió previamente" -#: ext.c:301 +#: ext.c:277 #, fuzzy, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" "extension: no se puede utilizar la orden interna de gawk `%s' como nombre de " "función" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "la función `%s' se definió para tomar no más de %d argumento(s)" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "función `%s': falta el argumento #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "" "función `%s': argumento #%d: se intentó usar un escalar como una matriz" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "" "función `%s': argumento #%d: se intentó usar una matriz como un escalar" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "" @@ -2258,7 +2303,7 @@ msgid "inplace_begin: in-place editing already active" msgstr "" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "" @@ -2287,55 +2332,55 @@ msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, fuzzy, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "%s: falló close (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, fuzzy, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "%s: falló close (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, fuzzy, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "%s: falló close (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, fuzzy, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "falló la limpieza de la tubería de `%s' (%s)." -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, fuzzy, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "falló al cerrar el df %d (`%s') (%s)" @@ -2385,52 +2430,56 @@ msgid "readfile: called with no arguments" msgstr "sqrt: se llamó con el argumento negativo %g" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 #, fuzzy msgid "writea: called with too many arguments" msgstr "sqrt: se llamó con el argumento negativo %g" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, fuzzy, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "exp: el argumento %g está fuera de rango" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, fuzzy, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "split: el cuarto argumento no es una matriz" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 #, fuzzy msgid "reada: called with too many arguments" msgstr "sqrt: se llamó con el argumento negativo %g" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, fuzzy, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "exp: el argumento %g está fuera de rango" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, fuzzy, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "match: el tercer argumento no es una matriz" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "" @@ -2463,92 +2512,92 @@ msgid "sleep: not supported on this platform" msgstr "" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "se definió NF con un valor negativo" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: el cuarto argumento es una extensión de gawk" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: el cuarto argumento no es una matriz" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: el segundo argumento no es una matriz" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: no se puede usar la misma matriz para el segundo y cuarto argumentos" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: no se puede usar una submatriz del segundo argumento para el cuarto " "argumento" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: no se puede usar una submatriz del cuarto argumento para el segundo " "argumento" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "" "split: la cadena nula para el tercer argumento es una extensión de gawk" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: el cuarto argumento no es una matriz" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: el segundo argumento no es una matriz" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: el tercer argumento no debe ser nulo" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: no se puede usar la misma matriz para el segundo y cuarto " "argumentos" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: no se puede usar una submatriz del segundo argumento para el " "cuarto argumento" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: no se puede usar una submatriz del cuarto argumento para el " "segundo argumento" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' es una extensión gawk" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "valor de FIELDWIDTHS inválido, cerca de `%s'" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "la cadena nula para `FS' es una extensión de gawk" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "el awk antiguo no admite expresiones regulares como valor de `FS'" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "`FPAT' es una extensión de gawk" @@ -2564,21 +2613,21 @@ msgid "node_to_awk_value: received null val" msgstr "" -#: gawkapi.c:807 +#: gawkapi.c:809 #, fuzzy msgid "remove_element: received null array" msgstr "length: se recibió un argumento de matriz" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "" @@ -2638,528 +2687,498 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: la opción '-W %s' requiere un argumento\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "el argumento de la línea de órdenes `%s' es un directorio: se salta" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "no se puede abrir el fichero `%s' para lectura (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "falló al cerrar el df %d (`%s') (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "no se permite la redirección en modo sandbox" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "la expresión en la redirección `%s' sólo tiene valor numérico" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "la expresión para la redirección `%s' tiene un valor de cadena nula" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "el fichero `%s' para la redirección `%s' puede ser resultado de una " "expresión lógica" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "mezcla innecesaria de `>' y `>>' para el fichero `%.*s'" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "no se puede abrir la tubería `%s' para la salida (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "no se puede abrir la tubería `%s' para la entrada (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "no se puede abrir la tubería de dos vías `%s' para entrada/salida (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "no se puede redirigir desde `%s' (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "no se puede redirigir a `%s' (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "se alcanzó el límite del sistema para ficheros abiertos: comenzando a " "multiplexar los descriptores de fichero" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "falló al cerrar `%s' (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "demasiadas tuberías o ficheros de entrada abiertos" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: el segundo argumento debe ser `to' o `from'" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: `%.*s' no es un fichero abierto, tubería o co-proceso" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "se cerró una redirección que nunca se abrió" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: la redirección `%s' no se abrió con `|&', se descarta el segundo " "argumento" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "estado de fallo (%d) al cerrar la tubería de `%s' (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "estado de fallo (%d) al cerrar el fichero de `%s' (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "no se provee el cerrado explícito del `socket' `%s'" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "no se provee el cerrado explícito del co-proceso `%s'" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "no se provee el cerrado explícito del la tubería `%s'" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "no se provee el cerrado explícito del fichero `%s'" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "error al escribir en la salida estándar (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "error al escribir en la salida estándar de error (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "falló la limpieza de la tubería de `%s' (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "falló la limpieza del co-proceso de la tubería a `%s' (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "falló la limpieza del fichero de `%s' (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "puerto local %s inválido en `/inet'" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "anfitrión remoto e información de puerto (%s, %s) inválidos" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "" -"no se proporciona algún protocolo (conocido) en el nombre de fichero " -"especial `%s'" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "el nombre de fichero especial `%s' está incompleto" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "se debe proporcionar a `/inet' un nombre de anfitrión remoto" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "se debe proporcionar a `/inet' un puerto remoto" - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "no se admiten las comunicaciones TCP/IP" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "no se puede abrir `%s', modo `%s'" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "falló al cerrar el pty maestro (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "falló al cerrar la salida estándar en el hijo (%s)" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "falló el movimiento del pty esclavo a la salida estándar en el hijo (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "falló al cerrar la entrada estándar en el hijo (%s)" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "falló el movimiento del pty esclavo a la entrada estándar en el hijo (dup: " "%s)" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "falló al cerrar el pty esclavo (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "falló el movimiento a la salida estándar en el hijo (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "falló el movimiento de la tubería a la entrada estándar en el hijo (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" msgstr "falló la restauración de la salida estándar en el proceso padre\n" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" msgstr "falló la restauración de la entrada estándar en el proceso padre\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "falló al cerrar la tubería (%s)" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "no se admite `|&'" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "no se puede abrir la tubería `%s' (%s)" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "no se puede crear el proceso hijo para `%s' (fork: %s)" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" msgstr "" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" msgstr "" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" msgstr "" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " "`%s'" msgstr "" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "el fichero de datos `%s' está vacío" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "no se puede reservar más memoria de entrada" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "el valor multicaracter de `RS' es una extensión de gawk" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "no se admite la comunicación IPv6" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "se descarta el argumento vacío para `-e/--source'" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: no se reconoce la opción `-W %s', se descarta\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: la opción requiere un argumento -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "la variable de ambiente `POSIXLY_CORRECT' está definida: se activa `--posix'" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "`--posix' se impone a `--traditional'" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--posix'/`--traditional' se imponen a `--non-decimal-data'" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "ejecutar %s como setuid root puede ser un problema de seguridad" -#: main.c:588 +#: main.c:346 #, fuzzy msgid "`--posix' overrides `--characters-as-bytes'" msgstr "`--posix' se impone a `--binary'" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "no se puede establecer el modo binario en la entrada estándar (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "no se puede establecer el modo binario en la salida estándar (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "" "no se puede establecer el modo binario en la salida estándar de error (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "¡No hay ningún programa de texto!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Modo de empleo: %s [opciones estilo POSIX o GNU] -f fichprog [--] " "fichero ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "Modo de empleo: %s [opciones estilo POSIX o GNU] [--] %cprograma%c " "fichero ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "Opciones POSIX:\t\tOpciones largas GNU: (estándar)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f fichprog\t\t--file=fichprog\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F sc\t\t\t--field-separator=sc\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=valor\t\t--assign=var=valor\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Opciones cortas:\t\tOpciones largas GNU: (extensiones)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[fichero]\t\t--dump-variables[=fichero]\n" -#: main.c:815 +#: main.c:579 #, fuzzy msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-p[fichero]\t\t--profile[=fichero]\n" # Esta es la línea más larga de la lista de argumentos. # Probar con gawk para revisar tabuladores. cfuga -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'texto-prog'\t--source='texto-prog'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E fichero\t\t--exec=fichero\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:591 #, fuzzy msgid "\t-M\t\t\t--bignum\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:594 #, fuzzy msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-p[fichero]\t\t--profile[=fichero]\n" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[fichero]\t\t--profile[=fichero]\n" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3168,7 +3187,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3182,7 +3201,7 @@ "Reporte los errores de los mensajes en español a .\n" "\n" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3192,7 +3211,7 @@ "Por defecto lee la entrada estándar y escribe en la salida estándar.\n" "\n" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3202,7 +3221,7 @@ "\tgawk '{ sum += $1 }; END { print sum }' fichero\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3222,7 +3241,7 @@ "(a su elección) cualquier versión posterior.\n" "\n" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3236,7 +3255,7 @@ "Licencia Pública General de GNU para más detalles.\n" "\n" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3245,16 +3264,16 @@ "junto con este programa. Si no es así, consulte\n" "http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft no establece FS a tabulador en el awk de POSIX" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "valor desconocido para la especificación de campo: %d\n" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3263,103 +3282,121 @@ "%s: el argumento `%s' para `-v' no es de la forma `var=valor'\n" "\n" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' no es un nombre de variable legal" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' no es un nombre de variable, se busca el fichero `%s=%s'" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "" "no se puede utilizar la orden interna de gawk `%s' como nombre de variable" -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "no se puede usar la función `%s' como nombre de variable" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "excepción de coma flotante" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "error fatal: error interno" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "error fatal: error interno: falla de segmentación" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "error fatal: error interno: desbordamiento de pila" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "no existe el df %d abierto previamente" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "no se puede abrir previamente /dev/null para el df %d" -#: mpfr.c:550 +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "se descarta el argumento vacío para `-e/--source'" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: no se reconoce la opción `-W %s', se descarta\n" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: la opción requiere un argumento -- %c\n" + +#: mpfr.c:557 #, fuzzy, c-format msgid "PREC value `%.*s' is invalid" msgstr "el valor BINMODE `%s' es inválido; se trata como 3" -#: mpfr.c:608 +#: mpfr.c:615 #, fuzzy, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "el valor BINMODE `%s' es inválido; se trata como 3" -#: mpfr.c:698 +#: mpfr.c:711 #, fuzzy, c-format msgid "%s: received non-numeric argument" msgstr "cos: se recibió un argumento que no es númerico" -#: mpfr.c:800 +#: mpfr.c:820 #, fuzzy msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%lf): el valor negativo dará resultados extraños" -#: mpfr.c:804 +#: mpfr.c:824 #, fuzzy msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%lf): el valor fraccionario se truncará" -#: mpfr.c:816 +#: mpfr.c:836 #, fuzzy, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "compl(%lf): el valor negativo dará resultados extraños" -#: mpfr.c:835 +#: mpfr.c:855 #, fuzzy, c-format msgid "%s: received non-numeric argument #%d" msgstr "cos: se recibió un argumento que no es númerico" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "" -#: mpfr.c:857 +#: mpfr.c:877 #, fuzzy msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "compl(%lf): el valor negativo dará resultados extraños" -#: mpfr.c:863 +#: mpfr.c:883 #, fuzzy msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "or(%lf, %lf): los valores fraccionarios serán truncados" -#: mpfr.c:878 +#: mpfr.c:898 #, fuzzy, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "compl(%lf): el valor negativo dará resultados extraños" @@ -3369,24 +3406,24 @@ msgid "cmd. line:" msgstr "línea ord.:" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "barra invertida al final de la cadena" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "el awk antiguo no admite la secuencia de escape `\\%c'" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX no permite escapes `\\x'" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "no hay dígitos hexadecimales en la secuencia de escape `\\x'" -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3395,12 +3432,12 @@ "el escape hexadecimal \\x%.*s de %d caracteres tal vez no se interprete de " "la forma esperada" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "la secuencia de escape `\\%c' se trata como una simple `%c'" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3419,25 +3456,25 @@ msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)" msgstr "%s %s `%s': no se puede establecer close-on-exec: (fcntl F_SETFD: %s)" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "no se puede abrir `%s' para escritura: %s" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" msgstr "se envía el perfil a la salida estándar de error" -#: profile.c:193 -#, c-format +#: profile.c:213 +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# bloque(s) %s\n" +"\t# Regla(s)\n" "\n" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" @@ -3446,29 +3483,29 @@ "\t# Regla(s)\n" "\n" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "error interno: %s con vname nulo" -#: profile.c:537 +#: profile.c:558 #, fuzzy msgid "internal error: builtin with null fname" msgstr "error interno: %s con vname nulo" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" "\n" msgstr "" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# perfil de gawk, creado %s\n" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" @@ -3477,7 +3514,7 @@ "\n" "\t# Funciones, enumeradas alfabéticamente\n" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: tipo de redirección %d desconocida" @@ -3488,74 +3525,116 @@ msgstr "" "el componente de expresión regular `%.*s' probablemente debe ser `[%.*s]'" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Éxito" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "No hay coincidencia" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Expresión regular inválida" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Caracter de ordenación inválido" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Nombre de clase de caracter inválido" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Barra invertida extra al final" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Referencia hacia atrás inválida" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "[ o [^ desemparejados" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "( o \\( desemparejados" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "\\{ desemparejado" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Contenido inválido de \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Final de rango inválido" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Memoria agotada" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Expresión regular precedente inválida" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Fin prematuro de la expresión regular" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "La expresión regular es demasiado grande" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr ") o \\) desemparejados" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "No hay una expresión regular previa" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "" +"función `%s': no se puede usar un nombre de función como nombre de parámetro" + +#: symbol.c:809 msgid "can not pop main context" msgstr "" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "`getline var' inválido dentro de la regla `%s'" + +#~ msgid "`getline' invalid inside `%s' rule" +#~ msgstr "`getline' inválido dentro de la regla `%s'" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "" +#~ "no se proporciona algún protocolo (conocido) en el nombre de fichero " +#~ "especial `%s'" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "el nombre de fichero especial `%s' está incompleto" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "se debe proporcionar a `/inet' un nombre de anfitrión remoto" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "se debe proporcionar a `/inet' un puerto remoto" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# bloque(s) %s\n" +#~ "\n" + #~ msgid "range of the form `[%c-%c]' is locale dependent" #~ msgstr "el rango de la forma `[%c-%c]' depende del local" @@ -3627,9 +3706,6 @@ #~ msgid "Operation Not Supported" #~ msgstr "No Se Admite La Operación" -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "se intentó usar la función `%s' como una matriz" - #~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" #~ msgstr "referencia al elemento sin inicializar `%s[\"%.*s\"]'" @@ -3673,9 +3749,6 @@ #~ msgid "function `%s' not defined" #~ msgstr "la función `%s' no está definida" -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "`getline' no redirigido es inválido dentro de la regla `%s'" - #~ msgid "error reading input file `%s': %s" #~ msgstr "error al leer el fichero de entrada `%s': %s" diff -urN gawk-4.1.1/po/fi.po gawk-4.1.2/po/fi.po --- gawk-4.1.1/po/fi.po 2014-04-08 19:23:37.000000000 +0300 +++ gawk-4.1.2/po/fi.po 2015-04-29 08:36:41.000000000 +0300 @@ -1,14 +1,14 @@ # Finnish messages for gawk. -# Copyright © 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc. # This file is distributed under the same license as the gawk package. -# Jorma Karvonen , 2010-2014. +# Jorma Karvonen , 2010-2015. # msgid "" msgstr "" -"Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" -"PO-Revision-Date: 2014-01-16 13:32+0200\n" +"Project-Id-Version: gawk 4.1.1d\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" +"PO-Revision-Date: 2015-04-17 01:28+0300\n" "Last-Translator: Jorma Karvonen \n" "Language-Team: Finnish \n" "Language: fi\n" @@ -16,7 +16,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 1.5.4\n" +"X-Generator: Poedit 1.7.5\n" #: array.c:256 #, c-format @@ -37,9 +37,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "yritettiin käyttää skalaaria ”%s” taulukkona" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "yritettiin käyttää taulukkoa ”%s” skalaarikontekstissa" @@ -98,408 +98,413 @@ "asorti: toisen argumentin alitaulukon käyttö ensimmäiselle argumentille " "epäonnistui" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "”%s” on virheellinen funktionimenä" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "lajitteluvertailufunktiota ”%s” ei ole määritelty" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "%s lohkoilla on oltava toiminto-osa" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "jokaisella säännöllä on oltava malli tai toiminto-osa" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "vanha awk ei tue useita ”BEGIN”- tai ”END”-sääntöjä" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "”%s” on sisäänrakennettu funktio. Sitä ei voi määritellä uudelleen" -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" "säännöllisen lausekkeen vakio ”//” näyttää C++-kommentilta, mutta ei ole" -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" "säännöllisen lausekkeen vakio ”/%s/” näyttää C-kommentilta, mutta ei ole" -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "kaksi samanlaista case-arvoa switch-rakenteen rungossa: %s" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "kaksoiskappale ”default” havaittu switch-rungossa" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "”break” ei ole sallittu silmukan tai switch-lauseen ulkopuolella" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "”continue” ei ole sallittu silmukan ulkopuolella" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "”next” käytetty %s-toiminnossa" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "”nextfile” käytetty %s-toiminnossa" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "”return” käytetty funktiokontekstin ulkopuolella" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "pelkkä ”print” BEGIN- tai END-säännössä pitäisi luultavasti olla ”print \"\"”" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" msgstr "”delete” ei ole sallittu kohteessa SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" msgstr "”delete” ei ole sallittu kohteessa FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" msgstr "”delete(array)” ei ole siirrettävä tawk-laajennus" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "monivaiheiset kaksisuuntaiset putket eivät toimi" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "säännöllinen lauseke sijoituksen oikealla puolella" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "säännöllinen lauseke ”~”- tai ”!~”-operaattorin vasemmalla puolella" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" msgstr "vanha awk ei tue avainsanaa ”in” paitsi ”for”-sanan jälkeen" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "säännöllinen lauseke vertailun oikealla puolella" -#: awkgram.y:1417 +#: awkgram.y:1410 #, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "”getline var” virheellinen säännön ”%s” sisällä" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "edelleenohjaamaton ”getline” virheellinen ”%s”-säännön sisällä" -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "”getline” virheellinen säännön ”%s” sisällä" - -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" msgstr "edelleenohjaamaton ”getline” määrittelemätön END-toiminnon sisällä" -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "vanha awk ei tue moniulotteisia taulukkoja" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "”length”-kutsu ilman sulkumerkkejä ei ole siirrettävä" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "epäsuorat funktiokutsut ovat gawk-laajennus" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "erikoismuuttujan ”%s” käyttö epäsuoralle funktiokutsulle epäonnistui" +#: awkgram.y:1634 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "yritys käyttää ei-funktio ”%s” funktiokutsussa" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "virheellinen indeksointilauseke" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "varoitus: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "tuhoisa: " -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "odottamaton rivinvaihto tai merkkijonon loppu" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "lähdetiedoston ”%s” avaaminen lukemista varten (%s) epäonnistui" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2392 awkgram.y:2517 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "jaetun kirjaston ”%s” avaaminen lukemista varten (%s) epäonnistui" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "syy tuntematon" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "kohteen ”%s” sisällyttäminen ja käyttö ohjelmatiedostona epäonnistui" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "on jo sisällytetty lähdetiedostoon ”%s”" -#: awkgram.y:2409 +#: awkgram.y:2417 #, c-format msgid "already loaded shared library `%s'" msgstr "jaettu kirjasto ”%s” on jo ladattu" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "@include on gawk-laajennus" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "tyhjä tiedostonimi @include:n jälkeen" -#: awkgram.y:2494 +#: awkgram.y:2502 msgid "@load is a gawk extension" msgstr "@load on gawk-laajennus" -#: awkgram.y:2500 +#: awkgram.y:2508 msgid "empty filename after @load" msgstr "tyhjä tiedostonimi @load:n jälkeen" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "tyhjä ohjelmateksti komentorivillä" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "lähdetiedoston ”%s” (%s) lukeminen epäonnistui" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "lähdetiedosto ”%s” on tyhjä" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "PEBKAC-virhe: virheellinen merkki ’\\%03o’ lähdekoodissa" + +#: awkgram.y:2958 msgid "source file does not end in newline" msgstr "lähdetiedoston lopussa ei ole rivinvaihtoa" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" "päättämätön säännöllinen lauseke loppuu ”\\”-merkkeihin tiedoston lopussa" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "%s: %d: tawk:n regex-määre ”/.../%c” ei toimi gawk:ssa" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "tawkin regex-määre ”/.../%c” ei toimi gawkissa" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "päättämätön säännöllinen lauseke" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "päättämätön säännöllinen lauseke tiedoston lopussa" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" msgstr "”\\ #...”-rivijatkamisen käyttö ei ole siirrettävä" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "kenoviiva ei ole rivin viimeinen merkki" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "POSIX ei salli operaattoria ”**=”" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "vanha awk ei tue operaattoria ”**=”" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "POSIX ei salli operaattoria ”**”" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "vanha awk ei tue operaattoria ”**”" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "operaattoria ”^=” ei tueta vanhassa awk:ssa" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "operaattoria ”^” ei tueta vanhassa awk:ssa" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "päättämätön merkkijono" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "virheellinen merkki ’%c’ lausekkeessa" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "”%s” on gawk-laajennus" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX ei salli operaattoria ”%s”" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "”%s” ei ole tuettu vanhassa awk-ohjelmassa" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "”goto”-käskyä pidetään haitallisena!\n" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d on virheellinen argumenttilukumäärä operaattorille %s" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: merkkijonoliteraalilla ei ole vaikutusta korvauksen viimeisenä " "argumenttina" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s kolmas parametri ei ole vaihdettava objekti" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "match: kolmas argumentti on gawk-laajennus" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "close: toinen argumentti on gawk-laajennus" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "dcgettext(_\"...\")-käyttö on virheellinen: poista alaviiva alusta" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "dcngettext(_\"...\")-käyttö on virheellinen: poista alaviiva alusta" -#: awkgram.y:4016 +#: awkgram.y:4050 msgid "index: regexp constant as second argument is not allowed" -msgstr "index: regexp-vakio toisena argumenttina ei ole sallittu" +msgstr "indeksi: regexp-vakio toisena argumenttina ei ole sallitttu" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funktio ”%s”: parametri ”%s” varjostaa yleismuuttujaa" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "tiedoston ”%s” avaaminen kirjoittamista varten (%s) epäonnistui" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "lähetetään muuttujaluettelo vakiovirheeseen" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "%s: sulkeminen epäonnistui (%s)" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() kutsuttu kahdesti!" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "siellä oli varjostettuja muuttujia." -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "funktionimi ”%s” on jo aikaisemmin määritelty" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "funktio ”%s”: funktionimen käyttö parametrinimenä epäonnistui" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "funktio ”%s”: erikoismuuttujan ”%s” käyttö funktioparametrina epäonnistui" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funktio ”%s”: parametri #%d, ”%s”, samanlainen parametri #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "funktiota ”%s” kutsuttiin, mutta sitä ei ole koskaan määritelty" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "funktio ”%s” määriteltiin, mutta sitä ei ole koskaan kutsuttu suoraan" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "säännöllisen lausekkeen vakio parametrille #%d antaa boolean-arvon" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -508,24 +513,25 @@ "funktio ”%s” kutsuttu välilyönnillä nimen ja ”(”-merkin\n" "välillä, tai käytetty muuttujana tai taulukkona" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "nollalla jakoa yritettiin" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "jakoa nollalla yritettiin operaattorissa ”%%”" -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" -msgstr "arvon liittäminen kenttäjälkiaskelkasvatuslausekkeeseen epäonnistui" +msgstr "" +"arvon sijoittaminen kenttäjälkikasvatuslausekkeen tulokseen epäonnistui" -#: awkgram.y:5052 +#: awkgram.y:5012 #, c-format msgid "invalid target of assignment (opcode %s)" -msgstr "virheellinen liittämiskohde (käskykoodi %s)" +msgstr "virheellinen sijoituskohde (käskykoodi %s)" # kohteena voi olla vakiotuloste tai joku muu #: builtin.c:133 @@ -565,192 +571,202 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: ”%s” ei ole avoin tiedosto, putki tai apuprosessi" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: ensimmäinen vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: toinen vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: vastaanotettu taulukkoargumentti" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "”length(array)” on gawk-laajennus" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: vastaanotettu negatiivinen argumentti %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "kohtalokas: on käytettävä ”count$” kaikilla muodoilla tai ei missään" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "kenttäleveys ohitetaan ”%%%%”-määritteelle" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "tarkkuus ohitetaan ”%%%%”-määritteelle" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "kenttäleveys ja tarkkuus ohitetaan ”%%%%”-määritteelle" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "kohtalokas: ”$”-argumentti ei ole sallittu awk-muodoissa" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "kohtalokas: argumenttilukumäärän argumentilla ”$” on oltava > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" "kohtalokas: argumenttilukumäärä %ld on suurempi kuin toimitettujen " "argumenttien lukumäärä" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "kohtalokas: ”$”-argumentti ei ole sallittu pisteen jälkeen muodossa" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "kohtalokas: ei ”$”-argumenttia tarjottu sijantikenttäleveydelle tai " "tarkkuudelle" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "”l” on merkityksetön awk-muodoissa; ohitetaan" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "kohtalokas: ”l” ei ole sallittu POSIX awk -muodoissa" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "”L” on merkityksetön awk-muodoissa; ohitetaan" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "kohtalokas: ”L” ei ole sallittu POSIX awk -muodoissa" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "”h” on merkityksetön awk-muodoissa; ohitetaan" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "kohtalokas: ”h” ei ole sallittu POSIX awk -muodoissa" -#: builtin.c:1463 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: arvo %g on liian suuri %%c-muodolle" + +#: builtin.c:1068 +#, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: arvo %g ei ole kelvollinen leveä merkki" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: arvo %g on lukualueen ulkopuolella ”%%%c”-muodolle" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "ohitetaan tuntematon muotoargumenttimerkki ”%c”: ei muunnettu argumenttia" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "kohtalokas: ei kylliksi argumentteja muotomerkkijonon tyydyttämiseksi" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ tällainen loppui kesken" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: muotoargumentilla ei ole ohjauskirjainta" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "muotomerkkijonoon toimitettu liian monta argumenttia" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: ei argumentteja" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: ei argumentteja" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: kutsuttu negatiivisella argumentilla %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: pituus %g ei ole >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: pituus %g ei ole >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: typistetään pituus %g, joka ei ole kokonaisluku" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: pituus %g liian suuri merkkijononindeksointiin, typistetään arvoon %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: aloitusindeksi %g on virheellinen, käytetään 1:tä" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: typistetään aloitusindeksi %g, joka ei ole kokonaisluku" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: lähdemerkkijono on nollapituinen" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: aloitusindeksi %g on merkkijonon lopun jälkeen" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -758,189 +774,209 @@ "substr: pituus %g alkuindeksissä %g ylittää ensimmäisen argumentin pituuden " "(%lu)" -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" "strftime: muotoarvolla kohteessa PROCINFO[\"strftime\"] on numerotyyppi" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" msgstr "strftime: toinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "" "strftime: toinen argumentti on pienempi kuin 0 tai liian suuri time_t-" "rakenteeseen" -#: builtin.c:1934 +#: builtin.c:1932 +msgid "strftime: second argument out of range for time_t" +msgstr "strftime: kohteen time_t toinen argumentti lukualueen ulkopuolella" + +#: builtin.c:1941 msgid "strftime: received non-string first argument" msgstr "strftime: ensimmäinen vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:1941 +#: builtin.c:1948 msgid "strftime: received empty format string" msgstr "strftime: vastaanotettu tyhjä muotomerkkijono" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" msgstr "mktime: vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: vähintään yksi arvoista on oletuslukualueen ulkopuolella" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "’system’-funktio ei ole sallittu hiekkalaatikkotilassa" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" msgstr "system: vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "viite alustamattomaan kenttään ”$%d”" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" msgstr "tolower: vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" msgstr "toupper: vastaanotettu argumentti ei ole merkkijono" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: ensimmäinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: toinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" msgstr "sin: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" msgstr "cos: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "match: kolmas argumentti ei ole taulukko" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" -msgstr "gensub: 0-arvoinen kolmas argumentti käsitellään kuin 1" +#: builtin.c:2725 +#, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "gensub: kolmatta argumenttia ”%.*s” käsiteltiin kuin 1:stä" + +#: builtin.c:2740 +#, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: kolmas argumentti %g käsiteltiin kuin 1." + +#: builtin.c:3038 +#, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "%s: voidaan kutsua epäsuorasti vain kahdella argumentilla" + +#: builtin.c:3128 +#, c-format +msgid "indirect call to %s requires at least two arguments" +msgstr "epäsuora kutsu kohteeseen %s vaatii vähintään kaksi argumenttia" -#: builtin.c:3030 +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" msgstr "lshift: ensimmäinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" msgstr "lshift: toinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:3038 +#: builtin.c:3188 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): negatiiviset arvot antavat outoja tuloksia" -#: builtin.c:3040 +#: builtin.c:3190 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): jaosarvot typistetään" -#: builtin.c:3042 +#: builtin.c:3192 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f): liian suuri siirrosarvo antaa outoja tuloksia" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" msgstr "rshift: ensimmäinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" msgstr "rshift: toinen vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:3075 +#: builtin.c:3225 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): negatiiviset arvot antavat outoja tuloksia" -#: builtin.c:3077 +#: builtin.c:3227 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): jaosarvot typistetään" -#: builtin.c:3079 +#: builtin.c:3229 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "rshift(%f, %f): liian suuri siirrosarvo antaa outoja tuloksia" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3254 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: kutsuttu vähemmällä kuin kahdella argumentilla" -#: builtin.c:3109 +#: builtin.c:3259 #, c-format msgid "and: argument %d is non-numeric" msgstr "and: argumentti %d ei ole numeeraaliargumentti" -#: builtin.c:3113 +#: builtin.c:3263 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and: argumentin %d negatiivinen arvo %g antaa outoja tuloksia" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3286 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: kutsuttu vähemmällä kuin kahdella argumentilla" -#: builtin.c:3141 +#: builtin.c:3291 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: argumentti %d ei ole numeraaliargumentti" -#: builtin.c:3145 +#: builtin.c:3295 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "or: argumentin %d negatiivinen arvo %g antaa outoja tuloksia" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3317 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: kutsuttu vähemmällä kuin kahdella argumentilla" -#: builtin.c:3173 +#: builtin.c:3323 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: argumentti %d ei ole numeraaliargumentti" -#: builtin.c:3177 +#: builtin.c:3327 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: argumentin %d negatiivinen arvo %g antaa outoja tuloksia" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: vastaanotettu argumentti ei ole numeerinen" -#: builtin.c:3208 +#: builtin.c:3358 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): negatiivinen arvo antaa outoja tuloksia" -#: builtin.c:3210 +#: builtin.c:3360 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): jaosarvo typistetään" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: ”%s” ei ole kelvollinen paikallinen kategoria" @@ -1245,40 +1281,48 @@ msgid "watch var - set a watchpoint for a variable." msgstr "watch muuttuja - aseta vahtikohta muuttujalle." -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"missä [N] - (sama kuin paluujälki) tulostaa kaikkien tai N-sisimmäisen " +"(ulommaisen jos N < 0) kehyksen jäljen." + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "virhe: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "komennon (%s) lukeminen epäonnistui\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "komennon (%s) lukeminen epäonnistui" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "virheellinen merkki komennossa" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "tuntematon komento - \"%.*s\", kokeile käskyä help" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "virheellinen merkki" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "määrittelemätön komento: %s\n" @@ -1817,68 +1861,68 @@ msgid "`return' not allowed in current context; statement ignored" msgstr "”return” ei ole sallittu nykyisessä asiayhteydessä; lause ohitetaan" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Symbolia ”%s” ei ole nykyisesssä asiayhteydessä" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 msgid "unbalanced [" msgstr "pariton [" -#: dfa.c:1174 +#: dfa.c:1118 msgid "invalid character class" msgstr "virheellinen merkkiluokka" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "merkkiluokkasyntaksi on [[:space:]], ei [:space:]" -#: dfa.c:1366 +#: dfa.c:1326 msgid "unfinished \\ escape" msgstr "päättymätön \\-koodinvaihtomerkki" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" -msgstr "Virheellinen \\{\\}-sisältö" +#: dfa.c:1473 +msgid "invalid content of \\{\\}" +msgstr "virheellinen \\{\\}-sisältö" + +#: dfa.c:1476 +msgid "regular expression too big" +msgstr "säännöllinen lauseke on liian suuri" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" -msgstr "Säännöllinen lauseke on liian iso" - -#: dfa.c:1936 +#: dfa.c:1911 msgid "unbalanced (" msgstr "pariton (" -#: dfa.c:2062 +#: dfa.c:2037 msgid "no syntax specified" msgstr "syntaksi ei ole määritelty" -#: dfa.c:2070 +#: dfa.c:2045 msgid "unbalanced )" msgstr "pariton )" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "tuntematon solmutyyppi %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "tuntematon käskykoodi %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "käskykoodi %s ei ole operaattori tai avainsana" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "puskurin ylivuoto funktiossa genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1889,217 +1933,217 @@ "\t# Funktiokutsupino:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "”IGNORECASE” on gawk-laajennus" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "”BINMODE” on gawk-laajennus" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "BINMODE-arvo ”%s” on virheellinen, käsiteltiin arvona 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "väärä ”%sFMT”-määritys ”%s”" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "käännetään pois ”--lint”-valitsin ”LINT”-sijoituksen vuoksi" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "viite alustamattomaan argumenttiin ”%s”" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "viite alustamattomaan muuttujaan ”%s”" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "yritettiin kenttäviitettä arvosta, joka ei ole numeerinen" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "yritettiin kenttäviitettä null-merkkijonosta" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "yritettiin saantia kenttään %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "viite alustamattomaan kenttään ”$%ld”" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "funktio ”%s” kutsuttiin useammalla argumentilla kuin esiteltiin" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: odottamaton tyyppi ”%s”" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "jakoa nollalla yritettiin operaatiossa ”/=”" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "jakoa nollalla yritettiin operaatiossa ”%%=”" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "laajennuksia ei sallita hiekkalaatikkotilassa" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load ovat gawk-laajennuksia" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext: vastaanotettiin NULL lib_name" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: kirjaston ”%s” (%s) avaus epäonnistui\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: kirjasto ”%s”: ei määrittele ”plugin_is_GPL_compatible” (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: kirjasto ”%s”: funktion ”%s” (%s) kutsu epäonnistui\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "load_ext: kirjaston ”%s” alustusrutiini ”%s” epäonnistui\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "”extension” on gawk-laajennus" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" -msgstr "extension: vastaanotettiin NULL lib_name" +msgstr "laajennos: vastaantotettu NULL lib_name" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension: kirjaston ”%s” (%s) avaus epäonnistui" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "extension: kirjasto ”%s”: ei määrittele ”plugin_is_GPL_compatible” (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "extension: kirjasto ”%s”: funktion ”%s” (%s) kutsu epäonnistui" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: puuttuva funktionimi" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: funktion ”%s” uudelleenmäärittely epäonnistui" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: funktio ”%s” on jo määritelty" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: funktionimi ”%s” on määritelty jo aiemmin" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "make_builtin: gawk-ohjelman sisäisen muuttujanimen ”%s” käyttö funktionimenä " "epäonnistui" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: negatiivinen argumenttilukumäärä funktiolle ”%s”" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: puuttuva funktionimi" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: virheellinen merkki ”%c” funktionimessä ”%s”" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: funktion ”%s” uudelleenmäärittely epäonnistui" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: funktio ”%s” on jo määritelty" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: funktionimi ”%s” on määritelty jo aiemmin" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" "extension: gawk-ohjelman sisäisen muuttujanimen käyttö ”%s” funktionimenä " "epäonnistui" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "funktio ”%s” on määritelty ottamaan enemmän kuin %d argumenttia" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "function ”%s”: puuttuva argumentti #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "funktio ”%s”: argumentti #%d: yritettiin käyttää skalaaria taulukkona" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "funktio ”%s”: argumentti #%d: yritettiin käyttää taulukkoa skalaarina" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "kirjaston dynaamista latausta ei tueta" @@ -2243,7 +2287,7 @@ msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin: kohdallaanmuokkaus on jo aktivoitu" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "" @@ -2277,57 +2321,57 @@ msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin: mkstemp(”%s”) epäonnistui (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin: chmod epäonnistui (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin: dup(stdout) epäonnistui (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin: dup2(%d, stdout) epäonnistui (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin: close(%d) epäonnistui (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" "inplace_end: ensimmäisen argumentin noutaminen merkkijonotiedostonimenä " "epäonnistui" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end: kohdallaanmuokkaus ei ole aktiivinen" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end: dup2(%d, stdout) epäonnistui (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end: close(%d) epäonnistui (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end: fsetpos(stdout) epäonnistui (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end: link(”%s”, ”%s”) epäonnistui (%s)." -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end: rename(”%s”, ”%s”) epäonnistui (%s)" @@ -2369,50 +2413,54 @@ msgid "readfile: called with no arguments" msgstr "readfile: kutsuttu ilman argumentteja" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "revoutput: REVOUT-muuttujan alustaminen epäonnistui" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: kutsuttu liian monella argumentilla" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: argumentti 0 ei ole merkkijono\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: argumentti 1 ei ole taulukko\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: taulukon litistäminen epäonnistui\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: litistettyä taulukon vapauttaminen epäonnistui\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: kutsuttu liian monilla argumenteilla" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: argumentti 0 ei ole merkkijono\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: argumentti 1 ei ole taulukko\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array epäonnistui\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element epäonnistui\n" @@ -2441,91 +2489,91 @@ msgid "sleep: not supported on this platform" msgstr "sleep: ei ole tuettu tällä alustalla" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF asetettu negatiiviseen arvoon" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: neljäs argumentti on gawk-laajennus" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: neljäs argumentti ei ole taulukko" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: toinen argumentti ei ole taulukko" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: saman taulukon käyttö toiselle ja neljännelle argumentille epäonnistui" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: toisen argumentin käyttö alitaulukkoa neljännelle argumentille " "epäonnistui" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: neljännen argumentin käyttö alitaulukkoa toiselle argumentille " "epäonnistui" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: null-merkkijono kolmantena argumenttina on gawk-laajennus" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: neljäs argumentti ei ole taulukko" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: toinen argumentti ei ole taulukko" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: kolmas argumentti ei ole taulukko" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: saman taulukon käyttö toiselle ja neljännelle argumentille " "epäonnistui" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: toisen argumentin käyttö alitaulukkkoa neljännelle argumentille " "epäonnistui" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: neljännen argumentin käyttö alitaulukkoa toiselle argumentille " "epäonnistui" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "”FIELDWIDTHS” on gawk-laajennus" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "virheellinen FIELDWIDTHS-arvo, lähellä ”%s”" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "null-merkkijono ”FS”-kenttäerotinmuuttujalle on gawk-laajennus" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "vanha awk ei tue regexp-arvoja ”FS”-kenttäerotinmuuttujana" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "”FPAT” on gawk-laajennus" @@ -2541,20 +2589,20 @@ msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: vastaanotti null-arvon" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element: vastaanotettu null-taulukko" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element: vastaanotti null-alaindeksin" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: indeksin %d muuntaminen epäonnistui\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: arvon %d muuntaminen epäonnistui\n" @@ -2614,295 +2662,277 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: valitsin ’-W %s’ vaatii argumentin\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "komentoriviargumentti ”%s” on hakemisto: ohitettiin" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "tiedoston ”%s” avaaminen lukemista varten (%s) epäonnistui" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "tiedostomäärittelijän %d (”%s”) sulkeminen epäonnistui (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "edelleenohjaus ei ole sallittua hiekkalaatikkotilassa" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "lausekkeella ”%s”-uudellenohjauksessa on vain numeerinen arvo" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "lausekkeella ”%s”-uudelleenohjauksessa on null-merkkijonoarvo" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "tiedostonimi ”%s” ”%s”-uudelleenohjaukselle saattaa olla loogisen lausekkeen " "tulos" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "turha merkkien ”>” ja ”>>” sekoittaminen tiedostolle ”%.*s”" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "putken ”%s” avaaminen tulosteelle (%s) epäonnistui" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "putken ”%s” avaaminen syötteelle (%s) epäonnistui" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" "kaksisuuntaisen putken ”%s” avaaminen syötteelle/tulosteelle (%s) epäonnistui" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "uudelleenohjaus putkesta ”%s” (%s) epäonnistui" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "uudelleenohjaus putkeen ”%s” (%s) epäonnistui" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "saavutettiin avoimien tiedostojen järjestelmäraja: aloitetaan " "tiedostomäärittelijöiden lomittaminen" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "uudelleenohjauksen ”%s” sulkeminen epäonnistui (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "avoinna liian monta putkea tai syötetiedostoa" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: toisen argumentin on oltava ”to” tai ”from”" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: ”%.*s” ei ole avoin tiedosto, putki tai apuprosessi" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "suljettiin uudelleenohjaus, jota ei avattu koskaan" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: uudelleenohjaus ”%s” ei ole avattu operaattoreilla ”|&”, toinen " "argumentti ohitettu" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "virhetila (%d) putken ”%s” sulkemisessa (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "virhetila (%d) tiedoston ”%s” sulkemisessa (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "pistokkeen ”%s” eksplisiittistä sulkemista ei tarjota" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "apuprosessin ”%s” eksplisiittistä sulkemista ei tarjota" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "putken ”%s” eksplisiittistä sulkemista ei tarjota" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "tiedoston ”%s” eksplisiittistä sulkemista ei tarjota" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "virhe kirjoitettaessa vakiotulosteeseen (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "virhe kirjoitettaessa vakiovirheeseen (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "uudelleenohjauksen ”%s” putken tyhjennys epäonnistui (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "putken apuprosessityhjennys uudelleenohjaukseen ”%s” epäonnistui (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "uudelleenohjauksen ”%s” tiedostontyhjennys epäonnistui (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "paikallinen portti %s virheellinen pistokkeessa ”/inet”" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "etäkone- ja porttitiedot (%s, %s) ovat virheellisiä" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "ei (tunnettua) yhteyskäytäntöä tarjottu erikoistiedostonimessä ”%s”" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "erikoistiedostonimi ”%s” on vaillinainen" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "on tarjottava etäkoneen nimi pistokkeeseen ”/inet”" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "on tarjottava etäportti pistokkeeseen ”/inet”" - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "TCP/IP-viestintää ei tueta" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "laitteen ”%s” avaus epäonnistui, tila ”%s”" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "”master pty”-sulkeminen epäonnistui (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "vakiotulosteen sulkeminen lapsiprosessissa epäonnistui (%s)" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "”slave pty”:n siirtäminen vakiotulosteeseen lapsiprosessissa epäonnistui " "(dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "vakiosyötteen sulkeminen lapsiprosessissa epäonnistui (%s)" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "”slave pty”:n siirtäminen vakiosyötteeseen lapsiprosessissa epäonnistui " "(dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "”slave pty”:n sulkeminen epäonnistui (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "putken siirtäminen vakiotulosteeseen lapsiprosessissa epäonnistui (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "putken siirtäminen vakiosyötteeseen lapsiprosessissa epäonnistui (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" msgstr "vakiotulosteen palauttaminen äitiprosessissa epäonnistui\n" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" msgstr "vakiosyötön palauttaminen äitiprosessissa epäonnistui\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "putken sulkeminen epäonnistui (%s)" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "”|&” ei tueta" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "putken ”%s” (%s) avaaminen epäonnistui" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "lapsiprosessin luominen komennolle ”%s” (fork: %s) epäonnistui" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser: vastaanotettiin NULL-osoitin" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "syötejäsennin ”%s” on ristiriidassa aiemmin asennetun syötejäsentimen ”%s” " "kanssa" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "syötejäsentäjä ”%s” epäonnistui kohteen ”%s” avaamisessa" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper: vastaanotti NULL-osoittimen" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" @@ -2910,16 +2940,16 @@ "tulostekäärin ”%s” on ristiriidassa aiemmin asennetun tulostekäärimen ”%s” " "kanssa" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "tulostekäärin ”%s” epäonnistui avaamaan ”%s”" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor: vastaanotti NULL-osoittimen" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2928,216 +2958,205 @@ "kaksisuuntainen prosessori ”%s” on ristiriidassa aiemmin asennetun " "kaksisuuntaisen prosessorin ”%s” kanssa" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "kaksisuuntainen prosessori ”%s” epäonnistui avaamaan ”%s”" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "data-tiedosto ”%s” on tyhjä" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "lisäsyötemuistin varaus epäonnistui" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "”RS”-monimerkkiarvo on gawk-laajennus" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "IPv6-viestintää ei tueta" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "tyhjä argumentti valitsimelle ”-e/--source” ohitetaan" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: valitsin ”-W %s” on tunnistamaton, ohitetaan\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: valitsin vaatii argumentin -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "ympäristömuuttuja ”POSIXLY_CORRECT” asetettu: käännetään päälle valitsin ”--" "posix”" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "valitsin ”--posix” korvaa valitsimen ”--traditional”" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" "valitsin ”--posix” tai ”--traditional” korvaa valitsimen ”--non-decimal-data”" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "suorittaminen ”%s setuid root”-käyttäjänä saattaa olla turvapulma" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "valitsin ”--posix” korvaa valitsimen ”--characters-as-bytes”" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "binaaritilan asettaminen vakiosyötteessä (%s) epäonnistui" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "binaaritilan asettaminen vakiotulosteessa (%s) epäonnistui" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "binaaritilaa asettaminen vakiovirheessä (%s) epäonnistui" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "ei ohjelmatekstiä ollenkaan!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Käyttö: %s [POSIX- tai GNU-tyyliset valitsimet] -f ohjelmatiedosto [--] " "tiedosto ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "Käyttö: %s [POSIX- tai GNU-tyyliset valitsimet] [--] %cohjelma%c " "tiedosto ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "POSIX-valitsimet:\t\tGNU-pitkät valitsimet: (vakio)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f ohjelmatiedosto\t\t--file=ohjelmatiedosto\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=arvo\t\t--assign=muuttuja=arvo\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Lyhyet valitsimet:\t\tGNU-pitkät valitsimet: (laajennukset)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[tiedosto]\t\t--dump-variables[=tiedosto]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[tiedosto]\t\t--debug[=tiedosto]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'program-text'\t--source='program-text'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E file\t\t\t--exec=tiedosto\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-po\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i include-tiedosto\t\t--include=include-tiedosto\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l kirjasto\t\t--load=kirjasto\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" -msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" +msgstr "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:591 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:594 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[tiedosto]\t\t--pretty-print[=tiedosto]\n" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[tiedosto]\t\t--profile[=tiedosto]\n" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3146,7 +3165,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3159,7 +3178,7 @@ "joka on kappale ”Reporting Problems and Bugs” painetussa versiossa.\n" "\n" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3169,7 +3188,7 @@ "Oletuksena se lukee vakiosyötettä ja kirjoittaa vakiotulosteeseen.\n" "\n" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3179,7 +3198,7 @@ "\tgawk '{ sum += $1 }; END { print sum }' tiedosto\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3198,7 +3217,7 @@ "ehtojen mukaisesti.\n" "\n" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3212,7 +3231,7 @@ "GNU General Public License-ehdoista.\n" "\n" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3220,16 +3239,16 @@ "Sinun pitäisi vastaanottaa kopion GNU General Public Licence-lisenssistä\n" "tämän ohjelman mukana. Jos näin ei ole, katso http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft ei aseta FS välilehteen POSIX awk:ssa" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "tuntematon arvo kenttämääritteelle: %d\n" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3238,100 +3257,118 @@ "%s: ”%s” argumentti valitsimelle ”-v” ei ole ”var=arvo”-muodossa\n" "\n" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "”%s” ei ole laillinen muuttujanimi" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "”%s” ei ole muuttujanimi, etsitään tiedostoa ”%s=%s”" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "" "gawk-ohjelman sisäisen ”%s”-määrittelyn käyttö muuttujanimenä epäonnistui" -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "funktionimen ”%s” käyttö muuttujanimenä epäonnistui" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "liukulukupoikkeus" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "tuhoisa virhe: sisäinen virhe" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "tuhoisa virhe: sisäinen virhe: segmenttivirhe" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "tuhoisa virhe: sisäinen virhe: pinoylivuoto" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "ei avattu uudelleen tiedostomäärittelijää %d" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "" "laitteen /dev/null avaaminen uudelleen tiedostomäärittelijälle %d epäonnistui" -#: mpfr.c:550 +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "tyhjä argumentti valitsimelle ”-e/--source” ohitetaan" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "-M ohitettu: MPFR/GMP-tuki ei ole käännetty kohteessa" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: valitsin ”-W %s” on tunnistamaton, ohitetaan\n" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: valitsin vaatii argumentin -- %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "PREC-arvo ”%.*s” on virheellinen" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "RNDMODE-arvo ”%.*s” on virheellinen" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s: vastaanotettu argumentti ei ole numeerinen" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): negatiivinen arvo antaa outoja tuloksia" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg): jaosarvo typistetään" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "compl(%Zd): negatiiviset arvot antavat outoja tuloksia" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s: vastaanotettu argumentti #%d ei ole numeerinen" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: argumentilla #%d on virheellinen arvo %Rg, käytetään 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: argumentin #%d negatiivinen arvo %Rg antaa outoja tuloksia" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s: argumentin #%d jaosarvo %Rg typistetään" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%s: argumentin #%d negatiivinen arvo %Zd antaa outoja tuloksia" @@ -3341,24 +3378,24 @@ msgid "cmd. line:" msgstr "komentorivi:" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "kenoviiva merkkijonon lopussa" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "vanha awk ei tue ”\\%c”-koodinvaihtosekvenssiä" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX ei salli ”\\x”-koodinvaihtoja" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "ei heksadesimaalilukuja ”\\x”-koodinvaihtosekvenssissä" -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3367,12 +3404,12 @@ "heksadesimaalikoodinvaihtomerkkejä \\x%.*s / %d ei ole luultavasti tulkittu " "sillä tavalla kuin odotat" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "koodinvaihtosekvenssi ”\\%c” käsitelty kuin pelkkä ”%c”" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3391,25 +3428,25 @@ msgstr "" "%s %s ”%s”: close-on-exec -asettaminen epäonnistui: (fcntl F_SETFD: %s)" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "tiedoston ”%s” avaaminen kirjoittamista varten epäonnistui: %s" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" msgstr "lähetetään profiili vakiovirheeseen" -#: profile.c:193 +#: profile.c:213 #, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s-lohko(t)\n" +"\t# %s säännöt\n" "\n" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" @@ -3418,16 +3455,16 @@ "\t# Säännöt\n" "\n" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "sisäinen virhe: %s null vname-arvolla" -#: profile.c:537 +#: profile.c:558 msgid "internal error: builtin with null fname" msgstr "sisäinen virhe: builtin null-funktionimellä" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3436,12 +3473,12 @@ "\t# Ladatut laajennukset (-l ja/tai @load)\n" "\n" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawk-profiili, luotu %s\n" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" @@ -3450,7 +3487,7 @@ "\n" "\t# Funktiot, luetteloitu aakkosjärjestyksessä\n" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: tuntematon edelleenohjaustyyppi %d" @@ -3461,80 +3498,115 @@ msgstr "" "säännöllisen lausekkeen komponentin ”%.*s” pitäisi luultavasti olla ”[%.*s]”" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Onnistui" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Ei täsmäystä" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Virheellinen säännöllinen lauseke" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Virheellinen vertailumerkki" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Virheellinen merkkiluokkanimi" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Jäljessä oleva kenoviiva" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Virheellinen paluuviite" -#: regcomp.c:152 -msgid "Unmatched [ or [^" -msgstr "Pariton [ tai [^" +#: regcomp.c:160 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Pariton [, [^, [:, [., or [=" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "Pariton ( tai \\(" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "Pariton \\{" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Virheellinen \\{\\}-sisältö" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Virheellinen lukualueen loppu" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Muisti loppui" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Virheellinen edeltävä säännöllinen lauseke" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Ennenaikainen säännöllisen lausekkeen loppu" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Säännöllinen lauseke on liian iso" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "Pariton ) tai \\)" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Ei edellistä säännöllistä lauseketta" -#: symbol.c:741 +#: symbol.c:677 +#, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "funktio ”%s”: funktion ”%s” käyttö parametrinimenä epäonnistui" + +#: symbol.c:809 msgid "can not pop main context" msgstr "pääsisällön pop-toiminto epäonnistui" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "”getline var” virheellinen säännön ”%s” sisällä" + +#~ msgid "`getline' invalid inside `%s' rule" +#~ msgstr "”getline” virheellinen säännön ”%s” sisällä" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "ei (tunnettua) yhteyskäytäntöä tarjottu erikoistiedostonimessä ”%s”" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "erikoistiedostonimi ”%s” on vaillinainen" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "on tarjottava etäkoneen nimi pistokkeeseen ”/inet”" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "on tarjottava etäportti pistokkeeseen ”/inet”" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s-lohko(t)\n" +#~ "\n" + #~ msgid "range of the form `[%c-%c]' is locale dependent" #~ msgstr "muodon ”[%c-%c]” lukualue on paikallisasetuksesta riippuvainen" -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "yritettiin käyttää funktiota ”%s” taulukkona" - #~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" #~ msgstr "viite alustamattomaan elementtiin ”%s[\"%.*s\"]”" @@ -3613,9 +3685,6 @@ #~ msgid "function `%s' not defined" #~ msgstr "funktio ”%s” ei ole määritelty" -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "edelleenohjaamaton ”getline” virheellinen ”%s”-säännön sisällä" - #~ msgid "`nextfile' cannot be called from a `%s' rule" #~ msgstr "”nextfile” ei voida kutsua ”%s”-säännöstä" @@ -3755,3 +3824,15 @@ #~ msgid "cannot pop main context" #~ msgstr "pääsisällön pop-toiminto epäonnistui" + +#~ msgid "gensub: third argument of 0 treated as 1" +#~ msgstr "gensub: 0-arvoinen kolmas argumentti käsitellään kuin 1" + +#~ msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#~ msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" + +#~ msgid "Unmatched [ or [^" +#~ msgstr "Pariton [ tai [^" + +#~ msgid "attempt to use function `%s' as an array" +#~ msgstr "yritettiin käyttää funktiota ”%s” taulukkona" diff -urN gawk-4.1.1/po/fr.po gawk-4.1.2/po/fr.po --- gawk-4.1.1/po/fr.po 2014-04-08 19:23:37.000000000 +0300 +++ gawk-4.1.2/po/fr.po 2015-04-29 08:36:41.000000000 +0300 @@ -7,10 +7,10 @@ # msgid "" msgstr "" -"Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" -"PO-Revision-Date: 2014-01-16 00:31+0100\n" +"Project-Id-Version: gawk 4.1.1d\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" +"PO-Revision-Date: 2015-04-16 22:57+0200\n" "Last-Translator: Jean-Philippe Guérard \n" "Language-Team: French \n" @@ -39,9 +39,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "tentative d'utiliser le scalaire « %s » comme tableau" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "tentative d'utilisation du tableau « %s » dans un contexte scalaire" @@ -92,420 +92,425 @@ msgid "asorti: cannot use a subarray of second arg for first arg" msgstr "asorti : le 1er argument ne doit pas être un sous-tableau du 2e" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "« %s » n'est pas un nom de fonction valide" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "la fonction de comparaison « %s » du tri n'est pas définie" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "les blocs %s doivent avoir une partie action" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "chaque règle doit avoir au moins une partie motif ou action" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "l'ancien awk ne permet pas les « BEGIN » ou « END » multiples" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "« %s » est une fonction interne, elle ne peut être redéfinie" -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "l'expression rationnelle constante « // » n'est pas un commentaire C++" -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "l'expression rationnelle constante « /%s/ » n'est pas un commentaire C" -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "le corps du switch comporte des cas répétés : %s" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "plusieurs « default » ont été détectés dans le corps du switch" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "« break » est interdit en dehors d'une boucle ou d'un switch" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "« continue » est interdit en dehors d'une boucle ou d'un switch" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "« next » est utilisé dans l'action %s" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "« nextfile » est utilisé dans l'action %s" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "« return » est utilisé hors du contexte d'une fonction" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "dans BEGIN ou END, un « print » seul devrait sans doute être un « print " "\"\" »" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" msgstr "« delete » est interdit sur SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" msgstr "« delete » est interdit sur FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" msgstr "« delete(array) » est une extension non portable de tawk" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "impossible d'utiliser des tubes bidirectionnels en série" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "expression rationnelle à droite d'une affectation" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "expression rationnelle à gauche d'un opérateur « ~ » ou « !~ »" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" msgstr "l'ancien awk n'autorise le mot-clef « in » qu'après « for »" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "expression rationnelle à droite d'une comparaison" -#: awkgram.y:1417 +#: awkgram.y:1410 #, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "« getline var » n'est pas valable dans une règle « %s »" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "un « getline » non redirigé n'est pas valable dans une règle « %s »" -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "« getline » n'est pas valable dans une règle « %s »" - -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" msgstr "dans une action END, un « getline » non redirigé n'est pas défini" -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "l'ancien awk ne dispose pas des tableaux multidimensionnels" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "l'appel de « length » sans parenthèses n'est pas portable" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "les appels indirects de fonctions sont une extension gawk" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "impossible d'utiliser la variable spéciale « %s » pour un appel indirect de " "fonction" +#: awkgram.y:1634 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "tentative d'appel de « %s » comme fonction" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "expression indice incorrecte" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "avertissement : " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fatal : " -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "fin de chaîne ou passage à la ligne inattendu" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "impossible d'ouvrir le fichier source « %s » en lecture (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2392 awkgram.y:2517 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "impossible d'ouvrir la bibliothèque partagée « %s » en lecture (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "raison inconnue" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "impossible d'inclure « %s » et de l'utiliser comme extension" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "le fichier source « %s » a déjà été intégré" -#: awkgram.y:2409 +#: awkgram.y:2417 #, c-format msgid "already loaded shared library `%s'" msgstr "la bibliothèque partagée « %s » est déjà chargée" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "@include est une extension gawk" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "Le nom de fichier après @include est vide" -#: awkgram.y:2494 +#: awkgram.y:2502 msgid "@load is a gawk extension" msgstr "@load est une extension gawk" -#: awkgram.y:2500 +#: awkgram.y:2508 msgid "empty filename after @load" msgstr "Le nom de fichier après @load est vide" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "le programme indiqué en ligne de commande est vide" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "impossible de lire le fichier source « %s » (%s)" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "le fichier source « %s » est vide" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "erreur bête : caractère incorrect « \\%03o » dans le code source" + +#: awkgram.y:2958 msgid "source file does not end in newline" msgstr "le fichier source ne se termine pas par un passage à la ligne" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" "expression rationnelle non refermée terminée par un « \\ » en fin de fichier" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "%s : %d : le modificateur d'expressions rationnelles « /.../%c » de tawk ne " "marche pas dans gawk" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "le modificateur d'expressions rationnelles « /.../%c » de tawk ne marche pas " "dans gawk" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "expression rationnelle non refermée" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "expression rationnelle non refermée en fin de fichier" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" msgstr "" "l'utilisation de « \\ #... » pour prolonger une ligne n'est pas portable" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "la barre oblique inverse n'est pas le dernier caractère de la ligne" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "POSIX n'autorise pas l'opérateur « **= »" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "l'ancien awk ne dispose pas de l'opérateur « **= »" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "POSIX n'autorise pas l'opérateur « ** »" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "l'ancien awk ne dispose pas de l'opérateur « ** »" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "l'ancien awk ne dispose pas de l'opérateur « ^= »" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "l'ancien awk ne dispose pas de l'opérateur « ^ »" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "chaîne non refermée" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "caractère incorrect « %c » dans l'expression" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "« %s » est une extension gawk" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX n'autorise pas « %s »" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "l'ancien awk ne dispose pas de « %s »" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "« goto est jugé dangereux ! » (Edsger W. Dijkstra)\n" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d n'est pas un nombre d'arguments valide de %s" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s : une chaîne littérale en dernier argument d'une substitution est sans " "effet" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "le 3e paramètre de %s n'est pas un objet modifiable" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "match : le 3e argument est une extension gawk" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "close : le 2e argument est une extension gawk" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "utilisation incorrecte de dcgettext(_\"...\") : enlevez le souligné de tête" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "utilisation incorrecte de dcngettext(_\"...\") : enlevez le souligné de tête" -#: awkgram.y:4016 +#: awkgram.y:4050 msgid "index: regexp constant as second argument is not allowed" msgstr "" "index : le second argument ne peut être une expression rationnelle constante" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "fonction « %s » : le paramètre « %s » masque la variable globale" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "impossible d'ouvrir « %s » en écriture (%s)" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "envoi de la liste des variables vers la sortie d'erreur standard" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "%s : échec de la fermeture (%s)" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "shadows_funcs() a été appelé deux fois !" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "il y avait des variables masquées." -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "nom de fonction « %s » déjà défini" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" "fonction « %s » : impossible d'utiliser un nom de fonction comme paramètre" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "fonction « %s » : impossible d'utiliser la variable spéciale « %s » comme " "paramètre d'une fonction" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "" "fonction « %s » : paramètre #%d, « %s » est un doublon du paramètre #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "fonction « %s » appelée sans être définie" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "fonction « %s » définie mais jamais appelée directement" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "le paramètre #%d, une expr. rationnelle constante, fournit un booléen" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -514,24 +519,24 @@ "fonction « %s » appelée avec un espace entre son nom\n" "et « ( », ou utilisée comme variable ou tableau" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "tentative de division par zéro" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "tentative de division par zéro dans « %% »" # gawk 'BEGIN { $1++ = 1 }' -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" "impossible d'assigner une valeur au résultat de la post-incrémentation d'un " "champ" -#: awkgram.y:5052 +#: awkgram.y:5012 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "cible de l'assignement incorrecte (opcode %s)" @@ -574,189 +579,199 @@ msgstr "" "fflush : « %s » n'est ni un fichier ouvert, ni un tube, ni un co-processus" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index : le premier argument n'est pas une chaîne" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index : le second argument n'est pas une chaîne" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int : l'argument n'est pas numérique" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length : l'argument reçu est un tableau" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "« length(tableau) » est une extension gawk" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length : l'argument n'est pas une chaîne" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log : l'argument n'est pas numérique" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log : l'argument est négatif %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "" "fatal : « numéro$ » doit être utilisé pour toutes les formats ou pour aucun" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "taille du champ de la spécification « %% » ignorée" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "précision de la spécification « %% » ignorée" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "taille du champ et précision de la spécification « %% » ignorées" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "fatal : « $ » n'est pas autorisé dans les formats awk" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fatal : le numéro d'argument de « $ » doit être > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" "fatal : le numéro d'argument %ld est > au nombre total d'arguments fournis" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "fatal : dans un format, « $ » ne doit pas suivre un point" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "fatal : aucun « $ » fourni pour la taille ou la précision du champ positionné" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "« l » n'a aucun sens dans un format awk ; ignoré" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "fatal : « l » est interdit dans un format awk POSIX" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "« L » n'a aucun sens dans un format awk ; ignoré" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "fatal : « L » est interdit dans un format awk POSIX" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "« h » n'a aucun sens dans un format awk ; ignoré" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "fatal : « h » est interdit dans un format awk POSIX" -#: builtin.c:1463 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf : valeur %g trop grande pour le format « %%c »" + +#: builtin.c:1068 +#, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf : %g n'est pas un caractère large valable" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf : valeur %g hors limite pour le format « %%%c »" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "caractère de format inconnu « %c » ignoré : aucun argument converti" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "fatal : pas assez d'arguments pour satisfaire la chaîne de formatage" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ à court pour celui-ci" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf : spécification de format sans lettre de contrôle" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "trop d'arguments pour la chaîne de formatage" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf : aucun argument" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf : aucun argument" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt : l'argument n'est pas numérique" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt : appelé avec un argument négatif %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr : la longueur %g n'est pas >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr : la longueur %g n'est pas >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr : la longueur %g n'est pas entière, elle sera tronquée" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr : la longueur %g est trop grande, tronquée à %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr : l'index de début %g n'est pas valide, utilisation de 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr : l'index de début %g n'est pas un entier, il sera tronqué" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr : la chaîne source est de longueur nulle" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr : l'index de début %g est au-delà de la fin de la chaîne" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -764,195 +779,215 @@ "substr : la longueur %g à partir de %g dépasse la fin du 1er argument (%lu)" # Exemple : gawk --lint 'BEGIN { PROCINFO["strftime"]=123 ; print strftime() }' -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" "strftime : la valeur de formatage PROCINFO[\"strftime\"] est de type " "numérique" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" msgstr "strftime : le second argument n'est pas numérique" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "strftime: second argument négatif ou trop grand pour time_t" -#: builtin.c:1934 +#: builtin.c:1932 +msgid "strftime: second argument out of range for time_t" +msgstr "strftime: second argument hors plage pour time_t" + +#: builtin.c:1941 msgid "strftime: received non-string first argument" msgstr "strftim : le premier argument n'est pas une chaîne" -#: builtin.c:1941 +#: builtin.c:1948 msgid "strftime: received empty format string" msgstr "strftime : la chaîne de formatage est vide" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" msgstr "mktime : l'argument n'est pas une chaîne" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "" "mktime : au moins l'une des valeurs est en dehors de la plage par défaut" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "La fonction « system » est interdite en isolement (mode sandbox)" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" msgstr "system : l'argument n'est pas une chaîne" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "référence à un champ non initialisé « $%d »" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" msgstr "tolower : l'argument n'est pas une chaîne" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" msgstr "toupper : l'argument n'est pas une chaîne" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2 : le premier argument n'est pas numérique" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2 : le second argument n'est pas numérique" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" msgstr "sin : l'argument n'est pas numérique" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" msgstr "cos : l'argument n'est pas numérique" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand : l'argument n'est pas numérique" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "match : le 3e argument n'est pas un tableau" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" -msgstr "gensub : le 3e argument vaut 0, il sera traité comme un 1" +#: builtin.c:2725 +#, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "gensub : le 3e argument « %.*s » sera traité comme un 1" + +#: builtin.c:2740 +#, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub : le 3e argument %g sera traité comme un 1" -#: builtin.c:3030 +#: builtin.c:3038 +#, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "%s : un appel indirect nécessite deux arguments" + +#: builtin.c:3128 +#, c-format +msgid "indirect call to %s requires at least two arguments" +msgstr "un appel indirect à %s demande au moins 2 arguments" + +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" msgstr "lshift : le premier argument n'est pas numérique" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" msgstr "lshift : le second argument reçu n'est pas numérique" -#: builtin.c:3038 +#: builtin.c:3188 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "" "lshift(%f, %f) : les valeurs négatives donnent des résultats inattendus" -#: builtin.c:3040 +#: builtin.c:3190 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f) : les valeurs non entières seront tronquées" -#: builtin.c:3042 +#: builtin.c:3192 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f) : un décalage trop grand donne des résultats inattendus" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" msgstr "rshift : le premier argument n'est pas numérique" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" msgstr "rshift : le second argument reçu n'est pas numérique" -#: builtin.c:3075 +#: builtin.c:3225 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "" "rshift(%f, %f) : les valeurs négatives donneront des résultats inattendus" -#: builtin.c:3077 +#: builtin.c:3227 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f) : les valeurs non entières seront tronquées" -#: builtin.c:3079 +#: builtin.c:3229 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" "rshift(%f, %f) : un décalage trop grand donnera des résultats inattendus" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3254 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and : appelé avec moins de 2 arguments" -#: builtin.c:3109 +#: builtin.c:3259 #, c-format msgid "and: argument %d is non-numeric" msgstr "and : l'argument %d n'est pas numérique" -#: builtin.c:3113 +#: builtin.c:3263 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "" "and : l'argument %d est négatif (%g) ce qui aura des résultats inattendus" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3286 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or : appelé avec moins de 2 arguments" -#: builtin.c:3141 +#: builtin.c:3291 #, c-format msgid "or: argument %d is non-numeric" msgstr "or : l'argument %d n'est pas numérique" -#: builtin.c:3145 +#: builtin.c:3295 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "" "or : l'argument %d est négatif (%g) ce qui aura des résultats inattendus" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3317 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor : appelé avec moins de 2 arguments" -#: builtin.c:3173 +#: builtin.c:3323 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor : l'argument %d n'est pas numérique" -#: builtin.c:3177 +#: builtin.c:3327 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "" "xor : l'argument %d est négatif (%g) ce qui aura des résultats inattendus" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl : l'argument n'est pas numérique" -#: builtin.c:3208 +#: builtin.c:3358 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f) : les valeurs négatives donneront des résultats inattendus" -#: builtin.c:3210 +#: builtin.c:3360 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f) : les valeurs non entières seront tronquées" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext : « %s » n'est pas dans un catégorie valide de la locale" @@ -1256,40 +1291,48 @@ msgid "watch var - set a watchpoint for a variable." msgstr "watch var - définit un point de surveillance pour une variable." -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"where [N] - (identique à backtrace) affiche la trace de tout ou des N " +"dernières trames (du début si N < 0)." + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "erreur : " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "impossible de lire la commande (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "impossible de lire la commande (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "la commande contient un caractère incorrect" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "commande inconnue - « %.*s », essayez « help »" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "Caractère incorrect" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "commande inconnue : %s\n" @@ -1821,68 +1864,68 @@ msgid "`return' not allowed in current context; statement ignored" msgstr "« return » interdit dans ce contexte ; instruction ignorée" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Pas de symbole « %s » dans le contexte actuel" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 msgid "unbalanced [" msgstr "[ non apparié" -#: dfa.c:1174 +#: dfa.c:1118 msgid "invalid character class" msgstr "classe de caractères incorrecte" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "la syntaxe des classes de caractères est [[:space:]], et non [:space:]" -#: dfa.c:1366 +#: dfa.c:1326 msgid "unfinished \\ escape" msgstr "échappement \\ non terminé" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" -msgstr "Contenu de \\{\\} incorrect" - -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" -msgstr "Expression rationnelle trop grande" +#: dfa.c:1473 +msgid "invalid content of \\{\\}" +msgstr "contenu de \\{\\} incorrect" + +#: dfa.c:1476 +msgid "regular expression too big" +msgstr "expression rationnelle trop grande" -#: dfa.c:1936 +#: dfa.c:1911 msgid "unbalanced (" msgstr "( non apparié" -#: dfa.c:2062 +#: dfa.c:2037 msgid "no syntax specified" msgstr "aucune syntaxe indiquée" -#: dfa.c:2070 +#: dfa.c:2045 msgid "unbalanced )" msgstr ") non apparié" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "type de nœud %d inconnu" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "code opération %d inconnu" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "le code opération %s n'est pas un opérateur ou un mot-clef" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "débordement de tampon dans genflag2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1893,93 +1936,93 @@ "\t# Pile des appels de fonctions :\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "« IGNORECASE » est une extension gawk" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "« BINMODE » est une extension gawk" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "la valeur « %s » de BINMODE n'est pas valide, 3 utilisé à la place" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "spécification de « %sFMT » erronée « %s »" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "désactivation de « --lint » en raison d'une affectation à « LINT »" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "référence à un argument non initialisé « %s »" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "référence à une variable non initialisée « %s »" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "tentative de référence à un champ via une valeur non numérique" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "tentative de référence à un champ via une chaîne nulle" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "tentative d'accès au champ %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "référence à un champ non initialisé « $%ld »" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "la fonction « %s » a été appelée avec trop d'arguments" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: type « %s » inattendu" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "tentative de division par zéro dans « /= »" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "tentative de division par zéro dans « %%= »" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "les extensions sont interdites en isolement (mode sandbox)" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load est une extension gawk" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext : lib_name reçu NULL" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext : impossible d'ouvrir la bibliothèque « %s » (%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" @@ -1987,34 +2030,34 @@ "load_ext : bibliothèque « %s » : ne définit pas " "« plugin_is_GPL_compatible » (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "" "load_ext : bibliothèque « %s » : impossible d'appeler la fonction " "« %s » (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" "load_ext : bibliothèque « %s » : échec de la routine d'initialisation « %s " "»\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "« extension » est une extension gawk" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "extension : lib_name reçu NULL" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension : impossible d'ouvrir la bibliothèque « %s » (%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" @@ -2022,100 +2065,100 @@ "extension : bibliothèque « %s » : ne définit pas " "« plugin_is_GPL_compatible » (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "" "extension : bibliothèque « %s » : impossible d'appeler la fonction " "« %s » (%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin : nom de fonction manquant" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin : impossible de redéfinir la fonction « %s »" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin : fonction « %s » déjà définie" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin : nom de la fonction « %s » déjà défini" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "make_builtin : impossible d'utiliser la fonction gawk « %s » comme nom de " "fonction" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin : la fonction « %s » a un nombre négatif d'arguments" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension : nom de fonction manquant" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension : caractère illégal « %c » dans le nom de la fonction « %s »" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension : impossible de redéfinir la fonction « %s »" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension : fonction « %s » est déjà définie" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension : nom de la fonction « %s » déjà défini" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" "extension : impossible d'utiliser la fonction interne gawk « %s » comme nom " "de fonction" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "fonction « %s » définie comme ayant au maximum« %d » argument(s)" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "fonction « %s » : argument #%d manquant" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "" "fonction « %s » : argument #%d : tentative d'utilisation d'un scalaire comme " "tableau" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "" "fonction « %s » : argument #%d : tentative d'utiliser un tableau comme " "scalaire" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "chargement dynamique des bibliothèques impossible" @@ -2259,7 +2302,7 @@ msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin : modification sur place déjà active" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin : 2 arguments attendu, appelé avec %d" @@ -2291,56 +2334,56 @@ msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin : échec de mkstemp('%s') (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin : échec de la chmod (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin : échec de dup(stdout) (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin : échec de dup2(%d, stdout) (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin : échec de close(%d) (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" "inplace_end : impossible de récupérer le 1er argument comme nom de fichier" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end : modification sur place non active" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "ipnlace_end : échec de dup2(%d, stdout) (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end : échec de close(%d) (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end : échec de fsetpos(stdout) (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end : échec de link('%s', '%s') (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end : échec de rename('%s', '%s') (%s)" @@ -2382,50 +2425,54 @@ msgid "readfile: called with no arguments" msgstr "readfile : appelé sans argument" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "revoutput : impossible d'initialiser la variable REVOUT" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea : appelé avec trop d'arguments" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea : l'argument 0 n'est pas une chaîne\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea : l'argument 1 n'est pas un tableau\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array : impossible d'aplatir le tableau\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array : impossible de libérer le tableau aplati\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada : appelé avec trop d'arguments" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada : l'argument 0 n'est pas une chaîne\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada : l'argument 1 n'est pas un tableau\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada : échec de clear_array\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array : échec de set_array_element\n" @@ -2454,88 +2501,88 @@ msgid "sleep: not supported on this platform" msgstr "sleep : n'est pas disponible sur cette plateforme" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "une valeur négative a été assignée à NF" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split : le 4e argument est une extension gawk" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split : le 4e argument n'est pas un tableau" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split : le 2e argument n'est pas un tableau" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "split : impossible d'utiliser le même tableau comme 2e et 4e argument" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split : impossible d'utiliser un sous-tableau du 2e argument en 4e argument" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split : impossible d'utiliser un sous-tableau du 4e argument en 2e argument" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split : utiliser une chaîne vide en 3e argument est une extension gawk" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit : le 4e argument n'est pas un tableau" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit : le 2e argument n'est pas un tableau" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit : le 3e argument n'est pas un tableau" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit : impossible d'utiliser le même tableau comme 2e et 4e argument" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit : impossible d'utiliser un sous-tableau du 2e argument en 4e " "argument" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit : impossible d'utiliser un sous-tableau du 4e argument en 2e " "argument" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "« FIELDWIDTHS » est une extension gawk" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "valeur de FIELDWIDTHS incorrecte, près de « %s »" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "utiliser une chaîne vide pour « FS » est une extension gawk" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "" "l'ancien awk n'accepte pas les expr. rationnelles comme valeur de « FS »" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "« FPAT » est une extension gawk" @@ -2551,20 +2598,20 @@ msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value : val nul reçu" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element : tableau nul reçu" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element : indice nul reçu" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array : impossible de convertir l'indice %d\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array : impossible de convertir la valeur %d\n" @@ -2624,312 +2671,293 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "%s : l'option « -W %s » nécessite un argument\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "L'argument « %s » de la ligne de commande est un répertoire : ignoré" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "impossible d'ouvrir le fichier « %s » en lecture (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "échec de la fermeture du fd %d (« %s ») : %s" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "les redirections sont interdites en isolement (mode sandbox)" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "l'expression dans la redirection « %s » n'a qu'une valeur numérique" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "l'expression dans la redirection « %s » donne une chaîne nulle" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "le fichier « %s » de la redirection « %s » pourrait être le résultat d'une " "expression booléenne" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "mélange non nécessaire de « > » et « >> » pour le fichier « %.*s »" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "impossible d'ouvrir le tube « %s » en sortie (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "impossible d'ouvrir le tube « %s » en entrée (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" "impossible d'ouvrir un tube bidirectionnel « %s » en entrées-sorties (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "impossible de rediriger depuis « %s » (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "impossible de rediriger vers « %s » (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "limite système du nombre de fichiers ouverts atteinte : début du " "multiplexage des descripteurs de fichiers" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "échec de la fermeture de « %s » (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "trop de fichiers d'entrées ou de tubes ouverts" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close : le second argument doit être « to » ou « from »" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "" "close : « %.*s » n'est ni un fichier ouvert, ni un tube ou un co-processus" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "fermeture d'une redirection qui n'a jamais été ouverte" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close : la redirection « %s » n'a pas été ouverte avec « |& », second " "argument ignoré" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "résultat d'échec (%d) sur la fermeture du tube « %s » (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "résultat d'échec (%d) sur la fermeture du fichier « %s » (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "aucune fermeture explicite du connecteur « %s » fournie" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "aucune fermeture explicite du co-processus « %s » fournie" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "aucune fermeture explicite du tube « %s » fournie" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "aucune fermeture explicite du fichier « %s » fournie" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "erreur lors de l'écriture vers la sortie standard (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "erreur lors de l'écriture vers l'erreur standard (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "échec du vidage du tube « %s » (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "échec du vidage du tube vers « %s » par le co-processus (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "échec du vidage vers le fichier « %s » (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "le port local %s n'est pas valide dans « /inet »" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "" "les informations sur l'hôte et le port distants (%s, %s) ne sont pas valides" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "" -"aucun protocole (connu) n'a été fourni dans le nom de fichier spécial « %s »" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "nom de fichier spécial « %s » incomplet" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "un nom d'hôte distant doit être fourni à « /inet »" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "un port distant doit être fourni à « /inet »" - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "les communications TCP/IP ne sont pas disponibles" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "impossible d'ouvrir « %s », mode « %s »" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "échec de la fermeture du pty maître (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "échec de la fermeture de stdout du processus fils (%s)" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "échec du déplacement du pty esclave vers le stdout du processus fils (dup : " "%s)" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "échec de fermeture du stdin du processus fils (%s)" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "échec du déplacement du pty esclave vers le stdin du processus fils (dup : " "%s)" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "échec de la fermeture du pty esclave (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "échec du déplacement du tube vers stdout du processus fils (dup : %s)" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "échec de déplacement du tube vers stdin du processus fils (dup : %s)" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" msgstr "échec de la restauration du stdout dans le processus parent\n" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" msgstr "échec de la restauration du stdin dans le processus parent\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "échec de la fermeture du tube (%s)" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "« |& » non disponible" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "impossible d'ouvrir le tube « %s » (%s)" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "impossible de créer le processus fils pour « %s » (fork : %s)" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser : pointeur NULL reçu" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "l'analyseur d'entrée « %s » est en conflit avec l'analyseur « %s » déjà " "installé" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "l'analyseur d'entrée « %s » n'a pu ouvrir « %s »" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper : pointeur NULL reçu" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" "le filtre de sortie « %s » est en conflit avec le filtre « %s » déjà installé" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "le filtre de sortie « %s » n'a pu ouvrir « %s »" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor : pointeur NULL reçu" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2938,216 +2966,205 @@ "le gestionnaire bidirectionnel « %s » est en conflit avec le gestionnaire " "« %s » déjà installé" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "le gestionnaire bidirectionnel « %s » n'a pu ouvrir « %s »" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "le fichier de données « %s » est vide" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "impossible d'allouer plus de mémoire d'entrée" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "" "l'utilisation d'un « RS » de plusieurs caractères est une extension gawk" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "les communications IPv6 ne sont pas disponibles" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "argument vide de l'option « -e / --source » ignoré" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s : option « -W %s » non reconnue, ignorée\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s : l'option requiert un argument - %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "variable d'environnement « POSIXLY__CORRECT » définie : activation de « --" "posix »" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "« --posix » prend le pas sur « --traditional »" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" "« --posix » et « --traditional » prennent le pas sur « --non-decimal-data »" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "" "l'exécution de %s en mode setuid root peut être un problème de sécurité" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "« --posix » prend le pas sur « --characters-as-bytes »" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "impossible d'activer le mode binaire sur stdin (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "impossible d'activer le mode binaire sur stdout (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "impossible d'activer le mode binaire sur stderr (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "aucun programme !" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Utilisation : %s [options GNU ou POSIX] -f fichier_prog [--] fichier ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "Utilisation : %s [options GNU ou POSIX] [--] %cprogramme%c fichier ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "Options POSIX :\t\tOptions longues GNU : (standard)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f fichier_prog\t\t--file=fichier_prog\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=valeur\t\t--assign=var=valeur\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Options POSIX :\t\tOptions longues GNU : (extensions)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[fichier]\t\t--dump-variables[=fichier]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[fichier]\t\t--debug[=fichier]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'programme'\t\t--source='programme'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E fichier\t\t--exec=fichier\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i fichier\t\t--include=fichier\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l bibliothèque\t\t--load=bibliothèque\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" -msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" - -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" +msgstr "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" -#: main.c:824 +#: main.c:591 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:594 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[fichier]\t\t--pretty-print[=fichier]\n" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[fichier]\t\t--profile[=fichier]\n" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3156,7 +3173,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3171,7 +3188,7 @@ ".\n" "\n" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3181,7 +3198,7 @@ "Par défaut, il lit l'entrée standard et écrit sur la sortie standard.\n" "\n" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3191,7 +3208,7 @@ "\tgawk '{ somme += $1 }; END { print somme }' fichier\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3211,7 +3228,7 @@ "version ultérieure de votre choix.\n" "\n" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3226,7 +3243,7 @@ "General Public License).\n" "\n" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3235,16 +3252,16 @@ "(GNU General Public License) avec ce programme. Sinon, consultez\n" "http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft ne définit pas le FS comme étant une tabulation en awk POSIX" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "valeur inconnue pour la définition de champ : %d\n" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3253,99 +3270,117 @@ "%s : « %s » l'argument de « -v » ne respecte pas la forme « var=valeur »\n" "\n" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "« %s » n'est pas un nom de variable valide" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "« %s » n'est pas un nom de variable, recherche du fichier « %s=%s »" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "impossible d'utiliser le mot clef gawk « %s » comme variable" -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "impossible d'utiliser la fonction « %s » comme variable" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "exception du traitement en virgule flottante" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "fatal : erreur interne" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "fatal : erreur interne : erreur de segmentation" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "fatal : erreur interne : débordement de la pile" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "aucun descripteur fd %d pré-ouvert" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "impossible de pré-ouvrir /dev/null pour le descripteur fd %d" -#: mpfr.c:550 +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "argument vide de l'option « -e / --source » ignoré" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "-M sans effet : version compilée sans MPFR/GMP" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s : option « -W %s » non reconnue, ignorée\n" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s : l'option requiert un argument - %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "la valeur « %.*s » de PREC est incorrecte" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "la valeur « %.*s » de RNDMODE est incorrecte" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s : argument reçu non numérique" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg) : les valeurs négatives donneront des résultats inattendus" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg) : les valeurs non entières seront tronquées" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "compl(%Zd) : les valeurs négatives donneront des résultats inattendus" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s : argument reçu non numérique #%d" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s : l'argument #%d a une valeur incorrecte %Rg, utilisation de 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "" "%s : argument #%d : la valeur négative %Rg donnera des résultats inattendus" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s : argument #%d : la valeur non entière %Rg sera tronquée" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "" @@ -3356,24 +3391,24 @@ msgid "cmd. line:" msgstr "ligne de commande:" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "barre oblique inverse à la fin de la chaîne" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "l'ancien awk ne dispose pas de la séquence d'échappement « \\%c »" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX n'autorise pas les séquences d'échappement « \\x »" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "aucun chiffre hexadécimal dans la séquence d'échappement « \\x » " -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3382,12 +3417,12 @@ "la séquence d'échappement hexa. \\x%.*s de %d caractères ne sera " "probablement pas interprétée comme vous l'imaginez" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "séquence d'échappement « \\%c » traitée comme un simple « %c »" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3407,25 +3442,25 @@ msgstr "" "%s %s « %s »: impossible de positionner close-on-exec: (fcntl F_SETFD: %s)" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "impossible d'ouvrir « %s » en écriture : %s" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" msgstr "envoi du profil vers la sortie d'erreur standard" -#: profile.c:193 +#: profile.c:213 #, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# Bloc(s) %s\n" +"\t# %s règle(s)\n" "\n" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" @@ -3434,16 +3469,16 @@ "\t# Règle(s)\n" "\n" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "erreur interne : %s avec un vname nul" -#: profile.c:537 +#: profile.c:558 msgid "internal error: builtin with null fname" msgstr "erreur interne : fonction interne avec un fname nul" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3452,12 +3487,12 @@ "\t# Extensions chargées (-l ou @load)\n" "\n" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# profile gawk, créé %s\n" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" @@ -3466,7 +3501,7 @@ "\n" "\t# Fonctions, par ordre alphabétique\n" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str : type de redirection %d inconnu" @@ -3478,73 +3513,84 @@ "le composant d'expression rationnelle « %.*s » devrait probablement être " "« [%.*s] »" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Succès" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Aucune correspondance" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Expression rationnelle incorrecte" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Caractère d'interclassement incorrect" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Nom de classe de caractères incorrect" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Barre oblique inverse finale" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Référence arrière incorrecte" -#: regcomp.c:152 -msgid "Unmatched [ or [^" -msgstr "[ ou [^ sans correspondance" +#: regcomp.c:160 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[, [^, [:, [. ou [= sans correspondance" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "( ou \\( sans correspondance" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "\\{ sans correspondance" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Contenu de \\{\\} incorrect" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Borne finale non valable" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Mémoire épuisée" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Expression rationnelle précédente incorrecte" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Fin prématurée de l'expression rationnelle" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Expression rationnelle trop grande" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr ") ou \\) sans correspondance" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Aucune expression rationnelle précédente" -#: symbol.c:741 +#: symbol.c:677 +#, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "" +"fonction « %s » : impossible d'utiliser la fonction « %s » comme paramètre" + +#: symbol.c:809 msgid "can not pop main context" msgstr "impossible de rétablir (pop) le contexte principal (main)" - -#~ msgid "range of the form `[%c-%c]' is locale dependent" -#~ msgstr "les plages « [%c-%c] » sont dépendantes des paramètres régionaux" diff -urN gawk-4.1.1/po/gawk.pot gawk-4.1.2/po/gawk.pot --- gawk-4.1.1/po/gawk.pot 2014-04-08 19:23:35.000000000 +0300 +++ gawk-4.1.2/po/gawk.pot 2015-04-29 08:36:40.000000000 +0300 @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: gawk 4.1.1\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Project-Id-Version: gawk 4.1.2\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -36,9 +36,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "" @@ -89,422 +89,427 @@ msgid "asorti: cannot use a subarray of second arg for first arg" msgstr "" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "" -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" msgstr "" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" msgstr "" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" msgstr "" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" msgstr "" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "" -#: awkgram.y:1417 +#: awkgram.y:1410 #, c-format -msgid "`getline var' invalid inside `%s' rule" +msgid "non-redirected `getline' invalid inside `%s' rule" msgstr "" -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "" - -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" msgstr "" -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" +#: awkgram.y:1634 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "" -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "" -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2392 awkgram.y:2517 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "" -#: awkgram.y:2409 +#: awkgram.y:2417 #, c-format msgid "already loaded shared library `%s'" msgstr "" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "" -#: awkgram.y:2494 +#: awkgram.y:2502 msgid "@load is a gawk extension" msgstr "" -#: awkgram.y:2500 +#: awkgram.y:2508 msgid "empty filename after @load" msgstr "" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2958 msgid "source file does not end in newline" msgstr "" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" msgstr "" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" -#: awkgram.y:4016 +#: awkgram.y:4050 msgid "index: regexp constant as second argument is not allowed" msgstr "" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "" -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" "or used as a variable or an array" msgstr "" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "" -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" -#: awkgram.y:5052 +#: awkgram.y:5012 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "" @@ -542,371 +547,401 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:1463 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "" + +#: builtin.c:1068 +#, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" msgstr "" -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" msgstr "" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "" -#: builtin.c:1934 -msgid "strftime: received non-string first argument" +#: builtin.c:1932 +msgid "strftime: second argument out of range for time_t" msgstr "" #: builtin.c:1941 +msgid "strftime: received non-string first argument" +msgstr "" + +#: builtin.c:1948 msgid "strftime: received empty format string" msgstr "" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" msgstr "" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" msgstr "" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" msgstr "" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" msgstr "" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" msgstr "" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" msgstr "" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2725 +#, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "" + +#: builtin.c:2740 +#, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "" + +#: builtin.c:3038 +#, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "" + +#: builtin.c:3128 +#, c-format +msgid "indirect call to %s requires at least two arguments" msgstr "" -#: builtin.c:3030 +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" msgstr "" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" msgstr "" -#: builtin.c:3038 +#: builtin.c:3188 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "" -#: builtin.c:3040 +#: builtin.c:3190 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "" -#: builtin.c:3042 +#: builtin.c:3192 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" msgstr "" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" msgstr "" -#: builtin.c:3075 +#: builtin.c:3225 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "" -#: builtin.c:3077 +#: builtin.c:3227 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "" -#: builtin.c:3079 +#: builtin.c:3229 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3254 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "" -#: builtin.c:3109 +#: builtin.c:3259 #, c-format msgid "and: argument %d is non-numeric" msgstr "" -#: builtin.c:3113 +#: builtin.c:3263 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3286 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "" -#: builtin.c:3141 +#: builtin.c:3291 #, c-format msgid "or: argument %d is non-numeric" msgstr "" -#: builtin.c:3145 +#: builtin.c:3295 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3317 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "" -#: builtin.c:3173 +#: builtin.c:3323 #, c-format msgid "xor: argument %d is non-numeric" msgstr "" -#: builtin.c:3177 +#: builtin.c:3327 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "" -#: builtin.c:3208 +#: builtin.c:3358 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "" -#: builtin.c:3210 +#: builtin.c:3360 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "" @@ -1186,40 +1221,46 @@ msgid "watch var - set a watchpoint for a variable." msgstr "" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "" -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "" @@ -1731,68 +1772,68 @@ msgid "`return' not allowed in current context; statement ignored" msgstr "" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 msgid "unbalanced [" msgstr "" -#: dfa.c:1174 +#: dfa.c:1118 msgid "invalid character class" msgstr "" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "" -#: dfa.c:1366 +#: dfa.c:1326 msgid "unfinished \\ escape" msgstr "" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1473 +msgid "invalid content of \\{\\}" msgstr "" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1476 +msgid "regular expression too big" msgstr "" -#: dfa.c:1936 +#: dfa.c:1911 msgid "unbalanced (" msgstr "" -#: dfa.c:2062 +#: dfa.c:2037 msgid "no syntax specified" msgstr "" -#: dfa.c:2070 +#: dfa.c:2045 msgid "unbalanced )" msgstr "" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1800,211 +1841,211 @@ "\n" msgstr "" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "" @@ -2148,7 +2189,7 @@ msgid "inplace_begin: in-place editing already active" msgstr "" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "" @@ -2177,55 +2218,55 @@ msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "" @@ -2267,50 +2308,54 @@ msgid "readfile: called with no arguments" msgstr "" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "" @@ -2339,80 +2384,80 @@ msgid "sleep: not supported on this platform" msgstr "" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "" @@ -2428,20 +2473,20 @@ msgid "node_to_awk_value: received null val" msgstr "" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "" @@ -2501,504 +2546,475 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "" -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "" -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "" -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "" -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "" - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" msgstr "" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" msgstr "" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" msgstr "" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" msgstr "" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" msgstr "" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " "`%s'" msgstr "" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "" - -#: main.c:824 +#: main.c:591 msgid "\t-M\t\t\t--bignum\n" msgstr "" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "" -#: main.c:826 +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "" + +#: main.c:594 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" msgstr "" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "" @@ -3007,7 +3023,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3015,21 +3031,21 @@ "\n" msgstr "" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" "\n" msgstr "" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" msgstr "" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3041,7 +3057,7 @@ "\n" msgstr "" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3050,120 +3066,138 @@ "\n" msgstr "" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" msgstr "" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" "\n" msgstr "" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "" -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "" -#: mpfr.c:550 +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "" @@ -3173,36 +3207,36 @@ msgid "cmd. line:" msgstr "" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "" -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " "expect" msgstr "" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3218,58 +3252,58 @@ msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)" msgstr "" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" msgstr "" -#: profile.c:193 +#: profile.c:213 #, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" "\n" msgstr "" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "" -#: profile.c:537 +#: profile.c:558 msgid "internal error: builtin with null fname" msgstr "" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" "\n" msgstr "" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" "\t# Functions, listed alphabetically\n" msgstr "" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "" @@ -3279,70 +3313,83 @@ msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +msgid "Unmatched [, [^, [:, [., or [=" msgstr "" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "" -#: symbol.c:741 +#: symbol.c:677 +#, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "" + +#: symbol.c:809 msgid "can not pop main context" msgstr "" diff -urN gawk-4.1.1/po/it.po gawk-4.1.2/po/it.po --- gawk-4.1.1/po/it.po 2014-04-08 19:23:37.000000000 +0300 +++ gawk-4.1.2/po/it.po 2015-04-29 08:36:41.000000000 +0300 @@ -1,13 +1,13 @@ # Italian messages for GNU Awk -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # Antonio Colombo . # msgid "" msgstr "" "Project-Id-Version: GNU Awk 4.0.73, API: 0.0\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" -"PO-Revision-Date: 2014-01-15 10:39+0100\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" +"PO-Revision-Date: 2015-04-27 10:10+0100\n" "Last-Translator: Antonio Colombo \n" "Language-Team: Italian \n" "Language: it\n" @@ -34,9 +34,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "tentativo di usare scalare '%s' come vettore" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "tentativo di usare vettore `%s' in un contesto scalare" @@ -95,412 +95,417 @@ "asorti: non consentito un primo argomento che sia un sottovettore del " "secondo argomento" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "`%s' non un nome funzione valido" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "funzione di confronto del sort `%s' non definita" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "blocchi %s richiedono una `azione'" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "ogni regola deve avere una parte `espressione' o una parte `azione'" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "il vecchio awk non supporta pi di una regola `BEGIN' o `END'" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "`%s' una funzione interna, non si pu ridefinire" -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "espressione regolare costante `//' sembra un commento C++, ma non lo " -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "espressione regolare costante `/%s/' sembra un commento C, ma non lo " -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "valori di `case' doppi all'interno di uno `switch': %s" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "valori di default doppi all'interno di uno `switch'" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "`break' non consentito fuori da un ciclo o da uno `switch'" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "`continue' non consentito fuori da un un ciclo" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "`next' usato in `azione' %s" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "`nextfile' usato in `azione' %s" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "`return' usato fuori da una funzione" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "`print' da solo in BEGIN o END dovrebbe forse essere `print \"\"'" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" msgstr "`delete' non consentito in SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" msgstr "`delete' non consentito in FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(array)' un'estensione tawk non-portabile" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "`pipeline' multistadio bidirezionali non funzionano" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "espressione regolare usata per assegnare un valore" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "espressione regolare prima di operatore `~' o `!~'" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" msgstr "il vecchio awk non supporta la parola-chiave `in' se non dopo `for'" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "espressione regolare a destra in un confronto" -#: awkgram.y:1417 +#: awkgram.y:1410 #, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "`getline var' invalida all'interno della regola `%s'" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "`getline' non ridiretta invalida all'interno della regola `%s'" -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "`getline' invalida all'interno della regola `%s'" - -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" -msgstr "`getline' non re-diretta indefinita dentro `azione' END" +msgstr "`getline' non ri-diretta indefinita dentro `azione' END" -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "il vecchio awk non supporta vettori multidimensionali" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "chiamata a `length' senza parentesi non portabile" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "chiamate a funzione indirette sono un'estensione gawk" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "non riesco a usare la variabile speciale `%s' come parametro indiretto di " "funzione" +#: awkgram.y:1634 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "tentativo di usare la non-funzione `%s' in una chiamata di funzione" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "espressione indice invalida" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "attenzione: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fatale: " -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "carattere 'a capo' o fine stringa non previsti" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "non riesco ad aprire file sorgente `%s' in lettura (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2392 awkgram.y:2517 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "non riesco ad aprire shared library `%s' in lettura (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "ragione indeterminata" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "non riesco a includere `%s' per usarlo come file di programma" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "file sorgente `%s' gi incluso" -#: awkgram.y:2409 +#: awkgram.y:2417 #, c-format msgid "already loaded shared library `%s'" msgstr "shared library `%s' gi inclusa" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "@include un'estensione gawk" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "nome-file mancante dopo @include" -#: awkgram.y:2494 +#: awkgram.y:2502 msgid "@load is a gawk extension" msgstr "@load un'estensione gawk" -#: awkgram.y:2500 +#: awkgram.y:2508 msgid "empty filename after @load" msgstr "nome-file mancante dopo @include" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "programma nullo sulla riga comandi" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "non riesco a leggere file sorgente `%s' (%s)" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "file sorgente `%s' vuoto" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "errore PEBKAC: carattere invalido '\\%03o' nel codice sorgente" + +#: awkgram.y:2958 msgid "source file does not end in newline" msgstr "file sorgente non termina con carattere 'a capo'" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "espressione regolare non completata termina con `\\' a fine file" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "%s: %d: modificatore di espressione regolare tawk `/.../%c' non valido in " "gawk" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "modificatore di espressione regolare tawk `/.../%c' non valido in gawk" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "espressione regolare non completata" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "espressione regolare non completata a fine file" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" msgstr "uso di `\\ #...' continuazione riga non portabile" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "'\\' non l'ultimo carattere della riga" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "POSIX non permette l'operatore `**='" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "il vecchio awk non supporta l'operatore `**='" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "POSIX non permette l'operatore `**'" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "il vecchio awk non supporta l'operatore `**'" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "l'operatore `^=' non supportato nel vecchio awk" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "l'operatore `^' non supportato nel vecchio awk" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "stringa non terminata" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "carattere '%c' non valido in un'espressione" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' un'estensione gawk" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX non permette `%s'" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "`%s' non supportato nel vecchio awk" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "`goto' considerato pericoloso!\n" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d non valido come numero di argomenti per %s" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: una stringa come ultimo argomento di `substitute' non ha effetto" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "il terzo parametro di '%s' non un oggetto modificabile" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "match: il terzo argomento un'estensione gawk" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "close: il secondo argomento un'estensione gawk" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "uso scorretto di dcgettext(_\"...\"): togliere il carattere '_' iniziale" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "uso scorretto di dcngettext(_\"...\"): togliere il carattere '_' iniziale" -#: awkgram.y:4016 +#: awkgram.y:4050 msgid "index: regexp constant as second argument is not allowed" msgstr "index: espressione regolare come secondo argomento non consentita" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funzione `%s': parametro `%s' nasconde variabile globale" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "non riesco ad aprire `%s' in scrittura (%s)" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "mando lista variabili a 'standard error'" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "%s: `close' non riuscita (%s)" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() chiamata due volte!" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "c'erano variabili nascoste." -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "funzione di nome `%s' definita in precedenza" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" "funzione `%s': non possibile usare nome della funzione come nome parametro" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "funzione `%s': non possibile usare la variabile speciale `%s' come " "parametro di funzione" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funzione `%s': parametro #%d, `%s', duplica parametro #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "funzione `%s' chiamata ma mai definita" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "funzione `%s' definita ma mai chiamata direttamente" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "espressione regolare di valore costante per parametro #%d genera valore " "booleano" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -509,23 +514,23 @@ "funzione `%s' chiamata con spazio tra il nome e `(',\n" "o usata come variabile o vettore" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "tentativo di dividere per zero" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "tentativo di dividere per zero in `%%'" -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" "impossibile assegnare un valore al risultato di un'espressione di post-" "incremento di un campo" -#: awkgram.y:5052 +#: awkgram.y:5012 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "destinazione di assegnazione non valida (codice operativo %s)" @@ -541,7 +546,7 @@ #: builtin.c:148 msgid "exp: received non-numeric argument" -msgstr "exp: argomento non-numerico" +msgstr "exp: l'argomento ricevuto non numerico" #: builtin.c:154 #, c-format @@ -566,189 +571,198 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' non un file aperto, una `pipe' o un co-processo" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" -msgstr "index: il primo argomento non una stringa" +msgstr "index: il primo argomento ricevuto non una stringa" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" -msgstr "index: il secondo argomento non una stringa" +msgstr "index: il secondo argomento ricevuto non una stringa" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" -msgstr "int: argomento non-numerico" +msgstr "int: l'argomento ricevuto non numerico" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" -msgstr "length: l'argomento fornito un vettore" +msgstr "length: l'argomento ricevuto un vettore" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "`length(array)' un'estensione gawk" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" -msgstr "length: l'argomento non una stringa" +msgstr "length: l'argomento ricevuto non una stringa" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" -msgstr "log: argomento non-numerico" +msgstr "log: l'argomento ricevuto non numerico" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" -msgstr "log: argomento negativo %g" +msgstr "log: argomento ricevuto negativo %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" -msgstr "fatale: `count$' va usato per ogni `format' o per nessuno" +msgstr "fatale: `count$' va usato per tutti i formati o per nessuno" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "larghezza campo ignorata per la specifica `%%'" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "precisione ignorata per la specifica `%%'" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "larghezza campo e precisone ignorate per la specifica `%%'" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" -msgstr "fatale: operatore `$' non consentito nei `format' awk" +msgstr "fatale: operatore `$' non consentito nei formati awk" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fatale: numero argomenti con `$' dev'essere > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "fatale: numero argomenti %ld > del numero totale argomenti specificati" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" -msgstr "fatale: `$' non consentito dopo il punto in un `format'" +msgstr "fatale: `$' non consentito dopo il punto in un formato" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "fatale: manca `$' per i campi posizionali larghezza o precisione" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" -msgstr "`l' non ha senso nei `format' awk; ignorato" +msgstr "`l' non ha senso nei formati awk; ignorato" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" -msgstr "fatale: `l' non consentito nei `format' POSIX awk" +msgstr "fatale: `l' non consentito nei formati POSIX awk" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" -msgstr "`L' non ha senso nei `format' awk; ignorato" +msgstr "`L' non ha senso nei formati awk; ignorato" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" -msgstr "`L' non ha senso nei `format' awk; ignorato" +msgstr "fatale: `L' non consentito nei formati POSIX awk" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" -msgstr "`h' non ha senso nei `format' awk; ignorato" +msgstr "`h' non ha senso nei formati awk; ignorato" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" -msgstr "fatale: `h' non consentito nei `format' POSIX awk" +msgstr "fatale: `h' non consentito nei formati POSIX awk" -#: builtin.c:1463 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: valore %g troppo elevato per il formato %%c" + +#: builtin.c:1068 +#, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: valore %g non un carattere multibyte valido " + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" -msgstr "[s]printf: valore %g fuori intervallo per il `format' `%%%c'" +msgstr "[s]printf: valore %g fuori intervallo per il formato `%%%c'" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" -msgstr "" -"carattere di `format' sconosciuto `%c' ignorato: nessun argomento convertito" +msgstr "carattere di formato ignoto `%c' ignorato: nessun argomento convertito" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "" "fatale: argomenti in numero minore di quelli richiesti dalla stringa di " -"`format'" +"formato" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ esauriti a questo punto" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" -msgstr "[s]printf: specifica di `format' senza un carattere di controllo" +msgstr "[s]printf: specifica di formato senza un carattere di controllo" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" -msgstr "troppi argomenti specificati per questa stringa di `format'" +msgstr "troppi argomenti specificati per questa stringa di formato" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: nessun argomento" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: nessun argomento" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" -msgstr "sqrt: argomento non-numerico" +msgstr "sqrt: l'argomento ricevuto non numerico" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: chiamata con argomento negativo %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: lunghezza %g non >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: lunghezza %g non >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: lunghezza non intera %g: sar troncata" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: lunghezza %g troppo elevata per indice stringa, tronco a %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: indice di partenza %g non valido, uso 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: indice di partenza non intero %g: sar troncato" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: stringa di partenza lunga zero" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: indice di partenza %g oltre la fine della stringa" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -756,187 +770,208 @@ "substr: lunghezza %g all'indice di partenza %g supera la lunghezza del primo " "argomento (%lu)" -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" -"strftime: il valore del `format' in PROCINFO[\"strftime\"] di tipo numerico" +"strftime: il valore del formato in PROCINFO[\"strftime\"] di tipo numerico" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" -msgstr "strftime: secondo argomento non-numerico" +msgstr "strftime: il secondo argomento ricevuto non numerico" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" -msgstr "strftime: secondo argomento < 0 o troppo elevato per time_t" +msgstr "strftime: il secondo argomento < 0 o troppo elevato per time_t" -#: builtin.c:1934 -msgid "strftime: received non-string first argument" -msgstr "strftime: il primo argomento non una stringa" +#: builtin.c:1932 +#, fuzzy +msgid "strftime: second argument out of range for time_t" +msgstr "strftime: il secondo argomento < 0 o troppo elevato per time_t" #: builtin.c:1941 +msgid "strftime: received non-string first argument" +msgstr "strftime: il primo argomento ricevuto non una stringa" + +#: builtin.c:1948 msgid "strftime: received empty format string" -msgstr "strftime: `format' una stringa nulla" +msgstr "strftime: il formato ricevuto una stringa nulla" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" -msgstr "mktime: l'argomento non una stringa" +msgstr "mktime: l'argomento ricevuto non una stringa" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: almeno un valore fuori dall'intervallo di default" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "funzione 'system' non consentita in modo `sandbox'" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" -msgstr "system: l'argomento non una stringa" +msgstr "system: l'argomento ricevuto non una stringa" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "riferimento a variabile non inizializzata `$%d'" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" -msgstr "tolower: l'argomento non una stringa" +msgstr "tolower: l'argomento ricevuto non una stringa" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" -msgstr "toupper: l'argomento non una stringa" +msgstr "toupper: l'argomento ricevuto non una stringa" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" -msgstr "atan2: primo argomento non-numerico" +msgstr "atan2: il primo argomento ricevuto non numerico" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" -msgstr "atan2: secondo argomento non-numerico" +msgstr "atan2: il secondo argomento ricevuto non numerico" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" -msgstr "sin: argomento non-numerico" +msgstr "sin: l'argomento ricevuto non numerico" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" -msgstr "cos: argomento non-numerico" +msgstr "cos: l'argomento ricevuto non numerico" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" -msgstr "srand: argomento non-numerico" +msgstr "srand: l'argomento ricevuto non numerico" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "match: terzo argomento non-vettoriale" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" -msgstr "gensub: il terzo argomento 0, trattato come 1" +#: builtin.c:2725 +#, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "gensub: il terzo argomento `%.*s' trattato come 1" + +#: builtin.c:2740 +#, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: il terzo argomento %g trattato come 1" -#: builtin.c:3030 +#: builtin.c:3038 +#, fuzzy, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "and: chiamata con meno di due argomenti" + +#: builtin.c:3128 +#, fuzzy, c-format +msgid "indirect call to %s requires at least two arguments" +msgstr "and: chiamata con meno di due argomenti" + +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" -msgstr "lshift: primo argomento non-numerico" +msgstr "lshift: il primo argomento ricevuto non numerico" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" -msgstr "lshift: secondo argomento non-numerico" +msgstr "lshift: il secondo argomento ricevuto non numerico" -#: builtin.c:3038 +#: builtin.c:3188 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): valori negativi daranno risultati strani" -#: builtin.c:3040 +#: builtin.c:3190 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): valori decimali saranno troncati" -#: builtin.c:3042 +#: builtin.c:3192 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f): valori troppo alti daranno risultati strani" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" -msgstr "rshift: primo argomento ricevuto non-numerico" +msgstr "rshift: il primo argomento ricevuto non numerico" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" -msgstr "rshift: secondo argomento non-numerico" +msgstr "rshift: il secondo argomento ricevuto non numerico" -#: builtin.c:3075 +#: builtin.c:3225 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): valori negativi daranno risultati strani" -#: builtin.c:3077 +#: builtin.c:3227 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): valori decimali saranno troncati" -#: builtin.c:3079 +#: builtin.c:3229 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "rshift(%f, %f): valori troppo alti daranno risultati strani" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3254 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: chiamata con meno di due argomenti" -#: builtin.c:3109 +#: builtin.c:3259 #, c-format msgid "and: argument %d is non-numeric" -msgstr "and: argomento %d non-numerico" +msgstr "and: l'argomento %d non numerico" -#: builtin.c:3113 +#: builtin.c:3263 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and: argomento %d, valore negativo %g dar risultati strani" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3286 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: chiamata con meno di due argomenti" -#: builtin.c:3141 +#: builtin.c:3291 #, c-format msgid "or: argument %d is non-numeric" -msgstr "or: argomento %d non-numerico" +msgstr "or: l'argomento %d non numerico" -#: builtin.c:3145 +#: builtin.c:3295 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "or: argomento %d, valore negativo %g dar risultati strani" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3317 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: chiamata con meno di due argomenti" -#: builtin.c:3173 +#: builtin.c:3323 #, c-format msgid "xor: argument %d is non-numeric" -msgstr "xor: argomento %d non-numerico" +msgstr "xor: l'argomento %d non numerico" -#: builtin.c:3177 +#: builtin.c:3327 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: argomento %d, valore negativo %g dar risultati strani" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" -msgstr "compl: argomento non-numerico" +msgstr "compl: l'argomento ricevuto non numerico" -#: builtin.c:3208 +#: builtin.c:3358 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): valore negativo, dar risultati strani" -#: builtin.c:3210 +#: builtin.c:3360 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): valori decimali saranno troncati" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' non una categoria `locale' valida" @@ -1141,7 +1176,7 @@ #: command.y:855 msgid "list [-|+|[filename:]lineno|function|range] - list specified line(s)." msgstr "" -"list [-|+|[nome-file:]num_linea|funzione|intervallo] - elenca riga/he " +"list [-|+|[nome-file:]num_riga|funzione|intervallo] - elenca riga/he " "richiesta/e." #: command.y:857 @@ -1167,7 +1202,7 @@ #: command.y:865 msgid "printf format, [arg], ... - formatted output." -msgstr "printf format, [arg], ... - output secondo formato specificato." +msgstr "printf format, [arg], ... - output secondo formato." #: command.y:867 msgid "quit - exit debugger." @@ -1228,8 +1263,8 @@ "until [[filename:]N|function] - execute until program reaches a different " "line or line N within current frame." msgstr "" -"until [[nome-file:]N|funzione] - esegui finch il programma arriva una " -"rigadifferente, o alla riga N nell'elemento di stack corrente." +"until [[nome-file:]N|funzione] - esegui finch il programma arriva una riga " +"differente, o alla riga N nell'elemento di stack corrente." #: command.y:895 msgid "unwatch [N] - remove variable(s) from watch list." @@ -1243,40 +1278,48 @@ msgid "watch var - set a watchpoint for a variable." msgstr "watch var - imposta un watchpoint per una variabile." -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"dove [N] - (equivalente a backtrace) stampa tracia di tutti gli elementi o " +"degli N pi interni (pi esterni se N <0)" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "errore: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "non riesco a leggere comando (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "non riesco a leggere comando (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "carattere non valido nel comando" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "comando sconosciuto - \"%.*s\", vedere help" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "carattere non valido" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "comando non definito: %s\n" @@ -1807,68 +1850,68 @@ msgid "`return' not allowed in current context; statement ignored" msgstr "`return' non consentito nel contesto corrente; istruzione ignorata" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Simbolo `%s' non esiste nel contesto corrente" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 msgid "unbalanced [" msgstr "[ non chiusa" -#: dfa.c:1174 +#: dfa.c:1118 msgid "invalid character class" msgstr "character class non valida" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "sintassi character class [[:spazio:]], non [:spazio:]" -#: dfa.c:1366 +#: dfa.c:1326 msgid "unfinished \\ escape" msgstr "sequenza escape \\ non completa" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" -msgstr "Contenuto di \\{\\} non valido" - -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" -msgstr "Espressione regolare troppo complessa" +#: dfa.c:1473 +msgid "invalid content of \\{\\}" +msgstr "contenuto di \\{\\} non valido" + +#: dfa.c:1476 +msgid "regular expression too big" +msgstr "espressione regolare troppo complessa" -#: dfa.c:1936 +#: dfa.c:1911 msgid "unbalanced (" msgstr "( non chiusa" -#: dfa.c:2062 +#: dfa.c:2037 msgid "no syntax specified" msgstr "nessuna sintassi specificata" -#: dfa.c:2070 +#: dfa.c:2045 msgid "unbalanced )" msgstr ") non aperta" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "tipo nodo sconosciuto %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "codice operativo sconosciuto %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "codice operativo %s non un operatore o una parola chiave" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "superamento limiti buffer in 'genflags2str'" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1879,216 +1922,216 @@ "\t# `Stack' (Pila) Chiamate Funzione:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' un'estensione gawk" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' un'estensione gawk" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "valore di BINMODE `%s' non valido, considerato come 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "specificazione invalida `%sFMT' `%s'" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "disabilito `--lint' a causa di assegnamento a `LINT'" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "riferimento ad argomento non inizializzato `%s'" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "riferimento a variabile non inizializzata `%s'" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "tentativo di riferimento a un campo da valore non-numerico" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "tentativo di riferimento a un campo da una stringa nulla" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "tentativo di accedere al campo %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "riferimento a campo non inizializzato `$%ld'" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "funzione `%s' chiamata con pi argomenti di quelli previsti" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: tipo non previsto `%s'" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "divisione per zero tentata in `/='" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "divisione per zero tentata in `%%='" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "le estensioni non sono consentite in modo `sandbox'" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load sono estensioni gawk" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" -msgstr "load_ext: nome libreria ricevuto NULL" +msgstr "load_ext: il nome libreria ricevuto NULL" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: non riesco ad aprire libreria `%s' (%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: libreria `%s': non definisce `plugin_is_GPL_compatible' (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: libreria `%s': non riesco a chiamare funzione `%s' (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" "load_ext: libreria `%s' routine di inizializzazione `%s' non riuscita\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "`extension' un'estensione gawk" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" -msgstr "extension: nome libreria ricevuto NULL" +msgstr "extension: il nome libreria ricevuto NULL" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension: non riesco ad aprire libreria `%s' (%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "extension: libreria `%s': non definisce `plugin_is_GPL_compatible' (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "extension: libreria `%s': non riesco a chiamare funzione `%s' (%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: manca nome di funzione" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: non riesco a ridefinire funzione `%s'" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: funzione `%s' gi definita" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: funzione di nome `%s' definita in precedenza" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "make_builtin: nome funzione interna gawk `%s' non ammesso come nome funzione" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: contatore argomenti negativo per la funzione `%s'" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: manca nome di funzione" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: carattere non ammesso `%c' nel nome di funzione `%s'" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: non riesco a ridefinire funzione `%s'" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: funzione `%s' gi definita" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: funzione di nome `%s' definita in precedenza" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" "extension: nome funzione interna gawk `%s' non ammesso come nome funzione" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "funzione `%s' definita per avere al massimo %d argomenti(o)" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "funzione `%s': manca argomento #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "funzione `%s': argomento #%d: tentativo di usare scalare come vettore" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "funzione `%s': argomento #%d: tentativo di usare vettore come scalare" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "caricamento dinamico di libreria non supportato" @@ -2232,7 +2275,7 @@ msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin: modifica in-place gi attiva" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin: 2 argumenti richiesti, ma chiamata con %d" @@ -2263,56 +2306,56 @@ msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin: mkstemp(`%s') non riuscita (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin: chmod non riuscita (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin: dup(stdout) non riuscita (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin: dup2(%d, stdout) non riuscita (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin: close(%d) non riuscita (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" "inplace_end: non riesco a trovare il 1 argomento come stringa nome-file" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end: modifica in-place non attiva" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end: dup2(%d, stdout) non riuscita (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end: close(%d) non riuscita (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end: fsetpos(stdout) non riuscita (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end: link(`%s', `%s') non riuscita (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end: rename(`%s', `%s') non riuscito (%s)" @@ -2354,50 +2397,54 @@ msgid "readfile: called with no arguments" msgstr "readfile: chiamata senza argomenti" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "revoutput: non riesco a inizializzare la variabile REVOUT" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: chiamata con troppi argomenti" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: argomento 0 non una stringa\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: argomento 1 non-vettoriale\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: non sono riuscito a appiattire un vettore\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: non sono riuscito a rilasciare un vettore appiattito\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: chiamata con troppi argomenti" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: argomento 0 non una stringa\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: argomento 1 non-vettoriale\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array non riuscita\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element non riuscita\n" @@ -2426,90 +2473,90 @@ msgid "sleep: not supported on this platform" msgstr "sleep: non supportato in questa architettura" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF impostato a un valore negativo" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: il quarto argomento un'estensione gawk" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: quarto argomento non-vettoriale" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: secondo argomento non-vettoriale" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: non si pu usare un unico vettore come secondo e quarto argomento" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: non consentito un quarto argomento che sia un sottovettore del " "secondo argomento" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: non consentito un secondo argomento che sia un sottovettore del " "quarto argomento" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: la stringa nulla come terzo arg. un'estensione gawk" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: secondo argomento non-vettoriale" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: secondo argomento non-vettoriale" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: il terzo argomento non pu essere nullo" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: non si pu usare un unico vettore come secondo e quarto argomento" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: non consentito un quarto argomento che sia un sottovettore del " "secondo argomento" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: non consentito un secondo argomento che sia un sottovettore del " "quarto argomento" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' un'estensione gawk" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "valore di FIELDWIDTHS non valido, vicino a `%s'" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "la stringa nulla usata come `FS' un'estensione gawk" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "il vecchio awk non supporta espressioni come valori di `FS'" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "`FPAT' un'estensione gawk" @@ -2525,20 +2572,20 @@ msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: ricevuto valore nullo" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element: ricevuto vettore nullo" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element: ricevuto indice nullo" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: non sono riuscito a convertire l'indice %d\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: non sono riuscito a convertire il valore %d\n" @@ -2598,293 +2645,275 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: l'opzione '-W %s' richiede un argomento\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" -msgstr "l'argomento in linea comando `%s' una directory: saltato" +msgstr "l'argomento in riga comando `%s' una directory: ignorata" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "non riesco ad aprire file `%s' in lettura (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "chiusura di fd %d (`%s') non riuscita (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" -msgstr "re-direzione non consentita in modo `sandbox'" +msgstr "ri-direzione non consentita in modo `sandbox'" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" -msgstr "espressione nella re-direzione `%s' ha solo un valore numerico" +msgstr "espressione nella ri-direzione `%s' ha solo un valore numerico" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" -msgstr "espressione nella re-direzione `%s' ha per valore la stringa nulla" +msgstr "espressione nella ri-direzione `%s' ha per valore la stringa nulla" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" -"nome-file `%s' per la re-direzione `%s' pu essere il risultato di una " +"nome-file `%s' per la ri-direzione `%s' pu essere il risultato di una " "espressione logica" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "mistura non necessaria di `>' e `>>' per il file `%.*s'" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "non riesco ad aprire `pipe' `%s' in scrittura (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "non riesco ad aprire `pipe' `%s' in lettura (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" "non riesco ad aprire `pipe' bidirezionale `%s' in lettura/scrittura (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" -msgstr "non riesco a re-dirigere da `%s' (%s)" +msgstr "non riesco a ri-dirigere da `%s' (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" -msgstr "non riesco a re-dirigere a `%s' (%s)" +msgstr "non riesco a ri-dirigere a `%s' (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "numero massimo consentito di file aperti raggiunto: comincio a riutilizzare " "i descrittori di file" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "chiusura di `%s' non riuscita (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "troppe `pipe' o file di input aperti" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: il secondo argomento deve essere `a' o `da'" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: `%.*s' non un file aperto, una `pipe' o un co-processo" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" -msgstr "chiusura di una re-direzione mai aperta" +msgstr "chiusura di una ri-direzione mai aperta" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" -msgstr "close: re-direzione `%s' non aperta con `|&', ignoro secondo argomento" +msgstr "close: ri-direzione `%s' non aperta con `|&', ignoro secondo argomento" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "errore ritornato (%d) dalla chiusura della `pipe' `%s' (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "errore ritornato (%d) dalla chiusura del file `%s' (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "nessuna chiusura esplicita richiesta per `socket' `%s'" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "nessuna chiusura esplicita richiesta per co-processo `%s'" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "nessuna chiusura esplicita richiesta per `pipe' `%s'" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "nessuna chiusura esplicita richiesta per file `%s'" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "errore scrivendo 'standard output' (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "errore scrivendo 'standard error' (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "scaricamento di `pipe' `%s' non riuscito (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "scaricamento da co-processo di `pipe' a `%s' non riuscito (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "scaricamento di file `%s' non riuscito (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "porta locale %s invalida in `/inet'" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "host remoto e informazione di porta (%s, %s) invalidi" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "nessuno protocollo (noto) specificato nel filename speciale `%s'" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "nome-file speciale `%s' incompleto" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "va fornito nome di `host' remoto a `/inet'" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "va fornita porta remota a `/inet'" - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "comunicazioni TCP/IP non supportate" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "non riesco ad aprire `%s', modo `%s'" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "close di `pty' principale non riuscita (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "close di `stdout' nel processo-figlio non riuscita (%s)" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "trasferimento di `pty' secondaria a `stdout' nel processo-figlio non " "riuscita (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "close di `stdin' nel processo-figlio non riuscita (%s)" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "trasferimento di 'pty' secondaria a 'stdin' nel processo-figlio non riuscito " "(dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "close di 'pty' secondaria non riuscita (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "passaggio di `pipe' a `stdout' nel processo-figlio non riuscito (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "passaggio di pipe a `stdin' nel processo-figlio non riuscito (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" msgstr "ripristino di `stdout' nel processo-padre non riuscito\n" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" msgstr "ripristino di `stdin' nel processo-padre non riuscito\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "close di 'pipe' non riuscita (%s)" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "`|&' non supportato" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "non riesco ad aprire `pipe' `%s' (%s)" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "non riesco a creare processo-figlio per `%s' (fork: %s)" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser: ricevuto puntatore NULL" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "input parser `%s' in conflitto con l'input parser `%s' installato in " "precedenza" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "l'input parser `%s' non riuscito ad aprire `%s'" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper: ricevuto puntatore NULL" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" @@ -2892,16 +2921,16 @@ "output wrapper `%s' in conflitto con l'output wrapper `%s' installato in " "precedenza" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "l'output wrapper `%s' non riuscito ad aprire `%s'" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor: ricevuto puntatore NULL" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2910,209 +2939,198 @@ "processore doppio `%s' in conflitto con il processore doppio installato in " "precedenza `%s'" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "il processore doppio `%s' non riuscito ad aprire `%s'" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "file dati `%s' vuoto" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "non riesco ad allocare ulteriore memoria per l'input" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "valore multicarattere per `RS' un'estensione gawk" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "comunicazioni IPv6 non supportate" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "argomento di `-e/--source' nullo, ignorato" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: opzione `-W %s' non riconosciuta, ignorata\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: l'opzione richiede un argomento -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "variable d'ambiente `POSIXLY_CORRECT' impostata: attivo `--posix'" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "`--posix' annulla `--traditional'" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--posix'/`--traditional' annulla `--non-decimal-data'" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "eseguire %s con `setuid' root pu essere un rischio per la sicurezza" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "`--posix' annulla `--characters-as-bytes'" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "non possibile impostare modalit binaria su `stdin'(%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "non possibile impostare modalit binaria su `stdout'(%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "non possibile impostare modalit binaria su `stderr'(%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "manca del tutto il testo del programma!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Uso: %s [opzioni in stile POSIX o GNU] -f file-prog. [--] file ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Usage: %s [opzioni in stile POSIX o GNU] [--] %cprogramma%c file ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "Opzioni POSIX:\t\topzioni lunghe GNU: (standard)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f fileprog\t\t--file=file-prog.\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=valore\t\t--assign=var=valore\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Opzioni brevi:\t\topzioni lunghe GNU: (estensioni)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[file]\t\t--dump-variables[=file]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[file]\t\t--debug[=file]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'testo-del-programma'\t--source='testo-del-programma'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E file\t\t\t--exec=file\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i include_file\t\t--include=include_file\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l libreria\t\t--load=libreria\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" -msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" - -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" +msgstr "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" -#: main.c:824 +#: main.c:591 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:594 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[file]\t\t--pretty-print[=file]\n" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[file]\t\t--profile[=file]\n" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3121,7 +3139,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3134,7 +3152,7 @@ "Problemi di traduzione, segnalare ad: azc100@gmail.com.\n" "\n" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3144,7 +3162,7 @@ "Senza parametri, legge da 'standard input' e scrive su 'standard output'.\n" "\n" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3154,7 +3172,7 @@ "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3173,7 +3191,7 @@ "Licenza, o (a tua scelta) a una qualsiasi versione successiva.\n" "\n" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3187,7 +3205,7 @@ "Vedi la 'GNU General Public License' per ulteriori dettagli.\n" "\n" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3196,16 +3214,16 @@ "assieme a questo programma; se non cos, vedi http://www.gnu.org/" "licenses/.\n" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft non imposta FS a `tab' nell'awk POSIX" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "valore non noto per specifica campo: %d\n" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3214,98 +3232,116 @@ "%s: `%s' argomento di `-v' non in forma `var=valore'\n" "\n" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' non un nome di variabile ammesso" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' non un nome di variabile, cerco il file `%s=%s'" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "nome funzione interna gawk `%s' non ammesso come nome variabile" -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "non possibile usare nome di funzione `%s' come nome di variabile" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "eccezione floating point" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "errore fatale: errore interno" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "errore fatale: errore interno: segfault" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "errore fatale: errore interno: stack overflow" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "manca `fd' pre-aperta %d" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "non riesco a pre-aprire /dev/null per `fd' %d" -#: mpfr.c:550 +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "argomento di `-e/--source' nullo, ignorato" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "-M ignorato: supporto per MPFR/GMP non generato" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: opzione `-W %s' non riconosciuta, ignorata\n" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: l'opzione richiede un argomento -- %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "valore PREC `%.*s' non valido" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "valore di RNDMODE `%.*s' non valido" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" -msgstr "%s: ricevuto argomento non-numerico" +msgstr "%s: l'argomento ricevuto non numerico" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): valore negativo, dar risultati strani" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "comp(%Rg): valore decimale sar troncato" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "cmpl(%Zd): valori negativi, daranno risultati strani" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" -msgstr "%s:ricevuto argomento non-numerico #%d" +msgstr "%s: l'argomento ricevuto non numerico #%d" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: argomento #%d con valore non valido %Rg, uso 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: argomento #%d con valore negativo %Rg, dar risultati strani" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s: argomento #%d, valore decimale sar troncato" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%s: argomento #%d con valore negativo %Zd, dar risultati strani" @@ -3313,26 +3349,26 @@ #: msg.c:68 #, c-format msgid "cmd. line:" -msgstr "linea com.:" +msgstr "riga com.:" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "'\\' a fine stringa" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "il vecchio awk non supporta la sequenza di escape '\\%c'" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX non permette escape `\\x'" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "niente cifre esadecimali nella sequenza di escape `\\x'" -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3341,12 +3377,12 @@ "sequenza di escape esadec.\\x%.*s di %d caratteri probabilmente non " "interpretata nel modo previsto" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "sequenza di escape `\\%c' considerata come semplice `%c'" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3365,25 +3401,25 @@ msgstr "" "%s %s `%s': non riesco a impostare 'close-on-exec': (fcntl F_SETFD: %s)" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "non riesco ad aprire `%s' in scrittura: %s" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" msgstr "mando profilo a 'standard error'" -#: profile.c:193 +#: profile.c:213 #, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# blocco(hi) %s\n" +"\t# %s regola(e)\n" "\n" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" @@ -3392,16 +3428,16 @@ "\t# Regola(e)\n" "\n" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "errore interno: %s con `vname' nullo" -#: profile.c:537 +#: profile.c:558 msgid "internal error: builtin with null fname" msgstr "errore interno: funzione interna con `fname' nullo" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3410,12 +3446,12 @@ "\t# Estensioni caricate (-l e/o @load)\n" "\n" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# profilo gawk, creato %s\n" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" @@ -3424,10 +3460,10 @@ "\n" "\t# Funzioni, in ordine alfabetico\n" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" -msgstr "redir2str: tipo di re-direzione non noto %d" +msgstr "redir2str: tipo di ri-direzione non noto %d" #: re.c:607 #, c-format @@ -3435,73 +3471,84 @@ msgstr "" "componente di espressione `%.*s' dovrebbe probabilmente essere `[%.*s]'" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Successo" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Nessuna corrispondenza" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Espressione regolare invalida" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Carattere di ordinamento non valido" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Nome di 'classe di caratteri' non valido" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "'\\' finale" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Riferimento indietro non valido" -#: regcomp.c:152 -msgid "Unmatched [ or [^" -msgstr "[ o [^ non chiusa" +#: regcomp.c:160 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "[, [^, [:, [. o [= non chiusa" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "( o \\( non chiusa" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "\\{ non chiusa" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Contenuto di \\{\\} non valido" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Fine di intervallo non valido" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Memoria esaurita" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Espressione regolare precedente invalida" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Fine di espressione regolare inaspettata" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Espressione regolare troppo complessa" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr ") o \\) non aperta" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Nessuna espressione regolare precedente" -#: symbol.c:741 +#: symbol.c:677 +#, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "" +"funzione `%s': non possibile come nome parametro quello della funzione `%s'" + +#: symbol.c:809 msgid "can not pop main context" msgstr "non posso salire pi in alto nello stack" - -#~ msgid "range of the form `[%c-%c]' is locale dependent" -#~ msgstr "intervallo della forma `[%c-%c]' dipende da `locale'" diff -urN gawk-4.1.1/po/ja.po gawk-4.1.2/po/ja.po --- gawk-4.1.1/po/ja.po 2014-04-08 19:23:37.000000000 +0300 +++ gawk-4.1.2/po/ja.po 2015-04-29 08:36:41.000000000 +0300 @@ -1,15 +1,15 @@ # Japanese messages for gawk. -# Copyright (C) 2003, 2011 Free Software Foundation, Inc. +# Copyright (C) 2003, 2014 Free Software Foundation, Inc. # This file is distributed under the same license as the gawk package. # Makoto Hosoya , 2003. -# Yasuaki Taniguchi , 2011. +# Yasuaki Taniguchi , 2011, 2014. # msgid "" msgstr "" -"Project-Id-Version: gawk 4.0.0\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" -"PO-Revision-Date: 2011-07-17 08:28+0900\n" +"Project-Id-Version: gawk 4.1.0b\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" +"PO-Revision-Date: 2014-11-07 12:26+0000\n" "Last-Translator: Yasuaki Taniguchi \n" "Language-Team: Japanese \n" "Language: ja\n" @@ -37,9 +37,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "スカラー `%s' を配列として使用する試みです" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "スカラーコンテキストで配列 `%s' を使用する試みです" @@ -55,9 +55,8 @@ msgstr "スカラー `%s[\"%.*s\"]' を配列として使用する試みです" #: array.c:776 -#, fuzzy msgid "adump: first argument not an array" -msgstr "adump: 引数が配列ではありません" +msgstr "adump: 第一引数が配列ではありません" #: array.c:815 msgid "asort: second argument not an array" @@ -91,409 +90,412 @@ msgid "asorti: cannot use a subarray of second arg for first arg" msgstr "asorti: 第二引数の部分配列を第一引数用に使用することは出来ません" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "`%s' は関数名としては無効です" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "ソート比較関数 `%s' が定義されていません" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "%s ブロックにはアクション部が必須です" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "各ルールにはパターンまたはアクション部が必須です。" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "古い awk は複数の `BEGIN' または `END' ルールをサポートしません" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "`%s' は組込み関数です。再定義できません" -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "正規表現定数 `//' は C++コメントに似ていますが、違います。" -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "正規表現定数 `/%s/' は C コメントに似ていますが、異なります" -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "switch 文の中で重複した case 値が使用されています: %s" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "switch 文の中で重複した `default' が検出されました" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "`break' はループまたは switch の外では許可されていません" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "`continue' はループの外では許可されていません" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "%s アクション内で `next' が使用されました" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "`nextfile' が %s アクション内で使用されました" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "`return' が関数定義文の外で使われました" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "BEGIN または END ルール内の引数の無い `print' は `print \"\"' だと思われます" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" msgstr "" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" msgstr "" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(array)' は移植性の無い tawk 拡張です" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "多段階で双方向パイプを利用した式は使用できません" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "正規表現が代入式の右辺に使用されています" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "`~' や `!~' 演算子の左辺に正規表現が使用されています" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" msgstr "古い awk では `in' 予約語は `for' の後を除きサポートしません" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "比較式の右辺に正規表現が使用されています。" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "`%s' ルールの内部では `getline var' は無効です" - -#: awkgram.y:1420 +#: awkgram.y:1410 #, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "`%s' ルールの内部では `getline' は無効です" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "`%s' ルールの内側ではリダイレクトされていない `getline' は無効です" -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" msgstr "リダイレクトされていない `getline' は END アクションでは未定義です。" -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "古い awk は多次元配列をサポートしません" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "小括弧が無い `length' は移植性がありません" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "間接関数呼び出しは gawk 拡張です" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "特別な変数 `%s' は間接関数呼び出し用には使用出来ません" +#: awkgram.y:1634 +#, fuzzy, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "関数 `%s' を配列として使用する試みです" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "添字の式が無効です" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "警告: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "致命的: " -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "予期しない改行または文字列終端です" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "ソースファイル `%s' を読み込み用に開けません (%s)" -#: awkgram.y:2384 awkgram.y:2509 -#, fuzzy, c-format +#: awkgram.y:2392 awkgram.y:2517 +#, c-format msgid "can't open shared library `%s' for reading (%s)" -msgstr "ソースファイル `%s' を読み込み用に開けません (%s)" +msgstr "共有ライブラリ `%s' を読み込み用に開けません (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "原因不明" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "ソースファイル `%s' は既に読み込まれています" -#: awkgram.y:2409 -#, fuzzy, c-format +#: awkgram.y:2417 +#, c-format msgid "already loaded shared library `%s'" -msgstr "ソースファイル `%s' は既に読み込まれています" +msgstr "共有ライブラリ `%s' は既に読み込まれています" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "@include は gawk 拡張です" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "@include の後に空のファイル名があります" -#: awkgram.y:2494 -#, fuzzy +#: awkgram.y:2502 msgid "@load is a gawk extension" -msgstr "@include は gawk 拡張です" +msgstr "@load は gawk 拡張です" -#: awkgram.y:2500 -#, fuzzy +#: awkgram.y:2508 msgid "empty filename after @load" -msgstr "@include の後に空のファイル名があります" +msgstr "@load の後に空のファイル名があります" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "コマンド行のプログラム表記が空です" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "ソースファイル `%s' を読み込めません (%s)" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "ソースファイル `%s' は空です" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2958 msgid "source file does not end in newline" msgstr "ソースファイルが改行で終っていません" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "終端されていない正規表現がファイル最後の `\\' で終っています。" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "%s: %d: tawk の正規表現修飾子 `/.../%c' は gawk で使用できません" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "tawk の正規表現修飾子 `/.../%c' は gawk で使用できません" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "正規表現が終端されていません" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "ファイルの中で正規表現が終端されていません" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" msgstr "`\\ #...' 形式の行継続は移植性がありません" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "バックスラッシュが行最後の文字になっていません。" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "POSIX では演算子 `**=' は許可されていません" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "古い awk は演算子 `**=' をサポートしません" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "POSIX では演算子 `**' は許可されていません" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "古い awk は演算子 `**' をサポートしません" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "古い awk は演算子 `^=' をサポートしません" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "古い awk は演算子 `^' をサポートしません" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "文字列が終端されていません" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "式内に無効な文字 '%c' があります" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' は gawk 拡張です" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX では `%s' は許可されていません" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "古い awk は `%s' をサポートしません" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "`goto' は有害だと見なされています!\n" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d は %s 用の引数の数としては無効です" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: 文字列リテラルを置き換え最後の引数に使用すると効果がありません" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s 第三仮引数は可変オブジェクトではありません" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "match: 第三引数は gawk 拡張です" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "close: 第二引数は gawk 拡張です" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "dcgettext(_\"...\")の使用法が間違っています: 先頭のアンダースコア(_)を削除し" "てください" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "dcngettext(_\"...\")の使用法が間違っています: 先頭のアンダースコア(_)を削除し" "てください" -#: awkgram.y:4016 +#: awkgram.y:4050 #, fuzzy msgid "index: regexp constant as second argument is not allowed" msgstr "index: 文字列では無い第二引数を受け取りました" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "関数 `%s': 仮引数 `%s' が大域変数を覆い隠しています" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "`%s' を書込み用に開けませんでした (%s)" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "変数リストを標準エラーに送っています" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "%s: 閉じるのに失敗しました (%s)" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() を二回呼び出しています!" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "覆い隠された変数がありました" -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "関数名 `%s' は前に定義されています" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "関数 `%s': 関数名を仮引数名として使用出来ません" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "関数 `%s': 特別な変数 `%s' は関数の仮引数として使用出来ません" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "関数 `%s': 仮引数 #%d, `%s' が仮引数 #%d と重複しています" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "未定義の関数 `%s' を呼び出しました" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "関数 `%s' は定義されていますが、一度も直接呼び出されていません" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "仮引数 #%d 用の正規表現定数は真偽値を出力します" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -502,21 +504,21 @@ "関数名と `(' の間にスペースを入れて関数 `%s' を呼び出しています。\n" "または、変数か配列として使われています。" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "ゼロによる除算が試みられました" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "`%%' 内でゼロによる除算が試みられました" -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" -#: awkgram.y:5052 +#: awkgram.y:5012 #, fuzzy, c-format msgid "invalid target of assignment (opcode %s)" msgstr "%d は %s 用の引数の数としては無効です" @@ -558,189 +560,198 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' が開かれたファイル、パイプ、プロセス共有ではありません" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: 文字列では無い第一引数を受け取りました" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: 文字列では無い第二引数を受け取りました" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: 数値では無い引数を受け取りました" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: 配列引数を受け取りました" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "`length(array)' は gawk 拡張です" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: 文字列では無い引数を受け取りました" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: 数値では無い引数を受け取りました" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: 負の引数 %g を受け取りました" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "" "致命的: `count$’ は全ての書式使用する、または全てに使用しないのいずれかでなけ" "ればいけません" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "`%%' 指定用のフィールド幅は無視されます" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "`%%' 指定用のフィールド幅は無視されます" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "`%%' 指定用のフィールド幅および精度は無視されます" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "致命的: `$' は awk 形式内では許可されていません" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "致命的: `$' で指定する引数の番号は正でなければいけません" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "致命的: 引数の番号 %ld は引数として与えられた数より大きいです" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "致命的: `$' は書式指定内のピリオド `.' の後に使用できません" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "致命的: フィールド幅、または精度の指定子に `$' が与えられていません" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "awk の書式指定では `l' は無意味です。無視します" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "致命的: POSIX awk 書式内では `l' は許可されていません" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "awk の書式指定では `L' は無意味です。無視します。" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "致命的: POSIX awk 書式内では `L' は許可されていません" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "awk の書式指定では `h' は無意味です。無視します。" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "致命的: POSIX awk 書式内では `h' は許可されていません" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: 値 %g は書式 `%%%c' の範囲外です" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: 値 %g は書式 `%%%c' の範囲外です" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: 値 %g は書式 `%%%c' の範囲外です" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "不明な書式指定文字 `%c' を無視しています: 変換される引数はありません" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "致命的: 書式文字列を満たす十分な数の引数がありません" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ ここから足りません" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: 書式指定子に制御文字がありません" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "書式文字列に与えられている引数が多すぎます" -#: builtin.c:1634 -#, fuzzy +#: builtin.c:1625 msgid "sprintf: no arguments" -msgstr "printf: 引数がありません" +msgstr "sprintf: 引数がありません" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: 引数がありません" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: 数値では無い引数を受け取りました" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: 負の値 %g を引数に使用して呼び出されました" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: 長さ %g が 1 以上ではありません" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: 長さ %g が 0 以上ではありません" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: 文字数 %g の小数点以下は切り捨てます。" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: 文字数 %g は最大値を超えています。%g を使います。" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: 開始インデックス %g が無効です。1を使用します" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: 開始インデックス %g が非整数のため、値は切り捨てられます" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: 文字列の長さがゼロです。" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: 開始インデックス %g が文字列終端の後にあります" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -748,189 +759,208 @@ "substr: 開始インデックス %2$g からの長さ %1$g は第一引数の長さを超えています " "(%3$lu)" -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "strftime: PROCINFO[\"strftime\"] の書式の値は数値型です" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" msgstr "strftime: 非数値の第二引数を受け取りました" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "" -#: builtin.c:1934 +#: builtin.c:1932 +#, fuzzy +msgid "strftime: second argument out of range for time_t" +msgstr "asorti: 第二引数が配列ではありません" + +#: builtin.c:1941 msgid "strftime: received non-string first argument" msgstr "strftime: 非文字列の第一引数を受け取りました" -#: builtin.c:1941 +#: builtin.c:1948 msgid "strftime: received empty format string" msgstr "strftime: 空の書式文字列を受け取りました" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" msgstr "mktime: 非文字列引数を受け取りました" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: 一つ以上の値がデフォルトの範囲を超えています" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "サンドボックスモードでは 'system' 関数は許可されていません" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" msgstr "system: 文字列では無い引数を受け取りました" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "初期化されていないフィールド `$%d' への参照です" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" msgstr "tolower: 非文字列引数を受け取りました" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" msgstr "toupper: 非文字列引数を受け取りました" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: 非数値の第一引数を受け取りました" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: 非数値の第二引数を受け取りました" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" msgstr "sin: 非数値の引数を受け取りました" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" msgstr "cos: 非数値の引数を受け取りました" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: 非数値の引数を受け取りました" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "match: 第三引数が配列ではありません" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2725 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" msgstr "gensub: 第三引数が 0 です。1 を代わりに使用します" -#: builtin.c:3030 +#: builtin.c:2740 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: 第三引数が 0 です。1 を代わりに使用します" + +#: builtin.c:3038 +#, fuzzy, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "and: 2個未満の引数で呼び出されました" + +#: builtin.c:3128 +#, fuzzy, c-format +msgid "indirect call to %s requires at least two arguments" +msgstr "and: 2個未満の引数で呼び出されました" + +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" msgstr "lshift: 非数値の第一引数を受け取りました" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" msgstr "lshift: 非数値の第二引数を受け取りました" -#: builtin.c:3038 -#, fuzzy, c-format +#: builtin.c:3188 +#, c-format msgid "lshift(%f, %f): negative values will give strange results" -msgstr "lshift(%lf, %lf): 負の数値を使用すると異常な結果になります" +msgstr "lshift(%f, %f): 負の数値を使用すると異常な結果になります" -#: builtin.c:3040 -#, fuzzy, c-format +#: builtin.c:3190 +#, c-format msgid "lshift(%f, %f): fractional values will be truncated" -msgstr "lshift(%lf, %lf): 小数点以下は切り捨てられます" +msgstr "lshift(%f, %f): 小数点以下は切り捨てられます" -#: builtin.c:3042 -#, fuzzy, c-format +#: builtin.c:3192 +#, c-format msgid "lshift(%f, %f): too large shift value will give strange results" -msgstr "lshift(%lf, %lf): シフト値が大き過ぎると異常な結果になります" +msgstr "lshift(%f, %f): シフト値が大き過ぎると異常な結果になります" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" msgstr "rshift: 非数値の第一引数を受け取りました" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" msgstr "rshift: 非数値の第二引数を受け取りました" -#: builtin.c:3075 -#, fuzzy, c-format +#: builtin.c:3225 +#, c-format msgid "rshift(%f, %f): negative values will give strange results" -msgstr "rshift(%lf, %lf): 負の数値を使用すると異常な結果になります" +msgstr "rshift(%f, %f): 負の数値を使用すると異常な結果になります" -#: builtin.c:3077 -#, fuzzy, c-format +#: builtin.c:3227 +#, c-format msgid "rshift(%f, %f): fractional values will be truncated" -msgstr "rshift(%lf, %lf): 小数点以下は切り捨てられます" +msgstr "rshift(%f, %f): 小数点以下は切り捨てられます" -#: builtin.c:3079 -#, fuzzy, c-format +#: builtin.c:3229 +#, c-format msgid "rshift(%f, %f): too large shift value will give strange results" -msgstr "rshift(%lf, %lf): シフト値が大き過ぎると異常な結果になります" +msgstr "rshift(%f, %f): シフト値が大き過ぎると異常な結果になります" -#: builtin.c:3104 mpfr.c:968 -#, fuzzy +#: builtin.c:3254 mpfr.c:988 msgid "and: called with less than two arguments" -msgstr "sqrt: 負の値 %g を引数に使用して呼び出されました" +msgstr "and: 2個未満の引数で呼び出されました" -#: builtin.c:3109 -#, fuzzy, c-format +#: builtin.c:3259 +#, c-format msgid "and: argument %d is non-numeric" -msgstr "exp: 引数 %g が範囲外です" +msgstr "and: 引数 %d が非数値です" -#: builtin.c:3113 +#: builtin.c:3263 #, fuzzy, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and(%lf, %lf): 負の数値を使用すると異常な結果になります" -#: builtin.c:3136 mpfr.c:1000 -#, fuzzy +#: builtin.c:3286 mpfr.c:1020 msgid "or: called with less than two arguments" -msgstr "sqrt: 負の値 %g を引数に使用して呼び出されました" +msgstr "or: 2個未満の引数で呼び出されました" -#: builtin.c:3141 -#, fuzzy, c-format +#: builtin.c:3291 +#, c-format msgid "or: argument %d is non-numeric" -msgstr "exp: 引数 %g が範囲外です" +msgstr "or: 引数 %d が非数値です" -#: builtin.c:3145 +#: builtin.c:3295 #, fuzzy, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "compl(%lf): 負の数値を使用すると異常な結果になります" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3317 mpfr.c:1051 #, fuzzy msgid "xor: called with less than two arguments" -msgstr "sqrt: 負の値 %g を引数に使用して呼び出されました" +msgstr "xor: 2個未満の引数で呼び出されました" -#: builtin.c:3173 -#, fuzzy, c-format +#: builtin.c:3323 +#, c-format msgid "xor: argument %d is non-numeric" -msgstr "exp: 引数 %g が範囲外です" +msgstr "xor: 引数 %d が非数値です" -#: builtin.c:3177 +#: builtin.c:3327 #, fuzzy, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor(%lf, %lf): 負の数値を使用すると異常な結果になります" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: 非数値の引数を受け取りました" -#: builtin.c:3208 -#, fuzzy, c-format +#: builtin.c:3358 +#, c-format msgid "compl(%f): negative value will give strange results" -msgstr "compl(%lf): 負の数値を使用すると異常な結果になります" +msgstr "compl(%f): 負の数値を使用すると異常な結果になります" -#: builtin.c:3210 -#, fuzzy, c-format +#: builtin.c:3360 +#, c-format msgid "compl(%f): fractional value will be truncated" -msgstr "compl(%lf): 小数点以下は切り捨てられます" +msgstr "compl(%f): 小数点以下は切り捨てられます" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' は無効なロケール区分です" @@ -941,24 +971,24 @@ msgstr "" #: command.y:289 -#, fuzzy, c-format +#, c-format msgid "invalid frame number: %d" -msgstr "無効な範囲終了です" +msgstr "無効なフレーム番号です: %d" #: command.y:295 #, fuzzy, c-format msgid "info: invalid option - \"%s\"" -msgstr "%s: 無効なオプション -- '%c'\n" +msgstr "info: 無効なオプション - \"%s\"" #: command.y:321 #, c-format msgid "source \"%s\": already sourced." -msgstr "" +msgstr "source \"%s\": 既に読み込まれて(source)います。" #: command.y:326 #, c-format msgid "save \"%s\": command not permitted." -msgstr "" +msgstr "save \"%s\": コマンドは許可されていません。" #: command.y:339 msgid "Can't use command `commands' for breakpoint/watchpoint commands" @@ -966,11 +996,11 @@ #: command.y:341 msgid "no breakpoint/watchpoint has been set yet" -msgstr "" +msgstr "まだ一つもブレークポイント/ウオッチポイントは設定されていません" #: command.y:343 msgid "invalid breakpoint/watchpoint number" -msgstr "" +msgstr "無効なブレークポイント/ウオッチポイント番号です" #: command.y:348 #, c-format @@ -991,51 +1021,49 @@ msgstr "" #: command.y:373 -#, fuzzy, c-format +#, c-format msgid "trace: invalid option - \"%s\"" -msgstr "%s: 無効なオプション -- '%c'\n" +msgstr "trace: 無効なオプション - \"%s\"" #: command.y:387 msgid "condition: invalid breakpoint/watchpoint number" msgstr "" #: command.y:449 -#, fuzzy msgid "argument not a string" -msgstr "exp: 引数 %g が範囲外です" +msgstr "引数が文字列ではありません" #: command.y:459 command.y:464 #, c-format msgid "option: invalid parameter - \"%s\"" -msgstr "" +msgstr "option: 無効なパラメーター - \"%s\"" #: command.y:474 #, c-format msgid "no such function - \"%s\"" -msgstr "" +msgstr "そのような関数はありません - \"%s\"" #: command.y:531 -#, fuzzy, c-format +#, c-format msgid "enable: invalid option - \"%s\"" -msgstr "%s: 無効なオプション -- '%c'\n" +msgstr "enable: 無効なオプション - \"%s\"" #: command.y:597 -#, fuzzy, c-format +#, c-format msgid "invalid range specification: %d - %d" -msgstr "無効な範囲終了です" +msgstr "無効な範囲指定: %d - %d" #: command.y:659 -#, fuzzy msgid "non-numeric value for field number" -msgstr "フィールド指定に不明な値があります: %d\n" +msgstr "フィールド番号に対して非数値が指定されています" #: command.y:680 command.y:687 msgid "non-numeric value found, numeric expected" -msgstr "" +msgstr "非数値が見つかりました。数値が予期されます。" #: command.y:712 command.y:718 msgid "non-zero integer value" -msgstr "" +msgstr "非ゼロ整数" #: command.y:817 msgid "" @@ -1212,42 +1240,47 @@ msgid "watch var - set a watchpoint for a variable." msgstr "" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "エラー: " -#: command.y:1051 +#: command.y:1053 #, fuzzy, c-format msgid "can't read command (%s)\n" msgstr "`%s' からリダイレクトできません (%s)" -#: command.y:1065 +#: command.y:1067 #, fuzzy, c-format msgid "can't read command (%s)" msgstr "`%s' からリダイレクトできません (%s)" -#: command.y:1116 +#: command.y:1118 #, fuzzy msgid "invalid character in command" msgstr "無効な文字クラス名です" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "" -#: command.y:1284 -#, fuzzy +#: command.y:1286 msgid "invalid character" -msgstr "無効な照合文字です" +msgstr "無効な文字です" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "" @@ -1417,9 +1450,9 @@ msgstr "" #: debug.c:1029 -#, fuzzy, c-format +#, c-format msgid "no symbol `%s' in current context\n" -msgstr "`next' は `%s' から呼び出すことが出来ません" +msgstr "" #: debug.c:1041 debug.c:1427 #, fuzzy, c-format @@ -1709,7 +1742,7 @@ #: debug.c:3424 #, fuzzy, c-format msgid "element not in array\n" -msgstr "delete: 配列 `%2$s' 内にインデックス `%1$s' がありません" +msgstr "adump: 引数が配列ではありません" #: debug.c:3424 #, c-format @@ -1754,78 +1787,79 @@ msgstr "" #: debug.c:5381 -#, fuzzy, c-format +#, c-format msgid "`%s' not allowed in current context; statement ignored" -msgstr "`next' は `%s' から呼び出すことが出来ません" +msgstr "" #: debug.c:5389 -#, fuzzy msgid "`return' not allowed in current context; statement ignored" -msgstr "`next' は `%s' から呼び出すことが出来ません" +msgstr "" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 msgid "unbalanced [" msgstr "" -#: dfa.c:1174 +#: dfa.c:1118 #, fuzzy msgid "invalid character class" msgstr "無効な文字クラス名です" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "" -#: dfa.c:1366 +#: dfa.c:1326 msgid "unfinished \\ escape" msgstr "" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1473 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "\\{\\} の中身が無効です" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1476 +#, fuzzy +msgid "regular expression too big" msgstr "正規表現が大きすぎます" -#: dfa.c:1936 +#: dfa.c:1911 msgid "unbalanced (" msgstr "" -#: dfa.c:2062 +#: dfa.c:2037 msgid "no syntax specified" msgstr "" -#: dfa.c:2070 +#: dfa.c:2045 msgid "unbalanced )" msgstr "" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "不明なノード型 %d です" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "不明なオペコード %d です" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "オペコード %s は演算子または予約語ではありません" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "genflags2str 内でバッファオーバーフローが発生しました" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1836,94 +1870,94 @@ "\t# 呼出関数スタック:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' は gawk 拡張です" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' は gawk 拡張です" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "BINMODE 値 `%s' は無効です。代わりに 3 を使用します" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "誤った `%sFMT' 指定 `%s' です" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "`LINT' への代入に従い `--lint' を無効にします" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "初期化されていない引数 `%s' への参照です" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "初期化されていない変数 `%s' への参照です" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "非数値を使用したフイールド参照の試みです" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "NULL 文字列を使用してフィールドの参照を試みています" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "フィールド %ld へのアクセスの試みです" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "初期化されていないフィールド `$%ld' への参照です" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "宣言されている数より多い引数を使って関数 `%s' を呼び出しました" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: 予期しない型 `%s' です" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "`/=' 内でゼロによる除算が行われました" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "`%%=' 内でゼロによる除算が行われました" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "サンドボックスモード内では拡張は許可されていません" -#: ext.c:92 +#: ext.c:68 #, fuzzy msgid "-l / @load are gawk extensions" msgstr "@include は gawk 拡張です" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "" -#: ext.c:98 +#: ext.c:74 #, fuzzy, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "致命的: extension: `%s' を開くことが出来ません (%s)\n" -#: ext.c:104 +#: ext.c:80 #, fuzzy, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" @@ -1931,32 +1965,32 @@ "致命的: extension: ライブラリ `%s': `plugin_is_GPL_compatible' が定義されてい" "ません (%s)\n" -#: ext.c:110 +#: ext.c:86 #, fuzzy, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "" "致命的: extension: ライブラリ `%s': 関数 `%s' を呼び出すことが出来ません " "(%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "`extension' は gawk 拡張です" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "" -#: ext.c:180 +#: ext.c:156 #, fuzzy, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "致命的: extension: `%s' を開くことが出来ません (%s)\n" -#: ext.c:186 +#: ext.c:162 #, fuzzy, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" @@ -1964,94 +1998,93 @@ "致命的: extension: ライブラリ `%s': `plugin_is_GPL_compatible' が定義されてい" "ません (%s)\n" -#: ext.c:190 +#: ext.c:166 #, fuzzy, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "" "致命的: extension: ライブラリ `%s': 関数 `%s' を呼び出すことが出来ません " "(%s)\n" -#: ext.c:221 +#: ext.c:197 #, fuzzy msgid "make_builtin: missing function name" msgstr "extension: 関数名がありません" -#: ext.c:236 +#: ext.c:212 #, fuzzy, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "extension: 関数 `%s' を再定義できません" -#: ext.c:240 +#: ext.c:216 #, fuzzy, c-format msgid "make_builtin: function `%s' already defined" msgstr "extension: 関数 `%s' は既に定義されています" -#: ext.c:244 +#: ext.c:220 #, fuzzy, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "extension: 関数名 `%s' は前に定義されています" -#: ext.c:246 +#: ext.c:222 #, fuzzy, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "extension: gawk に組み込まれている `%s' は関数名として使用出来ません" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: 関数 `%s' の引数の数が負です" -#: ext.c:276 -#, fuzzy +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: 関数名がありません" -#: ext.c:279 ext.c:283 -#, fuzzy, c-format +#: ext.c:255 ext.c:259 +#, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: 関数名 `%2$s' の中で不正な文字 `%1$c' が使用されています" -#: ext.c:291 -#, fuzzy, c-format +#: ext.c:267 +#, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: 関数 `%s' を再定義できません" -#: ext.c:295 -#, fuzzy, c-format +#: ext.c:271 +#, c-format msgid "extension: function `%s' already defined" msgstr "extension: 関数 `%s' は既に定義されています" -#: ext.c:299 -#, fuzzy, c-format +#: ext.c:275 +#, c-format msgid "extension: function name `%s' previously defined" -msgstr "関数名 `%s' は前に定義されています" +msgstr "extension: 関数名 `%s' は前に定義されています" -#: ext.c:301 -#, fuzzy, c-format +#: ext.c:277 +#, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "extension: gawk に組み込まれている `%s' は関数名として使用出来ません" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "関数 `%s' に使える引数の数は `%d' 以下と定義されています" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "関数 `%s': 引数 #%d がありません" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "関数 `%s': 引数 #%d: スカラーを配列として使用する試みです" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "関数 `%s': 引数 #%d: 配列をスカラーとして使用する試みです" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "" @@ -2076,9 +2109,9 @@ msgstr "%s: 仮引数です\n" #: extension/filefuncs.c:533 -#, fuzzy, c-format +#, c-format msgid "fts init: could not create variable %s" -msgstr "index: 文字列では無い第二引数を受け取りました" +msgstr "" #: extension/filefuncs.c:554 #, fuzzy @@ -2094,9 +2127,8 @@ msgstr "" #: extension/filefuncs.c:597 -#, fuzzy msgid "fill_path_element: could not set element" -msgstr "index: 文字列では無い第二引数を受け取りました" +msgstr "" #: extension/filefuncs.c:613 msgid "fill_error_element: could not set element" @@ -2108,9 +2140,8 @@ #: extension/filefuncs.c:670 extension/filefuncs.c:717 #: extension/filefuncs.c:735 -#, fuzzy msgid "fts-process: could not set element" -msgstr "index: 文字列では無い第二引数を受け取りました" +msgstr "" #: extension/filefuncs.c:784 #, fuzzy @@ -2133,9 +2164,8 @@ msgstr "%s: 仮引数です\n" #: extension/filefuncs.c:806 -#, fuzzy msgid "fts: could not flatten array\n" -msgstr "`%s' は不正な変数名です" +msgstr "" #: extension/filefuncs.c:824 msgid "fts: ignoring sneaky FTS_NOSTAT flag. nyah, nyah, nyah." @@ -2214,7 +2244,7 @@ msgid "inplace_begin: in-place editing already active" msgstr "" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "" @@ -2234,64 +2264,64 @@ msgstr "致命的: extension: `%s' を開くことが出来ません (%s)\n" #: extension/inplace.c:158 -#, fuzzy, c-format +#, c-format msgid "inplace_begin: `%s' is not a regular file" -msgstr "`%s' は不正な変数名です" +msgstr "" #: extension/inplace.c:169 #, c-format msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, fuzzy, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "%s: 閉じるのに失敗しました (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, fuzzy, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "%s: 閉じるのに失敗しました (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, fuzzy, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "%s: 閉じるのに失敗しました (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, fuzzy, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "パイプ `%s' をフラッシュできません (%s)。" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, fuzzy, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "fd %d (`%s') を閉じることができません (%s)" @@ -2341,52 +2371,56 @@ msgid "readfile: called with no arguments" msgstr "sqrt: 負の値 %g を引数に使用して呼び出されました" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 #, fuzzy msgid "writea: called with too many arguments" msgstr "sqrt: 負の値 %g を引数に使用して呼び出されました" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, fuzzy, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "exp: 引数 %g が範囲外です" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, fuzzy, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "split: 第四引数が配列ではありません" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 #, fuzzy msgid "reada: called with too many arguments" msgstr "sqrt: 負の値 %g を引数に使用して呼び出されました" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, fuzzy, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "exp: 引数 %g が範囲外です" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, fuzzy, c-format msgid "do_reada: argument 1 is not an array\n" -msgstr "match: 第三引数が配列ではありません" +msgstr "adump: 引数が配列ではありません" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "" @@ -2419,80 +2453,80 @@ msgid "sleep: not supported on this platform" msgstr "" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF が負の値に設定されています" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: 第四引数は gawk 拡張です" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: 第四引数が配列ではありません" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: 第二引数が配列ではありません" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "split: 第二引数と第四引数に同じ配列を使用することは出来ません" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "split: 第四引数に第二引数の部分配列を使用することは出来ません" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "split: 第二引数に第四引数の部分配列を使用することは出来ません" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: 第三引数に NULL 文字列を使用することは gawk 拡張です" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: 第四引数が配列ではありません" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: 第二引数が配列ではありません" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: 第三引数は非 NULL でなければいけません" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "patsplit: 第二引数と第四引数に同じ配列を使用することは出来ません" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "patsplit: 第四引数に第二引数の部分配列を使用することは出来ません" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "patsplit: 第二引数に第四引数の部分配列を使用することは出来ません" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' は gawk 拡張です" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "`%s' 付近の FIELDWIDTHS 値が無効です" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "`FS' に NULL 文字列を使用するのは gawk 拡張です" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "古い awk は `FS' の値として正規表現をサポートしません" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "`FPAT' は gawk 拡張です" @@ -2508,21 +2542,21 @@ msgid "node_to_awk_value: received null val" msgstr "" -#: gawkapi.c:807 +#: gawkapi.c:809 #, fuzzy msgid "remove_element: received null array" msgstr "length: 配列引数を受け取りました" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "" @@ -2582,522 +2616,493 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: オプション '-W %s' には引数が必要です\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "コマンドライン引数 `%s' はディレクトリです: スキップされました" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "ファイル `%s' を読み込み用に開けません (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "fd %d (`%s') を閉じることができません (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "サンドボックスモード内ではリダイレクトは許可されていません" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "`%s' リダイレクトの命令式に数値しか記述されていません。" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "`%s' リダイレクトの命令式が空列です。" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "`%2$s' リダイレクトに論理演算の結果と思われるファイル名 `%1$s' が使われていま" "す。" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "ファイル `%.*s' で必要以上に `>' と `>>' を組合せています。" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "出力用にパイプ `%s' を開けません (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "入力用にパイプ `%s' を開けません (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "入出力用の双方向パイプ `%s' が開けません (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "`%s' からリダイレクトできません (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "`%s' にリダイレクトできません (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "開いているファイルの数がシステム制限に達しました。ファイル記述子を多重化しま" "す。" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "`%s' を閉じるのに失敗しました (%s)" -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "開いているパイプまたは入力ファイルの数が多過ぎます。" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: 第二引数は `to' または `from' でなければいけません" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: `%.*s' は開いているファイル、パイプ、プロセス共有ではありません" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "開いてないリダイレクトを閉じようとしています" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: リダイレクト `%s' は `|&' を使用して開かれていません。第二引数は無視さ" "れました" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "パイプ `%2$s' を閉じたときの状態コードが失敗 (%1$d) でした (%3$s)。" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "ファイル `%2$s' を閉じたときの状態コードが失敗 (%1$d) でした (%3$s)。" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "ソケット `%s' を明示して閉じていません。" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "並行プロセス `%s' を明示して閉じていません。" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "パイプ `%s' を明示して閉じていません。" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "ファイル `%s' を明示して閉じていません。" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "標準出力への書込みエラー (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "標準エラーへの書込みエラー (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "パイプ `%s' をフラッシュできません (%s)。" -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "`%s' へ接続するパイプを並行プロセスからフラッシュできません (%s)。" -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "ファイル `%s' をフラッシュできません (%s)。" -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "`/inet' 内のローカルポート %s が無効です" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "リモートのホストおよびポート情報 (%s, %s) が無効です" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "" -"スペシャルファイル名 `%s' に(認識できる)プロトコルが指定されていません" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "スペシャルファイル名 `%s' は不完全です" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "`/inet' にはリモートホスト名を与えなければいけません" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "`/inet' にはリモートポート番号を与えなければいけません" - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "TCP/IP 通信はサポートされていません" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "`%s' をモード `%s' で開けません" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "マスター pty を閉じるのに失敗しました (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "子プロセスが標準出力を閉じるのに失敗しました (%s)" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "子プロセスがスレーブ pty を標準出力に移動できません (dup: %s)。" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "子プロセスが標準入力を閉じられません (%s)。" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "子プロセスがスレーブ pty を標準入力に移動できません (dup: %s)。" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "スレーブ pty を閉じるのに失敗しました (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "子プロセスがパイプを標準出力に移動できません (dup: %s)。" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "子プロセスがパイプを標準入力に移動できません (dup: %s)。" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" msgstr "親プロセスが標準出力を復旧できません。\n" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" msgstr "親プロセスが標準入力を復旧できません。\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "パイプを閉じられません (%s)。" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "`|&' は使用できません。" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "パイプ `%s' が開けません (%s)。" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "`%s' 用の子プロセスを実行できません (fork: %s)。" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" msgstr "" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" msgstr "" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" msgstr "" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " "`%s'" msgstr "" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "データファイル `%s' は空です。" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "入力用メモリーをこれ以上確保できません。" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "複数の文字を `RS' に使用するのは gawk 特有の拡張です。" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "IPv6 通信はサポートされていません" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "`-e/--source' への空の引数は無視されました" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: オプション `-W %s' は認識できません。無視されました\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: 引数が必要なオプション -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "環境変数 `POSIXLY_CORRECT' が指定されています。オプション `--posix' を有効に" "します" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "オプション `--posix' は `--traditional' を無効にします。" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" "オプション `--posix'/`--traditional' は `--non-decimal-data' を無効にします。" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "" "setuid root で %s を実行すると、セキュリティ上の問題が発生する場合がありま" "す。" -#: main.c:588 +#: main.c:346 #, fuzzy msgid "`--posix' overrides `--characters-as-bytes'" msgstr "`--posix' は `--binary' を上書きします" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "標準入力をバイナリモードに設定できません (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "標準出力をバイナリモードに設定できません (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "標準エラーをバイナリモードに設定できません (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "プログラム文が全くありません!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "使用法: %s [POSIX または GNU 形式のオプション] -f progfile [--] file ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "使用法: %s [POSIX または GNU 形式のオプション] [--] %cprogram%c file ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "POSIX オプション:\t\tGNU 長い形式のオプション: (標準)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f progfile\t\t--file=progfile\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=val\t\t--assign=var=val\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "短いオプション:\t\tGNU 長い形式のオプション: (拡張)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[file]\t\t--dump-variables[=file]\n" -#: main.c:815 +#: main.c:579 #, fuzzy msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-p[file]\t\t--profile[=file]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'program-text'\t--source='program-text'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E file\t\t\t--exec=file\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:591 #, fuzzy msgid "\t-M\t\t\t--bignum\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:594 #, fuzzy msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-p[file]\t\t--profile[=file]\n" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[file]\t\t--profile[=file]\n" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3106,7 +3111,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3121,7 +3126,7 @@ "翻訳に関するバグはに報告してくださ" "い。\n" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3131,7 +3136,7 @@ "デフォルト設定では、標準入力を読み込み、標準出力に書き出します。\n" "\n" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3141,7 +3146,7 @@ "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3160,7 +3165,7 @@ "(at your option) any later version.\n" "\n" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3174,7 +3179,7 @@ "GNU General Public License for more details.\n" "\n" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3182,16 +3187,16 @@ "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "POSIX awk では -Ft は FS をタブに設定しません" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "フィールド指定に不明な値があります: %d\n" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3200,129 +3205,147 @@ "%s: オプション `-v' の引数 `%s' が `変数=代入値' の形式になっていません。\n" "\n" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' は不正な変数名です" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' は変数名ではありません。`%s=%s' のファイルを探します。" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "gawk に組み込みの `%s' は変数名として使用出来ません" -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "関数 `%s' は変数名として使用出来ません" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "浮動小数点例外" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "致命的エラー: 内部エラー" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "致命的エラー: 内部エラー: セグメンテーション違反" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "致命的エラー: 内部エラー: スタックオーバーフロー" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "fd %d が事前に開いていません。" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "事前に fd %d 用に /dev/null を開けません。" -#: mpfr.c:550 +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "`-e/--source' への空の引数は無視されました" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: オプション `-W %s' は認識できません。無視されました\n" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: 引数が必要なオプション -- %c\n" + +#: mpfr.c:557 #, fuzzy, c-format msgid "PREC value `%.*s' is invalid" msgstr "BINMODE 値 `%s' は無効です。代わりに 3 を使用します" -#: mpfr.c:608 +#: mpfr.c:615 #, fuzzy, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "BINMODE 値 `%s' は無効です。代わりに 3 を使用します" -#: mpfr.c:698 +#: mpfr.c:711 #, fuzzy, c-format msgid "%s: received non-numeric argument" msgstr "cos: 非数値の引数を受け取りました" -#: mpfr.c:800 +#: mpfr.c:820 #, fuzzy msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%lf): 負の数値を使用すると異常な結果になります" -#: mpfr.c:804 +#: mpfr.c:824 #, fuzzy msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%lf): 小数点以下は切り捨てられます" -#: mpfr.c:816 +#: mpfr.c:836 #, fuzzy, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "compl(%lf): 負の数値を使用すると異常な結果になります" -#: mpfr.c:835 +#: mpfr.c:855 #, fuzzy, c-format msgid "%s: received non-numeric argument #%d" msgstr "cos: 非数値の引数を受け取りました" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "" -#: mpfr.c:857 +#: mpfr.c:877 #, fuzzy msgid "%s: argument #%d negative value %Rg will give strange results" -msgstr "compl(%lf): 負の数値を使用すると異常な結果になります" +msgstr "and(%lf, %lf): 負の数値を使用すると異常な結果になります" -#: mpfr.c:863 +#: mpfr.c:883 #, fuzzy msgid "%s: argument #%d fractional value %Rg will be truncated" -msgstr "or(%lf, %lf): 小数点以下は切り捨てられます" +msgstr "and(%lf, %lf): 小数点以下は切り捨てられます" -#: mpfr.c:878 +#: mpfr.c:898 #, fuzzy, c-format msgid "%s: argument #%d negative value %Zd will give strange results" -msgstr "compl(%lf): 負の数値を使用すると異常な結果になります" +msgstr "and(%lf, %lf): 負の数値を使用すると異常な結果になります" #: msg.c:68 #, c-format msgid "cmd. line:" msgstr "コマンドライン:" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "文字列の終りにバックスラッシュが使われています。" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "古い awk は `\\%c' エスケープシーケンスをサポートしません" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX では `\\x' エスケープは許可されていません" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "`\\x' エスケープシーケンスに十六進数がありません" -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3331,12 +3354,12 @@ "十六進エスケープ \\x%.*s (%d 文字) はおそらく予期したようには解釈されないで" "しょう" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "エスケープシーケンス `\\%c' は `%c' と同等に扱われます" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3354,25 +3377,25 @@ msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)" msgstr "%s %s `%s': close-on-exec を設定できません: (fcntl F_SETFD: %s)" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "`%s' を書込み用に開けませんでした: %s" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" msgstr "プロファイルを標準エラーに送っています" -#: profile.c:193 -#, c-format +#: profile.c:213 +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s ブロック\n" +"\t# ルール\n" "\n" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" @@ -3381,29 +3404,29 @@ "\t# ルール\n" "\n" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "内部エラー: %s の vname が無効です。" -#: profile.c:537 +#: profile.c:558 #, fuzzy msgid "internal error: builtin with null fname" msgstr "内部エラー: %s の vname が無効です。" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" "\n" msgstr "" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawk プロファイル、作成日時 %s\n" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" @@ -3412,7 +3435,7 @@ "\n" "\t# 関数一覧(アルファベット順)\n" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: 不明なリダイレクト型 %d です" @@ -3422,118 +3445,132 @@ msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "正規表現の要素 `%.*s' はおそらく `[%.*s]' であるべきです" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "成功です" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "一致しません" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "無効な正規表現です" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "無効な照合文字です" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "無効な文字クラス名です" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "終端のバックスラッシュ" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "無効な前方参照です" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "[ または [^ が不一致です" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "( または \\( が不一致です" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "\\{ が不一致です" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "\\{\\} の中身が無効です" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "無効な範囲終了です" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "メモリを使い果たしました" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "無効な前方正規表現です" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "正規表現が途中で終了しました" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "正規表現が大きすぎます" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr ") または \\) が不一致です" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "以前に正規表現がありません" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "関数 `%s': 関数名を仮引数名として使用出来ません" + +#: symbol.c:809 msgid "can not pop main context" msgstr "" -#, fuzzy -#~ msgid "range of the form `[%c-%c]' is locale dependent" -#~ msgstr "`[%c-%c]' 形式の範囲はロケール依存です" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "`%s' ルールの内部では `getline var' は無効です" -#, fuzzy -#~ msgid "[s]printf called with no arguments" -#~ msgstr "sqrt: 負の値 %g を引数に使用して呼び出されました" +#~ msgid "`getline' invalid inside `%s' rule" +#~ msgstr "`%s' ルールの内部では `getline' は無効です" -#~ msgid "`-m[fr]' option irrelevant in gawk" -#~ msgstr "gawk ではオプション `-m[fr]' に効果はありません。" +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "" +#~ "スペシャルファイル名 `%s' に(認識できる)プロトコルが指定されていません" -#~ msgid "-m option usage: `-m[fr] nnn'" -#~ msgstr "-m オプションの使用法: `-m[fr] 数値'" +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "スペシャルファイル名 `%s' は不完全です" -#, fuzzy -#~ msgid "%s: received non-numeric first argument" -#~ msgstr "or: 非数値の第一引数を受け取りました" +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "`/inet' にはリモートホスト名を与えなければいけません" -#, fuzzy -#~ msgid "%s: received non-numeric second argument" -#~ msgstr "or: 非数値の第二引数を受け取りました" +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "`/inet' にはリモートポート番号を与えなければいけません" -#, fuzzy -#~ msgid "%s(%Rg, ..): negative values will give strange results" -#~ msgstr "or(%lf, %lf): 負の数値を使用すると異常な結果になります" +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s ブロック\n" +#~ "\n" -#, fuzzy -#~ msgid "%s(%Rg, ..): fractional values will be truncated" -#~ msgstr "or(%lf, %lf): 小数点以下は切り捨てられます" +#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" +#~ msgstr "初期化されていない要素 `%s[\"%.*s\"]' への参照です" -#, fuzzy -#~ msgid "%s(%Zd, ..): negative values will give strange results" -#~ msgstr "or(%lf, %lf): 負の数値を使用すると異常な結果になります" +#~ msgid "subscript of array `%s' is null string" +#~ msgstr "配列 `%s' の添字が NULL 文字列です" -#, fuzzy -#~ msgid "%s(.., %Rg): negative values will give strange results" -#~ msgstr "or(%lf, %lf): 負の数値を使用すると異常な結果になります" +#~ msgid "%s: empty (null)\n" +#~ msgstr "%s: 空 (null)\n" -#, fuzzy -#~ msgid "%s(.., %Zd): negative values will give strange results" -#~ msgstr "or(%lf, %lf): 負の数値を使用すると異常な結果になります" +#~ msgid "%s: empty (zero)\n" +#~ msgstr "%s: 空 (zero)\n" -#~ msgid "`%s' is a Bell Labs extension" -#~ msgstr "`%s' はベル研究所による拡張です" +#~ msgid "%s: table_size = %d, array_size = %d\n" +#~ msgstr "" +#~ "%s: テーブルサイズ (table_size) = %d, 配列サイズ (array_size) = %d\n" + +#~ msgid "%s: array_ref to %s\n" +#~ msgstr "%s: %s への配列参照 (array_ref) です\n" #~ msgid "`nextfile' is a gawk extension" #~ msgstr "`nextfile' は gawk 拡張です" @@ -3541,14 +3578,29 @@ #~ msgid "`delete array' is a gawk extension" #~ msgstr "`delete array' は gawk 拡張です" +#~ msgid "use of non-array as array" +#~ msgstr "配列でないものを配列として使用しています" + +#~ msgid "`%s' is a Bell Labs extension" +#~ msgstr "`%s' はベル研究所による拡張です" + #~ msgid "and: received non-numeric first argument" #~ msgstr "and: 非数値の第一引数を受け取りました" #~ msgid "and: received non-numeric second argument" #~ msgstr "and: 非数値の第二引数を受け取りました" -#~ msgid "and(%lf, %lf): fractional values will be truncated" -#~ msgstr "and(%lf, %lf): 小数点以下は切り捨てられます" +#~ msgid "or: received non-numeric first argument" +#~ msgstr "or: 非数値の第一引数を受け取りました" + +#~ msgid "or: received non-numeric second argument" +#~ msgstr "or: 非数値の第二引数を受け取りました" + +#~ msgid "or(%lf, %lf): negative values will give strange results" +#~ msgstr "or(%lf, %lf): 負の数値を使用すると異常な結果になります" + +#~ msgid "or(%lf, %lf): fractional values will be truncated" +#~ msgstr "or(%lf, %lf): 小数点以下は切り捨てられます" #~ msgid "xor: received non-numeric first argument" #~ msgstr "xor: 非数値の第一引数を受け取りました" @@ -3559,37 +3611,12 @@ #~ msgid "xor(%lf, %lf): fractional values will be truncated" #~ msgstr "xor(%lf, %lf): 小数点以下は切り捨てられます" -#~ msgid "Operation Not Supported" -#~ msgstr "この操作はサポートされていません" - -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "関数 `%s' を配列として使用する試みです" - -#~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" -#~ msgstr "初期化されていない要素 `%s[\"%.*s\"]' への参照です" - -#~ msgid "subscript of array `%s' is null string" -#~ msgstr "配列 `%s' の添字が NULL 文字列です" - -#~ msgid "%s: empty (null)\n" -#~ msgstr "%s: 空 (null)\n" - -#~ msgid "%s: empty (zero)\n" -#~ msgstr "%s: 空 (zero)\n" - -#~ msgid "%s: table_size = %d, array_size = %d\n" -#~ msgstr "" -#~ "%s: テーブルサイズ (table_size) = %d, 配列サイズ (array_size) = %d\n" - -#~ msgid "%s: array_ref to %s\n" -#~ msgstr "%s: %s への配列参照 (array_ref) です\n" - -#~ msgid "use of non-array as array" -#~ msgstr "配列でないものを配列として使用しています" - #~ msgid "can't use function name `%s' as variable or array" #~ msgstr "関数名 `%s' は変数または配列として使用出来ません" +#~ msgid "assignment is not allowed to result of builtin function" +#~ msgstr "組込関数の戻り値への代入は許可されていません" + #~ msgid "assignment used in conditional context" #~ msgstr "条件コンテキスト内で代入が使用されました" @@ -3608,9 +3635,6 @@ #~ msgid "function `%s' not defined" #~ msgstr "関数 `%s' は定義されていません" -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "`%s' ルールの内側ではリダイレクトされていない `getline' は無効です" - #~ msgid "`nextfile' cannot be called from a `%s' rule" #~ msgstr "`nextfile' は `%s' ルールから呼び出すことが出来ません" @@ -3620,11 +3644,20 @@ #~ msgid "Sorry, don't know how to interpret `%s'" #~ msgstr "申し訳ありませんが `%s' をどのように解釈するか分かりません" +#~ msgid "Operation Not Supported" +#~ msgstr "この操作はサポートされていません" + +#~ msgid "`-m[fr]' option irrelevant in gawk" +#~ msgstr "gawk ではオプション `-m[fr]' に効果はありません。" + +#~ msgid "-m option usage: `-m[fr] nnn'" +#~ msgstr "-m オプションの使用法: `-m[fr] 数値'" + #~ msgid "\t-R file\t\t\t--command=file\n" #~ msgstr "\t-R file\t\t\t--command=file\n" #~ msgid "could not find groups: %s" #~ msgstr "グループが見つかりません: %s" -#~ msgid "assignment is not allowed to result of builtin function" -#~ msgstr "組込関数の戻り値への代入は許可されていません" +#~ msgid "range of the form `[%c-%c]' is locale dependant" +#~ msgstr "`[%c-%c]' 形式の範囲はロケール依存です" diff -urN gawk-4.1.1/po/ms.po gawk-4.1.2/po/ms.po --- gawk-4.1.1/po/ms.po 2014-04-08 19:23:37.000000000 +0300 +++ gawk-4.1.2/po/ms.po 2015-04-29 08:36:41.000000000 +0300 @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.0.75\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" "PO-Revision-Date: 2013-04-19 10:45+0800\n" "Last-Translator: Sharuzzaman Ahmat Raslan \n" "Language-Team: Malay \n" @@ -38,9 +38,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "cubaan untuk menggunakan skalar `%s' sebagai tatasusunan" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "cubaan untuk menggunakan tatasusunan `%s' dalam konteks skalar" @@ -91,422 +91,427 @@ msgid "asorti: cannot use a subarray of second arg for first arg" msgstr "" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "" -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" msgstr "" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" msgstr "" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" msgstr "" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" msgstr "" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "" -#: awkgram.y:1417 +#: awkgram.y:1410 #, c-format -msgid "`getline var' invalid inside `%s' rule" +msgid "non-redirected `getline' invalid inside `%s' rule" msgstr "" -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "" - -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" msgstr "" -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" +#: awkgram.y:1634 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "" -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "" -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2392 awkgram.y:2517 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "" -#: awkgram.y:2409 +#: awkgram.y:2417 #, c-format msgid "already loaded shared library `%s'" msgstr "" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "" -#: awkgram.y:2494 +#: awkgram.y:2502 msgid "@load is a gawk extension" msgstr "" -#: awkgram.y:2500 +#: awkgram.y:2508 msgid "empty filename after @load" msgstr "" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2958 msgid "source file does not end in newline" msgstr "" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" msgstr "" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" -#: awkgram.y:4016 +#: awkgram.y:4050 msgid "index: regexp constant as second argument is not allowed" msgstr "" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "" -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" "or used as a variable or an array" msgstr "" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "" -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" -#: awkgram.y:5052 +#: awkgram.y:5012 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "" @@ -544,371 +549,401 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:1463 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "" + +#: builtin.c:1068 +#, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" msgstr "" -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" msgstr "" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "" -#: builtin.c:1934 -msgid "strftime: received non-string first argument" +#: builtin.c:1932 +msgid "strftime: second argument out of range for time_t" msgstr "" #: builtin.c:1941 +msgid "strftime: received non-string first argument" +msgstr "" + +#: builtin.c:1948 msgid "strftime: received empty format string" msgstr "" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" msgstr "" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" msgstr "" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" msgstr "" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" msgstr "" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" msgstr "" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" msgstr "" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2725 +#, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "" + +#: builtin.c:2740 +#, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "" + +#: builtin.c:3038 +#, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "" + +#: builtin.c:3128 +#, c-format +msgid "indirect call to %s requires at least two arguments" msgstr "" -#: builtin.c:3030 +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" msgstr "" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" msgstr "" -#: builtin.c:3038 +#: builtin.c:3188 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "" -#: builtin.c:3040 +#: builtin.c:3190 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "" -#: builtin.c:3042 +#: builtin.c:3192 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" msgstr "" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" msgstr "" -#: builtin.c:3075 +#: builtin.c:3225 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "" -#: builtin.c:3077 +#: builtin.c:3227 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "" -#: builtin.c:3079 +#: builtin.c:3229 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3254 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "" -#: builtin.c:3109 +#: builtin.c:3259 #, c-format msgid "and: argument %d is non-numeric" msgstr "" -#: builtin.c:3113 +#: builtin.c:3263 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3286 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "" -#: builtin.c:3141 +#: builtin.c:3291 #, c-format msgid "or: argument %d is non-numeric" msgstr "" -#: builtin.c:3145 +#: builtin.c:3295 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3317 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "" -#: builtin.c:3173 +#: builtin.c:3323 #, c-format msgid "xor: argument %d is non-numeric" msgstr "" -#: builtin.c:3177 +#: builtin.c:3327 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "" -#: builtin.c:3208 +#: builtin.c:3358 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "" -#: builtin.c:3210 +#: builtin.c:3360 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "" @@ -1188,40 +1223,46 @@ msgid "watch var - set a watchpoint for a variable." msgstr "" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "" -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "" @@ -1733,68 +1774,68 @@ msgid "`return' not allowed in current context; statement ignored" msgstr "" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 msgid "unbalanced [" msgstr "" -#: dfa.c:1174 +#: dfa.c:1118 msgid "invalid character class" msgstr "" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "" -#: dfa.c:1366 +#: dfa.c:1326 msgid "unfinished \\ escape" msgstr "" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1473 +msgid "invalid content of \\{\\}" msgstr "" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1476 +msgid "regular expression too big" msgstr "" -#: dfa.c:1936 +#: dfa.c:1911 msgid "unbalanced (" msgstr "" -#: dfa.c:2062 +#: dfa.c:2037 msgid "no syntax specified" msgstr "" -#: dfa.c:2070 +#: dfa.c:2045 msgid "unbalanced )" msgstr "" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1802,211 +1843,211 @@ "\n" msgstr "" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "" @@ -2150,7 +2191,7 @@ msgid "inplace_begin: in-place editing already active" msgstr "" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "" @@ -2179,55 +2220,55 @@ msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "" @@ -2269,50 +2310,54 @@ msgid "readfile: called with no arguments" msgstr "" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "" @@ -2341,80 +2386,80 @@ msgid "sleep: not supported on this platform" msgstr "" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "" @@ -2430,20 +2475,20 @@ msgid "node_to_awk_value: received null val" msgstr "" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "" @@ -2503,504 +2548,475 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "" -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "" -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "" -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "" -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "" - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" msgstr "" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" msgstr "" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" msgstr "" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" msgstr "" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" msgstr "" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " "`%s'" msgstr "" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "" - -#: main.c:824 +#: main.c:591 msgid "\t-M\t\t\t--bignum\n" msgstr "" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "" -#: main.c:826 +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "" + +#: main.c:594 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" msgstr "" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "" @@ -3009,7 +3025,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3017,21 +3033,21 @@ "\n" msgstr "" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" "\n" msgstr "" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" msgstr "" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3043,7 +3059,7 @@ "\n" msgstr "" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3052,120 +3068,138 @@ "\n" msgstr "" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" msgstr "" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" "\n" msgstr "" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "" -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "" -#: mpfr.c:550 +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "" @@ -3175,36 +3209,36 @@ msgid "cmd. line:" msgstr "" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "" -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " "expect" msgstr "" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3220,58 +3254,58 @@ msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)" msgstr "" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" msgstr "" -#: profile.c:193 +#: profile.c:213 #, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" "\n" msgstr "" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "" -#: profile.c:537 +#: profile.c:558 msgid "internal error: builtin with null fname" msgstr "" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" "\n" msgstr "" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" "\t# Functions, listed alphabetically\n" msgstr "" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "" @@ -3281,70 +3315,83 @@ msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +msgid "Unmatched [, [^, [:, [., or [=" msgstr "" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "" -#: symbol.c:741 +#: symbol.c:677 +#, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "" + +#: symbol.c:809 msgid "can not pop main context" msgstr "" diff -urN gawk-4.1.1/po/nl.po gawk-4.1.2/po/nl.po --- gawk-4.1.1/po/nl.po 2014-04-08 19:23:37.000000000 +0300 +++ gawk-4.1.2/po/nl.po 2015-04-29 08:36:41.000000000 +0300 @@ -1,17 +1,17 @@ # Dutch translations for GNU gawk. -# Copyright (C) 2014 Free Software Foundation, Inc. +# Copyright (C) 2015 Free Software Foundation, Inc. # This file is distributed under the same license as the gawk package. # # “Flierefluiten!!” # # Erwin Poeze , 2009. -# Benno Schulenberg , 2005, 2007, 2010, 2011, 2012, 2013, 2014. +# Benno Schulenberg , 2005, 2007, 2010, 2011, 2012, 2013, 2014, 2015. msgid "" msgstr "" -"Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" -"PO-Revision-Date: 2014-02-04 11:18+0100\n" +"Project-Id-Version: gawk 4.1.1d\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" +"PO-Revision-Date: 2015-04-17 11:01+0200\n" "Last-Translator: Benno Schulenberg \n" "Language-Team: Dutch \n" "Language: nl\n" @@ -40,9 +40,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "scalair '%s' wordt gebruikt als array" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "array '%s' wordt gebruikt in een scalaire context" @@ -101,406 +101,411 @@ "asorti: een subarray van het tweede argument kan niet als eerste argument " "gebruikt worden" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "'%s' is ongeldig als functienaam" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "sorteervergelijkingsfunctie '%s' is niet gedefinieerd" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "%s-blokken horen een actiedeel te hebben" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "elke regel hoort een patroon of een actiedeel te hebben" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "oude 'awk' staat meerdere 'BEGIN'- en 'END'-regels niet toe" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "'%s' is een ingebouwde functie en is niet te herdefiniëren" -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "regexp-constante '//' lijkt op C-commentaar, maar is het niet" -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "regexp-constante '/%s/' lijkt op C-commentaar, maar is het niet" -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "dubbele 'case'-waarde in 'switch'-opdracht: %s" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "dubbele 'default' in 'switch'-opdracht" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "'break' buiten een lus of 'switch'-opdracht is niet toegestaan" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "'continue' buiten een lus is niet toegestaan" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "'next' wordt gebruikt in %s-actie" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "'nextfile' wordt gebruikt in %s-actie" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "'return' wordt gebruikt buiten functiecontext" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "kale 'print' in BEGIN- of END-regel moet vermoedelijk 'print \"\"' zijn" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" msgstr "'delete' is niet toegestaan met SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" msgstr "'delete' is niet toegestaan met FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" msgstr "'delete(array)' is een niet-overdraagbare 'tawk'-uitbreiding" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "meerfase-tweerichtings-pijplijnen werken niet" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "reguliere expressie rechts van toewijzing" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "reguliere expressie links van operator '~' of '!~'" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" msgstr "oude 'awk' kent het sleutelwoord 'in' niet, behalve na 'for'" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "reguliere expressie rechts van vergelijking" -#: awkgram.y:1417 +#: awkgram.y:1410 #, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "'getline var' is ongeldig binnen een '%s'-regel" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "niet-omgeleide 'getline' is ongeldig binnen een '%s'-regel" -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "'getline' is ongeldig binnen een '%s'-regel" - -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" msgstr "niet-omgeleide 'getline' is ongedefinieerd binnen een END-actie" -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "oude 'awk' kent geen meerdimensionale arrays" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "aanroep van 'length' zonder haakjes is niet overdraagbaar" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "indirecte functieaanroepen zijn een gawk-uitbreiding" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "kan speciale variabele '%s' niet voor indirecte functieaanroep gebruiken" +#: awkgram.y:1634 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "niet-functie '%s' wordt gebruikt in functie-aanroep" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "ongeldige index-expressie" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "waarschuwing: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fataal: " -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "onverwacht regeleinde of einde van string" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "kan bronbestand '%s' niet openen om te lezen (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2392 awkgram.y:2517 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "kan gedeelde bibliotheek '%s' niet openen om te lezen (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "reden onbekend" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "kan '%s' niet invoegen en als programmabestand gebruiken" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "bronbestand '%s' is reeds ingesloten" -#: awkgram.y:2409 +#: awkgram.y:2417 #, c-format msgid "already loaded shared library `%s'" msgstr "gedeelde bibliotheek '%s' is reeds geladen" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "'@include' is een gawk-uitbreiding" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "lege bestandsnaam na '@include'" -#: awkgram.y:2494 +#: awkgram.y:2502 msgid "@load is a gawk extension" msgstr "'@load' is een gawk-uitbreiding" -#: awkgram.y:2500 +#: awkgram.y:2508 msgid "empty filename after @load" msgstr "lege bestandsnaam na '@load'" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "lege programmatekst op opdrachtregel" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "kan bronbestand '%s' niet lezen (%s)" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "bronbestand '%s' is leeg" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "PEBKAC-fout: ongeldig teken '\\%03o' in brontekst" + +#: awkgram.y:2958 msgid "source file does not end in newline" msgstr "bronbestand eindigt niet met een regeleindeteken (LF)" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "onafgesloten reguliere expressie eindigt met '\\' aan bestandseinde" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "%s: %d: regexp-optie '/.../%c' van 'tawk' werkt niet in gawk" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "regexp-optie '/.../%c' van 'tawk' werkt niet in gawk" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "onafgesloten reguliere expressie" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "onafgesloten reguliere expressie aan bestandseinde" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" msgstr "gebruik van regelvoortzetting '\\ #...' is niet overdraagbaar" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "backslash is niet het laatste teken op de regel" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "POSIX staat operator '**=' niet toe" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "oude 'awk' kent de operator '**=' niet" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "POSIX staat operator '**' niet toe" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "oude 'awk' kent de operator '**' niet" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "oude 'awk' kent de operator '^=' niet" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "oude 'awk' kent de operator '^' niet" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "onafgesloten string" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "ongeldig teken '%c' in expressie" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "'%s' is een gawk-uitbreiding" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX staat '%s' niet toe" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "oude 'awk' kent '%s' niet" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "'goto' wordt als schadelijk beschouwd!\n" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d is een ongeldig aantal argumenten voor %s" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: een stringwaarde als laatste vervangingsargument heeft geen effect" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s: derde parameter is geen veranderbaar object" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "match: derde argument is een gawk-uitbreiding" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "close: tweede argument is een gawk-uitbreiding" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "dcgettext(_\"...\") is onjuist: verwijder het liggende streepje" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "dcngettext(_\"...\") is onjuist: verwijder het liggende streepje" -#: awkgram.y:4016 +#: awkgram.y:4050 msgid "index: regexp constant as second argument is not allowed" msgstr "" "index: een reguliere-expressie-constante als tweede argument is niet " "toegestaan" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "functie '%s': parameter '%s' schaduwt een globale variabele" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "kan '%s' niet openen om te schrijven (%s)" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "variabelenlijst gaat naar standaardfoutuitvoer" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "%s: sluiten is mislukt (%s)" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() twee keer aangeroepen!" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "er waren geschaduwde variabelen." -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "functienaam '%s' is al eerder gedefinieerd" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "functie '%s': kan functienaam niet als parameternaam gebruiken" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "functie '%s': kan speciale variabele '%s' niet als functieparameter gebruiken" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "functie '%s': parameter #%d, '%s', dupliceert parameter #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "functie '%s' wordt aangeroepen maar is nergens gedefinieerd" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "functie '%s' is gedefinieerd maar wordt nergens direct aangeroepen" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "regexp-constante als parameter #%d levert booleanwaarde op" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -509,23 +514,23 @@ "functie '%s' wordt aangeroepen met een spatie tussen naam en '(',\n" "of wordt gebruikt als variabele of array" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "deling door nul" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "deling door nul in '%%'" -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" "kan geen waarde toewijzen aan het resultaat van een post-increment-expressie " "van een veld" -#: awkgram.y:5052 +#: awkgram.y:5012 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "ongeldig doel van toewijzing (opcode %s)" @@ -567,188 +572,198 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: '%s' is geen open bestand, pijp, of co-proces" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: eerste argument is geen string" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: tweede argument is geen string" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: argument is geen getal" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: argument is een array" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "'length(array)' is een gawk-uitbreiding" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: argument is geen string" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: argument is geen getal" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: argument %g is negatief" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "fataal: 'count$' hoort in alle opmaken gebruikt te worden, of in geen" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "veldbreedte wordt genegeerd voor opmaakaanduiding '%%'" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "veldprecisie wordt genegeerd voor opmaakaanduiding '%%'" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "veldbreedte en -precisie worden genegeerd voor opmaakaanduiding '%%'" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "fataal: '$' is niet toegestaan in awk-opmaak" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fataal: het aantal argumenten met '$' moet > 0 zijn" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "fataal: argumentental %ld is groter dan het gegeven aantal argumenten" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "fataal: '$' is niet toegestaan na een punt in de opmaak" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "fataal: geen '$' opgegeven bij positionele veldbreedte of -precisie" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "'l' is betekenisloos in awk-opmaak; genegeerd" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "fataal: 'l' is niet toegestaan in POSIX awk-opmaak" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "'L' is betekenisloos in awk-opmaak; genegeerd" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "fataal: 'L' is niet toegestaan in POSIX awk-opmaak" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "'h' is betekenisloos in awk-opmaak; genegeerd" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "fataal: 'h' is niet toegestaan in POSIX awk-opmaak" -#: builtin.c:1463 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: waarde %g is te groot voor opmaak %%c" + +#: builtin.c:1068 +#, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: waarde %g is geen geldig breed teken" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: waarde %g ligt buiten toegestaan bereik voor opmaak '%%%c'" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "onbekend opmaakteken '%c' wordt genegeerd: geen argument is geconverteerd" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "fataal: niet genoeg argumenten voor opmaakstring" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "niet genoeg ^ voor deze" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: opmaakaanduiding mist een stuurletter" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "te veel argumenten voor opmaakstring" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: geen argumenten" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: geen argumenten" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: argument is geen getal" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: argument %g is negatief" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: lengte %g is niet >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: lengte %g is niet >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: lengte %g is geen integer; wordt afgekapt" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: lengte %g is te groot voor stringindexering; wordt verkort tot %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: startindex %g is ongeldig; 1 wordt gebruikt" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: startindex %g is geen integer; wordt afgekapt" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: bronstring heeft lengte nul" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: startindex %g ligt voorbij het einde van de string" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -756,186 +771,207 @@ "substr: lengte %g bij startindex %g is groter dan de lengte van het eerste " "argument (%lu)" -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "strftime: opmaakwaarde in PROCINFO[\"strftime\"] is numeriek" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" msgstr "strftime: tweede argument is geen getal" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "strftime: tweede argument is kleiner dan nul of te groot voor 'time_t'" -#: builtin.c:1934 +#: builtin.c:1932 +msgid "strftime: second argument out of range for time_t" +msgstr "strftime: tweede argument ligt buiten toegestaan bereik voor 'time_t'" + +#: builtin.c:1941 msgid "strftime: received non-string first argument" msgstr "strftime: eerste argument is geen string" -#: builtin.c:1941 +#: builtin.c:1948 msgid "strftime: received empty format string" msgstr "strftime: opmaakstring is leeg" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" msgstr "mktime: argument is geen string" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: minstens één van waarden valt buiten het standaardbereik" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "'system'-functie is niet toegestaan in sandbox-modus" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" msgstr "system: argument is geen string" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "verwijzing naar ongeïnitialiseerd veld '$%d'" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" msgstr "tolower: argument is geen string" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" msgstr "toupper: argument is geen string" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: eerste argument is geen getal" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: tweede argument is geen getal" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" msgstr "sin: argument is geen getal" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" msgstr "cos: argument is geen getal" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: argument is geen getal" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "match: derde argument is geen array" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" -msgstr "gensub: derde argument is 0; wordt beschouwd als 1" +#: builtin.c:2725 +#, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "gensub: derde argument is '%.*s'; wordt beschouwd als 1" + +#: builtin.c:2740 +#, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: derde argument is %g; wordt beschouwd als 1" + +# FIXME: ambiguous +#: builtin.c:3038 +#, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "%s: kan alleen indirect aangeroepen worden met twee argumenten" -#: builtin.c:3030 +#: builtin.c:3128 +#, c-format +msgid "indirect call to %s requires at least two arguments" +msgstr "indirecte aanroep van %s vereist minstens twee argumenten" + +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" msgstr "lshift: eerste argument is geen getal" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" msgstr "lshift: tweede argument is geen getal" -#: builtin.c:3038 +#: builtin.c:3188 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): negatieve waarden geven rare resultaten" -#: builtin.c:3040 +#: builtin.c:3190 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): cijfers na de komma worden afgekapt" -#: builtin.c:3042 +#: builtin.c:3192 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f): te grote opschuifwaarden geven rare resultaten" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" msgstr "rshift: eerste argument is geen getal" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" msgstr "rshift: tweede argument is geen getal" -#: builtin.c:3075 +#: builtin.c:3225 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): negatieve waarden geven rare resultaten" -#: builtin.c:3077 +#: builtin.c:3227 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): cijfers na de komma worden afgekapt" -#: builtin.c:3079 +#: builtin.c:3229 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "rshift(%f, %f): te grote opschuifwaarden geven rare resultaten" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3254 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: aangeroepen met minder dan twee argumenten" -#: builtin.c:3109 +#: builtin.c:3259 #, c-format msgid "and: argument %d is non-numeric" msgstr "and: argument %d is niet-numeriek" -#: builtin.c:3113 +#: builtin.c:3263 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and: negatieve waarde %2$g van argument %1$d geeft rare resultaten" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3286 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: aangeroepen met minder dan twee argumenten" -#: builtin.c:3141 +#: builtin.c:3291 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: argument %d is niet-numeriek" -#: builtin.c:3145 +#: builtin.c:3295 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "or: negatieve waarde %2$g van argument %1$d geeft rare resultaten" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3317 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: aangeroepen met minder dan twee argumenten" -#: builtin.c:3173 +#: builtin.c:3323 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: argument %d is niet-numeriek" -#: builtin.c:3177 +#: builtin.c:3327 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: negatieve waarde %2$g van argument %1$d geeft rare resultaten" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: argument is geen getal" -#: builtin.c:3208 +#: builtin.c:3358 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): negatieve waarden geven rare resultaten" -#: builtin.c:3210 +#: builtin.c:3360 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): cijfers na de komma worden afgekapt" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: '%s' is geen geldige taalregio-deelcategorie" @@ -1249,40 +1285,48 @@ msgid "watch var - set a watchpoint for a variable." msgstr "watch VAR - een kijkpunt voor een variabele zetten" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"where[N] - (zelfde als backtrace) een trace weergeven van alle of N " +"binnenste frames (of buitenste als N < 0)" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "fout: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "kan commando niet lezen (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "kan commando niet lezen (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "ongeldig teken in commando" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "onbekend commando - \"%.*s\", probeer help" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "ongeldig teken" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "ongedefinieerd commando: %s\n" @@ -1811,68 +1855,68 @@ msgid "`return' not allowed in current context; statement ignored" msgstr "'return' is niet toegestaan in huidige context; statement is genegeerd" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Geen symbool '%s' in huidige context" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 msgid "unbalanced [" msgstr "ongepaarde [" -#: dfa.c:1174 +#: dfa.c:1118 msgid "invalid character class" msgstr "ongeldige tekenklasse" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "syntax van tekenklasse is [[:space:]], niet [:space:]" -#: dfa.c:1366 +#: dfa.c:1326 msgid "unfinished \\ escape" msgstr "onafgemaakte \\-stuurcode" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" -msgstr "Ongeldige inhoud van \\{\\}" - -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" -msgstr "Reguliere expressie is te groot" +#: dfa.c:1473 +msgid "invalid content of \\{\\}" +msgstr "ongeldige inhoud van \\{\\}" + +#: dfa.c:1476 +msgid "regular expression too big" +msgstr "reguliere expressie is te groot" -#: dfa.c:1936 +#: dfa.c:1911 msgid "unbalanced (" msgstr "ongepaarde (" -#: dfa.c:2062 +#: dfa.c:2037 msgid "no syntax specified" msgstr "geen syntax opgegeven" -#: dfa.c:2070 +#: dfa.c:2045 msgid "unbalanced )" msgstr "ongepaarde )" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "onbekend knooptype %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "onbekende opcode %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "opcode %s is geen operator noch sleutelwoord" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "bufferoverloop in genflags2str()" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1883,215 +1927,215 @@ "\t# Functieaanroepen-stack:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "'IGNORECASE' is een gawk-uitbreiding" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "'BINMODE' is een gawk-uitbreiding" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "BINMODE-waarde '%s' is ongeldig, wordt behandeld als 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "onjuiste opgave van '%sFMT': '%s'" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "'--lint' wordt uitgeschakeld wegens toewijzing aan 'LINT'" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "verwijzing naar ongeïnitialiseerd argument '%s'" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "verwijzing naar ongeïnitialiseerde variabele '%s'" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "veldverwijzingspoging via een waarde die geen getal is" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "veldverwijzingspoging via een lege string" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "toegangspoging tot veld %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "verwijzing naar ongeïnitialiseerd veld '$%ld'" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "functie '%s' aangeroepen met meer argumenten dan gedeclareerd" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack(): onverwacht type '%s'" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "deling door nul in '/='" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "deling door nul in '%%='" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "uitbreidingen zijn niet toegestaan in sandbox-modus" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / '@load' zijn gawk-uitbreidingen" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext: lege bibliotheeknaam ontvangen" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: kan bibliotheek '%s' niet openen (%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: bibliotheek '%s' definieert 'plugin_is_GPL_compatible' niet (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: bibliotheek '%s' kan functie '%s' niet aanroepen (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "load_ext: bibliotheek '%s': initialisatiefunctie '%s' is mislukt\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "'extension' is een gawk-uitbreiding" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "uitbreiding: lege bibliotheeknaam ontvangen" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension: kan bibliotheek '%s' niet openen (%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "extension: bibliotheek '%s' definieert 'plugin_is_GPL_compatible' niet (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "extension: bibliotheek '%s' kan functie '%s' niet aanroepen (%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: ontbrekende functienaam" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: kan functie '%s' niet herdefiniëren" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: functie '%s' is al gedefinieerd" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: functienaam '%s' is al eerder gedefinieerd" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "make_builtin: kan in gawk ingebouwde '%s' niet als functienaam gebruiken" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: negatief aantal argumenten voor functie '%s'" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: ontbrekende functienaam" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: ongeldig teken '%c' in functienaam '%s'" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: kan functie '%s' niet herdefiniëren" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: functie '%s' is al gedefinieerd" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: functienaam '%s' is al eerder gedefinieerd" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "extension: kan in gawk ingebouwde '%s' niet als functienaam gebruiken" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "" "functie '%s' is gedefinieerd om niet meer dan %d argument(en) te accepteren" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "functie '%s': ontbrekend argument #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "functie '%s': argument #%d: een scalair wordt gebruikt als array" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "functie '%s': argument #%d: een array wordt gebruikt als scalair" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "het dynamisch laden van de bibliotheek wordt niet ondersteund" @@ -2237,7 +2281,7 @@ msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin(): in-situ-bewerken is al actief" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin(): verwachtte twee argumenten maar is aangeroepen met %d" @@ -2269,56 +2313,56 @@ msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin(): mkstemp('%s') is mislukt (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin(): chmod is mislukt (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin(): dup(stdout) is mislukt (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin(): dup2(%d, stdout) is mislukt (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin(): close(%d) is mislukt (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "" "inplace_end(): kan eerste argument niet als bestandsnaamstring oppakken" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end(): in-situ-bewerken is niet actief" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end(): dup2(%d, stdout) is mislukt (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end(): close(%d) is mislukt (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end(): fsetpos(stdout) is mislukt (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end(): link('%s', '%s') is mislukt (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end(): rename('%s', '%s') is mislukt (%s)" @@ -2360,50 +2404,54 @@ msgid "readfile: called with no arguments" msgstr "readfile: aangeroepen zonder argumenten" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "revoutput: kan variabele REVOUT niet initialiseren" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: aangeroepen met te veel argumenten" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: argument 0 is geen string\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: argument 1 is geen array\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: kan array niet pletten\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: kan geplet array niet vrijgeven\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: aangeroepen met te veel argumenten" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: argument 0 is geen string\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: argument 1 is geen array\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array() is mislukt\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element() is mislukt\n" @@ -2432,92 +2480,92 @@ msgid "sleep: not supported on this platform" msgstr "sleep: wordt op dit platform niet ondersteund" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF is op een negatieve waarde gezet" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: vierde argument is een gawk-uitbreiding" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: vierde argument is geen array" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: tweede argument is geen array" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: hetzelfde array kan niet zowel als tweede als als vierde argument " "gebruikt worden" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: een subarray van het tweede argument kan niet als vierde argument " "gebruikt worden" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: een subarray van het vierde argument kan niet als tweede argument " "gebruikt worden" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: lege string als derde argument is een gawk-uitbreiding" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: vierde argument is geen array" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: tweede argument is geen array" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: derde argument moet niet-nil zijn" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: hetzelfde array kan niet zowel als tweede als als vierde argument " "gebruikt worden" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: een subarray van het tweede argument kan niet als vierde argument " "gebruikt worden" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: een subarray van het vierde argument kan niet als tweede argument " "gebruikt worden" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "'FIELDWIDTHS' is een gawk-uitbreiding" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "ongeldige waarde voor FIELDWIDTHS, nabij '%s'" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "een lege string als 'FS' is een gawk-uitbreiding" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "oude 'awk' staat geen reguliere expressies toe als waarde van 'FS'" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "'FPAT' is een gawk-uitbreiding" @@ -2533,20 +2581,20 @@ msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value(): lege waarde ontvangen" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element(): leeg array ontvangen" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element(): lege index ontvangen" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array(): kan index %d niet converteren\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array(): kan waarde %d niet converteren\n" @@ -2606,307 +2654,289 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: optie '-W %s' vereist een argument\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "opdrachtregelargument '%s' is een map -- overgeslagen" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "kan bestand '%s' niet openen om te lezen (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "sluiten van bestandsdescriptor %d ('%s') is mislukt (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "omleiding is niet toegestaan in sandbox-modus" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "expressie in omleiding '%s' heeft alleen een getal als waarde" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "expressie voor omleiding '%s' heeft een lege string als waarde" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "bestandsnaam '%s' voor omleiding '%s' kan het resultaat zijn van een " "logische expressie" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "onnodige mix van '>' en '>>' voor bestand '%.*s'" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "kan pijp '%s' niet openen voor uitvoer (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "kan pijp '%s' niet openen voor invoer (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "kan tweerichtings-pijp '%s' niet openen voor in- en uitvoer (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "kan niet omleiden van '%s' (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "kan niet omleiden naar '%s' (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "systeemgrens voor aantal open bestanden is bereikt: begonnen met multiplexen" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "sluiten van '%s' is mislukt (%s)" -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "te veel pijpen of invoerbestanden geopend" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: tweede argument moet 'to' of 'from' zijn" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: '%.*s' is geen open bestand, pijp, of co-proces" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "sluiten van een nooit-geopende omleiding" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: omleiding '%s' is niet geopend met '|&'; tweede argument wordt " "genegeerd" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "afsluitwaarde %d bij mislukte sluiting van pijp '%s' (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "afsluitwaarde %d bij mislukte sluiting van bestand '%s' (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "geen expliciete sluiting van socket '%s' aangegeven" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "geen expliciete sluiting van co-proces '%s' aangegeven" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "geen expliciete sluiting van pijp '%s' aangegeven" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "geen expliciete sluiting van bestand '%s' aangegeven" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "fout tijdens schrijven van standaarduitvoer (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "fout tijdens schrijven van standaardfoutuitvoer (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "leegmaken van pijp '%s' is mislukt (%s)" -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "leegmaken door co-proces van pijp naar '%s' is mislukt (%s)" -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "leegmaken van bestand '%s' is mislukt (%s)" -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "lokale poort %s is ongeldig in '/inet'" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "host- en poortinformatie (%s, %s) zijn ongeldig" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "geen (bekend) protocol aangegeven in speciale bestandsnaam '%s'" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "speciale bestandsnaam '%s' is onvolledig" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "'/inet' heeft een gindse hostnaam nodig" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "'/inet' heeft een gindse poort nodig" - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "TCP/IP-communicatie wordt niet ondersteund" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "kan '%s' niet openen -- modus '%s'" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "kan meester-pty van dochterproces niet sluiten (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "kan standaarduitvoer van dochterproces niet sluiten (%s)" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "kan slaaf-pty niet overzetten naar standaarduitvoer van dochterproces (dup: " "%s)" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "kan standaardinvoer van dochterproces niet sluiten (%s)" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "kan slaaf-pty niet overzetten naar standaardinvoer van dochterproces (dup: " "%s)" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "kan slaaf-pty niet sluiten (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "kan pijp niet overzetten naar standaarduitvoer van dochterproces (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "kan pijp niet overzetten naar standaardinvoer van dochterproces (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" msgstr "kan standaarduitvoer van ouderproces niet herstellen\n" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" msgstr "kan standaardinvoer van ouderproces niet herstellen\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "kan pijp niet sluiten (%s)" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "'|&' wordt niet ondersteund" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "kan pijp '%s' niet openen (%s)" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "kan voor '%s' geen dochterproces starten (fork: %s)" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser(): NULL-pointer gekregen" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "invoer-parser '%s' botst met eerder geïnstalleerde invoer-parser '%s'" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "invoer-parser '%s' kan '%s' niet openen" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper(): NULL-pointer gekregen" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" "uitvoer-wrapper '%s' botst met eerder geïnstalleerde uitvoer-wrapper '%s'" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "uitvoer-wrapper '%s' kan '%s' niet openen" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor(): NULL-pointer gekregen" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2914,213 +2944,203 @@ msgstr "" "tweeweg-processor '%s' botst met eerder geïnstalleerde tweeweg-processor '%s'" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "tweeweg-processor '%s' kan '%s' niet openen" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "databestand '%s' is leeg" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "kan geen extra invoergeheugen meer toewijzen" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "een 'RS' van meerdere tekens is een gawk-uitbreiding" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "IPv6-communicatie wordt niet ondersteund" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "argument van '-e/--source' is leeg; genegeerd" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: optie '-W %s' is onbekend; genegeerd\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: optie vereist een argument -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "omgevingsvariabele 'POSIXLY_CORRECT' is gezet: '--posix' ingeschakeld" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "'--posix' overstijgt '--traditional'" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "'--posix'/'--traditional' overstijgen '--non-decimal-data'" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "het uitvoeren van %s als 'setuid root' kan een veiligheidsrisico zijn" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "'--posix' overstijgt '--characters-as-bytes'" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "kan standaardinvoer niet in binaire modus zetten (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "kan standaarduitvoer niet in binaire modus zetten (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "kan standaardfoutuitvoer niet in binaire modus zetten (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "helemaal geen programmatekst!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Gebruik: %s [opties] -f programmabestand [--] bestand...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" " of: %s [opties] [--] %cprogrammatekst%c bestand...\n" "\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "\tPOSIX-opties:\t\tEquivalente GNU-opties: (standaard)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f programmabestand\t--file=programmabestand\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F veldscheidingsteken\t--field-separator=veldscheidingsteken\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "" "\t-v var=waarde\t\t--assign=var=waarde\n" "\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "\tKorte opties:\t\tEquivalente GNU-opties: (uitbreidingen)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[bestand]\t\t--dump-variables[=bestand]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[bestand]\t\t--debug[=bestand]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'programmatekst'\t--source='programmatekst'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E bestand\t\t--exec=bestand\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i include-bestand\t\t--include=include-bestand\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l bibliotheek\t\t--load=bibliotheek\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" -msgstr "\t-L [fataal]\t\t--lint[=fataal]\n" - -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" +# FIXME: are arguments literal or translatable? +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" +msgstr "\t-L[fatal|invalid]\t\t--lint[=fatal|invalid]\n" -#: main.c:824 +#: main.c:591 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:594 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[bestand]\t\t--pretty-print[=bestand]\n" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[bestand]\t\t--profile[=bestand]\n" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t\t--nostalgia\n" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t\t--parsedebug\n" @@ -3129,7 +3149,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3142,7 +3162,7 @@ "Meld fouten in de vertaling aan .\n" "\n" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3152,7 +3172,7 @@ "Standaard leest het van standaardinvoer en schrijft naar standaarduitvoer.\n" "\n" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3162,7 +3182,7 @@ "\tgawk '{ som += $1 }; END { print som }' bestand\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3180,7 +3200,7 @@ "uitgegeven door de Free Software Foundation, naar keuze ofwel onder\n" "versie 3 of onder een nieuwere versie van die licentie.\n" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3194,7 +3214,7 @@ "Zie de GNU General Public License voor meer details.\n" "\n" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3203,16 +3223,16 @@ "ontvangen te hebben; is dit niet het geval, dan kunt u deze licentie\n" "ook vinden op http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft maakt van FS geen tab in POSIX-awk" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "onbekende waarde voor veldspecificatie: %d\n" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3221,99 +3241,118 @@ "%s: argument '%s' van '-v' is niet van de vorm 'var=waarde'\n" "\n" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "'%s' is geen geldige variabelenaam" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "'%s' is geen variabelenaam; zoekend naar bestand '%s=%s'" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "kan in gawk ingebouwde '%s' niet als variabelenaam gebruiken" -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "kan functie '%s' niet als variabelenaam gebruiken" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "drijvendekomma-berekeningsfout" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "fatale fout: **interne fout**" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "fatale fout: **interne fout**: segmentatiefout" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "fatale fout: **interne fout**: stack is vol" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "geen reeds-geopende bestandsdescriptor %d" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "kan /dev/null niet openen voor bestandsdescriptor %d" -#: mpfr.c:550 +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "argument van '-e/--source' is leeg; genegeerd" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" +"optie '-M' is genegeerd; ondersteuning voor MPFR/GMP is niet meegecompileerd" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: optie '-W %s' is onbekend; genegeerd\n" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: optie vereist een argument -- %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "PREC-waarde '%.*s' is ongeldig" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "RNDMODE-waarde '%.*s' is ongeldig" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s: niet-numeriek argument ontvangen" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): negatieve waarden geven rare resultaten" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg): cijfers na de komma worden afgekapt" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "compl(%Zd): negatieve waarden geven rare resultaten" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s: niet-numeriek argument #%d ontvangen" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: argument #%d heeft ongeldige waarde %Rg; 0 wordt gebruikt" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: negatieve waarde %2$Rg van argument #%1$d geeft rare resultaten" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "" "%s: cijfers na de komma van waarde %2$Rg van argument #%1$d worden afgekapt" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%1$s: negatieve waarde %3$Zd van argument #%2$d geeft rare resultaten" @@ -3323,24 +3362,24 @@ msgid "cmd. line:" msgstr "commandoregel:" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "backslash aan het einde van de string" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "oude 'awk' kent de stuurcodereeks '\\%c' niet" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX staat stuurcode '\\x' niet toe" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "geen hex cijfers in stuurcodereeks '\\x'" -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3349,12 +3388,12 @@ "hexadecimale stuurcode \\x%.*s van %d tekens wordt waarschijnlijk niet " "afgehandeld zoals u verwacht" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "stuurcodereeks '\\%c' behandeld als normale '%c'" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3374,25 +3413,25 @@ msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)" msgstr "%s %s '%s': kan 'close-on-exec' niet activeren: (fcntl F_SETFD: %s)" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "kan '%s' niet openen om te schrijven: %s" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" msgstr "profiel gaat naar standaardfoutuitvoer" -#: profile.c:193 +#: profile.c:213 #, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s-blok(ken)\n" +"\t# %s regel(s)\n" "\n" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" @@ -3401,16 +3440,16 @@ "\t# Regel(s)\n" "\n" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "**interne fout**: %s met lege 'vname'" -#: profile.c:537 +#: profile.c:558 msgid "internal error: builtin with null fname" msgstr "**interne fout**: ingebouwde functie met lege 'fname'" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3419,12 +3458,12 @@ "\t# Geladen uitbreidingen ('-l' en/of '@load')\n" "\n" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawk-profiel, gemaakt op %s\n" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" @@ -3433,7 +3472,7 @@ "\n" "\t# Functies, alfabetisch geordend\n" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str(): onbekend omleidingstype %d" @@ -3444,82 +3483,117 @@ msgstr "" "component '%.*s' van reguliere expressie moet vermoedelijk '[%.*s]' zijn" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Gelukt" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Geen overeenkomsten" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Ongeldige reguliere expressie" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Ongeldig samengesteld teken" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Ongeldige tekenklassenaam" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Backslash aan het eind" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Ongeldige terugverwijzing" -#: regcomp.c:152 -msgid "Unmatched [ or [^" -msgstr "Ongepaarde [ of [^" +#: regcomp.c:160 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Ongepaarde [, [^, [:, [., of [=" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "Ongepaarde ( of \\(" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "Ongepaarde \\{" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Ongeldige inhoud van \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Ongeldig bereikeinde" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Onvoldoende geheugen beschikbaar" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Ongeldige voorafgaande reguliere expressie" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Voortijdig einde van reguliere expressie" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Reguliere expressie is te groot" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "Ongepaarde ) of \\)" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Geen eerdere reguliere expressie" -#: symbol.c:741 +#: symbol.c:677 +#, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "functie '%s': kan functie '%s' niet als parameternaam gebruiken" + +#: symbol.c:809 msgid "can not pop main context" msgstr "kan hoofdcontext niet poppen" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "'getline var' is ongeldig binnen een '%s'-regel" + +#~ msgid "`getline' invalid inside `%s' rule" +#~ msgstr "'getline' is ongeldig binnen een '%s'-regel" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "geen (bekend) protocol aangegeven in speciale bestandsnaam '%s'" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "speciale bestandsnaam '%s' is onvolledig" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "'/inet' heeft een gindse hostnaam nodig" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "'/inet' heeft een gindse poort nodig" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s-blok(ken)\n" +#~ "\n" + #~ msgid "range of the form `[%c-%c]' is locale dependent" #~ msgstr "" #~ "de betekenis van een bereik van de vorm '[%c-%c]' is afhankelijk van de " #~ "taalregio" -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "functie '%s' wordt gebruikt als array" - #~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" #~ msgstr "verwijzing naar ongeïnitialiseerd element '%s[\"%.*s\"]'" @@ -3598,9 +3672,6 @@ #~ msgid "function `%s' not defined" #~ msgstr "functie '%s' is niet gedefinieerd" -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "niet-omgeleide 'getline' is ongeldig binnen een '%s'-regel" - #~ msgid "`nextfile' cannot be called from a `%s' rule" #~ msgstr "'nextfile' kan niet aangeroepen worden in een '%s'-regel" diff -urN gawk-4.1.1/po/pl.po gawk-4.1.2/po/pl.po --- gawk-4.1.1/po/pl.po 2014-04-08 19:23:37.000000000 +0300 +++ gawk-4.1.2/po/pl.po 2015-04-29 08:36:41.000000000 +0300 @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" "PO-Revision-Date: 2014-03-22 17:49+0100\n" "Last-Translator: Wojciech Polak \n" "Language-Team: Polish \n" @@ -39,9 +39,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "próba użycia skalaru `%s' jako tablicy" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "próba użycia tablicy `%s' w kontekście skalaru" @@ -96,417 +96,423 @@ msgstr "" "asorti: nie można użyć podtablicy drugiego argumentu dla pierwszego argumentu" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "nieprawidłowa nazwa funkcji `%s'" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "funkcja porównująca w sortowaniu `%s' nie została zdefiniowna" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "%s bloków musi posiadać część dotyczącą akcji" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "każda reguła musi posiadać wzorzec lub część dotyczącą akcji" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "stary awk nie wspiera wielokrotnych reguł `BEGIN' lub `END'" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "" "`%s' jest funkcją wbudowaną, więc nie może zostać ponownie zdefiniowana" -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" "stałe wyrażenie regularne `//' wygląda jak komentarz C++, ale nim nie jest" -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" "stałe wyrażenie regularne `/%s/' wygląda jak komentarz C, ale nim nie jest" -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "powielone wartości case w ciele switch: %s" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "wykryto powielony `default' w ciele switch" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "instrukcja `break' poza pętlą lub switch'em jest niedozwolona" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "instrukcja `continue' poza pętlą jest niedozwolona" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "`next' użyty w akcji %s" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "`nextfile' użyty w akcji %s" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "`return' użyty poza kontekstem funkcji" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "zwykły `print' w regułach BEGIN lub END powinien prawdopodobnie być jako " "`print \"\"'" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" msgstr "`delete' nie jest dozwolony z SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" msgstr "`delete' nie jest dozwolony z FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(tablica)' jest nieprzenośnym rozszerzeniem tawk" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "wieloetapowe dwukierunkowe linie potokowe nie działają" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "wyrażanie regularne po prawej stronie przypisania" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "wyrażenie regularne po lewej stronie operatora `~' lub `!~'" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" msgstr "" "stary awk nie wspiera słowa kluczowego `in', z wyjątkiem po słowie `for'" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "wyrażenie regularne po prawej stronie porównania" -#: awkgram.y:1417 +#: awkgram.y:1410 #, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "nieprawidłowy `getline var' wewnątrz reguły `%s'" - -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "nieprawidłowy `getline' wewnątrz reguły `%s'" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "" +"komenda `getline' bez przekierowania jest nieprawidłowa wewnątrz reguły `%s'" -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" msgstr "" "komenda `getline' bez przekierowania nie jest zdefiniowana wewnątrz akcji END" -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "stary awk nie wspiera wielowymiarowych tablic" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "wywołanie `length' bez nawiasów jest nieprzenośne" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "pośrednie wywołania funkcji są rozszerzeniem gawk" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "nie można użyć specjalnej zmiennej `%s' do pośredniego wywołania funkcji" +#: awkgram.y:1634 +#, fuzzy, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "próba użycia funkcji `%s' jako tablicy" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "nieprawidłowe wyrażenie indeksowe" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "ostrzeżenie: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "fatalny błąd: " -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "niespodziewany znak nowego wiersza lub końca łańcucha" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "nie można otworzyć pliku źródłowego `%s' do czytania (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2392 awkgram.y:2517 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "nie można otworzyć współdzielonej biblioteki `%s' do czytania (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "nieznany powód" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "nie można dołączyć `%s' i używać go jako pliku programu" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "plik źródłowy `%s' jest już załączony" -#: awkgram.y:2409 +#: awkgram.y:2417 #, c-format msgid "already loaded shared library `%s'" msgstr "biblioteka współdzielona jest już załadowana `%s'" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "@include jest rozszerzeniem gawk" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "pusta nazwa pliku po @include" -#: awkgram.y:2494 +#: awkgram.y:2502 msgid "@load is a gawk extension" msgstr "@load jest rozszerzeniem gawk" -#: awkgram.y:2500 +#: awkgram.y:2508 msgid "empty filename after @load" msgstr "pusta nazwa pliku po @load" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "pusty tekst programu w linii poleceń" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "nie można otworzyć pliku źródłowego `%s' (%s)" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "plik źródłowy `%s' jest pusty" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "" + +#: awkgram.y:2958 msgid "source file does not end in newline" msgstr "plik źródłowy nie posiada na końcu znaku nowego wiersza" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" "niezakończone prawidłowo wyrażenie regularne kończy się znakiem `\\' na " "końcu pliku" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "%s: %d: modyfikator wyrażenia regularnego `/.../%c' tawk nie działa w gawk" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "modyfikator wyrażenia regularnego `/.../%c' tawk nie działa w gawk" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "niezakończone wyrażenie regularne" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "niezakończone wyrażenie regularne na końcu pliku" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" msgstr "użycie `\\ #...' kontynuacji linii nie jest przenośne" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "backslash nie jest ostatnim znakiem w wierszu" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "POSIX nie zezwala na operator `**='" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "stary awk nie wspiera operatora `**='" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "POSIX nie zezwala na operator `**'" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "stary awk nie wspiera operatora `**'" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "operator `^=' nie jest wspierany w starym awk" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "operator `^' nie jest wspierany w starym awk" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "niezakończony łańcuch" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "nieprawidłowy znak '%c' w wyrażeniu" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' jest rozszerzeniem gawk" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX nie zezwala na `%s'" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "`%s' nie jest wspierany w starym awk" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "`goto' uważane za szkodliwe!\n" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d jest nieprawidłowe jako liczba argumentów dla %s" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: literał łańcuchowy jako ostatni argument podstawienia nie ma żadnego " "efektu" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s trzeci parametr nie jest zmiennym obiektem" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "match: trzeci argument jest rozszerzeniem gawk" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "close: drugi argument jest rozszerzeniem gawk" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "nieprawidłowe użycie dcgettext(_\"...\"): usuń znak podkreślenia" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "nieprawidłowe użycie dcngettext(_\"...\"): usuń znak podkreślenia" -#: awkgram.y:4016 +#: awkgram.y:4050 msgid "index: regexp constant as second argument is not allowed" msgstr "index: stały regexp jako drugi argument nie jest dozwolony" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funkcja `%s': parametr `%s' zasłania globalną zmienną" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "nie można otworzyć `%s' do zapisu (%s)" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "wysyłanie listy zmiennych na standardowe wyjście diagnostyczne" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "%s: zamknięcie nie powiodło się (%s)" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() wywołana podwójnie!" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "wystąpiły przykryte zmienne." -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "nazwa funkcji `%s' została zdefiniowana poprzednio" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "funkcja `%s': nie można użyć nazwy funkcji jako nazwy parametru" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "funkcja `%s': nie można użyć specjalnej zmiennej `%s' jako parametru funkcji" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funkcja `%s': parametr #%d, `%s', powiela parametr #%d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "funkcja `%s' została wywołana, ale nigdy nie została zdefiniowana" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "" "funkcja `%s' została zdefiniowana, ale nigdy nie została wywołana " "bezpośrednio" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "stałe wyrażenie regularne dla parametru #%d daje wartość logiczną" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -516,21 +522,21 @@ "`(',\n" "lub użyta jako zmienna lub jako tablica" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "próba dzielenia przez zero" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "próba dzielenia przez zero w `%%'" -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "nie można przypisać wartości do wyniku tego wyrażenia" -#: awkgram.y:5052 +#: awkgram.y:5012 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "nieprawidłowy cel przypisania (opcode %s)" @@ -570,193 +576,203 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' nie jest ani otwartym plikiem, ani potokiem, ani procesem" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: otrzymano pierwszy argument, który nie jest łańcuchem" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: otrzymano drugi argument, który nie jest łańcuchem" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: otrzymano argument, który nie jest liczbą" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: otrzymano argument, który jest tablicą" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "`length(tablica)' jest rozszerzeniem gawk" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: otrzymano argument, który nie jest łańcuchem" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: otrzymano argument, który nie jest liczbą" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: otrzymano ujemny argument %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "fatal: należy użyć `count$' we wszystkich formatach lub nic" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "szerokość pola jest ignorowana dla specyfikatora `%%'" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "precyzja jest ignorowana dla specyfikatora `%%'" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "szerokość pola i precyzja są ignorowane dla specyfikatora `%%'" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "fatal: `$' jest niedozwolony w formatach awk" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "fatal: argument count z `$' musi być > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" "fatal: argument count %ld większy niż całkowita suma argumentów dostarczonych" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "fatal: `$' jest niedozwolony po kropce w formacie" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "fatal: brak `$' dla pozycyjnej szerokości pola lub precyzji" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "`l' jest bezsensowny w formatach awk; zignorowany" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "fatal: `l' jest niedozwolony w formatach POSIX awk" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "`L' jest bezsensowny w formatach awk; zignorowany" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "fatal: `L' jest niedozwolony w formatach POSIX awk" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "`h' jest bezsensowny w formatach awk; zignorowany" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "fatal: `h' jest niedozwolony w formatach POSIX awk" -#: builtin.c:1463 +#: builtin.c:1055 +#, fuzzy, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: wartość %g jest poza zasięgiem dla formatu `%%%c'" + +#: builtin.c:1068 +#, fuzzy, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: wartość %g jest poza zasięgiem dla formatu `%%%c'" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: wartość %g jest poza zasięgiem dla formatu `%%%c'" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "pominięcie nieznanego formatu specyfikatora znaku `%c': nie skonwertowano " "argumentu" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "" "fatal: brak wystarczającej liczby argumentów, aby zaspokoić łańcuch " "formatujący" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "zabrakło ^" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: specyfikator formatu nie posiada kontrolnej litery" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "zbyt dużo podanych argumentów w łańcuchu formatującym" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: brak argumentów" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: brak argumentów" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: otrzymano argument, który nie jest liczbą" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: wywołana z ujemnym argumentem %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: długość %g nie jest >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: długość %g nie jest >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: długość %g, która nie jest liczbą całkowitą, zostanie obcięta" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: długość %g zbyt duża dla indeksu łańcucha, obcinanie do %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: początkowy indeks %g jest nieprawidłowy, nastąpi użycie 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "" "substr: początkowy indeks %g, który nie jest liczbą całkowitą, zostanie " "obcięty" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: łańcuch źródłowy ma zerową długość" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: początkowy indeks %g leży poza końcem łańcucha" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -764,187 +780,208 @@ "substr: długość %g zaczynając od %g przekracza długość pierwszego argumentu " "(%lu)" -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" "strftime: wartość formatu w PROCINFO[\"strftime\"] posiada typ numeryczny" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" msgstr "strftime: otrzymano drugi argument, który nie jest liczbą" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "strftime: drugi argument mniejszy od 0 lub zbyt duży dla time_t" -#: builtin.c:1934 +#: builtin.c:1932 +#, fuzzy +msgid "strftime: second argument out of range for time_t" +msgstr "strftime: drugi argument mniejszy od 0 lub zbyt duży dla time_t" + +#: builtin.c:1941 msgid "strftime: received non-string first argument" msgstr "strftime: otrzymano pierwszy argument, który nie jest łańcuchem" -#: builtin.c:1941 +#: builtin.c:1948 msgid "strftime: received empty format string" msgstr "strftime: otrzymano pusty łańcuch formatujący" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" msgstr "mktime: otrzymano argument, który nie jest łańcuchem" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: przynajmniej jedna z wartości jest poza domyślnym zakresem" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "funkcja 'system' nie jest dozwolona w trybie piaskownicy" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" msgstr "system: otrzymano argument, który nie jest łańcuchem" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "odwołanie do niezainicjowanego pola `$%d'" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" msgstr "tolower: otrzymano argument, który nie jest łańcuchem" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" msgstr "toupper: otrzymano argument, który nie jest łańcuchem" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: otrzymano pierwszy argument, który nie jest liczbą" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: otrzymano drugi argument, który nie jest liczbą" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" msgstr "sin: otrzymano argument, który nie jest liczbą" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" msgstr "cos: otrzymano argument, który nie jest liczbą" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: otrzymano argument, który nie jest liczbą" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "match: otrzymano trzeci argument, który nie jest tablicą" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" +#: builtin.c:2725 +#, fuzzy, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "gensub: trzeci argument 0 potraktowany jako 1" + +#: builtin.c:2740 +#, fuzzy, c-format +msgid "gensub: third argument %g treated as 1" msgstr "gensub: trzeci argument 0 potraktowany jako 1" -#: builtin.c:3030 +#: builtin.c:3038 +#, fuzzy, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "and: wywołano z mniej niż dwoma argumentami" + +#: builtin.c:3128 +#, fuzzy, c-format +msgid "indirect call to %s requires at least two arguments" +msgstr "and: wywołano z mniej niż dwoma argumentami" + +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" msgstr "lshift: otrzymano pierwszy argument, który nie jest liczbą" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" msgstr "lshift: otrzymano drugi argument, który nie jest liczbą" -#: builtin.c:3038 +#: builtin.c:3188 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): ujemne wartości spowodują dziwne wyniki" -#: builtin.c:3040 +#: builtin.c:3190 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): ułamkowe wartości zostaną obcięte" -#: builtin.c:3042 +#: builtin.c:3192 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f): zbyt duża wartość przesunięcia spowoduje dziwne wyniki" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" msgstr "rshift: otrzymano pierwszy argument, który nie jest liczbą" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" msgstr "rshift: otrzymano drugi argument, który nie jest liczbą" -#: builtin.c:3075 +#: builtin.c:3225 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): ujemne wartości spowodują dziwne wyniki" -#: builtin.c:3077 +#: builtin.c:3227 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): ułamkowe wartości zostaną obcięte" -#: builtin.c:3079 +#: builtin.c:3229 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "rshift(%f, %f): zbyt duża wartość przesunięcia spowoduje dziwne wyniki" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3254 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: wywołano z mniej niż dwoma argumentami" -#: builtin.c:3109 +#: builtin.c:3259 #, c-format msgid "and: argument %d is non-numeric" msgstr "and: argument %d nie jest liczbą" -#: builtin.c:3113 +#: builtin.c:3263 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and: argument %d ujemna wartość %g spowoduje dziwne wyniki" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3286 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: wywołano z mniej niż dwoma argumentami" -#: builtin.c:3141 +#: builtin.c:3291 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: argument %d nie jest liczbą" -#: builtin.c:3145 +#: builtin.c:3295 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "or: argument %d ujemna wartość %g spowoduje dziwne wyniki" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3317 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: wywołano z mniej niż dwoma argumentami" -#: builtin.c:3173 +#: builtin.c:3323 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: argument %d nie jest liczbą" -#: builtin.c:3177 +#: builtin.c:3327 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: argument %d ujemna wartość %g spowoduje dziwne wyniki" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: otrzymano argument, który nie jest liczbą" -#: builtin.c:3208 +#: builtin.c:3358 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): ujemne wartości spowodują dziwne wyniki" -#: builtin.c:3210 +#: builtin.c:3360 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): ułamkowe wartości zostaną obcięte" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' nie jest prawidłową kategorią lokalizacji" @@ -1224,40 +1261,46 @@ msgid "watch var - set a watchpoint for a variable." msgstr "" -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "błąd: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "nie można odczytać komendy (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "nie można odczytać komendy (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "nieprawidłowy znak w komendzie" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "nieznana komenda - \"%.*s\", spróbuj pomoc" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "nieprawidłowy znak" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "niezdefiniowana komenda: %s\n" @@ -1778,68 +1821,70 @@ msgstr "" "instrukcja `return' nie może być wywołana w tym kontekście; zignorowano" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Brak symbolu `%s' w bieżącym kontekście" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 msgid "unbalanced [" msgstr "[ nie do pary" -#: dfa.c:1174 +#: dfa.c:1118 msgid "invalid character class" msgstr "nieprawidłowa klasa znaku" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "składnia klasy znaku to [[:space:]], a nie [:space:]" -#: dfa.c:1366 +#: dfa.c:1326 msgid "unfinished \\ escape" msgstr "niedokończona sekwencja ucieczki \\" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" +#: dfa.c:1473 +#, fuzzy +msgid "invalid content of \\{\\}" msgstr "Nieprawidłowa zawartość \\{\\}" -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" +#: dfa.c:1476 +#, fuzzy +msgid "regular expression too big" msgstr "Wyrażenie regularne jest zbyt duże" -#: dfa.c:1936 +#: dfa.c:1911 msgid "unbalanced (" msgstr "( nie do pary" -#: dfa.c:2062 +#: dfa.c:2037 msgid "no syntax specified" msgstr "nie podano składni" -#: dfa.c:2070 +#: dfa.c:2045 msgid "unbalanced )" msgstr ") nie do pary" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "nieznany typ węzła %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "nieznany opcode %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "opcode %s nie jest operatorem ani słowem kluczowym" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "przepełnienie bufora w genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1850,216 +1895,216 @@ "\t# Stos Wywoławczy Funkcji:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' jest rozszerzeniem gawk" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' jest rozszerzeniem gawk" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "wartość BINMODE `%s' jest nieprawidłowa, przyjęto ją jako 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "zła specyfikacja `%sFMT' `%s'" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "wyłączenie `--lint' z powodu przypisania do `LINT'" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "odwołanie do niezainicjowanego argumentu `%s'" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "odwołanie do niezainicjowanej zmiennej `%s'" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "próba odwołania do pola poprzez nienumeryczną wartość" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "próba odwołania z zerowego łańcucha" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "próba dostępu do pola %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "odwołanie do niezainicjowanego pola `$%ld'" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "" "funkcja `%s' została wywołana z większą ilością argumentów niż zostało to " "zadeklarowane" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: niespodziewany typ `%s'" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "próba dzielenia przez zero w `/='" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "próba dzielenia przez zero w `%%='" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "rozszerzenia nie są dozwolone w trybie piaskownicy" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load są rozszerzeniami gawk" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext: otrzymano NULL lib_name" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: nie można otworzyć biblioteki `%s' (%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: biblioteka `%s': nie definiuje `plugin_is_GPL_compatible' (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: biblioteka `%s': nie można wywołać funkcji `%s' (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" "load_ext: funkcja inicjalizująca `%s' biblioteki `%s' nie powiodła się\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "`extension' jest rozszerzeniem gawk" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "extension: otrzymano NULL lib_name" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension: nie można otworzyć biblioteki `%s' (%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "extension: biblioteka `%s': nie definiuje `plugin_is_GPL_compatible' (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "extension: biblioteka `%s': nie można wywołać funkcji `%s' (%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: brakująca nazwa funkcji" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: nie można zredefiniować funkcji `%s'" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: funkcja `%s' została już zdefiniowana" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: nazwa funkcji `%s' została zdefiniowana wcześniej" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "make_builtin: nie można użyć wbudowanej w gawk `%s' jako nazwy funkcji" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: ujemny licznik argumentów dla funkcji `%s'" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: brakująca nazwa funkcji" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: nieprawidłowy znak `%c' w nazwie funkcji `%s'" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: nie można zredefiniować funkcji `%s'" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: funkcja `%s' została już zdefiniowana" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: nazwa funkcji `%s' została zdefiniowana wcześniej" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "extension: nie można użyć wbudowanej w gawk `%s' jako nazwy funkcji" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "funkcja `%s' zdefiniowana aby pobrać nie więcej niż %d argument(ów)" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "funkcja `%s': brakuje #%d argumentu" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "funkcja `%s': argument #%d: próba użycia skalaru jako tablicy" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "funkcja `%s': argument #%d: próba użycia tablicy jako skalaru" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "dynamiczne ładowanie biblioteki nie jest wspierane" @@ -2203,7 +2248,7 @@ msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin: edycja w miejscu jest już aktywna" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin: spodziewano się 2 argumentów, a otrzymano %d" @@ -2234,55 +2279,55 @@ msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin: wywołanie mkstemp(`%s') nie powiodło się (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin: funkcja chmod nie powiodła się (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin: wywołanie dup(stdout) nie powiodło się (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin: wywołanie dup2(%d, stdout) nie powiodło się (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin: wywołanie close(%d) nie powiodło się (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "inplace_end: nie można pobrać pierwszego argumentu jako nazwy pliku" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end: edycja w miejscu nie jest aktywna" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end: wywołanie dup2(%d, stdout) nie powiodło się (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end: wywołanie close(%d) nie powiodło się (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end: wywołanie fsetpos(stdout) nie powiodło się (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end: wywołanie link(`%s', `%s') nie powiodło się (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end: wywołanie rename(`%s', `%s') nie powiodło się (%s)" @@ -2324,50 +2369,54 @@ msgid "readfile: called with no arguments" msgstr "readfile: wywołano bez argumentów" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: wywołana ze zbyt dużą ilością argumentów" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: argument 0 nie jest tekstem\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: argument 1 nie jest tablicą\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: nie można spłaszczyć tablicy\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: nie można było zwolnić spłaszczonej tablicy\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: wywołana ze zbyt dużą ilością argumentów" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: argument 0 nie jest tekstem\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: argument 1 nie jest tablicą\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array nie powiodła się\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element nie powiodła się\n" @@ -2396,88 +2445,88 @@ msgid "sleep: not supported on this platform" msgstr "sleep: funkcja nie jest wspierana na tej platformie" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF ustawiony na wartość ujemną" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: czwarty argument jest rozszerzeniem gawk" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: czwarty argument nie jest tablicą" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: drugi argument nie jest tablicą" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: nie można użyć tej samej tablicy dla drugiego i czwartego argumentu" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: nie można użyć podtablicy drugiego argumentu dla czwartego argumentu" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: nie można użyć podtablicy czwartego argumentu dla drugiego argumentu" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: zerowy łańcuch dla trzeciego argumentu jest rozszerzeniem gawk" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: czwarty argument nie jest tablicą" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: drugi argument nie jest tablicą" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: trzeci argument nie może być pusty" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: nie można użyć tej samej tablicy dla drugiego i czwartego argumentu" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: nie można użyć podtablicy drugiego argumentu dla czwartego " "argumentu" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: nie można użyć podtablicy czwartego argumentu dla drugiego " "argumentu" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' jest rozszerzeniem gawk" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "nieprawidłowa wartość FIELDWIDTHS, w pobliżu `%s'" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "zerowy łańcuch dla `FS' jest rozszerzeniem gawk" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "stary awk nie wspiera wyrażeń regularnych jako wartości `FS'" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "`FPAT' jest rozszerzeniem gawk" @@ -2493,20 +2542,20 @@ msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: otrzymano null val" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element: otrzymano tablicę null" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element: otrzymano null subscript" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: nie można było skonwertować indeksu %d\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: nie można było skonwertować wartości %d\n" @@ -2566,318 +2615,300 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: opcja '-W %s' wymaga argumentu\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "argument linii poleceń `%s' jest katalogiem: pominięto" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "nie można otworzyć pliku `%s' do czytania (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "zamknięcie fd %d (`%s') nie powiodło się (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "przekierowanie nie jest dozwolone w trybie piaskownicy" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "wyrażenie w przekierowaniu `%s' ma tylko wartość numeryczną" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "wyrażenie dla przekierowania `%s' ma zerową wartość łańcucha" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "nazwa pliku `%s' dla przekierowania `%s' może być rezultatem logicznego " "wyrażenia" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "niepotrzebne mieszanie `>' i `>>' dla pliku `%.*s'" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "nie można otworzyć potoku `%s' jako wyjścia (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "nie można otworzyć potoku `%s' jako wejścia (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" "nie można otworzyć dwukierunkowego potoku `%s' jako wejścia/wyjścia (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "nie można przekierować z `%s' (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "nie można przekierować do `%s' (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "osiągnięto systemowy limit otwartych plików: rozpoczęcie multipleksowania " "deskryptorów plików" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "zamknięcie `%s' nie powiodło się (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "zbyt dużo otwartych potoków lub plików wejściowych" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: drugim argumentem musi być `to' lub `from'" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "" "close: `%.*s' nie jest ani otwartym plikiem, ani potokiem, ani procesem" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "zamknięcie przekierowania, które nigdy nie zostało otwarte" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: przekierowanie `%s' nie zostało otwarte z `|&', drugi argument " "zignorowany" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "status awarii (%d) podczas zamykania potoku `%s' (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "status awarii (%d) podczas zamykania pliku `%s' (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "brak jawnego zamknięcia gniazdka `%s'" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "brak jawnego zamknięcia procesu pomocniczego `%s'" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "brak jawnego zamknięcia potoku `%s'" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "brak jawnego zamknięcia pliku `%s'" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "błąd podczas zapisu na standardowe wyjście (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "błąd podczas zapisu na standardowe wyjście diagnostyczne (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "opróżnienie potoku `%s' nie powiodło się (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "" "opróżnienie potoku do `%s' przez proces pomocniczy nie powiodło się (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "opróżnienie pliku `%s' nie powiodło się (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "nieprawidłowy lokalny port %s w `/inet'" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "informacje o zdalnym hoście i porcie są nieprawidłowe (%s, %s)" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "nie dostarczono (znanego) protokołu w specjalnym pliku `%s'" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "specjalna nazwa pliku `%s' jest niekompletna" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "należy dostarczyć nazwę zdalnego hosta do `/inet'" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "należy dostarczyć numer zdalnego portu do `/inet'" - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "Komunikacja TCP/IP nie jest wspierana" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "nie można otworzyć `%s', tryb `%s'" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "zamknięcie nadrzędnego pty nie powiodło się (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "" "zamknięcie standardowego wyjścia w procesie potomnym nie powiodło się (%s)" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "przesunięcie podległego pty na standardowe wyjście w procesie potomnym nie " "powiodło się (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "" "zamknięcie standardowego wejścia w procesie potomnym nie powiodło się (%s)" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "przesunięcie podległego pty na standardowe wejście w procesie potomnym nie " "powiodło się (dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "zamknięcie podległego pty nie powiodło się (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "przesunięcie potoku na standardowe wyjście w procesie potomnym nie powiodło " "się (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "przesunięcie potoku na standardowe wejście w procesie potomnym nie powiodło " "się (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" msgstr "" "odzyskanie standardowego wyjścia w procesie potomnym nie powiodło się\n" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" msgstr "" "odzyskanie standardowego wejścia w procesie potomnym nie powiodło się\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "zamknięcie potoku nie powiodło się (%s)" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "`|&' nie jest wspierany" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "nie można otworzyć potoku `%s' (%s)" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "nie można utworzyć procesu potomnego dla `%s' (fork: %s)" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser: otrzymano wskaźnik NULL" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "parser wejścia `%s' konfliktuje z poprzednio zainstalowanym parserem `%s'" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "parser wejścia `%s': nie powiodło się otwarcie `%s'" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper: otrzymano wskaźnik NULL" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" "otoczka wyjścia `%s' konfliktuje z poprzednio zainstalowaną otoczką `%s'" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "otoczka wyjścia `%s': nie powiodło się otwarcie `%s'" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor: otrzymano wskaźnik NULL" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2886,212 +2917,202 @@ "dwukierunkowy procesor `%s' konfliktuje z poprzednio zainstalowanym " "procesorem `%s'" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "dwukierunkowy procesor `%s' zawiódł w otwarciu `%s'" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "plik danych `%s' jest pusty" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "nie można zarezerwować więcej pamięci wejściowej" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "wieloznakowa wartość `RS' jest rozszerzeniem gawk" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "Komunikacja IPv6 nie jest wspierana" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "pusty argument dla opcji `-e/--source' został zignorowany" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: opcja `-W %s' nierozpoznana i zignorowana\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: opcja musi mieć argument -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "zmienna środowiskowa `POSIXLY_CORRECT' ustawiona: `--posix' został włączony" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "opcja `--posix' zostanie użyta nad `--traditional'" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--posix'/`--traditional' użyte nad opcją `--non-decimal-data'" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "" "uruchamianie %s setuid root może być problemem pod względem bezpieczeństwa" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "opcja `--posix' zostanie użyta nad `--characters-as-bytes'" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "nie można ustawić trybu binarnego na standardowym wejściu (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "nie można ustawić trybu binarnego na standardowym wyjściu (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "nie można ustawić trybu binarnego na wyjściu diagnostycznym (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "brak tekstu programu!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Użycie: %s [styl opcji POSIX lub GNU] -f plik_z_programem [--] plik ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Użycie: %s [styl opcji POSIX lub GNU] [--] %cprogram%c plik ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "Opcje POSIX:\t\tDługie opcje GNU (standard):\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f program\t\t--file=program\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v zmienna=wartość\t--assign=zmienna=wartość\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Krótkie opcje:\t\tDługie opcje GNU: (rozszerzenia)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[plik]\t\t--dump-variables[=plik]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[plik]\t\t--debug[=plik]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'tekst-programu'\t--source='tekst-programu'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E plik\t\t\t--exec=plik\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i plikinclude\t\t--include=plikinclude\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l biblioteka\t\t--load=biblioteka\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +#, fuzzy +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" - -#: main.c:824 +#: main.c:591 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:594 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[plik]\t\t--pretty-print[=plik]\n" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[plik]\t\t--profile[=plik]\n" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3100,7 +3121,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3113,7 +3134,7 @@ "dokumentacji.\n" "\n" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3123,7 +3144,7 @@ "Program domyślnie czyta standardowe wejście i zapisuje standardowe wyjście.\n" "\n" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3133,7 +3154,7 @@ "\tgawk '{ suma += $1 }; END { print suma }' plik\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3152,7 +3173,7 @@ "tej Licencji lub którejś z późniejszych wersji.\n" "\n" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3167,7 +3188,7 @@ "Powszechną Licencję Publiczną GNU.\n" "\n" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3176,16 +3197,16 @@ "Powszechnej Licencji Publicznej GNU (GNU General Public License);\n" "jeśli zaś nie - odwiedź stronę http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft nie ustawia FS na znak tabulatora w POSIX awk" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "nieznana wartość dla specyfikacji pola: %d\n" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3194,98 +3215,116 @@ "%s: argument `%s' dla `-v' nie jest zgodny ze składnią `zmienna=wartość'\n" "\n" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' nie jest dozwoloną nazwą zmiennej" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' nie jest nazwą zmiennej, szukanie pliku `%s=%s'" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "nie można użyć wbudowanej w gawk `%s' jako nazwy zmiennej" -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "nie można użyć funkcji `%s' jako nazwy zmiennej" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "wyjątek zmiennopozycyjny" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "fatalny błąd: wewnętrzny błąd" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "fatalny błąd: wewnętrzny błąd: błąd segmentacji" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "fatalny błąd: wewnętrzny błąd: przepełnienie stosu" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "brak już otwartego fd %d" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "nie można otworzyć zawczasu /dev/null dla fd %d" -#: mpfr.c:550 +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "pusty argument dla opcji `-e/--source' został zignorowany" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: opcja `-W %s' nierozpoznana i zignorowana\n" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: opcja musi mieć argument -- %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "wartość PREC `%.*s' jest nieprawidłowa" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "wartość RNDMODE `%.*s' jest nieprawidłowa" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s: otrzymano argument, który nie jest liczbą" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): ujemne wartości spowodują dziwne wyniki" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg): ułamkowe wartości zostaną obcięte" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "cmpl(%Zd): ujemne wartości spowodują dziwne wyniki" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s: otrzymano argument #%d, który nie jest liczbą" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: argument #%d ma nieprawidłową wartość %Rg, użyto 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: argument #%d ujemna wartość %Rg spowoduje dziwne wyniki" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s: argument #%d ułamkowa wartość %Rg zostanie obcięta" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%s: argument #%d ujemna wartość %Zd spowoduje dziwne wyniki" @@ -3295,24 +3334,24 @@ msgid "cmd. line:" msgstr "linia poleceń:" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "backslash na końcu łańcucha" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "stary awk nie wspiera sekwencji ucieczki `\\%c'" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX nie zezwala na sekwencję ucieczki `\\x'" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "brak liczb szesnastkowych w sekwencji ucieczki `\\x'" -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3321,12 +3360,12 @@ "szesnastkowa sekwencja ucieczki \\x%.*s %d znaków prawdopodobnie nie została " "zinterpretowana jak tego oczekujesz" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "sekwencja ucieczki `\\%c' potraktowana jako zwykłe `%c'" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3344,25 +3383,25 @@ msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)" msgstr "%s %s `%s': nie można ustawić close-on-exec: (fcntl F_SETFD: %s)" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "nie można otworzyć `%s' do zapisu: %s" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" msgstr "wysyłanie profilu na standardowe wyjście diagnostyczne" -#: profile.c:193 -#, c-format +#: profile.c:213 +#, fuzzy, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s blok(i)\n" +"\t# Reguła(i)\n" "\n" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" @@ -3371,16 +3410,16 @@ "\t# Reguła(i)\n" "\n" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "wewnętrzny błąd: %s z zerowym vname" -#: profile.c:537 +#: profile.c:558 msgid "internal error: builtin with null fname" msgstr "wewnętrzny błąd: builtin z fname null" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3389,12 +3428,12 @@ "\t# Załadowane rozszerzenia (-l i/lub @load)\n" "\n" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# profil programu gawk, utworzony %s\n" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" @@ -3403,7 +3442,7 @@ "\n" "\t# Funkcje, spis alfabetyczny\n" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: nieznany typ przekierowania %d" @@ -3413,80 +3452,116 @@ msgid "regexp component `%.*s' should probably be `[%.*s]'" msgstr "komponent regexp `%.*s' powinien być prawdopodobnie `[%.*s]'" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Sukces" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Brak dopasowania" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Nieprawidłowe wyrażenie regularne" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Nieprawidłowy znak porównania" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Nieprawidłowa nazwa klasy znaku" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Końcowy znak backslash" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Nieprawidłowe odwołanie wsteczne" -#: regcomp.c:152 -msgid "Unmatched [ or [^" +#: regcomp.c:160 +#, fuzzy +msgid "Unmatched [, [^, [:, [., or [=" msgstr "Niedopasowany znak [ lub [^" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "Niedopasowany znak ( lub \\(" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "Niedopasowany znak \\{" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Nieprawidłowa zawartość \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Nieprawidłowy koniec zakresu" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Pamięć wyczerpana" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Nieprawidłowe poprzedzające wyrażenie regularne" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Przedwczesny koniec wyrażenia regularnego" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Wyrażenie regularne jest zbyt duże" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "Niedopasowany znak ) lub \\)" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Brak poprzedniego wyrażenia regularnego" -#: symbol.c:741 +#: symbol.c:677 +#, fuzzy, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "funkcja `%s': nie można użyć nazwy funkcji jako nazwy parametru" + +#: symbol.c:809 msgid "can not pop main context" msgstr "nie można zdjąć głównego kontekstu" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "nieprawidłowy `getline var' wewnątrz reguły `%s'" + +#~ msgid "`getline' invalid inside `%s' rule" +#~ msgstr "nieprawidłowy `getline' wewnątrz reguły `%s'" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "nie dostarczono (znanego) protokołu w specjalnym pliku `%s'" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "specjalna nazwa pliku `%s' jest niekompletna" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "należy dostarczyć nazwę zdalnego hosta do `/inet'" + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "należy dostarczyć numer zdalnego portu do `/inet'" + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s blok(i)\n" +#~ "\n" + #~ msgid "range of the form `[%c-%c]' is locale dependent" #~ msgstr "zasięg formy `[%c-%c]' jest zależny od lokalizacji" -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "próba użycia funkcji `%s' jako tablicy" - #~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" #~ msgstr "odwołanie do niezainicjowanego elementu `%s[\"%.*s\"]'" @@ -3565,11 +3640,6 @@ #~ msgid "function `%s' not defined" #~ msgstr "funkcja `%s' nie została zdefiniowana" -#~ msgid "non-redirected `getline' invalid inside `%s' rule" -#~ msgstr "" -#~ "komenda `getline' bez przekierowania jest nieprawidłowa wewnątrz reguły `" -#~ "%s'" - #~ msgid "error reading input file `%s': %s" #~ msgstr "błąd podczas czytania z pliku `%s': %s" diff -urN gawk-4.1.1/po/sv.po gawk-4.1.2/po/sv.po --- gawk-4.1.1/po/sv.po 2014-04-08 19:23:37.000000000 +0300 +++ gawk-4.1.2/po/sv.po 2015-04-29 08:36:41.000000000 +0300 @@ -1,17 +1,18 @@ # Swedish translation of gawk -# Copyright © 2003, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. +# Copyright © 2003, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc. # This file is distributed under the same license as the gawk package. +# # Martin Sjögren , 2001-2002. # Christer Andersson , 2007. -# Göran Uddeborg , 2011, 2012, 2013, 2014. +# Göran Uddeborg , 2011, 2012, 2013, 2014, 2015. # -# $Revision: 1.14 $ +# $Revision: 1.20 $ msgid "" msgstr "" -"Project-Id-Version: gawk 4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" -"PO-Revision-Date: 2014-01-21 17:40+0100\n" +"Project-Id-Version: gawk 4.1.1d\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" +"PO-Revision-Date: 2015-04-22 22:34+0200\n" "Last-Translator: Göran Uddeborg \n" "Language-Team: Swedish \n" "Language: sv\n" @@ -38,9 +39,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "försök att använda skalären ”%s” som en vektor" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "försök att använda vektorn ”%s” i skalärsammanhang" @@ -99,413 +100,418 @@ "asorti: det går inte att använda en delvektor av andra argumentet som första " "argument" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "”%s” är ogiltigt som ett funktionsnamn" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "jämförelsefunktionen ”%s” för sortering är inte definierad" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "%s-block måste ha en åtgärdsdel" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "varje regel måste ha ett mönster eller en åtgärdsdel" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "gamla awk stöder inte flera ”BEGIN”- eller ”END”-regler" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "”%s“ är en inbyggd funktion, den kan inte definieras om" -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "regexp-konstanten \"//\" ser ut som en C++-kommentar men är inte det" -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "regexp-konstanten \"/%s/\" ser ut som en C-kommentar men är inte det" -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "upprepade case-värden i switch-sats: %s" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "flera \"default\" upptäcktes i switch-sats" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "\"break\" är inte tillåtet utanför en slinga eller switch" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "\"continue\" är inte tillåtet utanför en slinga" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "\"next\" använt i %s-åtgärd" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "\"nextfile\" använt i %s-åtgärd" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "\"return\" använd utanför funktion" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "ensamt \"print\" i BEGIN eller END-regel bör troligen vara 'print \"\"'" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" msgstr "”delete” är inte tillåtet med SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" msgstr "”delete” är inte tillåtet med FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" msgstr "\"delete(array)\" är en icke portabel tawk-utökning" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "flerstegs dubbelriktade rör fungerar inte" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "reguljärt uttryck i högerledet av en tilldelning" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "reguljärt uttryck på vänster sida om en \"~\"- eller \"!~\"-operator" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" msgstr "gamla awk stöder inte operatorn \"**\"" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "reguljärt uttryck i högerledet av en jämförelse" -#: awkgram.y:1417 -#, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "\"getline var\" är ogiltigt inuti \"%s\"-regel" - -#: awkgram.y:1420 +#: awkgram.y:1410 #, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "\"getline är ogiltigt inuti \"%s\"-regel" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "icke omdirigerad ”getline” är ogiltigt inuti \"%s\"-regel" -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" msgstr "icke omdirigerad \"getline\" odefinierad inuti END-åtgärd" -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "gamla awk stöder inte flerdimensionella vektorer" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "anrop av \"length\" utan parenteser är inte portabelt" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "indirekta funktionsanrop är en gawk-utökning" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "" "det går inte att använda specialvariabeln \"%s\" för indirekta fuktionsanrop" +#: awkgram.y:1634 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "försök att använda en icke-funktion ”%s” i ett funktionsanrop" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "ogiltig indexuttryck" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "varning: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "ödesdigert: " -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "oväntat nyradstecken eller slut på strängen" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "kan inte öppna källfilen \"%s\" för läsning (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2392 awkgram.y:2517 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "kan inte öppna det delade biblioteket ”%s” för läsning (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "okänd anledning" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "kan inte inkludera ”%s” och använda den som en programfil" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "inkluderade redan källfilen \"%s\"" -#: awkgram.y:2409 +#: awkgram.y:2417 #, c-format msgid "already loaded shared library `%s'" msgstr "inkluderade redan det delade biblioteket ”%s”" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "@include är en gawk-utökning" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "tomt filnamn efter @include" -#: awkgram.y:2494 +#: awkgram.y:2502 msgid "@load is a gawk extension" msgstr "@load är en gawk-utökning" -#: awkgram.y:2500 +#: awkgram.y:2508 msgid "empty filename after @load" msgstr "tomt filnamn efter @load" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "tom programtext på kommandoraden" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "kan inte läsa källfilen \"%s\" (%s)" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "källfilen \"%s\" är tom" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "PEBKAC-fel: ogiltigt tecken ”\\%03o” i källkoden" + +#: awkgram.y:2958 msgid "source file does not end in newline" msgstr "källfilen slutar inte med en ny rad" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "oavslutat reguljärt uttryck slutar med \"\\\" i slutet av filen" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "%s: %d: tawk-modifierare för reguljära uttryck \"/.../%c\" fungerar inte i " "gawk" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" "tawk-modifierare för reguljära uttryck \"/.../%c\" fungerar inte i gawk" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "oavslutat reguljärt uttryck" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "oavslutat reguljärt uttryck i slutet av filen" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" msgstr "Användning av \"\\ #...\" för radfortsättning är inte portabelt" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "sista tecknet på raden är inte ett omvänt snedstreck" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "POSIX tillåter inte operatorn \"**=\"" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "gamla awk stöder inte operatorn \"**=\"" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "POSIX tillåter inte operatorn \"**\"" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "gamla awk stöder inte operatorn \"**\"" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "operatorn \"^=\" stöds inte i gamla awk" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "operatorn \"^\" stöds inte i gamla awk" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "oavslutad sträng" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "ogiltigt tecken \"%c\" i uttryck" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "\"%s\" är en gawk-utökning" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX tillåter inte \"%s\"" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "\"%s\" stöds inte i gamla awk" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "\"goto\" anses skadlig!\n" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d är ett ogiltigt antal argument för %s" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: bokstavlig sträng som sista argument till ersättning har ingen effekt" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s: tredje argumentet är inte ett ändringsbart objekt" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "match: tredje argumentet är en gawk-utökning" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "close: andra argumentet är en gawk-utökning" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "användandet av dcgettext(_\"...\") är felaktigt: ta bort det inledande " "understrykningstecknet" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "användandet av dcngettext(_\"...\") är felaktigt: ta bort det inledande " "understrykningstecknet" -#: awkgram.y:4016 +#: awkgram.y:4050 msgid "index: regexp constant as second argument is not allowed" msgstr "index: reguljäruttryck som andra argumentet är inte tillåtet" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funktionen \"%s\": parametern \"%s\" överskuggar en global variabel" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "kunde inte öppna \"%s\" för skrivning (%s)" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "skickar variabellista till standard fel" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "%s: misslyckades att stänga (%s)" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() anropad två gånger!" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "det fanns överskuggade variabler." -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "funktionsnamnet \"%s\" är definierat sedan tidigare" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "funktionen \"%s\": kan inte använda funktionsnamn som parameternamn" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "" "funktionen \"%s\": det går inte att använda specialvariabeln \"%s\" som en " "funktionsparameter" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funktionen \"%s\": parameter %d, \"%s\", är samma som parameter %d" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "funktionen \"%s\" anropad men aldrig definierad" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "funktionen \"%s\" definierad men aldrig anropad direkt" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "konstant reguljärt uttryck för parameter %d ger ett booleskt värde" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -514,23 +520,23 @@ "funktionen \"%s\" anropad med blanktecken mellan namnet och \"(\",\n" "eller använd som variabel eller vektor" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "försökte dividera med noll" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "försökte dividera med noll i \"%%\"" -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "" "kan inte tilldela ett värde till uttryck som är en efterinkrementering av " "ett fält" -#: awkgram.y:5052 +#: awkgram.y:5012 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "ogiltigt mål för tilldelning (op-kod %s)" @@ -570,189 +576,199 @@ msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: \"%s\" är inte en öppen fil, rör eller koprocess" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: första argumentet är inte en sträng" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: andra argumentet är inte en sträng" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: fick ett ickenumeriskt argument" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: fick ett vektorargument" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "\"length(array)\" är en gawk-utökning" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: fick ett argument som inte är en sträng" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: fick ett ickenumeriskt argument" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: fick ett negativt argumentet %g" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "ödesdigert: måste använda \"count$\" på alla eller inga format" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "fältbredd ignoreras för \"%%\"-specificerare" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "precision ignoreras för \"%%\"-specificerare" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "fältbredd och precision ignoreras för \"%%\"-specificerare" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "ödesdigert: \"$\" tillåts inte i awk-format" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "ödesdigert: argumentantalet med \"$\" måste vara > 0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "ödesdigert: argumentantalet %ld är större än antalet givna argument" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "ödesdigert: \"$\" tillåts inte efter en punkt i formatet" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "ödesdigert: inget \"$\" bifogat för positionsangiven fältbredd eller " "precision" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "\"l\" är meningslös i awk-format, ignorerad" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "ödesdigert: \"l\" tillåts inte i POSIX awk-format" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "\"L\" är meningslös i awk-format, ignorerad" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "ödesdigert: \"L\" tillåts inte i POSIX awk-format" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "\"h\" är meningslös i awk-format, ignorerad" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "ödesdigert: \"h\" tillåts inte i POSIX awk-format" -#: builtin.c:1463 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: värdet %g är utanför formatet %%c giltiga intervall" + +#: builtin.c:1068 +#, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: värdet %g är inte ett giltigt brett tecken " + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: värdet %g är utanför \"%%%c\"-formatets giltiga intervall" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "ignorerar okänt formatspecifikationstecken \"%c\": inget argument konverterat" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "ödesdigert: för få argument för formatsträngen" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "^ tog slut här" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" -msgstr "[s]printf: formatspecifieraren har ingen kommandobokstav" +msgstr "[s]printf: formatspecificeraren har ingen kommandobokstav" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "för många argument för formatsträngen" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: inga argument" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: inga argument" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: fick ickenumeriskt argument" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: anropad med negativt argument %g" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" msgstr "substr: längden %g är inte >= 1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" msgstr "substr: längden %g är inte >= 0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: längden %g som inte är ett heltal kommer huggas av" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: längden %g är för stor för strängindexering, huggas av till %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: startindex %g är ogiltigt, använder 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: startindex %g som inte är ett heltal kommer huggas av" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: källsträngen är tom" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: startindex %g är bortom strängens slut" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -760,186 +776,206 @@ "substr: längden %g vid startindex %g överskrider det första argumentets " "längd (%lu)" -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "strftime: formatvärde i PROCINFO[\"strftime\"] har numerisk typ" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" msgstr "strftime: fick ett ickenumeriskt andra argument" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" -msgstr "strftime: andra argimentet mindre än 0 eller för stort för time_t" +msgstr "strftime: andra argumentet mindre än 0 eller för stort för time_t" -#: builtin.c:1934 +#: builtin.c:1932 +msgid "strftime: second argument out of range for time_t" +msgstr "strftime: andra argumentet utanför intervallet för för time_t" + +#: builtin.c:1941 msgid "strftime: received non-string first argument" msgstr "strftime: fick ett första argument som inte är en sträng" -#: builtin.c:1941 +#: builtin.c:1948 msgid "strftime: received empty format string" msgstr "strftime: fick en tom formatsträng" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" msgstr "mktime: fick ett argument som inte är en sträng" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: åtminstone ett av värdena är utanför standardintervallet" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "funktionen \"system\" är inte tillåten i sandlådeläge" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" msgstr "system: fick ett argument som inte är en sträng" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "referens till icke initierat fält \"$%d\"" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" msgstr "tolower: fick ett argument som inte är en sträng" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" msgstr "toupper: fick ett argument som inte är en sträng" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: fick ett ickenumeriskt första argument" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: fick ett ickenumeriskt andra argument" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" msgstr "sin: fick ett ickenumeriskt argument" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" msgstr "cos: fick ett ickenumeriskt argument" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" msgstr "srand: fick ett ickenumeriskt argument" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "match: tredje argumentet är inte en vektor" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" -msgstr "gensub: nollan i tredje argumentet behandlad som en etta" +#: builtin.c:2725 +#, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "gensub: tredje argumentet ”%.*s” behandlat som 1" + +#: builtin.c:2740 +#, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: tredje argumentet %g behandlat som 1" -#: builtin.c:3030 +#: builtin.c:3038 +#, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "%s: kan anropas indirekt endast med två argument" + +#: builtin.c:3128 +#, c-format +msgid "indirect call to %s requires at least two arguments" +msgstr "indirekt anrop till %s kräver åtminstone två argument" + +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" msgstr "lshift: fick ett ickenumeriskt första argument" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" msgstr "lshift: fick ett ickenumeriskt andra argument" -#: builtin.c:3038 +#: builtin.c:3188 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): negativa värden kommer ge konstiga resultat" -#: builtin.c:3040 +#: builtin.c:3190 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): flyttalsvärden kommer huggas av" -#: builtin.c:3042 +#: builtin.c:3192 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "lshift(%f, %f): för stort skiftvärde kommer ge konstiga resultat" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" msgstr "rshift: fick ett ickenumeriskt första argument" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" msgstr "rshift: fick ett ickenumeriskt andra argument" -#: builtin.c:3075 +#: builtin.c:3225 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): negativa värden kommer ge konstiga resultat" -#: builtin.c:3077 +#: builtin.c:3227 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): flyttalsvärden kommer huggas av" -#: builtin.c:3079 +#: builtin.c:3229 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "rshift(%f, %f): för stor skiftvärde kommer ge konstiga resultat" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3254 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: anropad med mindre än två argument" -#: builtin.c:3109 +#: builtin.c:3259 #, c-format msgid "and: argument %d is non-numeric" msgstr "and: argument %d är inte numeriskt" -#: builtin.c:3113 +#: builtin.c:3263 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "and: argument %d med negativt värde %g kommer ge konstiga resultat" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3286 mpfr.c:1020 msgid "or: called with less than two arguments" -msgstr "or: anropad med färre än två argmuent" +msgstr "or: anropad med färre än två argument" -#: builtin.c:3141 +#: builtin.c:3291 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: argument %d är inte numeriskt" -#: builtin.c:3145 +#: builtin.c:3295 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "or: argument %d med negativt värde %g kommer ge konstiga resultat" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3317 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: anropad med färre än två argument" -#: builtin.c:3173 +#: builtin.c:3323 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: argument %d är inte numeriskt" -#: builtin.c:3177 +#: builtin.c:3327 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: argument %d med negativt värde %g kommer ge konstiga resultat" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: fick ett ickenumeriskt argument" -#: builtin.c:3208 +#: builtin.c:3358 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): negativt värde kommer ge konstiga resultat" -#: builtin.c:3210 +#: builtin.c:3360 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): flyttalsvärde kommer huggas av" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: \"%s\" är inte en giltig lokalkategori" @@ -1087,7 +1123,7 @@ #: command.y:831 msgid "disable [breakpoints] [range] - disable specified breakpoints." -msgstr "disable [brytpunkger] [intervall] - avaktivera angivna brytpunkter." +msgstr "disable [brytpunkter] [intervall] - avaktivera angivna brytpunkter." #: command.y:833 msgid "display [var] - print value of variable each time the program stops." @@ -1237,47 +1273,55 @@ msgid "watch var - set a watchpoint for a variable." msgstr "watch var - sätt en observationspunkt för en variabel." -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"where [N] - (samma som backtrace) skriv ett spår över alla eller N innersta " +"(yttersta om N < 0) ramar." + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "fel: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "kan inte läsa kommando (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "kan inte läsa kommandot (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "ogiltigt tecken i kommandot" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "okänt kommando - \"%.*s\", försök med help" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "ogiltigt tecken" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "odefinierat kommando: %s\n" #: debug.c:252 msgid "set or show the number of lines to keep in history file." -msgstr "sätt eller visa antalet rader att behålla i historiefilen." +msgstr "sätt eller visa antalet rader att behålla i historikfilen." #: debug.c:254 msgid "set or show the list command window size." @@ -1293,7 +1337,7 @@ #: debug.c:260 msgid "(un)set or show saving of command history (value=on|off)." -msgstr "slå av/på eller visa sparandet av kommandohisterik (värde=on|off)." +msgstr "slå av/på eller visa sparandet av kommandohistorik (värde=on|off)." #: debug.c:262 msgid "(un)set or show saving of options (value=on|off)." @@ -1561,7 +1605,7 @@ #, c-format msgid "Note: breakpoint %d (enabled, ignore next %ld hits), also set at %s:%d" msgstr "" -"Observera: brytpunkt %d (aktiverad, ingorera följande %ld träffar), är också " +"Observera: brytpunkt %d (aktiverad, ignorera följande %ld träffar), är också " "satt vid %s:%d" #: debug.c:2207 @@ -1573,7 +1617,7 @@ #, c-format msgid "Note: breakpoint %d (disabled, ignore next %ld hits), also set at %s:%d" msgstr "" -"Observera: brytpunkt %d (avaktiverad, intorera följande %ld träffar), är " +"Observera: brytpunkt %d (avaktiverad, ignorera följande %ld träffar), är " "också satt vid %s:%d" #: debug.c:2221 @@ -1604,7 +1648,7 @@ #: debug.c:2375 #, c-format msgid "Can't set breakpoint at `%s':%d\n" -msgstr "Kan inte sätta än brytpunkt vid ”%s”:%d\n" +msgstr "Kan inte sätta en brytpunkt vid ”%s”:%d\n" #: debug.c:2387 #, c-format @@ -1680,7 +1724,7 @@ #: debug.c:2942 #, c-format msgid "error (%s): cannot restart, ignoring rest of the commands\n" -msgstr "fel (%s): kan inte starta om, ingorerar resten av kommandona\n" +msgstr "fel (%s): kan inte starta om, ignorerar resten av kommandona\n" #: debug.c:2950 #, c-format @@ -1799,68 +1843,68 @@ msgstr "" "”return” är inte tillåtet i det aktuella sammanhanget; satsen ignoreras" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Ingen symbol ”%s” i aktuell omgivning" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 msgid "unbalanced [" msgstr "obalanserad [" -#: dfa.c:1174 +#: dfa.c:1118 msgid "invalid character class" msgstr "ogiltig teckenklass" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "syntaxen för teckenklass är [[:space:]], inte [:space:]" -#: dfa.c:1366 +#: dfa.c:1326 msgid "unfinished \\ escape" msgstr "oavslutad \\-följd" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" -msgstr "Ogiltigt innehåll i \\{\\}" - -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" -msgstr "Reguljärt uttryck för stort" +#: dfa.c:1473 +msgid "invalid content of \\{\\}" +msgstr "ogiltigt innehåll i \\{\\}" + +#: dfa.c:1476 +msgid "regular expression too big" +msgstr "reguljärt uttryck för stort" -#: dfa.c:1936 +#: dfa.c:1911 msgid "unbalanced (" msgstr "obalanserad (" -#: dfa.c:2062 +#: dfa.c:2037 msgid "no syntax specified" msgstr "ingen syntax angiven" -#: dfa.c:2070 +#: dfa.c:2045 msgid "unbalanced )" msgstr "obalanserad )" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "okänd nodtyp %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "okänd op-kod %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" msgstr "op-kod %s är inte en operator eller ett nyckelord" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "buffertöverflöd i genflags2str" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1871,216 +1915,216 @@ "\t# Funktionsanropsstack:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "\"IGNORECASE\" är en gawk-utökning" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "\"BINMODE\" är en gawk-utökning" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "BINMODE-värde \"%s\" är ogiltigt, behandlas som 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "felaktig \"%sFMT\"-specifikation \"%s\"" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "slår av \"--lint\" på grund av en tilldelning till \"LINT\"" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "referens till icke initierat argument \"%s\"" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "referens till icke initierad variabel \"%s\"" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "försök att fältreferera från ickenumeriskt värde" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "försök till fältreferens från en tom sträng" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "försök att komma åt fält nummer %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "referens till icke initierat fält \"$%ld\"" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "funktionen \"%s\" anropad med fler argument än vad som deklarerats" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: oväntad typ \"%s\"" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "försökte dividera med noll i \"/=\"" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "försökte dividera med noll i \"%%=\"" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "utökningar är inte tillåtna i sandlådeläge" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load är gawk-utökningar" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext: mottog NULL-lib_name" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: kan inte öppna biblioteket ”%s” (%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: biblioteket ”%s”: definierar inte ”plugin_is_GPL_compatible” (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: biblioteket ”%s”: kan inte anropa funktionen ”%s” (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "" "load_ext: initieringsrutinen ”%2$s” i biblioteket ”%1$s” misslyckades\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "\"extension\" är en gawk-utökning" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" msgstr "utökning: mottog NULL-lib_name" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "extension: kan inte öppna biblioteket ”%s” (%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "extension: biblioteket ”%s”: definierar inte ”plugin_is_GPL_compatible” (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "extension: biblioteket ”%s”: kan inte anropa funktionen ”%s” (%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: funktionsnamn saknas" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: det går inte att definiera om funktionen ”%s”" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: funktionen ”%s” är redan definierad" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: funktionsnamnet ”%s” är definierat sedan tidigare" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "make_builtin: kan inte använda gawks inbyggda ”%s” som ett funktionsnamn" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: negativt argumentantal för funktionen \"%s\"" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: saknar funktionsnamn" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: ogiltigt tecken \"%c\" i funktionsnamnet \"%s\"" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: det går inte att definiera om funktionen \"%s\"" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: funktionen \"%s\" är redan definierad" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "extension: funktionsnamnet \"%s\" är definierat sedan tidigare" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" "extension: kan inte använda gawks inbyggda \"%s\" som ett funktionsnamn" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" msgstr "funktionen \"%s\" definierades för att ta maximalt %d argument" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "funktionen \"%s\": argument %d saknas" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "funktionen \"%s\": argument %d: försök att använda skalär som vektor" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "funktionen \"%s\": argument %d: försök att använda vektor som skalär" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "dynamisk laddning av bibliotek stödjs inte" @@ -2224,7 +2268,7 @@ msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin: redigering på plats är redan aktivt" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin: förväntar sig 2 argument men anropad med %d" @@ -2254,55 +2298,55 @@ msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin: mkstemp(”%s”) misslyckades (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin: chmod misslyckades (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin: dup(standard ut) misslyckades (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin: dup2(%d, standard ut) misslyckades (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin: close(%d) misslyckades (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "inplace_end: kan inte hämta 1:a argumentet som en filnamnssträng" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end: redigering på plats är inte aktivt" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end: dup2(%d, standard ut) misslyckades (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end: close(%d) misslyckades (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end: fsetpos(standard ut) misslyckades (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end: link(”%s”, ”%s”) misslyckades (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end: rename(”%s”, ”%s”) misslyckades (%s)" @@ -2344,50 +2388,54 @@ msgid "readfile: called with no arguments" msgstr "readfile: anropad utan argument" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "revoutput: kunde inte initiera REVOUT-variabeln" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: anropad med för många argument" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: argument 0 är inte en sträng\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: argument 1 är inte en vektor\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: kunde inte platta till vektor\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: kunde inte släppa en tillplattad vektor\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: anropad med för många argument" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: argument 0 är inte en sträng\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: argument 1 är inte en vektor\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array misslyckades\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element misslyckades\n" @@ -2416,90 +2464,90 @@ msgid "sleep: not supported on this platform" msgstr "sleep: stödjs inte på denna plattform" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "NF satt till ett negativt värde" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split: fjärde argumentet är en gawk-utökning" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split: fjärde argumentet är inte en vektor" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: andra argumentet är inte en vektor" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split: det går inte att använda samma vektor som andra och fjärde argument" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split: det går inte att använda en delvektor av andra argumentet som fjärde " "argument" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split: det går inte att använda en delvektor av fjärde argumentet som andra " "argument" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "split: tom sträng som tredje argument är en gawk-utökning" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: fjärde argumentet är inte en vektor" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: andra argumentet är inte en vektor" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: tredje argumentet får inte vara tomt" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit: det går inte att använda samma vektor som andra och fjärde argument" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit: det går inte att använda en delvektor av andra argumentet som " "fjärde argument" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit: det går inte att använda en delvektor av fjärde argumentet som " "andra argument" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "\"FIELDWIDTHS\" är en gawk-utökning" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "ogiltigt FIELDWITHS-värde i närheten av \"%s\"" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "tom sträng som \"FS\" är en gawk-utökning" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "gamla awk stöder inte reguljära uttryck som värden på \"FS\"" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "\"FPAT\" är en gawk-utökning" @@ -2515,20 +2563,20 @@ msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: mottog null-värde" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element: fick en null-vektor" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element: mottog null-index" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: kunde inte konvertera index %d\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: kunde inte konvertera värdet %d\n" @@ -2588,288 +2636,269 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: flaggan \"-W %s\" kräver ett argument\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "kommandoradsargumentet \"%s\" är en katalog: hoppas över" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "kan inte öppna filen \"%s\" för läsning (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "stängning av fd %d (\"%s\") misslyckades (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "omdirigering är inte tillåten i sandlådeläge" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "uttrycket i \"%s\"-omdirigering har bara numeriskt värde" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "uttrycket för \"%s\"-omdirigering har en tom sträng som värde" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "filnamnet \"%s\" för \"%s\"-omdirigering kan vara resultatet av ett logiskt " "uttryck" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "onödig blandning av \">\" och \">>\" för filen \"%.*s\"" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "kan inte öppna röret \"%s\" för utmatning (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "kan inte öppna röret \"%s\" för inmatning (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "kan inte öppna tvåvägsröret \"%s\" för in-/utmatning (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "kan inte dirigera om från \"%s\" (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "kan inte dirigera om till \"%s\" (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "nådde systembegränsningen för öppna filer: börjar multiplexa fildeskriptorer" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." -msgstr "stängning av \"%s\" misslyckades (%s)" +msgstr "stängning av \"%s\" misslyckades (%s)." -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "för många rör eller indatafiler öppna" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: andra argumentet måste vara \"to\" eller \"from\"" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: \"%.*s\" är inte en öppen fil, rör eller koprocess" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "stängning av omdirigering som aldrig öppnades" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: omdirigeringen \"%s\" öppnades inte med \"|&\", andra argumentet " "ignorerat" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "felstatus (%d) från rörstängning av \"%s\" (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "felstatus (%d) från filstängning av \"%s\" (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "ingen explicit stängning av uttaget \"%s\" tillhandahållen" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "ingen explicit stängning av koprocessen \"%s\" tillhandahållen" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "ingen explicit stängning av röret \"%s\" tillhandahållen" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "ingen explicit stängning av filen \"%s\" tillhandahållen" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "fel vid skrivning till standard ut (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "fel vid skrivning till standard fel (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." -msgstr "rörspolning av \"%s\" misslyckades (%s)" +msgstr "rörspolning av \"%s\" misslyckades (%s)." -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." -msgstr "koprocesspolning av röret till \"%s\" misslyckades (%s)" +msgstr "koprocesspolning av röret till \"%s\" misslyckades (%s)." -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." -msgstr "filspolning av \"%s\" misslyckades (%s)" +msgstr "filspolning av \"%s\" misslyckades (%s)." -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "lokal port %s ogiltig i \"/inet\"" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "ogiltig information (%s, %s) för fjärrvärd och fjärrport" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "" -"inget (känt) protokoll tillhandahållet i det speciella filnamnet \"%s\"" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "speciellt filnamn \"%s\" är ofullständigt" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "måste tillhandahålla ett fjärrdatornamn till \"/inet\"" - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "måste tillhandahålla en fjärrport till \"/inet\"" - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "TCP/IP-kommunikation stöds inte" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "kunde inte öppna \"%s\", läge \"%s\"" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "stängning av huvudpty misslyckades (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "stängning av standard ut i barnet misslyckades (%s)" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "flyttandet av slavpty till standard ut i barnet misslyckades (dup: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "stängning av standard in i barnet misslyckades (%s)" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "flyttandet av slavpty till standard in i barnet misslyckades (dup: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "stängning av slavpty misslyckades (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "flyttande av rör till standard ut i barnet misslyckades (dup: %s)" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "flyttande av rör till standard in i barnet misslyckades (dup: %s)" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" -msgstr "återställande av standard ut i förälderprocessen misslyckades\n" +msgstr "återställande av standard ut i föräldraprocessen misslyckades\n" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" -msgstr "återställande av standard in i förälderprocessen misslyckades\n" +msgstr "återställande av standard in i föräldraprocessen misslyckades\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "stängning av röret misslyckades (%s)" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "\"|&\" stöds inte" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "kan inte öppna röret \"%s\" (%s)" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "kan inte skapa barnprocess för \"%s\" (fork: %s)" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser: mottog NULL-pekare" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "inmatningstolken ”%s” står i konflikt med tidigare installerad " "inmatningstolk ”%s”" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "inmatningstolken ”%s” misslyckades att öppna ”%s”" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper: mottog NULL-pekare" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" @@ -2877,16 +2906,16 @@ "utmatningsomslag ”%s” står i konflikt med tidigare installerat " "utmatningsomslag ”%s”" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" -msgstr "utmatningsomslag ”%s” misslyckades att öpnna ”%s”" +msgstr "utmatningsomslag ”%s” misslyckades att öppna ”%s”" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor: mottog NULL-pekare" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2895,210 +2924,199 @@ "tvåvägsprocessorn ”%s” står i konflikt med tidigare installerad " "tvåvägsprocessor ”%s”" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "tvåvägsprocessorn ”%s” misslyckades att öppna ”%s”" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "datafilen \"%s\" är tom" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "kunde inte allokera mer indataminne" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "flerteckensvärdet av \"RS\" är en gawk-utökning" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "IPv6-kommunikation stöds inte" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "tomt argument till \"-e/--source\" ignorerat" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: flaggan \"-W %s\" okänd, ignorerad\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: flaggan kräver ett argument -- %c\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "miljövariabeln \"POSIXLY_CORRECT\" satt: slår på \"--posix\"" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "\"--posix\" åsidosätter \"--traditional\"" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "\"--posix\"/\"--traditional\" åsidosätter \"--non-decimal-data\"" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "att köra %s setuid root kan vara ett säkerhetsproblem" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "”--posix” åsidosätter ”--character-as-bytes”" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "kan inte sätta binärläge på standard in (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "kan inte sätta binärläge på standard ut (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "kan inte sätta binärläge på standard fel (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "ingen programtext alls!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Användning: %s [POSIX- eller GNU-stilsflaggor] -f progfil [--] fil ...\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Användning: %s [POSIX- eller GNU-stilsflaggor] %cprogram%c fil ...\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "POSIX-flaggor:\t\tGNU långa flaggor: (standard)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f progfil\t\t--file=progfil\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=värde\t\t--assign=var=värde\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" msgstr "Korta flaggor:\t\tGNU långa flaggor: (utökningar)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[fil]\t\t\t--dump-variables[=fil]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[fil]\t\t\t--debug[=fil]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e 'programtext'\t--source='programtext'\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E fil\t\t\t--exec=fil\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i inkluderingsfil\t--include=inkluderingsfil\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l bibliotek\t\t--load=bibliotek\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" -msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" - -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" +msgstr "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" -#: main.c:824 +#: main.c:591 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:594 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[fil]\t\t\t--pretty-print[=fil]\n" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" msgstr "\t-O\t\t\t--optimize\n" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[fil]\t\t\t--profile[=fil]\n" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3107,7 +3125,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3121,7 +3139,7 @@ "Rapportera synpunkter på översättningen till .\n" "\n" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3131,7 +3149,7 @@ "Normalt läser det från standard in och skriver till standard ut.\n" "\n" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -3141,7 +3159,7 @@ "\tgawk '{ sum += $1 }; END { print sum }' fil\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3160,7 +3178,7 @@ "någon senare version.\n" "\n" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3174,122 +3192,140 @@ "General Public License för ytterligare information.\n" "\n" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" msgstr "" "Du bör ha fått en kopia av GNU General Public License tillsammans\n" -"med detta program. Om inte, se http//www.gnu.org/liceences/.\n" +"med detta program. Om inte, se http://www.gnu.org/licenses/.\n" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft sätter inte FS till tab i POSIX-awk" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "okänt värde till fältspecifikation: %d\n" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" "\n" msgstr "%s: Argumentet \"%s\" till \"-v\" är inte på formatet \"var=värde\"\n" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "\"%s\" är inte ett giltigt variabelnamn" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "\"%s\" är inte ett variabelnamn, letar efter filen \"%s=%s\"" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "kan inte använda gawks inbyggda \"%s\" som ett funktionsnamn" -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "kan inte använda funktionen \"%s\" som variabelnamn" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "flyttalsundantag" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "ödesdigert fel: internt fel" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "ödesdigert fel: internt fel: segmenteringsfel" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "ödesdigert fel: internt fel: stackspill" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "ingen föröppnad fd %d" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "kunde inte föröppna /dev/null för fd %d" -#: mpfr.c:550 +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "tomt argument till \"-e/--source\" ignorerat" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "-M ignoreras: MPFR/GMP-stöd är inte inkompilerat" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: flaggan \"-W %s\" okänd, ignorerad\n" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: flaggan kräver ett argument -- %c\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "PREC-värdet ”%.*s” är ogiltigt" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "RNDMODE-värdet ”%.*s” är ogiltigt" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s: fick ett ickenumeriskt argument" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): negativt värde kommer ge konstiga resultat" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg): flyttalsvärden kommer huggas av" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "cmpl(%Zd): negativt värde kommer ge konstiga resultat" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s: fick ett ickenumeriskt argument nr. %d" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: argument nr. %d har ogiltigt värde %Rg, använder 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: argument nr. %d negativa värde %Rg kommer ge konstiga resultat" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s: argument nr. %d flyttalsvärde %Rg kommer huggas av" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%s: argument nr. %d negativa värde %Zd kommer ge konstiga resultat" @@ -3299,24 +3335,24 @@ msgid "cmd. line:" msgstr "kommandorad:" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "omvänt snedstreck i slutet av strängen" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" msgstr "gamla awk stöder inte kontrollsekvensen \"\\%c\"" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX tillåter inte \"\\x\"-kontrollsekvenser" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "inga hexadecimala siffror i \"\\x\"-kontrollsekvenser" -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3325,12 +3361,12 @@ "hexkod \\x%.*s med %d tecken tolkas förmodligen inte på det sätt du " "förväntar dig" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "kontrollsekvensen \"\\%c\" behandlad som bara \"%c\"" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." @@ -3348,25 +3384,25 @@ msgid "%s %s `%s': could not set close-on-exec: (fcntl F_SETFD: %s)" msgstr "%s %s \"%s\": kunde inte sätta stäng-vid-exec (fcntl F_SETFD: %s)" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "kunde inte öppna \"%s\" för skrivning: %s" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" msgstr "skickar profilen till standard fel" -#: profile.c:193 +#: profile.c:213 #, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s-block\n" +"\t# %s-regler\n" "\n" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" @@ -3375,16 +3411,16 @@ "\t# Regel/regler\n" "\n" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "internt fel: %s med null vname" -#: profile.c:537 +#: profile.c:558 msgid "internal error: builtin with null fname" msgstr "internt fel: inbyggd med tomt fname" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3393,12 +3429,12 @@ "\t# Laddade utvidgningar (-l och/eller @load)\n" "\n" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawkprofil, skapad %s\n" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" @@ -3407,7 +3443,7 @@ "\n" "\t# Funktioner, listade alfabetiskt\n" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: okänd omdirigeringstyp %d" @@ -3418,70 +3454,84 @@ msgstr "" "komponenten \"%.*s\" i reguljäruttryck skall förmodligen vara \"[%.*s]\"" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Lyckades" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Misslyckades" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Ogiltigt reguljärt uttryck" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Ogiltigt kollationeringstecken" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Ogiltigt teckenklassnamn" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Eftersläpande omvänt snedstreck" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Ogiltig bakåtrerefens" -#: regcomp.c:152 -msgid "Unmatched [ or [^" -msgstr "Obalanserad [ eller [^" +#: regcomp.c:160 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Obalanserad [, [^, [:, [. eller [=" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "Obalanserad ( eller \\(" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "Obalanserad \\{" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Ogiltigt innehåll i \\{\\}" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Ogiltigt omfångsslut" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Minnet slut" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Ogiltigt föregående reguljärt uttryck" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "För tidigt slut på reguljärt uttryck" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Reguljärt uttryck för stort" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "Obalanserad ) eller \\)" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Inget föregående reguljärt uttryck" -#: symbol.c:741 +#: symbol.c:677 +#, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "" +"funktionen ”%s”: kan inte använda funktionen ”%s” som ett parameternamn" + +#: symbol.c:809 msgid "can not pop main context" msgstr "kan inte poppa huvudsammanhang" diff -urN gawk-4.1.1/po/vi.po gawk-4.1.2/po/vi.po --- gawk-4.1.1/po/vi.po 2014-04-08 19:23:37.000000000 +0300 +++ gawk-4.1.2/po/vi.po 2015-04-29 08:36:41.000000000 +0300 @@ -1,16 +1,16 @@ # Vietnamese translation for Gawk. # Bản dịch Tiếng Việt dành cho Gawk. -# Copyright © 2014 Free Software Foundation, Inc. +# Copyright © 2015 Free Software Foundation, Inc. # This file is distributed under the same license as the gawk package. # Clytie Siddall , 2005-2010. -# Trần Ngọc Quân , 2012-2014. +# Trần Ngọc Quân , 2012-2014, 2015. # msgid "" msgstr "" -"Project-Id-Version: gawk-4.1.0b\n" -"Report-Msgid-Bugs-To: arnold@skeeve.com\n" -"POT-Creation-Date: 2014-04-08 19:23+0300\n" -"PO-Revision-Date: 2014-01-16 14:52+0700\n" +"Project-Id-Version: gawk 4.1.1d\n" +"Report-Msgid-Bugs-To: bug-gawk@gnu.org\n" +"POT-Creation-Date: 2015-04-29 08:36+0300\n" +"PO-Revision-Date: 2015-04-17 07:37+0700\n" "Last-Translator: Trần Ngọc Quân \n" "Language-Team: Vietnamese \n" "Language: vi\n" @@ -18,8 +18,6 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 1.5.5\n" -"X-Poedit-SourceCharset: UTF-8\n" #: array.c:256 #, c-format @@ -40,9 +38,9 @@ msgid "attempt to use scalar `%s' as an array" msgstr "cố dùng “%s” vô hướng như là mảng" -#: array.c:409 array.c:576 builtin.c:85 builtin.c:1615 builtin.c:1661 -#: builtin.c:1674 builtin.c:2102 builtin.c:2116 eval.c:1122 eval.c:1126 -#: eval.c:1531 +#: array.c:409 array.c:576 builtin.c:85 builtin.c:1606 builtin.c:1652 +#: builtin.c:1665 builtin.c:2112 builtin.c:2126 eval.c:1149 eval.c:1153 +#: eval.c:1564 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "cố gắng dùng mảng “%s” trong một ngữ cảnh vô hướng" @@ -50,7 +48,7 @@ #: array.c:583 #, c-format msgid "delete: index `%s' not in array `%s'" -msgstr "delete: (xoá) chỉ số “%s” không nằm trong mảng “%s”" +msgstr "delete: (xóa) chỉ số “%s” không nằm trong mảng “%s”" #: array.c:597 #, c-format @@ -101,422 +99,427 @@ "asorti (một chương trình xắp xếp thứ tự): không thể sử dụng mảng con của " "tham số thứ hai cho tham số thứ nhất" -#: array.c:1314 +#: array.c:1313 #, c-format msgid "`%s' is invalid as a function name" msgstr "“%s” không phải là tên hàm hợp lệ" -#: array.c:1318 +#: array.c:1317 #, c-format msgid "sort comparison function `%s' is not defined" msgstr "chưa định nghĩa hàm so sánh xắp xếp “%s”" -#: awkgram.y:233 +#: awkgram.y:225 #, c-format msgid "%s blocks must have an action part" msgstr "Mọi khối %s phải có một phần kiểu hành động" -#: awkgram.y:236 +#: awkgram.y:228 msgid "each rule must have a pattern or an action part" msgstr "Mọi quy tắc phải có một mẫu hay phần kiểu hành động" -#: awkgram.y:325 awkgram.y:336 +#: awkgram.y:319 awkgram.y:330 msgid "old awk does not support multiple `BEGIN' or `END' rules" msgstr "" "awk cũ không hỗ trợ nhiều quy tắc kiểu “BEGIN” (bắt đầu) hay “END” (kết thúc)" -#: awkgram.y:373 +#: awkgram.y:367 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "“%s” là một hàm có sẵn nên nó không thể được định nghĩa lại." -#: awkgram.y:419 +#: awkgram.y:416 msgid "regexp constant `//' looks like a C++ comment, but is not" msgstr "" "hằng biểu thức chính quy “//” trông giống như một chú thích C++, nhưng mà " "không phải" -#: awkgram.y:423 +#: awkgram.y:420 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" "hằng biểu thức chính quy “/%s/” trông giống như một chú thích C, nhưng mà " "không phải" -#: awkgram.y:515 +#: awkgram.y:512 #, c-format msgid "duplicate case values in switch body: %s" msgstr "gặp giá trị case trùng trong thân chuyển đổi (switch body): %s" -#: awkgram.y:536 +#: awkgram.y:533 msgid "duplicate `default' detected in switch body" msgstr "" "đã phát hiện trùng “default” trong thân cấu trúc điều khiển chọn lựa (switch)" -#: awkgram.y:796 awkgram.y:3723 +#: awkgram.y:793 awkgram.y:3757 msgid "`break' is not allowed outside a loop or switch" msgstr "" "không cho phép “break” (ngắt) nằm ở ngoại vòng lặp hay cấu trúc chọn lựa" -#: awkgram.y:805 awkgram.y:3715 +#: awkgram.y:802 awkgram.y:3749 msgid "`continue' is not allowed outside a loop" msgstr "không cho phép “continue” (tiếp tục) ở ngoài một vòng lặp" -#: awkgram.y:815 +#: awkgram.y:812 #, c-format msgid "`next' used in %s action" msgstr "“next” (kế tiếp) được dùng trong hành động %s" -#: awkgram.y:824 +#: awkgram.y:821 #, c-format msgid "`nextfile' used in %s action" msgstr "“nextfile” (tập tin kế tiếp) được dùng trong hành động %s" -#: awkgram.y:848 +#: awkgram.y:845 msgid "`return' used outside function context" msgstr "“return” (trở về) được dùng ở ngoại ngữ cảnh hàm" -#: awkgram.y:922 +#: awkgram.y:919 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "“print” (in) thường trong quy tắc “BEGIN” (bắt đầu) hay “END” (kết thúc) gần " "như chắc chắn nên là “print”””" -#: awkgram.y:988 awkgram.y:1037 +#: awkgram.y:985 awkgram.y:1034 msgid "`delete' is not allowed with SYMTAB" msgstr "“delete” không được phép với SYMTAB" -#: awkgram.y:990 awkgram.y:1039 +#: awkgram.y:987 awkgram.y:1036 msgid "`delete' is not allowed with FUNCTAB" msgstr "“delete” không được phép với FUNCTAB" -#: awkgram.y:1024 awkgram.y:1028 +#: awkgram.y:1021 awkgram.y:1025 msgid "`delete(array)' is a non-portable tawk extension" -msgstr "“delete array” (xoá mảng) là phần mở rộng gawk không khả chuyển" +msgstr "“delete array” (xóa mảng) là phần mở rộng gawk không khả chuyển" -#: awkgram.y:1149 +#: awkgram.y:1146 msgid "multistage two-way pipelines don't work" msgstr "đường ống dẫn hai chiếu đa giai đoạn không phải hoạt động được" -#: awkgram.y:1264 +#: awkgram.y:1261 msgid "regular expression on right of assignment" msgstr "biểu thức chính quy nằm bên phải phép gán" -#: awkgram.y:1275 +#: awkgram.y:1272 msgid "regular expression on left of `~' or `!~' operator" msgstr "biểu thức chính quy nằm bên trái toán tử “~” hay “!~”" -#: awkgram.y:1291 awkgram.y:1442 +#: awkgram.y:1288 awkgram.y:1430 msgid "old awk does not support the keyword `in' except after `for'" -msgstr "awk cũ không hỗ trợ từ khoá “in”, trừ khi nằm sau “for”" +msgstr "awk cũ không hỗ trợ từ khóa “in”, trừ khi nằm sau “for”" -#: awkgram.y:1301 +#: awkgram.y:1298 msgid "regular expression on right of comparison" msgstr "biểu thức chính quy nằm bên phải sự so sánh" -#: awkgram.y:1417 +#: awkgram.y:1410 #, c-format -msgid "`getline var' invalid inside `%s' rule" -msgstr "“getline var” không hợp lệ bên trong quy tắc “%s”" +msgid "non-redirected `getline' invalid inside `%s' rule" +msgstr "“getline” không-chuyển-hướng không hợp lệ trong quy tắc “%s”" -#: awkgram.y:1420 -#, c-format -msgid "`getline' invalid inside `%s' rule" -msgstr "“getline” không hợp lệ trong quy tắc “%s”" - -#: awkgram.y:1425 +#: awkgram.y:1413 msgid "non-redirected `getline' undefined inside END action" msgstr "" "trong hành động “END” (kết thúc) có “getline” (lấy dòng) không được chuyển " "hướng lại và chưa được định nghĩa." -#: awkgram.y:1444 +#: awkgram.y:1432 msgid "old awk does not support multidimensional arrays" msgstr "awk cũ không hỗ trợ mảng đa chiều" -#: awkgram.y:1541 +#: awkgram.y:1529 msgid "call of `length' without parentheses is not portable" msgstr "" "lời gọi “length” (độ dài) mà không có dấu ngoặc đơn là không tương thích " "trên các hệ thống khác" -#: awkgram.y:1607 +#: awkgram.y:1595 msgid "indirect function calls are a gawk extension" msgstr "cuộc gọi hàm gián tiếp là một phần mở rộng gawk" -#: awkgram.y:1620 +#: awkgram.y:1608 #, c-format msgid "can not use special variable `%s' for indirect function call" msgstr "không thể dùng biến đặc biệt “%s” cho cú gọi hàm gián tiếp" +#: awkgram.y:1634 +#, c-format +msgid "attempt to use non-function `%s' in function call" +msgstr "cố gắng dùng không-phải-hàm “%s” trong cú gọi hàm" + #: awkgram.y:1698 msgid "invalid subscript expression" msgstr "biểu thức in thấp không hợp lệ" -#: awkgram.y:2048 awkgram.y:2068 gawkapi.c:206 gawkapi.c:224 msg.c:126 +#: awkgram.y:2044 awkgram.y:2064 gawkapi.c:206 gawkapi.c:224 msg.c:126 msgid "warning: " msgstr "cảnh báo: " -#: awkgram.y:2066 gawkapi.c:192 gawkapi.c:221 msg.c:158 +#: awkgram.y:2062 gawkapi.c:192 gawkapi.c:221 msg.c:158 msgid "fatal: " msgstr "lỗi nghiêm trọng: " -#: awkgram.y:2116 +#: awkgram.y:2112 msgid "unexpected newline or end of string" msgstr "gặp dòng mới hay kết thúc chuỗi bất ngờ" -#: awkgram.y:2383 awkgram.y:2459 awkgram.y:2682 debug.c:523 debug.c:539 +#: awkgram.y:2391 awkgram.y:2467 awkgram.y:2690 debug.c:523 debug.c:539 #: debug.c:2812 debug.c:5055 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "không thể mở tập tin nguồn “%s” để đọc (%s)" -#: awkgram.y:2384 awkgram.y:2509 +#: awkgram.y:2392 awkgram.y:2517 #, c-format msgid "can't open shared library `%s' for reading (%s)" msgstr "không thể mở tập thư viện chia sẻ “%s” để đọc (%s)" -#: awkgram.y:2386 awkgram.y:2460 awkgram.y:2510 builtin.c:135 debug.c:5206 +#: awkgram.y:2394 awkgram.y:2468 awkgram.y:2518 builtin.c:135 debug.c:5206 msgid "reason unknown" msgstr "không rõ lý do" -#: awkgram.y:2395 awkgram.y:2419 +#: awkgram.y:2403 awkgram.y:2427 #, c-format msgid "can't include `%s' and use it as a program file" msgstr "không thể bao gồm “%s” và dùng nó như là tập tin chương trình" -#: awkgram.y:2408 +#: awkgram.y:2416 #, c-format msgid "already included source file `%s'" msgstr "đã sẵn bao gồm tập tin nguồn “%s”" -#: awkgram.y:2409 +#: awkgram.y:2417 #, c-format msgid "already loaded shared library `%s'" msgstr "thư viện dùng chung “%s” đã được sẵn được tải rồi" -#: awkgram.y:2444 +#: awkgram.y:2452 msgid "@include is a gawk extension" msgstr "@include là phần mở rộng của gawk" -#: awkgram.y:2450 +#: awkgram.y:2458 msgid "empty filename after @include" msgstr "tập tin trống sau @include" -#: awkgram.y:2494 +#: awkgram.y:2502 msgid "@load is a gawk extension" msgstr "@load là một phần mở rộng gawk" -#: awkgram.y:2500 +#: awkgram.y:2508 msgid "empty filename after @load" msgstr "tên tập tin trống sau @load" -#: awkgram.y:2634 +#: awkgram.y:2642 msgid "empty program text on command line" msgstr "gặp đoạn chữ chương trình rỗng nằm trên dòng lệnh" -#: awkgram.y:2749 +#: awkgram.y:2757 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "không thể đọc tập tin nguồn “%s” (%s)" -#: awkgram.y:2760 +#: awkgram.y:2768 #, c-format msgid "source file `%s' is empty" msgstr "tập tin nguồn “%s” là rỗng" -#: awkgram.y:2937 +#: awkgram.y:2827 +#, c-format +msgid "PEBKAC error: invalid character '\\%03o' in source code" +msgstr "Lỗi PEBKAC: gặp ký tự không hợp lệ “\\%03o” trong mã nguồn" + +#: awkgram.y:2958 msgid "source file does not end in newline" -msgstr "tập tin nguồn không kết thúc với một dòng mới" +msgstr "tập tin nguồn không kết thúc bằng một dòng trống" -#: awkgram.y:3042 +#: awkgram.y:3068 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" "biểu thức chính quy chưa được chấm dứt kết thúc với “\\” tại kết thúc của " "tập tin" -#: awkgram.y:3066 +#: awkgram.y:3095 #, c-format msgid "%s: %d: tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" -"%s: %d: bộ sửa đổi biểu thức chính quy tawk “/.../%c” không hoạt động được " +"%s: %d: bộ sửa đổi biểu thức chính quy tawk “/…/%c” không hoạt động được " "trong gawk" -#: awkgram.y:3070 +#: awkgram.y:3099 #, c-format msgid "tawk regex modifier `/.../%c' doesn't work in gawk" msgstr "" -"bộ sửa đổi biểu thức chính quy tawk “/.../%c” không hoạt động được trong gawk" +"bộ sửa đổi biểu thức chính quy tawk “/…/%c” không hoạt động được trong gawk" -#: awkgram.y:3077 +#: awkgram.y:3106 msgid "unterminated regexp" msgstr "biểu thức chính quy chưa được chấm dứt" -#: awkgram.y:3081 +#: awkgram.y:3110 msgid "unterminated regexp at end of file" msgstr "biểu thức chính quy chưa được chấm dứt nằm tại kết thúc của tập tin" -#: awkgram.y:3140 +#: awkgram.y:3168 msgid "use of `\\ #...' line continuation is not portable" -msgstr "không thể mang khả năng dùng “\\#...” để tiếp tục dòng" +msgstr "không thể mang khả năng dùng “\\#…” để tiếp tục dòng" -#: awkgram.y:3156 +#: awkgram.y:3184 msgid "backslash not last character on line" msgstr "dấu gạch ngược không phải là ký tự cuối cùng nằm trên dòng" -#: awkgram.y:3217 +#: awkgram.y:3245 msgid "POSIX does not allow operator `**='" msgstr "POSIX không cho phép toán tử “**=”" -#: awkgram.y:3219 +#: awkgram.y:3247 msgid "old awk does not support operator `**='" msgstr "awk cũ không hỗ trợ toán tử “**=”" -#: awkgram.y:3228 +#: awkgram.y:3256 msgid "POSIX does not allow operator `**'" msgstr "POSIX không cho phép toán tử “**”" -#: awkgram.y:3230 +#: awkgram.y:3258 msgid "old awk does not support operator `**'" msgstr "awk cũ không hỗ trợ toán tử “**”" -#: awkgram.y:3265 +#: awkgram.y:3293 msgid "operator `^=' is not supported in old awk" msgstr "awk cũ không hỗ trợ toán tử “^=”" -#: awkgram.y:3273 +#: awkgram.y:3301 msgid "operator `^' is not supported in old awk" msgstr "awk cũ không hỗ trợ toán tử “^”" -#: awkgram.y:3366 awkgram.y:3382 command.y:1178 +#: awkgram.y:3398 awkgram.y:3416 command.y:1180 msgid "unterminated string" msgstr "chuỗi không được chấm dứt" -#: awkgram.y:3603 +#: awkgram.y:3637 #, c-format msgid "invalid char '%c' in expression" msgstr "có ký tự không hợp lệ “%c” nằm trong biểu thức" -#: awkgram.y:3650 +#: awkgram.y:3684 #, c-format msgid "`%s' is a gawk extension" msgstr "“%s” là một phần mở rộng gawk" -#: awkgram.y:3655 +#: awkgram.y:3689 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX không cho phép “%s”" -#: awkgram.y:3663 +#: awkgram.y:3697 #, c-format msgid "`%s' is not supported in old awk" msgstr "awk kiểu cũ không hỗ trợ “%s”" -#: awkgram.y:3753 +#: awkgram.y:3787 msgid "`goto' considered harmful!\n" msgstr "“goto” được xem là có hại!\n" -#: awkgram.y:3787 +#: awkgram.y:3821 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "“%d” không hợp lệ khi là số đối số cho “%s”" -#: awkgram.y:3822 +#: awkgram.y:3856 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: khi đối số cuối cùng của sự thay thế, hằng mã nguồn chuỗi không có tác " "dụng" -#: awkgram.y:3827 +#: awkgram.y:3861 #, c-format msgid "%s third parameter is not a changeable object" msgstr "tham số thứ ba %s không phải là một đối tượng có thể thay đổi" -#: awkgram.y:3910 awkgram.y:3913 +#: awkgram.y:3944 awkgram.y:3947 msgid "match: third argument is a gawk extension" msgstr "match: (khớp) đối số thứ ba là phần mở rộng gawk" -#: awkgram.y:3967 awkgram.y:3970 +#: awkgram.y:4001 awkgram.y:4004 msgid "close: second argument is a gawk extension" msgstr "close: (đóng) đối số thứ hai là phần mở rộng gawk" -#: awkgram.y:3982 +#: awkgram.y:4016 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" -msgstr "dùng “dcgettext(_\"...\")” không đúng: hãy gỡ bỏ gạch dưới nằm trước" +msgstr "dùng “dcgettext(_\"…\")” không đúng: hãy gỡ bỏ gạch dưới nằm trước" -#: awkgram.y:3997 +#: awkgram.y:4031 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" -msgstr "dùng “dcgettext(_\"...\")” không đúng: hãy gỡ bỏ gạch dưới nằm trước" +msgstr "dùng “dcgettext(_\"…\")” không đúng: hãy gỡ bỏ gạch dưới nằm trước" -#: awkgram.y:4016 +#: awkgram.y:4050 msgid "index: regexp constant as second argument is not allowed" msgstr "" "index: (chỉ mục) không cho phép hằng biểu thức chính quy làm đối số thứ hai" -#: awkgram.y:4069 +#: awkgram.y:4103 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "hàm “%s”: tham số “%s” che biến toàn cục" -#: awkgram.y:4126 debug.c:4041 debug.c:4084 debug.c:5204 +#: awkgram.y:4160 debug.c:4041 debug.c:4084 debug.c:5204 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "không mở được “%s” để ghi (%s)" -#: awkgram.y:4127 +#: awkgram.y:4161 msgid "sending variable list to standard error" msgstr "đang gởi danh sách biến tới thiết bị lỗi chuẩn" -#: awkgram.y:4135 +#: awkgram.y:4169 #, c-format msgid "%s: close failed (%s)" msgstr "%s: gặp lỗi khi đóng (%s)" -#: awkgram.y:4160 +#: awkgram.y:4194 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() (hàm bóng) được gọi hai lần!" -#: awkgram.y:4168 +#: awkgram.y:4202 msgid "there were shadowed variables." msgstr "có biến bị bóng." -#: awkgram.y:4239 +#: awkgram.y:4273 #, c-format msgid "function name `%s' previously defined" msgstr "tên hàm “%s” trước đây đã được định nghĩa rồi" -#: awkgram.y:4285 +#: awkgram.y:4319 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "hàm “%s”: không thể dùng tên hàm như là tên tham số" -#: awkgram.y:4288 +#: awkgram.y:4322 #, c-format msgid "function `%s': can't use special variable `%s' as a function parameter" msgstr "hàm “%s”: không thể dùng biến đặc biệt “%s” như là tham số hàm" -#: awkgram.y:4296 +#: awkgram.y:4330 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "hàm “%s”: tham số “#%d”, “%s”, nhân đôi tham số “#%d”" -#: awkgram.y:4383 awkgram.y:4389 +#: awkgram.y:4417 awkgram.y:4423 #, c-format msgid "function `%s' called but never defined" msgstr "hàm “%s” được gọi nhưng mà chưa định nghĩa" -#: awkgram.y:4393 +#: awkgram.y:4427 #, c-format msgid "function `%s' defined but never called directly" msgstr "hàm “%s” được định nghĩa nhưng mà chưa được gọi trực tiếp bao giờ" -#: awkgram.y:4425 +#: awkgram.y:4459 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "hằng biểu thức chính quy cho tham số “#%d” làm giá trị luận lý (bun)" -#: awkgram.y:4484 +#: awkgram.y:4474 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -525,21 +528,21 @@ "hàm “%s” được gọi với dấu cách nằm giữa tên và “(”\n" "hoặc được dùng như là biến hay mảng" -#: awkgram.y:4720 +#: awkgram.y:4680 msgid "division by zero attempted" msgstr "gặp phép chia cho số không" -#: awkgram.y:4729 +#: awkgram.y:4689 #, c-format msgid "division by zero attempted in `%%'" msgstr "gặp phép chia cho số không trong “%%”" -#: awkgram.y:5049 +#: awkgram.y:5009 msgid "" "cannot assign a value to the result of a field post-increment expression" msgstr "không thể gán giá trị cho kết quả của biểu thức trường tăng-trước" -#: awkgram.y:5052 +#: awkgram.y:5012 #, c-format msgid "invalid target of assignment (opcode %s)" msgstr "gán đich không hợp lệ (mã thi hành “%s”)" @@ -582,194 +585,204 @@ msgstr "" "fflush: “%s” không phải là tập tin, ống dẫn hay đồng tiến trình được mở" -#: builtin.c:362 +#: builtin.c:351 msgid "index: received non-string first argument" msgstr "index: (chỉ số) đã nhận đối số thứ nhất không phải là chuỗi" -#: builtin.c:364 +#: builtin.c:353 msgid "index: received non-string second argument" msgstr "index: (chỉ số) đã nhận đối số thứ hai không phải là chuỗi" -#: builtin.c:488 mpfr.c:757 +#: builtin.c:466 mpfr.c:777 msgid "int: received non-numeric argument" msgstr "int: (số nguyên?) đã nhận đối số không phải thuộc số" -#: builtin.c:525 +#: builtin.c:503 msgid "length: received array argument" msgstr "length: (chiều dài) đã nhận mảng đối số" -#: builtin.c:528 +#: builtin.c:506 msgid "`length(array)' is a gawk extension" msgstr "“length(array)” (độ dài mảng) là một phần mở rộng gawk" -#: builtin.c:544 +#: builtin.c:525 msgid "length: received non-string argument" msgstr "length: (chiều dài) đã nhận đối số không phải chuỗi" -#: builtin.c:575 +#: builtin.c:554 msgid "log: received non-numeric argument" msgstr "log: (nhật ký) đã nhận đối số không phải thuộc số" -#: builtin.c:578 +#: builtin.c:557 #, c-format msgid "log: received negative argument %g" msgstr "log: (nhật ký) đã nhận đối số âm “%g”" -#: builtin.c:776 builtin.c:781 +#: builtin.c:755 builtin.c:760 builtin.c:911 msgid "fatal: must use `count$' on all formats or none" msgstr "lỗi nghiêm trọng: phải dùng “count$” với mọi dạng thức hay không gì cả" -#: builtin.c:851 +#: builtin.c:830 #, c-format msgid "field width is ignored for `%%' specifier" msgstr "chiều rộng trường bị bỏ qua đối với bộ chỉ định “%%”" -#: builtin.c:853 +#: builtin.c:832 #, c-format msgid "precision is ignored for `%%' specifier" msgstr "độ chính xác bị bỏ qua đối với bộ chỉ định “%%”" -#: builtin.c:855 +#: builtin.c:834 #, c-format msgid "field width and precision are ignored for `%%' specifier" msgstr "chiều rộng trường và độ chính xác bị bỏ qua đối với bộ chỉ định “%%”" -#: builtin.c:906 +#: builtin.c:885 msgid "fatal: `$' is not permitted in awk formats" msgstr "lỗi nghiêm trọng: không cho phép “$” trong định dạng awk" -#: builtin.c:915 +#: builtin.c:894 msgid "fatal: arg count with `$' must be > 0" msgstr "lỗi nghiêm trọng: số lượng đối số với “$” phải >0" -#: builtin.c:919 +#: builtin.c:898 #, c-format msgid "fatal: arg count %ld greater than total number of supplied arguments" msgstr "" "lỗi nghiêm trọng: số lượng đối số %ld lớn hơn tổng số đối số được cung cấp" -#: builtin.c:923 +#: builtin.c:902 msgid "fatal: `$' not permitted after period in format" msgstr "lỗi nghiêm trọng: không cho phép “$” nằm sau dấu chấm trong định dạng" -#: builtin.c:939 +#: builtin.c:921 msgid "fatal: no `$' supplied for positional field width or precision" msgstr "" "lỗi nghiêm trọng: chưa cung cấp “$” cho độ rộng trường thuộc vị trí hay cho " "độ chính xác" -#: builtin.c:1009 +#: builtin.c:991 msgid "`l' is meaningless in awk formats; ignored" msgstr "chữ “l” không có nghĩa trong định dạng awk nên bị bỏ qua" -#: builtin.c:1013 +#: builtin.c:995 msgid "fatal: `l' is not permitted in POSIX awk formats" msgstr "lỗi nghiêm trọng: không cho phép chữ “l” nằm trong định dạng awk POSIX" -#: builtin.c:1026 +#: builtin.c:1008 msgid "`L' is meaningless in awk formats; ignored" msgstr "chữ “L” không có nghĩa trong định dạng awk nên bị bỏ qua" -#: builtin.c:1030 +#: builtin.c:1012 msgid "fatal: `L' is not permitted in POSIX awk formats" msgstr "lỗi nghiêm trọng: không cho phép chữ “L” nằm trong định dạng awk POSIX" -#: builtin.c:1043 +#: builtin.c:1025 msgid "`h' is meaningless in awk formats; ignored" msgstr "chữ “h” không có nghĩa trong định dạng awk nên bị bỏ qua" -#: builtin.c:1047 +#: builtin.c:1029 msgid "fatal: `h' is not permitted in POSIX awk formats" msgstr "lỗi nghiêm trọng: không cho phép chữ “h” nằm trong định dạng awk POSIX" -#: builtin.c:1463 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is too big for %%c format" +msgstr "[s]printf: giá trị %g quá lớn cho định dạng “%%c”" + +#: builtin.c:1068 +#, c-format +msgid "[s]printf: value %g is not a valid wide character" +msgstr "[s]printf: giá trị %g phải là một ký tự rộng hợp lệ" + +#: builtin.c:1454 #, c-format msgid "[s]printf: value %g is out of range for `%%%c' format" msgstr "[s]printf: giá trị %g ở ngoại phạm vi cho dạng thức “%%%c”" -#: builtin.c:1561 +#: builtin.c:1552 #, c-format msgid "ignoring unknown format specifier character `%c': no argument converted" msgstr "" "đang bỏ qua ký tự ghi rõ định dạng không rõ “%c”: không có đối số được " "chuyển đổi" -#: builtin.c:1566 +#: builtin.c:1557 msgid "fatal: not enough arguments to satisfy format string" msgstr "lỗi nghiêm trọng: chưa có đủ đối số để đáp ứng chuỗi định dạng" -#: builtin.c:1568 +#: builtin.c:1559 msgid "^ ran out for this one" msgstr "bị hết “^” cho cái này" -#: builtin.c:1575 +#: builtin.c:1566 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: chỉ định định dạng không có ký hiệu điều khiển" -#: builtin.c:1578 +#: builtin.c:1569 msgid "too many arguments supplied for format string" msgstr "quá nhiều đối số được cung cấp cho chuỗi định dạng" -#: builtin.c:1634 +#: builtin.c:1625 msgid "sprintf: no arguments" msgstr "sprintf: không có đối số" -#: builtin.c:1657 builtin.c:1668 +#: builtin.c:1648 builtin.c:1659 msgid "printf: no arguments" msgstr "printf: không có đối số" -#: builtin.c:1711 +#: builtin.c:1702 msgid "sqrt: received non-numeric argument" msgstr "sqrt: (căn bậc hai) đã nhận đối số không phải thuộc số" -#: builtin.c:1715 +#: builtin.c:1706 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: (căn bậc hai) đã gọi với đối số âm “%g”" -#: builtin.c:1746 +#: builtin.c:1737 #, c-format msgid "substr: length %g is not >= 1" -msgstr "substr: (chuỗi con) độ dài %g không phải ≥1" +msgstr "substr: (chuỗi con) độ dài %g không ≥1" -#: builtin.c:1748 +#: builtin.c:1739 #, c-format msgid "substr: length %g is not >= 0" -msgstr "substr: (chuỗi con) độ dài %g không phải ≥0" +msgstr "substr: (chuỗi con) độ dài %g không ≥0" -#: builtin.c:1755 +#: builtin.c:1753 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: (chuỗi con) sẽ cắt xén độ dài không phải số nguyên “%g”" -#: builtin.c:1760 +#: builtin.c:1758 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: (chuỗi con) độ dài %g là quá lớn cho chỉ số chuỗi, nên xén ngắn " "thành %g" -#: builtin.c:1772 +#: builtin.c:1770 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: (chuỗi con) chỉ số đầu “%g” không hợp lệ nên dùng 1" -#: builtin.c:1777 +#: builtin.c:1775 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "" "substr: (chuỗi con) chỉ số đầu không phải số nguyên “%g” sẽ bị cắt ngắn" -#: builtin.c:1802 +#: builtin.c:1798 msgid "substr: source string is zero length" msgstr "substr: (chuỗi con) chuỗi nguồn có độ dài số không" -#: builtin.c:1818 +#: builtin.c:1812 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: (chuỗi con) chỉ số đầu %g nằm sau kết thúc của chuỗi" -#: builtin.c:1826 +#: builtin.c:1820 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -777,191 +790,211 @@ "substr: (chuỗi con) độ dài %g chỉ số đầu %g vượt quá độ dài của đối số đầu " "(%lu)" -#: builtin.c:1900 +#: builtin.c:1892 msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type" msgstr "" -"strftime: giá trị định dạng trong PROCINFO[”strftime”] phải thuộc kiểu số" +"strftime: giá trị định dạng trong PROCINFO[\"strftime\"] phải thuộc kiểu số" -#: builtin.c:1923 +#: builtin.c:1915 msgid "strftime: received non-numeric second argument" msgstr "strftime: đã nhận đối số thứ hai khác thuộc số" -#: builtin.c:1927 +#: builtin.c:1925 msgid "strftime: second argument less than 0 or too big for time_t" msgstr "strftime: tham số thứ hai nhỏ hơn 0 hay quá lớn dành cho time_t" -#: builtin.c:1934 +#: builtin.c:1932 +msgid "strftime: second argument out of range for time_t" +msgstr "strftime: tham số thứ hai nằm ngoài phạm vi cho phép của kiểu time_t" + +#: builtin.c:1941 msgid "strftime: received non-string first argument" msgstr "strftime: đã nhận đối số thứ nhất khác chuỗi" -#: builtin.c:1941 +#: builtin.c:1948 msgid "strftime: received empty format string" msgstr "strftime: đã nhận chuỗi định dạng rỗng" -#: builtin.c:2007 +#: builtin.c:2017 msgid "mktime: received non-string argument" msgstr "mktime: đã nhận đối số khác chuỗi" -#: builtin.c:2024 +#: builtin.c:2034 msgid "mktime: at least one of the values is out of the default range" msgstr "mktime: ít nhất một của những giá trị nằm ở ngoại phạm vi mặc định" -#: builtin.c:2059 +#: builtin.c:2069 msgid "'system' function not allowed in sandbox mode" msgstr "hàm “system” không cho phép ở chế độ khuôn đúc" -#: builtin.c:2064 +#: builtin.c:2074 msgid "system: received non-string argument" msgstr "system: (hệ thống) đã nhận đối số khác chuỗi" -#: builtin.c:2184 +#: builtin.c:2194 #, c-format msgid "reference to uninitialized field `$%d'" msgstr "gặp tham chiếu đến trường chưa được khởi tạo “$%d”" -#: builtin.c:2271 +#: builtin.c:2279 msgid "tolower: received non-string argument" -msgstr "tolower: (đến thấp hơn) đã nhận đối số khác chuỗi" +msgstr "tolower: (thành chư thường) đã nhận đối số khác chuỗi" -#: builtin.c:2305 +#: builtin.c:2310 msgid "toupper: received non-string argument" -msgstr "toupper: (đến cao hơn) đã nhận đối số khác chuỗi" +msgstr "toupper: (thành chữ HOA) đã nhận đối số khác chuỗi" -#: builtin.c:2341 mpfr.c:672 +#: builtin.c:2343 mpfr.c:679 msgid "atan2: received non-numeric first argument" msgstr "atan2: đã nhận đối số thứ nhất khác thuộc số" -#: builtin.c:2343 mpfr.c:674 +#: builtin.c:2345 mpfr.c:681 msgid "atan2: received non-numeric second argument" msgstr "atan2: đã nhận đối số thứ hai khác thuộc số" -#: builtin.c:2362 +#: builtin.c:2364 msgid "sin: received non-numeric argument" -msgstr "sin: đã nhận đối số không phải thuộc số" +msgstr "sin: đã nhận đối số không thuộc kiểu số học" -#: builtin.c:2378 +#: builtin.c:2380 msgid "cos: received non-numeric argument" -msgstr "cos: đã nhận đối số không phải thuộc số" +msgstr "cos: đã nhận đối số không thuộc kiểu số học" -#: builtin.c:2431 mpfr.c:1156 +#: builtin.c:2433 mpfr.c:1176 msgid "srand: received non-numeric argument" -msgstr "srand: đã nhận đối số không phải thuộc số" +msgstr "srand: đã nhận đối số không thuộc kiểu số học" -#: builtin.c:2462 +#: builtin.c:2464 msgid "match: third argument is not an array" msgstr "match: (khớp) đối số thứ ba không phải là mảng" -#: builtin.c:2734 -msgid "gensub: third argument of 0 treated as 1" -msgstr "gensub: đối số thứ ba của 0 được xử lý như 1" +#: builtin.c:2725 +#, c-format +msgid "gensub: third argument `%.*s' treated as 1" +msgstr "gensub: đối số thứ ba “%.*s” được xử lý như 1" + +#: builtin.c:2740 +#, c-format +msgid "gensub: third argument %g treated as 1" +msgstr "gensub: đối số thứ ba %g được xử lý như 1" + +#: builtin.c:3038 +#, c-format +msgid "%s: can be called indirectly only with two arguments" +msgstr "%s: được gọi một cách gián tiếp với ít hơn hai đối số" + +#: builtin.c:3128 +#, c-format +msgid "indirect call to %s requires at least two arguments" +msgstr "cú gọi gián tiếp đến %s cần ít nhất hai đối số" -#: builtin.c:3030 +#: builtin.c:3180 msgid "lshift: received non-numeric first argument" msgstr "lshift: đã nhận đối số đầu không phải thuộc số" -#: builtin.c:3032 +#: builtin.c:3182 msgid "lshift: received non-numeric second argument" msgstr "lshift: (dịch bên trái) đã nhận đối số thứ hai khác thuộc số" -#: builtin.c:3038 +#: builtin.c:3188 #, c-format msgid "lshift(%f, %f): negative values will give strange results" msgstr "lshift(%f, %f): giá trị âm sẽ gây ra kết quả không như mong muốn" -#: builtin.c:3040 +#: builtin.c:3190 #, c-format msgid "lshift(%f, %f): fractional values will be truncated" msgstr "lshift(%f, %f): giá trị thuộc phân số sẽ bị cắt ngắn" -#: builtin.c:3042 +#: builtin.c:3192 #, c-format msgid "lshift(%f, %f): too large shift value will give strange results" msgstr "" "lshift(%f, %f): giá trị dịch quá lớn sẽ gây ra kết quả không như mong muốn" -#: builtin.c:3067 +#: builtin.c:3217 msgid "rshift: received non-numeric first argument" msgstr "rshift: đã nhận đối số thứ nhất khác thuộc số" -#: builtin.c:3069 +#: builtin.c:3219 msgid "rshift: received non-numeric second argument" msgstr "rshift: (dịch phải) đã nhận đối số thứ hai khác thuộc số" -#: builtin.c:3075 +#: builtin.c:3225 #, c-format msgid "rshift(%f, %f): negative values will give strange results" msgstr "rshift(%f, %f): giá trị âm sẽ gây ra kết quả không như mong muốn" -#: builtin.c:3077 +#: builtin.c:3227 #, c-format msgid "rshift(%f, %f): fractional values will be truncated" msgstr "rshift(%f, %f): giá trị thuộc kiểu phân số sẽ bị xén ngắn" -#: builtin.c:3079 +#: builtin.c:3229 #, c-format msgid "rshift(%f, %f): too large shift value will give strange results" msgstr "" "rshift(%f, %f): giá trị dịch quá lớn sẽ gây ra kết quả không như mong muốn" -#: builtin.c:3104 mpfr.c:968 +#: builtin.c:3254 mpfr.c:988 msgid "and: called with less than two arguments" msgstr "and: được gọi với ít hơn hai đối số" -#: builtin.c:3109 +#: builtin.c:3259 #, c-format msgid "and: argument %d is non-numeric" -msgstr "and: đối số %d không phải thuộc số" +msgstr "and: đối số %d không phải thuộc số" -#: builtin.c:3113 +#: builtin.c:3263 #, c-format msgid "and: argument %d negative value %g will give strange results" msgstr "" "and: (và) đối số %d giá trị âm %g sẽ đưa lại kết quả không như mong muốn" -#: builtin.c:3136 mpfr.c:1000 +#: builtin.c:3286 mpfr.c:1020 msgid "or: called with less than two arguments" msgstr "or: (hoặc) được gọi với ít hơn hai đối số" -#: builtin.c:3141 +#: builtin.c:3291 #, c-format msgid "or: argument %d is non-numeric" msgstr "or: (hoặc) đối số %d không thuộc kiểu số" -#: builtin.c:3145 +#: builtin.c:3295 #, c-format msgid "or: argument %d negative value %g will give strange results" msgstr "" "or: (hoặc) đối số %d giá trị âm %g sẽ đưa lại kết quả không như mong muốn" -#: builtin.c:3167 mpfr.c:1031 +#: builtin.c:3317 mpfr.c:1051 msgid "xor: called with less than two arguments" msgstr "xor: được gọi với ít hơn hai đối số" -#: builtin.c:3173 +#: builtin.c:3323 #, c-format msgid "xor: argument %d is non-numeric" msgstr "xor: đối số %d không thuộc kiểu số" -#: builtin.c:3177 +#: builtin.c:3327 #, c-format msgid "xor: argument %d negative value %g will give strange results" msgstr "xor: đối số %d giá trị âm %g sẽ đưa lại kết quả không như mong muốn" -#: builtin.c:3202 mpfr.c:787 +#: builtin.c:3352 mpfr.c:807 msgid "compl: received non-numeric argument" msgstr "compl: (biên dịch) đã nhận được đối số không-phải-số" -#: builtin.c:3208 +#: builtin.c:3358 #, c-format msgid "compl(%f): negative value will give strange results" msgstr "compl(%f): giá trị âm sẽ gây ra kết quả không như mong đợi" -#: builtin.c:3210 +#: builtin.c:3360 #, c-format msgid "compl(%f): fractional value will be truncated" msgstr "compl(%f): giá trị thuộc phân số sẽ bị cắt ngắn" -#: builtin.c:3379 +#: builtin.c:3529 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: “%s” không phải là một phân loại miền địa phương hợp lệ" @@ -1132,7 +1165,7 @@ #: command.y:843 msgid "eval stmt|[p1, p2, ...] - evaluate awk statement(s)." -msgstr "eval stmt|[p1, p2, ...] - định giá các câu lệnh awk." +msgstr "eval stmt|[p1, p2, …] - định giá các câu lệnh awk." #: command.y:845 msgid "finish - execute until selected stack frame returns." @@ -1164,14 +1197,14 @@ #: command.y:857 msgid "next [COUNT] - step program, proceeding through subroutine calls." msgstr "" -"next [SỐ_LƯỢNG] - nhảy một chỉ lệnh, nhưng được xử lý thông qua gọi thủ " -"tục con." +"next [SỐ_LƯỢNG] - nhảy một chỉ lệnh, nhưng được xử lý thông qua gọi thủ tục " +"con." #: command.y:859 msgid "" "nexti [COUNT] - step one instruction, but proceed through subroutine calls." msgstr "" -"nexti [SỐ_LƯỢNG] - nhảy từng chỉ lệnh, nhưng được xử lý thông qua gọi thủ " +"nexti [SỐ_LƯỢNG] - nhảy từng chỉ lệnh, nhưng được xử lý thông qua gọi thủ " "tục con." #: command.y:861 @@ -1184,7 +1217,7 @@ #: command.y:865 msgid "printf format, [arg], ... - formatted output." -msgstr "printf format, [arg], ... - kết xuất có định dạng." +msgstr "printf format, [arg], … - kết xuất có định dạng." #: command.y:867 msgid "quit - exit debugger." @@ -1261,40 +1294,48 @@ msgid "watch var - set a watchpoint for a variable." msgstr "watch var - đặt điểm theo dõi cho một biến." -#: command.y:1011 debug.c:401 msg.c:135 +#: command.y:901 +msgid "" +"where [N] - (same as backtrace) print trace of all or N innermost (outermost " +"if N < 0) frames." +msgstr "" +"where [N] - (giống như backtrace) in vết của tất cả hay N khung trong cùng " +"nhất (ngoài cùng nhất nếu N < 0)." + +#: command.y:1013 debug.c:401 msg.c:135 #, c-format msgid "error: " msgstr "lỗi: " -#: command.y:1051 +#: command.y:1053 #, c-format msgid "can't read command (%s)\n" msgstr "không thể đọc lệnh (%s)\n" -#: command.y:1065 +#: command.y:1067 #, c-format msgid "can't read command (%s)" msgstr "không thể đọc lệnh (%s)" -#: command.y:1116 +#: command.y:1118 msgid "invalid character in command" msgstr "ký tự trong câu lệnh không hợp lệ" -#: command.y:1152 +#: command.y:1154 #, c-format msgid "unknown command - \"%.*s\", try help" msgstr "không hiểu lệnh - “%.*s”, hãy gõ lệnh trợ giúp “help”" -#: command.y:1222 +#: command.y:1224 #, c-format msgid "%s" msgstr "%s" -#: command.y:1284 +#: command.y:1286 msgid "invalid character" msgstr "ký tự không hợp lệ" -#: command.y:1455 +#: command.y:1457 #, c-format msgid "undefined command: %s\n" msgstr "lệnh chưa định nghĩa: %s\n" @@ -1574,7 +1615,7 @@ #: debug.c:1974 #, c-format msgid "More stack frames follow ...\n" -msgstr "Nhiều khung ngăn xếp theo sau...\n" +msgstr "Nhiều khung ngăn xếp theo sau …\n" #: debug.c:2017 msgid "invalid frame number" @@ -1718,7 +1759,7 @@ #: debug.c:2975 msgid "The program is running. Exit anyway (y/n)? " -msgstr "Chương trình này đang chạy. Vẫn thoát (c/không)?" +msgstr "Chương trình này đang chạy. Vẫn thoát (c/k)?" #: debug.c:3010 #, c-format @@ -1743,7 +1784,7 @@ #: debug.c:3212 #, c-format msgid "Run till return from " -msgstr "Chạy cho đến khi có trả về từ đó" +msgstr "Chạy cho đến khi có trả về từ " #: debug.c:3255 #, c-format @@ -1778,7 +1819,7 @@ #: debug.c:3466 #, c-format msgid "Stopping in %s ...\n" -msgstr "Dừng trong %s ...\n" +msgstr "Dừng trong %s …\n" #: debug.c:3543 #, c-format @@ -1792,7 +1833,7 @@ #: debug.c:4185 msgid "\t------[Enter] to continue or q [Enter] to quit------" -msgstr "\t-Nhấn [Enter] để tiếp tục hay “q” [Enter] để thoát------" +msgstr "\t------Nhấn [Enter] để tiếp tục hay t [Enter] để thoát------" #: debug.c:4186 msgid "q" @@ -1821,68 +1862,68 @@ msgid "`return' not allowed in current context; statement ignored" msgstr "“return” không được phép trong ngữ cảnh hiện hành; câu lệnh bị bỏ qua" -#: debug.c:5590 +#: debug.c:5604 #, c-format msgid "No symbol `%s' in current context" msgstr "Không có ký hiệu “%s” trong ngữ cảnh hiện thời" -#: dfa.c:1118 dfa.c:1121 dfa.c:1142 dfa.c:1150 dfa.c:1162 dfa.c:1197 -#: dfa.c:1206 dfa.c:1209 dfa.c:1214 dfa.c:1228 dfa.c:1275 +#: dfa.c:1062 dfa.c:1065 dfa.c:1084 dfa.c:1094 dfa.c:1106 dfa.c:1142 +#: dfa.c:1151 dfa.c:1154 dfa.c:1159 dfa.c:1173 dfa.c:1221 msgid "unbalanced [" msgstr "thiếu dấu ngoặc vuông mở [" -#: dfa.c:1174 +#: dfa.c:1118 msgid "invalid character class" msgstr "sai lớp ký tự" -#: dfa.c:1316 +#: dfa.c:1264 msgid "character class syntax is [[:space:]], not [:space:]" msgstr "cú pháp lớp ký tự là [[:dấu_cách:]], không phải [:dấu_cách:]" -#: dfa.c:1366 +#: dfa.c:1326 msgid "unfinished \\ escape" msgstr "chưa kết thúc dãy thoát \\" -#: dfa.c:1513 regcomp.c:161 -msgid "Invalid content of \\{\\}" -msgstr "Nội dung của “\\{\\}” không hợp lệ" - -#: dfa.c:1516 regcomp.c:176 -msgid "Regular expression too big" -msgstr "Biểu thức chính quy quá lớn" +#: dfa.c:1473 +msgid "invalid content of \\{\\}" +msgstr "nội dung của “\\{\\}” không hợp lệ" + +#: dfa.c:1476 +msgid "regular expression too big" +msgstr "biểu thức chính quy quá lớn" -#: dfa.c:1936 +#: dfa.c:1911 msgid "unbalanced (" msgstr "thiếu dấu (" -#: dfa.c:2062 +#: dfa.c:2037 msgid "no syntax specified" msgstr "chưa chỉ rõ cú pháp" -#: dfa.c:2070 +#: dfa.c:2045 msgid "unbalanced )" msgstr "thiếu dấu )" -#: eval.c:394 +#: eval.c:396 #, c-format msgid "unknown nodetype %d" msgstr "không biết kiểu nút %d" -#: eval.c:405 eval.c:419 +#: eval.c:407 eval.c:421 #, c-format msgid "unknown opcode %d" msgstr "gặp opcode (mã thao tác) không rõ %d" -#: eval.c:416 +#: eval.c:418 #, c-format msgid "opcode %s not an operator or keyword" -msgstr "mã lệnh %s không phải là một toán tử hoặc từ khoá" +msgstr "mã lệnh %s không phải là một toán tử hoặc từ khóa" -#: eval.c:472 +#: eval.c:474 msgid "buffer overflow in genflags2str" msgstr "tràn bộ đệm trong “genflags2str” (tạo ra cờ đến chuỗi)" -#: eval.c:675 +#: eval.c:676 #, c-format msgid "" "\n" @@ -1893,217 +1934,217 @@ "\t# Ngăn xếp gọi hàm:\n" "\n" -#: eval.c:704 +#: eval.c:705 msgid "`IGNORECASE' is a gawk extension" msgstr "“IGNORECASE” (bỏ qua chữ HOA/thường) là phần mở rộng gawk" -#: eval.c:736 +#: eval.c:737 msgid "`BINMODE' is a gawk extension" msgstr "“BINMODE” (chế độ nhị phân) là phần mở rộng gawk" -#: eval.c:794 +#: eval.c:795 #, c-format msgid "BINMODE value `%s' is invalid, treated as 3" msgstr "Giá trị BINMODE (chế độ nhị phân) “%s” không hợp lệ nên đã coi là 3" -#: eval.c:885 +#: eval.c:912 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "đặc tả “%sFMT” sai “%s”" -#: eval.c:969 +#: eval.c:996 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "đang tắt “--lint” do việc gán cho “LINT”" -#: eval.c:1147 +#: eval.c:1174 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "gặp tham chiếu đến đối số chưa được khởi tạo “%s”" -#: eval.c:1148 +#: eval.c:1175 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "gặp tham chiếu đến biến chưa được khởi tạo “%s”" -#: eval.c:1166 +#: eval.c:1193 msgid "attempt to field reference from non-numeric value" msgstr "cố gắng tham chiếu trường từ giá trị khác thuộc số" -#: eval.c:1168 +#: eval.c:1195 msgid "attempt to field reference from null string" msgstr "cố gắng tham chiếu trường từ chuỗi trống rỗng" -#: eval.c:1176 +#: eval.c:1203 #, c-format msgid "attempt to access field %ld" msgstr "cố gắng để truy cập trường %ld" -#: eval.c:1185 +#: eval.c:1212 #, c-format msgid "reference to uninitialized field `$%ld'" msgstr "tham chiếu đến trường chưa được khởi tạo “$%ld”" -#: eval.c:1272 +#: eval.c:1299 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "hàm “%s” được gọi với nhiều số đối số hơn số được khai báo" -#: eval.c:1473 +#: eval.c:1506 #, c-format msgid "unwind_stack: unexpected type `%s'" msgstr "unwind_stack: không cần kiểu “%s”" -#: eval.c:1569 +#: eval.c:1602 msgid "division by zero attempted in `/='" msgstr "gặp phép chia cho số không trong “/=”" -#: eval.c:1576 +#: eval.c:1609 #, c-format msgid "division by zero attempted in `%%='" msgstr "gặp phép chia cho số không trong “%%=”" -#: ext.c:89 ext.c:171 +#: ext.c:65 ext.c:147 msgid "extensions are not allowed in sandbox mode" msgstr "phần mở rộng không cho phép ở chế độ khuôn đúc" -#: ext.c:92 +#: ext.c:68 msgid "-l / @load are gawk extensions" msgstr "-l / @load là một phần mở rộng gawk" -#: ext.c:95 +#: ext.c:71 msgid "load_ext: received NULL lib_name" msgstr "load_ext: nhận được NULL lib_name" -#: ext.c:98 +#: ext.c:74 #, c-format msgid "load_ext: cannot open library `%s' (%s)\n" msgstr "load_ext: không thể mở thư viện “%s” (%s)\n" -#: ext.c:104 +#: ext.c:80 #, c-format msgid "" "load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n" msgstr "" "load_ext: thư viện “%s”: chưa định nghĩa “plugin_is_GPL_compatible” (%s)\n" -#: ext.c:110 +#: ext.c:86 #, c-format msgid "load_ext: library `%s': cannot call function `%s' (%s)\n" msgstr "load_ext: thư viện “%s”: không thể gọi hàm “%s” (%s)\n" -#: ext.c:114 +#: ext.c:90 #, c-format msgid "load_ext: library `%s' initialization routine `%s' failed\n" msgstr "load_ext: thư viện “%s” thủ tục khởi tạo “%s” gặp lỗi\n" -#: ext.c:174 +#: ext.c:150 msgid "`extension' is a gawk extension" msgstr "“extension” là một phần mở rộng gawk" -#: ext.c:177 +#: ext.c:153 msgid "extension: received NULL lib_name" -msgstr "extension: nhận được NULL lib_name" +msgstr "extension: nhận được tên_thư_viện NULL" -#: ext.c:180 +#: ext.c:156 #, c-format msgid "extension: cannot open library `%s' (%s)" msgstr "phần mở rộng: không thể mở thư viện “%s” (%s)" -#: ext.c:186 +#: ext.c:162 #, c-format msgid "" "extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)" msgstr "" "phần mở rộng: thư viện “%s”: chưa định nghĩa “plugin_is_GPL_compatible” (%s)" -#: ext.c:190 +#: ext.c:166 #, c-format msgid "extension: library `%s': cannot call function `%s' (%s)" msgstr "phần mở rộng: thư viện “%s”: không thể gọi hàm “%s” (%s)" -#: ext.c:221 +#: ext.c:197 msgid "make_builtin: missing function name" msgstr "make_builtin: thiếu tên hàm" -#: ext.c:236 +#: ext.c:212 #, c-format msgid "make_builtin: can't redefine function `%s'" msgstr "make_builtin: không thể định nghĩa lại hàm “%s”" -#: ext.c:240 +#: ext.c:216 #, c-format msgid "make_builtin: function `%s' already defined" msgstr "make_builtin: hàm “%s” đã được định nghĩa rồi" -#: ext.c:244 +#: ext.c:220 #, c-format msgid "make_builtin: function name `%s' previously defined" msgstr "make_builtin: hàm “%s” đã được định nghĩa trước đây rồi" -#: ext.c:246 +#: ext.c:222 #, c-format msgid "make_builtin: can't use gawk built-in `%s' as function name" msgstr "" "make_builtin: không thể sử dụng “%s” như là một hàm được xây dựng sẵn trong " "gawk" -#: ext.c:249 ext.c:304 +#: ext.c:225 ext.c:280 #, c-format msgid "make_builtin: negative argument count for function `%s'" msgstr "make_builtin: đối số dành cho số đếm bị âm cho hàm “%s”" -#: ext.c:276 +#: ext.c:252 msgid "extension: missing function name" msgstr "extension: (phần mở rộng) tên hàm còn thiếu" -#: ext.c:279 ext.c:283 +#: ext.c:255 ext.c:259 #, c-format msgid "extension: illegal character `%c' in function name `%s'" msgstr "extension: (phần mở rộng) gặp ký tự cấm “%c” nằm trong tên hàm “%s”" -#: ext.c:291 +#: ext.c:267 #, c-format msgid "extension: can't redefine function `%s'" msgstr "extension: (phần mở rộng) không thể định nghĩa lại hàm “%s”" -#: ext.c:295 +#: ext.c:271 #, c-format msgid "extension: function `%s' already defined" msgstr "extension: (phần mở rộng) hàm “%s” đã được định nghĩa" -#: ext.c:299 +#: ext.c:275 #, c-format msgid "extension: function name `%s' previously defined" msgstr "tên hàm “%s” đã được định nghĩa trước đó" -#: ext.c:301 +#: ext.c:277 #, c-format msgid "extension: can't use gawk built-in `%s' as function name" msgstr "" "extension: (phần mở rộng) không thể dùng điều có sẵn của gawk “%s” như là " "tên hàm" -#: ext.c:375 +#: ext.c:351 #, c-format msgid "function `%s' defined to take no more than %d argument(s)" -msgstr "hàm “%s” được định nghĩa để chấp nhấn %d đối số tối đa" +msgstr "hàm “%s” được định nghĩa để chấp nhận tối đa %d đối số" -#: ext.c:378 +#: ext.c:354 #, c-format msgid "function `%s': missing argument #%d" msgstr "hàm “%s”: thiếu đối số #%d" -#: ext.c:395 +#: ext.c:371 #, c-format msgid "function `%s': argument #%d: attempt to use scalar as an array" msgstr "hàm “%s”: đối số thứ %d: cố gắng dùng kiểu vô hướng như là mảng" -#: ext.c:399 +#: ext.c:375 #, c-format msgid "function `%s': argument #%d: attempt to use array as a scalar" msgstr "hàm “%s”: đối số thứ %d: cố gắng dùng mảng như là kiểu vô hướng" -#: ext.c:413 +#: ext.c:389 msgid "dynamic loading of library not supported" msgstr "tải động của thư viện không được hỗ trợ" @@ -2247,7 +2288,7 @@ msgid "inplace_begin: in-place editing already active" msgstr "inplace_begin: sửa in-place đã sẵn được kích hoạt rồi" -#: extension/inplace.c:133 extension/inplace.c:207 +#: extension/inplace.c:133 extension/inplace.c:210 #, c-format msgid "inplace_begin: expects 2 arguments but called with %d" msgstr "inplace_begin: cần 2 đối số như lại được gọi với %d" @@ -2276,55 +2317,55 @@ msgid "inplace_begin: mkstemp(`%s') failed (%s)" msgstr "inplace_begin: mkstemp(“%s”) gặp lỗi (%s)" -#: extension/inplace.c:178 +#: extension/inplace.c:181 #, c-format msgid "inplace_begin: chmod failed (%s)" msgstr "inplace_begin: chmod gặp lỗi (%s)" -#: extension/inplace.c:185 +#: extension/inplace.c:188 #, c-format msgid "inplace_begin: dup(stdout) failed (%s)" msgstr "inplace_begin: dup(stdout) gặp lỗi (%s)" -#: extension/inplace.c:188 +#: extension/inplace.c:191 #, c-format msgid "inplace_begin: dup2(%d, stdout) failed (%s)" msgstr "inplace_begin: dup2(%d, stdout) gặp lỗi (%s)" -#: extension/inplace.c:191 +#: extension/inplace.c:194 #, c-format msgid "inplace_begin: close(%d) failed (%s)" msgstr "inplace_begin: close(%d) gặp lỗi (%s)" -#: extension/inplace.c:210 +#: extension/inplace.c:213 msgid "inplace_end: cannot retrieve 1st argument as a string filename" msgstr "inplace_end: không thể lấy lại đối số thứ nhất như là một tên tập tin" -#: extension/inplace.c:217 +#: extension/inplace.c:220 msgid "inplace_end: in-place editing not active" msgstr "inplace_end: việc sửa in-place không được kích hoạt" -#: extension/inplace.c:223 +#: extension/inplace.c:226 #, c-format msgid "inplace_end: dup2(%d, stdout) failed (%s)" msgstr "inplace_end: dup2(%d, stdout) gặp lỗi (%s)" -#: extension/inplace.c:226 +#: extension/inplace.c:229 #, c-format msgid "inplace_end: close(%d) failed (%s)" msgstr "inplace_end: close(%d) gặp lỗi (%s)" -#: extension/inplace.c:230 +#: extension/inplace.c:233 #, c-format msgid "inplace_end: fsetpos(stdout) failed (%s)" msgstr "inplace_end: fsetpos(stdout) gặp lỗi (%s)" -#: extension/inplace.c:243 +#: extension/inplace.c:246 #, c-format msgid "inplace_end: link(`%s', `%s') failed (%s)" msgstr "inplace_end: link(“%s”, “%s”) gặp lỗi (%s)" -#: extension/inplace.c:253 +#: extension/inplace.c:256 #, c-format msgid "inplace_end: rename(`%s', `%s') failed (%s)" msgstr "inplace_end: rename(“%s”, “%s”) gặp lỗi (%s)" @@ -2366,50 +2407,54 @@ msgid "readfile: called with no arguments" msgstr "readfile: được gọi mà không có đối số" -#: extension/rwarray.c:124 +#: extension/revoutput.c:125 +msgid "revoutput: could not initialize REVOUT variable" +msgstr "revoutput: không thể khởi tạo biến REVOUT" + +#: extension/rwarray.c:124 extension/rwarray0.c:109 msgid "writea: called with too many arguments" msgstr "writea: được gọi với quá nhiều đối số" -#: extension/rwarray.c:131 +#: extension/rwarray.c:131 extension/rwarray0.c:116 #, c-format msgid "do_writea: argument 0 is not a string\n" msgstr "do_writea: đối số 0 không phải là một chuỗi\n" -#: extension/rwarray.c:137 +#: extension/rwarray.c:137 extension/rwarray0.c:122 #, c-format msgid "do_writea: argument 1 is not an array\n" msgstr "do_writea: đối số 1 không phải là một mảng\n" -#: extension/rwarray.c:184 +#: extension/rwarray.c:184 extension/rwarray0.c:169 #, c-format msgid "write_array: could not flatten array\n" msgstr "write_array: không thể làm phẳng mảng\n" -#: extension/rwarray.c:198 +#: extension/rwarray.c:198 extension/rwarray0.c:183 #, c-format msgid "write_array: could not release flattened array\n" msgstr "write_array: không thể giải phóng mảng được làm phẳng\n" -#: extension/rwarray.c:280 +#: extension/rwarray.c:280 extension/rwarray0.c:265 msgid "reada: called with too many arguments" msgstr "reada: được gọi với quá nhiều đối số" -#: extension/rwarray.c:287 +#: extension/rwarray.c:287 extension/rwarray0.c:272 #, c-format msgid "do_reada: argument 0 is not a string\n" msgstr "do_reada: đối số 0 không phải là một chuỗi\n" -#: extension/rwarray.c:293 +#: extension/rwarray.c:293 extension/rwarray0.c:278 #, c-format msgid "do_reada: argument 1 is not an array\n" msgstr "do_reada: đối số 1 không phải là một mảng\n" -#: extension/rwarray.c:337 +#: extension/rwarray.c:337 extension/rwarray0.c:322 #, c-format msgid "do_reada: clear_array failed\n" msgstr "do_reada: clear_array gặp lỗi\n" -#: extension/rwarray.c:374 +#: extension/rwarray.c:374 extension/rwarray0.c:358 #, c-format msgid "read_array: set_array_element failed\n" msgstr "read_array: set_array_element gặp lỗi\n" @@ -2438,93 +2483,93 @@ msgid "sleep: not supported on this platform" msgstr "sleep: không được hỗ trợ trên nền tảng này" -#: field.c:345 +#: field.c:346 msgid "NF set to negative value" msgstr "“NF” được đặt thành giá trị âm" -#: field.c:971 field.c:978 field.c:982 +#: field.c:958 field.c:965 field.c:969 msgid "split: fourth argument is a gawk extension" msgstr "split (chia tách): đối số thứ tư là phần mở rộng gawk" -#: field.c:975 +#: field.c:962 msgid "split: fourth argument is not an array" msgstr "split (chia tách): đối số thứ tư không phải là mảng" -#: field.c:989 +#: field.c:976 msgid "split: second argument is not an array" msgstr "split: (chia tách) đối số thứ hai không phải là mảng" -#: field.c:993 +#: field.c:980 msgid "split: cannot use the same array for second and fourth args" msgstr "" "split (chia tách): không thể sử dụng cùng một mảng có cả đối số thứ hai và " "thứ tư" -#: field.c:998 +#: field.c:985 msgid "split: cannot use a subarray of second arg for fourth arg" msgstr "" "split (phân tách): không thể sử dụng mảng con của tham số thứ hai cho tham " "số thứ tư" -#: field.c:1001 +#: field.c:988 msgid "split: cannot use a subarray of fourth arg for second arg" msgstr "" "split (phân tách): không thể sử dụng mảng con của tham số thứ tư cho tham số " "thứ hai" -#: field.c:1032 +#: field.c:1019 msgid "split: null string for third arg is a gawk extension" msgstr "" "split: (chia tách) chuỗi vô giá trị cho đối số thứ ba là phần mở rộng gawk" -#: field.c:1072 +#: field.c:1059 msgid "patsplit: fourth argument is not an array" msgstr "patsplit: đối số thứ tư không phải là mảng" -#: field.c:1077 +#: field.c:1064 msgid "patsplit: second argument is not an array" msgstr "patsplit: đối số thứ hai không phải là mảng" -#: field.c:1083 +#: field.c:1070 msgid "patsplit: third argument must be non-null" msgstr "patsplit: đối số thứ ba không phải không rỗng" -#: field.c:1087 +#: field.c:1074 msgid "patsplit: cannot use the same array for second and fourth args" msgstr "" "patsplit (chương trình chia tách): không thể sử dụng cùng một mảng cho cả " "hai đối số thứ hai và thứ tư" -#: field.c:1092 +#: field.c:1079 msgid "patsplit: cannot use a subarray of second arg for fourth arg" msgstr "" "patsplit (chương trình phân tách): không thể sử dụng mảng con của tham số " "thứ hai cho tham số thứ tư" -#: field.c:1095 +#: field.c:1082 msgid "patsplit: cannot use a subarray of fourth arg for second arg" msgstr "" "patsplit (chương trình phân tách): không thể sử dụng mảng con của tham số " "thứ tư cho tham số thứ hai" -#: field.c:1133 +#: field.c:1120 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "“FIELDWIDTHS” (độ rộng trường) là phần mở rộng gawk" -#: field.c:1197 +#: field.c:1184 #, c-format msgid "invalid FIELDWIDTHS value, near `%s'" msgstr "giá trị FIELDWIDTHS (độ rộng trường) không hợp lệ, gần “%s”" -#: field.c:1270 +#: field.c:1257 msgid "null string for `FS' is a gawk extension" msgstr "chuỗi vô giá trị cho “FS” là phần mở rộng gawk" -#: field.c:1274 +#: field.c:1261 msgid "old awk does not support regexps as value of `FS'" msgstr "awk cũ không hỗ trợ biểu thức chính quy làm giá trị của “FS”" -#: field.c:1393 +#: field.c:1380 msgid "`FPAT' is a gawk extension" msgstr "“FPAT” là phần mở rộng của gawk" @@ -2540,20 +2585,20 @@ msgid "node_to_awk_value: received null val" msgstr "node_to_awk_value: biến nhận được là null" -#: gawkapi.c:807 +#: gawkapi.c:809 msgid "remove_element: received null array" msgstr "remove_element: mảng nhận được là null" -#: gawkapi.c:810 +#: gawkapi.c:812 msgid "remove_element: received null subscript" msgstr "remove_element: nhận được là null" -#: gawkapi.c:947 +#: gawkapi.c:949 #, c-format msgid "api_flatten_array: could not convert index %d\n" msgstr "api_flatten_array: không thể chuyển đổi chỉ số %d\n" -#: gawkapi.c:952 +#: gawkapi.c:954 #, c-format msgid "api_flatten_array: could not convert value %d\n" msgstr "api_flatten_array: không thể chuyển đổi giá trị %d\n" @@ -2613,313 +2658,295 @@ msgid "%s: option '-W %s' requires an argument\n" msgstr "%s: tùy chọn “-W %s” yêu cầu một đối số\n" -#: io.c:392 +#: io.c:423 #, c-format msgid "command line argument `%s' is a directory: skipped" msgstr "tham số dòng lệnh “%s” là một thư mục: đã bị bỏ qua" -#: io.c:395 io.c:513 +#: io.c:426 io.c:544 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "không mở được tập tin “%s” để đọc (%s)" -#: io.c:640 +#: io.c:671 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "lỗi đóng fd %d (“%s”) (%s)" -#: io.c:716 +#: io.c:749 msgid "redirection not allowed in sandbox mode" msgstr "chuyển hướng không cho phép ở chế độ khuôn đúc" -#: io.c:750 +#: io.c:783 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "biểu thức trong điều chuyển hướng “%s” chỉ có giá trị thuộc số" -#: io.c:756 +#: io.c:789 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "biểu thức cho điều chuyển hướng “%s” có giá trị chuỗi vô giá trị" -#: io.c:761 +#: io.c:794 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "tên tập tin “%s” cho điều chuyển hướng “%s” có lẽ là kết quả của biểu thức " "luận lý" -#: io.c:809 +#: io.c:842 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "không cần hợp “>” và “>>” cho tập tin “%.*s”" -#: io.c:863 +#: io.c:896 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "không thể mở ống dẫn “%s” để xuất (%s)" -#: io.c:873 +#: io.c:906 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "không thể mở ống dẫn “%s” để nhập (%s)" -#: io.c:904 +#: io.c:937 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "không thể mở ống dẫn hai chiều “%s” để nhập/xuất (%s)" -#: io.c:986 +#: io.c:1019 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "không thể chuyển hướng từ “%s” (%s)" -#: io.c:989 +#: io.c:1022 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "không thể chuyển hướng đến “%s” (%s)" -#: io.c:1040 +#: io.c:1073 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "đã tới giới hạn hệ thống về tập tin được mở nên bắt đầu phối hợp nhiều dòng " "điều mô tả tập tin" -#: io.c:1056 +#: io.c:1089 #, c-format msgid "close of `%s' failed (%s)." msgstr "lỗi đóng “%s” (%s)" -#: io.c:1064 +#: io.c:1097 msgid "too many pipes or input files open" msgstr "quá nhiều ống dẫn hay tập tin nhập được mở" -#: io.c:1086 +#: io.c:1119 msgid "close: second argument must be `to' or `from'" msgstr "close: (đóng) đối số thứ hai phải là “to” (đến) hay “from” (từ)" -#: io.c:1103 +#: io.c:1136 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "" "close: (đóng) “%.*s” không phải là tập tin, ống dẫn hay đồng tiến trình đã " "được mở" -#: io.c:1108 +#: io.c:1141 msgid "close of redirection that was never opened" msgstr "đóng một chuyển hướng mà nó chưa từng được mở" -#: io.c:1205 +#: io.c:1238 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: chuyển hướng “%s” không được mở bởi “|&” nên đối số thứ hai bị bỏ qua" -#: io.c:1222 +#: io.c:1255 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "trạng thái thất bại (%d) khi đóng ống dẫn “%s” (%s)" -#: io.c:1225 +#: io.c:1258 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "trạng thái thất bại (%d) khi đóng tập tin “%s” (%s)" -#: io.c:1245 +#: io.c:1278 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "không cung cấp lệnh đóng ổ cắm “%s” rõ ràng" -#: io.c:1248 +#: io.c:1281 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "không cung cấp lệnh đóng đồng tiến trình “%s” rõ ràng" -#: io.c:1251 +#: io.c:1284 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "không cung cấp lệnh đóng đường ống dẫn lệnh “%s” rõ ràng" -#: io.c:1254 +#: io.c:1287 #, c-format msgid "no explicit close of file `%s' provided" msgstr "không cung cấp lệnh đóng tập tin “%s” rõ ràng" -#: io.c:1284 io.c:1342 main.c:864 main.c:906 +#: io.c:1317 io.c:1375 main.c:632 main.c:674 #, c-format msgid "error writing standard output (%s)" msgstr "gặp lỗi khi ghi đầu ra tiêu chuẩn (%s)" -#: io.c:1289 io.c:1348 main.c:866 +#: io.c:1322 io.c:1381 main.c:634 #, c-format msgid "error writing standard error (%s)" msgstr "gặp lỗi khi ghi thiết bị lỗi chuẩn (%s)" -#: io.c:1297 +#: io.c:1330 #, c-format msgid "pipe flush of `%s' failed (%s)." -msgstr "lỗi xoá sạch ống dẫn “%s” (%s)" +msgstr "lỗi xóa sạch ống dẫn “%s” (%s)" -#: io.c:1300 +#: io.c:1333 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." -msgstr "lỗi xoá sạch ống dẫn đồng tiến trình đến “%s” (%s)" +msgstr "lỗi xóa sạch ống dẫn đồng tiến trình đến “%s” (%s)" -#: io.c:1303 +#: io.c:1336 #, c-format msgid "file flush of `%s' failed (%s)." -msgstr "lỗi xoá sạch tập tin “%s” (%s)" +msgstr "lỗi xóa sạch tập tin “%s” (%s)" -#: io.c:1420 +#: io.c:1453 #, c-format msgid "local port %s invalid in `/inet'" msgstr "cổng cục bộ %s không hợp lệ trong “/inet”" -#: io.c:1438 +#: io.c:1471 #, c-format msgid "remote host and port information (%s, %s) invalid" msgstr "thông tin về máy/cổng ở xa (%s, %s) không phải hợp lệ" -#: io.c:1590 -#, c-format -msgid "no (known) protocol supplied in special filename `%s'" -msgstr "trong tên tập tin đặc biệt “%s” không cung cấp giao thức (đã biết) nào" - -#: io.c:1604 -#, c-format -msgid "special file name `%s' is incomplete" -msgstr "tên tập tin đặc biệt “%s” chưa xong" - -#: io.c:1621 -msgid "must supply a remote hostname to `/inet'" -msgstr "phải cung cấp một tên máy chủ cho " - -#: io.c:1639 -msgid "must supply a remote port to `/inet'" -msgstr "phải cung cấp một cổng máy chủ cho " - -#: io.c:1685 +#: io.c:1699 msgid "TCP/IP communications are not supported" msgstr "truyền thông TCP/IP không được hỗ trợ" -#: io.c:1867 +#: io.c:1880 #, c-format msgid "could not open `%s', mode `%s'" msgstr "không mở được “%s”, chế độ “%s”" -#: io.c:1917 +#: io.c:1930 #, c-format msgid "close of master pty failed (%s)" msgstr "gặp lỗi khi đóng thiết bị cuối giả (%s)" -#: io.c:1919 io.c:2105 io.c:2305 +#: io.c:1932 io.c:2118 io.c:2319 #, c-format msgid "close of stdout in child failed (%s)" msgstr "lỗi đóng đầu ra tiêu chuẩn trong tiến trình con (%s)" -#: io.c:1922 +#: io.c:1935 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "gặp lỗi khi di chuyển pty (thiết bị cuối giả) phụ thuộc đến thiết bị đầu ra " "tiêu chuẩn trong con (trùng: %s)" -#: io.c:1924 io.c:2110 +#: io.c:1937 io.c:2123 #, c-format msgid "close of stdin in child failed (%s)" msgstr "lỗi đóng thiết bị nhập chuẩn trong tiến trình con (%s)" -#: io.c:1927 +#: io.c:1940 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "lỗi di chuyển pty (thiết bị cuối giả) phụ tới thiết bị nhập chuẩn trong điều " "con (nhân đôi: %s)" -#: io.c:1929 io.c:1951 +#: io.c:1942 io.c:1964 #, c-format msgid "close of slave pty failed (%s)" msgstr "đóng pty (thiết bị cuối giả) phụ thuộc gặp lỗi (%s)" -#: io.c:2040 io.c:2108 io.c:2276 io.c:2308 +#: io.c:2053 io.c:2121 io.c:2290 io.c:2322 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" "lỗi di chuyển ống dẫn đến thiết bị xuất chuẩn trong tiến trình con (trùng: " "%s)" -#: io.c:2047 io.c:2113 +#: io.c:2060 io.c:2126 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "lỗi di chuyển ống dẫn đến thiết bị nhập chuẩn trong tiến trình con (trùng: " "%s)" -#: io.c:2073 io.c:2298 +#: io.c:2086 io.c:2312 msgid "restoring stdout in parent process failed\n" msgstr "phục hồi đầu ra tiêu chuẩn trong tiến trình mẹ gặp lỗi\n" -#: io.c:2081 +#: io.c:2094 msgid "restoring stdin in parent process failed\n" msgstr "phục hồi đầu vào tiêu chuẩn trong tiến trình mẹ gặp lỗi\n" -#: io.c:2116 io.c:2310 io.c:2324 +#: io.c:2129 io.c:2324 io.c:2339 #, c-format msgid "close of pipe failed (%s)" msgstr "đóng ống dẫn gặp lỗi (%s)" -#: io.c:2174 +#: io.c:2188 msgid "`|&' not supported" msgstr "“|&” không được hỗ trợ" -#: io.c:2261 +#: io.c:2275 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "không thể mở ống dẫn “%s” (%s)" -#: io.c:2318 +#: io.c:2333 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "không thể tạo tiến trình con cho “%s” (fork: %s)" -#: io.c:2790 +#: io.c:2760 msgid "register_input_parser: received NULL pointer" msgstr "register_input_parser: nhận được con trỏ NULL" -#: io.c:2818 +#: io.c:2788 #, c-format msgid "input parser `%s' conflicts with previously installed input parser `%s'" msgstr "" "bộ phân tích đầu vào “%s” xung đột với bộ phân tích đầu vào được cài đặt " "trước đó “%s”" -#: io.c:2825 +#: io.c:2795 #, c-format msgid "input parser `%s' failed to open `%s'" msgstr "bộ phân tích đầu vào “%s” gặp lỗi khi mở “%s”" -#: io.c:2845 +#: io.c:2815 msgid "register_output_wrapper: received NULL pointer" msgstr "register_output_wrapper: nhận được con trỏ NULL" -#: io.c:2873 +#: io.c:2843 #, c-format msgid "" "output wrapper `%s' conflicts with previously installed output wrapper `%s'" msgstr "" "bộ bao kết xuất “%s” xung đột với bộ bao kết xuất được cài đặt trước đó “%s”" -#: io.c:2880 +#: io.c:2850 #, c-format msgid "output wrapper `%s' failed to open `%s'" msgstr "bộ bao kết xuất “%s” gặp lỗi khi mở “%s”" -#: io.c:2901 +#: io.c:2871 msgid "register_output_processor: received NULL pointer" msgstr "register_output_processor: nhận được con trỏ NULL" -#: io.c:2930 +#: io.c:2900 #, c-format msgid "" "two-way processor `%s' conflicts with previously installed two-way processor " @@ -2928,221 +2955,209 @@ "bộ xử lý hai hướng “%s” xung đột với bộ xử lý hai hướng đã được cài đặt " "trước đó “%s”" -#: io.c:2939 +#: io.c:2909 #, c-format msgid "two way processor `%s' failed to open `%s'" msgstr "bộ xử lý hai hướng “%s” gặp lỗi khi mở “%s”" -#: io.c:3064 +#: io.c:3034 #, c-format msgid "data file `%s' is empty" msgstr "tập tin dữ liệu “%s” là rỗng" -#: io.c:3106 io.c:3114 +#: io.c:3076 io.c:3084 msgid "could not allocate more input memory" msgstr "không thể cấp phát bộ nhớ nhập thêm nữa" -#: io.c:3682 +#: io.c:3662 msgid "multicharacter value of `RS' is a gawk extension" msgstr "giá trị đa ký tự của “RS” là phần mở rộng gawk" -#: io.c:3771 +#: io.c:3809 msgid "IPv6 communication is not supported" msgstr "Truyền thông trên IPv6 không được hỗ trợ" -#: main.c:405 -msgid "empty argument to `-e/--source' ignored" -msgstr "đối số rỗng cho tuỳ chọn “-e/--source” bị bỏ qua" - -#: main.c:495 -#, c-format -msgid "%s: option `-W %s' unrecognized, ignored\n" -msgstr "%s: tùy chọn “-W %s” không được nhận diện nên bị bỏ qua\n" - -#: main.c:541 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: tùy chọn cần đến đối số “-- %c”\n" - -#: main.c:562 +#: main.c:321 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "biến môi trường “POSIXLY_CORRECT” (đúng kiểu POSIX) đã được đặt; đang bật " "tùy chọn “--posix”" -#: main.c:568 +#: main.c:327 msgid "`--posix' overrides `--traditional'" msgstr "tùy chọn “--posix” có quyền cao hơn “--traditional” (truyền thống)" -#: main.c:579 +#: main.c:338 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" "“--posix”/“--traditional” (cổ điển) có quyền cao hơn “--non-decimal-" "data” (dữ liệu khác thập phân)" -#: main.c:583 +#: main.c:342 #, c-format msgid "running %s setuid root may be a security problem" msgstr "việc chạy %s với tư cách “setuid root” có thể rủi rỏ bảo mật" -#: main.c:588 +#: main.c:346 msgid "`--posix' overrides `--characters-as-bytes'" msgstr "“--posix” đè lên “--characters-as-bytes”" -#: main.c:647 +#: main.c:404 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "không thể đặt chế độ nhị phân trên đầu vào tiêu chuẩn (%s)" -#: main.c:650 +#: main.c:407 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "không thể đặt chế độ nhị phân trên đầu ra tiêu chuẩn (%s)" -#: main.c:652 +#: main.c:409 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "không thể đặt chế độ nhị phân trên đầu ra lỗi tiêu chuẩn (%s)" -#: main.c:710 +#: main.c:469 msgid "no program text at all!" msgstr "không có đoạn chữ chương trình nào cả!" -#: main.c:799 +#: main.c:563 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Cách dùng: %s [tùy chọn kiểu POSIX hay GNU] -f tập_tin_chương_trình [--] " -"tập_tin ...\n" +"tập_tin …\n" -#: main.c:801 +#: main.c:565 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" -"Cách dùng: %s [tùy chọn kiểu POSIX hay GNU] [--] %cchương_trình%c " -"tập_tin ...\n" +"Cách dùng: %s [tùy chọn kiểu POSIX hay GNU] [--] %cchương_trình%c tập_tin …\n" -#: main.c:806 +#: main.c:570 msgid "POSIX options:\t\tGNU long options: (standard)\n" msgstr "Tùy chọn POSIX:\t\t\tTùy chọn dài GNU: (tiêu chuẩn)\n" -#: main.c:807 +#: main.c:571 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f tập_tin_chương_trình\t--file=tập_tin_chương_trình\n" -#: main.c:808 +#: main.c:572 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=ký_hiệu_phân_cách_trường\n" -#: main.c:809 +#: main.c:573 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "" "\t-v var=giá_trị\t\t--assign=biến=giá_trị\n" "(assign: gán)\n" -#: main.c:810 +#: main.c:574 msgid "Short options:\t\tGNU long options: (extensions)\n" -msgstr "Tuỳ chọn ngắn:\t\t\tTuỳ chọn GNU dạng dài: (mở rộng)\n" +msgstr "Tùy chọn ngắn:\t\t\tTùy chọn GNU dạng dài: (mở rộng)\n" -#: main.c:811 +#: main.c:575 msgid "\t-b\t\t\t--characters-as-bytes\n" msgstr "\t-b\t\t\t--characters-as-bytes\n" -#: main.c:812 +#: main.c:576 msgid "\t-c\t\t\t--traditional\n" msgstr "\t-c\t\t\t--traditional\n" -#: main.c:813 +#: main.c:577 msgid "\t-C\t\t\t--copyright\n" msgstr "\t-C\t\t\t--copyright\n" -#: main.c:814 +#: main.c:578 msgid "\t-d[file]\t\t--dump-variables[=file]\n" msgstr "\t-d[tập_tin]\t\t--dump-variables[=tập_tin]\n" -#: main.c:815 +#: main.c:579 msgid "\t-D[file]\t\t--debug[=file]\n" msgstr "\t-D[tập_tin]\t\t--debug[=tập_tin]\n" -#: main.c:816 +#: main.c:580 msgid "\t-e 'program-text'\t--source='program-text'\n" msgstr "\t-e “program-text”\t--source=“program-text”\n" -#: main.c:817 +#: main.c:581 msgid "\t-E file\t\t\t--exec=file\n" msgstr "\t-E file\t\t\t--exec=tập_tin\n" -#: main.c:818 +#: main.c:582 msgid "\t-g\t\t\t--gen-pot\n" msgstr "\t-g\t\t\t--gen-pot\n" -#: main.c:819 +#: main.c:583 msgid "\t-h\t\t\t--help\n" msgstr "\t-h\t\t\t--help\n" -#: main.c:820 +#: main.c:584 msgid "\t-i includefile\t\t--include=includefile\n" msgstr "\t-i includefile\t\t--include=tập-tin-bao-gồm\n" -#: main.c:821 +#: main.c:585 msgid "\t-l library\t\t--load=library\n" msgstr "\t-l library\t\t--load=thư-viện\n" -#: main.c:822 -msgid "\t-L [fatal]\t\t--lint[=fatal]\n" -msgstr "\t-L [fatal]\t\t--lint[=fatal]\n" - -#: main.c:823 -msgid "\t-n\t\t\t--non-decimal-data\n" -msgstr "\t-n\t\t\t--non-decimal-data\n" +#. TRANSLATORS: the "fatal" and "invalid" here are literal +#. values, they should not be translated. Thanks. +#. +#: main.c:590 +msgid "\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n" +msgstr "\t-L [fatal|invalid]\t--lint[=fatal|invalid]\n" -#: main.c:824 +#: main.c:591 msgid "\t-M\t\t\t--bignum\n" msgstr "\t-M\t\t\t--bignum\n" -#: main.c:825 +#: main.c:592 msgid "\t-N\t\t\t--use-lc-numeric\n" msgstr "\t-N\t\t\t--use-lc-numeric\n" -#: main.c:826 +#: main.c:593 +msgid "\t-n\t\t\t--non-decimal-data\n" +msgstr "\t-n\t\t\t--non-decimal-data\n" + +#: main.c:594 msgid "\t-o[file]\t\t--pretty-print[=file]\n" msgstr "\t-o[tập_tin]\t\t--pretty-print[=tập_tin]\n" -#: main.c:827 +#: main.c:595 msgid "\t-O\t\t\t--optimize\n" -msgstr "\t-O\t\t\t--optimize (tạm dịch: tối_ưu_hoá)\n" +msgstr "\t-O\t\t\t--optimize (tối_ưu_hóa)\n" -#: main.c:828 +#: main.c:596 msgid "\t-p[file]\t\t--profile[=file]\n" msgstr "\t-p[tập_tin]\t\t--profile[=tập_tin]\n" -#: main.c:829 +#: main.c:597 msgid "\t-P\t\t\t--posix\n" msgstr "\t-P\t\t\t--posix\n" -#: main.c:830 +#: main.c:598 msgid "\t-r\t\t\t--re-interval\n" msgstr "\t-r\t\t\t--re-interval\n" -#: main.c:831 +#: main.c:599 msgid "\t-S\t\t\t--sandbox\n" msgstr "\t-S\t\t\t--sandbox\n" -#: main.c:832 +#: main.c:600 msgid "\t-t\t\t\t--lint-old\n" msgstr "\t-t\t\t\t--lint-old\n" -#: main.c:833 +#: main.c:601 msgid "\t-V\t\t\t--version\n" msgstr "\t-V\t\t\t--version\n" -#: main.c:835 +#: main.c:603 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "" "\t-W nostalgia\t\t--nostalgia\n" "(nỗi luyến tiếc quá khứ)\n" -#: main.c:838 +#: main.c:606 msgid "\t-Y\t\t--parsedebug\n" msgstr "\t-Y\t\t--parsedebug\n" @@ -3151,7 +3166,7 @@ #. for this application. Please add _another line_ with the #. address for translation bugs. #. no-wrap -#: main.c:847 +#: main.c:615 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -3159,14 +3174,13 @@ "\n" msgstr "" "\n" -"Để thông báo lỗi, xem nút “Bugs” (lỗi) trong tập tin\n" -"thông tin “gawk.info”, cái mà nằm trong phần\n" -"“Reporting Problems and Bugs” (thông báo trục trặc và lỗi)\n" -"trong bản in.\n" +"Để thông báo lỗi, xem nút “Bugs” (lỗi) trong tập tin thông tin\n" +"“gawk.info”, cái mà nằm trong phần “Reporting Problems and Bugs”\n" +"(thông báo trục trặc và lỗi) trong bản in.\n" "Thông báo lỗi dịch cho: .\n" "\n" -#: main.c:851 +#: main.c:619 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -3176,17 +3190,17 @@ "Mặc định, nó đọc từ đầu vào tiêu chuẩn và ghi ra đầu ra tiêu chuẩn.\n" "\n" -#: main.c:855 +#: main.c:623 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" msgstr "" "Ví dụ:\n" -"\tgawk \"{ sum += $1 }; END { print sum }\" file\n" +"\tgawk \"{ sum += $1 }; END { print sum }\" tập_tin\n" "\tgawk -F: \"{ print $1 }\" /etc/passwd\n" -#: main.c:880 +#: main.c:648 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -3205,7 +3219,7 @@ "của Giấy Phép này, hoặc là (tùy chọn) bất kỳ phiên bản mới hơn.\n" "\n" -#: main.c:888 +#: main.c:656 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -3219,7 +3233,7 @@ "Hãy xem Giấy phép Công Chung GNU (GPL) để biết chi tiết.\n" "\n" -#: main.c:894 +#: main.c:662 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" @@ -3227,16 +3241,16 @@ "Bạn nên nhận một bản sao của Giấy Phép Công Cộng GNU cùng với chương\n" "trình này. Nếu chưa có, bạn xem tại .\n" -#: main.c:931 +#: main.c:699 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft không đặt FS (hệ thống tập tin?) vào tab trong awk POSIX" -#: main.c:1208 +#: main.c:986 #, c-format msgid "unknown value for field spec: %d\n" msgstr "không hiểu giá trị dành cho đặc tả trường: %d\n" -#: main.c:1306 +#: main.c:1084 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -3245,98 +3259,116 @@ "%s: đối số “%s” cho “-v” không có dạng “biến=giá_trị”\n" "\n" -#: main.c:1332 +#: main.c:1110 #, c-format msgid "`%s' is not a legal variable name" msgstr "“%s” không phải là tên biến hợp lệ" -#: main.c:1335 +#: main.c:1113 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "“%s” không phải là tên biến; đang tìm tập tin “%s=%s”" -#: main.c:1339 +#: main.c:1117 #, c-format msgid "cannot use gawk builtin `%s' as variable name" msgstr "không thể dùng builtin (dựng sẵn) của gawk “%s” như là tên biến" -#: main.c:1344 +#: main.c:1122 #, c-format msgid "cannot use function `%s' as variable name" msgstr "không thể dùng hàm “%s” như là tên biến" -#: main.c:1397 +#: main.c:1175 msgid "floating point exception" msgstr "ngoại lệ số thực dấu chấm động" -#: main.c:1404 +#: main.c:1182 msgid "fatal error: internal error" msgstr "lỗi nghiêm trọng: lỗi nội bộ" -#: main.c:1419 +#: main.c:1197 msgid "fatal error: internal error: segfault" msgstr "lỗi nghiêm trọng: lỗi nội bộ: lỗi phân đoạn" -#: main.c:1431 +#: main.c:1209 msgid "fatal error: internal error: stack overflow" msgstr "lỗi nghiêm trọng: lỗi nội bộ: tràn ngăn xếp" -#: main.c:1490 +#: main.c:1268 #, c-format msgid "no pre-opened fd %d" msgstr "không có fd (bộ mô tả tập tin) %d đã mở trước" -#: main.c:1497 +#: main.c:1275 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "không thể mở trước “/dev/null” cho fd %d" -#: mpfr.c:550 +#: main.c:1489 +msgid "empty argument to `-e/--source' ignored" +msgstr "đối số rỗng cho tùy chọn “-e/--source” bị bỏ qua" + +#: main.c:1560 +msgid "-M ignored: MPFR/GMP support not compiled in" +msgstr "-M bị bỏ qua: chưa biên dịch phần hỗ trợ MPFR/GMP" + +#: main.c:1581 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: tùy chọn “-W %s” không được nhận diện nên bị bỏ qua\n" + +#: main.c:1634 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: tùy chọn cần đến đối số “-- %c”\n" + +#: mpfr.c:557 #, c-format msgid "PREC value `%.*s' is invalid" msgstr "giá trị PREC “%.*s” là không hợp lệ" -#: mpfr.c:608 +#: mpfr.c:615 #, c-format msgid "RNDMODE value `%.*s' is invalid" msgstr "giá trị RNDMODE “%.*s” là không hợp lệ" -#: mpfr.c:698 +#: mpfr.c:711 #, c-format msgid "%s: received non-numeric argument" msgstr "%s: đã nhận đối số không phải thuộc số" -#: mpfr.c:800 +#: mpfr.c:820 msgid "compl(%Rg): negative value will give strange results" msgstr "compl(%Rg): giá trị âm sẽ gây ra kết quả không như mong muốn" -#: mpfr.c:804 +#: mpfr.c:824 msgid "comp(%Rg): fractional value will be truncated" msgstr "compl(%Rg): giá trị thuộc phân số sẽ bị cắt ngắn" -#: mpfr.c:816 +#: mpfr.c:836 #, c-format msgid "cmpl(%Zd): negative values will give strange results" msgstr "cmpl(%Zd): giá trị âm sẽ gây ra kết quả không như mong muốn" -#: mpfr.c:835 +#: mpfr.c:855 #, c-format msgid "%s: received non-numeric argument #%d" msgstr "%s: đã nhận đối số không phải thuộc số #%d" -#: mpfr.c:845 +#: mpfr.c:865 msgid "%s: argument #%d has invalid value %Rg, using 0" msgstr "%s: đối số #%d có giá trị không hợp lệ %Rg, dùng 0" -#: mpfr.c:857 +#: mpfr.c:877 msgid "%s: argument #%d negative value %Rg will give strange results" msgstr "%s: đối số #%d giá trị âm %Rg sẽ gây ra kết quả không như mong muốn" -#: mpfr.c:863 +#: mpfr.c:883 msgid "%s: argument #%d fractional value %Rg will be truncated" msgstr "%s: đối số #%d giá trị phần phân số %Rg sẽ bị cắt cụt" -#: mpfr.c:878 +#: mpfr.c:898 #, c-format msgid "%s: argument #%d negative value %Zd will give strange results" msgstr "%s: đối số #%d có giá trị âm %Zd sẽ đưa ra kết quả không như mong muốn" @@ -3346,24 +3378,24 @@ msgid "cmd. line:" msgstr "dòng lệnh:" -#: node.c:421 +#: node.c:418 msgid "backslash at end of string" msgstr "gặp dấu gạch ngược tại kết thúc của chuỗi" -#: node.c:500 +#: node.c:497 #, c-format msgid "old awk does not support the `\\%c' escape sequence" -msgstr "awk cũ không hỗ trợ thoát chuỗi “\\%c”" +msgstr "awk cũ không hỗ trợ thoát chuỗi “\\%c”" -#: node.c:551 +#: node.c:548 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX không cho phép thoát chuỗi “\\x”" -#: node.c:557 +#: node.c:554 msgid "no hex digits in `\\x' escape sequence" msgstr "không có số thập lúc nằm trong thoát chuỗi “\\x”" -#: node.c:579 +#: node.c:576 #, c-format msgid "" "hex escape \\x%.*s of %d characters probably not interpreted the way you " @@ -3372,17 +3404,17 @@ "thoát chuỗi thập lục \\x%.*s chứa %d ký tự mà rất có thể không phải được đọc " "bằng cách dự định" -#: node.c:594 +#: node.c:591 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "thoát chuỗi “\\%c” được xử lý như là “%c” chuẩn" -#: node.c:739 +#: node.c:735 msgid "" "Invalid multibyte data detected. There may be a mismatch between your data " "and your locale." msgstr "" -"Dữ liệu dạng đa byte (multibyte) không hợp lệ được tìm thấy. Tại đó có lẽ " +"Dữ liệu dạng đa byte (multibyte) không hợp lệ được tìm thấy. Tại đó có lẽ " "không khớp giữa dữ liệu của bạn và nơi xảy ra." #: posix/gawkmisc.c:177 @@ -3397,25 +3429,25 @@ "%s %s “%s”: không thể đặt “close-on-exec” (đóng một khi thực hiện): (fcntl " "F_SETFD: %s)" -#: profile.c:71 +#: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" msgstr "không thể mở “%s” để ghi: %s" -#: profile.c:73 +#: profile.c:93 msgid "sending profile to standard error" -msgstr "đang gởi hồ sơ cho thiết bị lỗi chuẩn" +msgstr "đang gửi hồ sơ cho thiết bị lỗi chuẩn" -#: profile.c:193 +#: profile.c:213 #, c-format msgid "" -"\t# %s block(s)\n" +"\t# %s rule(s)\n" "\n" msgstr "" -"\t# %s khối\n" +"\t# Quy tắc %s\n" "\n" -#: profile.c:198 +#: profile.c:218 #, c-format msgid "" "\t# Rule(s)\n" @@ -3424,16 +3456,16 @@ "\t# Quy tắc\n" "\n" -#: profile.c:272 +#: profile.c:292 #, c-format msgid "internal error: %s with null vname" msgstr "lỗi nội bộ: %s với vname (tên biến?) vô giá trị" -#: profile.c:537 +#: profile.c:558 msgid "internal error: builtin with null fname" msgstr "lỗi nội bộ: phần dựng sẵn với fname là null" -#: profile.c:949 +#: profile.c:978 #, c-format msgid "" "\t# Loaded extensions (-l and/or @load)\n" @@ -3442,12 +3474,12 @@ "\t# Các phần mở rộng được tải (-l và/hoặc @load)\n" "\n" -#: profile.c:972 +#: profile.c:1001 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# hồ sơ gawk, được tạo %s\n" -#: profile.c:1475 +#: profile.c:1555 #, c-format msgid "" "\n" @@ -3456,7 +3488,7 @@ "\n" "\t# Danh sách các hàm theo thứ tự abc\n" -#: profile.c:1513 +#: profile.c:1593 #, c-format msgid "redir2str: unknown redirection type %d" msgstr "redir2str: không hiểu kiểu chuyển hướng %d" @@ -3468,80 +3500,113 @@ "thành phần của biểu thức chính qui (regexp) “%.*s” gần như chắc chắn nên là " "“[%.*s]”" -#: regcomp.c:131 +#: regcomp.c:139 msgid "Success" msgstr "Thành công" -#: regcomp.c:134 +#: regcomp.c:142 msgid "No match" msgstr "Không khớp" -#: regcomp.c:137 +#: regcomp.c:145 msgid "Invalid regular expression" msgstr "Biểu thức chính quy không hợp lệ" -#: regcomp.c:140 +#: regcomp.c:148 msgid "Invalid collation character" msgstr "Ký tự đối chiếu không hợp lệ" -#: regcomp.c:143 +#: regcomp.c:151 msgid "Invalid character class name" msgstr "Tên hạng ký tự không hợp lệ" -#: regcomp.c:146 +#: regcomp.c:154 msgid "Trailing backslash" msgstr "Gặp dấu gạch ngược thừa" -#: regcomp.c:149 +#: regcomp.c:157 msgid "Invalid back reference" msgstr "Tham chiếu ngược không hợp lệ" -#: regcomp.c:152 -msgid "Unmatched [ or [^" -msgstr "Chưa khớp “[” hay “[^”" +#: regcomp.c:160 +msgid "Unmatched [, [^, [:, [., or [=" +msgstr "Chưa khớp [, [^, [:, [., hay [=" -#: regcomp.c:155 +#: regcomp.c:163 msgid "Unmatched ( or \\(" msgstr "Chưa khớp “(” hay “\\(”" -#: regcomp.c:158 +#: regcomp.c:166 msgid "Unmatched \\{" msgstr "Chưa khớp “\\{”" -#: regcomp.c:164 +#: regcomp.c:169 +msgid "Invalid content of \\{\\}" +msgstr "Nội dung của “\\{\\}” không hợp lệ" + +#: regcomp.c:172 msgid "Invalid range end" msgstr "Kết thúc phạm vi không hợp lệ" -#: regcomp.c:167 +#: regcomp.c:175 msgid "Memory exhausted" msgstr "Hết bộ nhớ" -#: regcomp.c:170 +#: regcomp.c:178 msgid "Invalid preceding regular expression" msgstr "Biểu thức chính quy nằm trước không hợp lệ" -#: regcomp.c:173 +#: regcomp.c:181 msgid "Premature end of regular expression" msgstr "Kết thúc quá sớm của biểu thức chính quy" -#: regcomp.c:179 +#: regcomp.c:184 +msgid "Regular expression too big" +msgstr "Biểu thức chính quy quá lớn" + +#: regcomp.c:187 msgid "Unmatched ) or \\)" msgstr "Chưa khớp “)” hoặc “\\)”" -#: regcomp.c:704 +#: regcomp.c:712 msgid "No previous regular expression" msgstr "Không có biểu thức chính quy nằm trước" -#: symbol.c:741 +#: symbol.c:677 +#, c-format +msgid "function `%s': can't use function `%s' as a parameter name" +msgstr "hàm “%s”: không thể dùng hàm “%s” như là tên tham số" + +#: symbol.c:809 msgid "can not pop main context" msgstr "không thể pop (lấy ra) ngữ cảnh chính" +#~ msgid "`getline var' invalid inside `%s' rule" +#~ msgstr "“getline var” không hợp lệ bên trong quy tắc “%s”" + +#~ msgid "no (known) protocol supplied in special filename `%s'" +#~ msgstr "" +#~ "trong tên tập tin đặc biệt “%s” không cung cấp giao thức (đã biết) nào" + +#~ msgid "special file name `%s' is incomplete" +#~ msgstr "tên tập tin đặc biệt “%s” chưa xong" + +#~ msgid "must supply a remote hostname to `/inet'" +#~ msgstr "phải cung cấp một tên máy chủ cho " + +#~ msgid "must supply a remote port to `/inet'" +#~ msgstr "phải cung cấp một cổng máy chủ cho " + +#~ msgid "" +#~ "\t# %s block(s)\n" +#~ "\n" +#~ msgstr "" +#~ "\t# %s khối\n" +#~ "\n" + #~ msgid "range of the form `[%c-%c]' is locale dependent" #~ msgstr "vùng của dạng thức “[%c-%c]” phụ thuộc vào vị trí" -#~ msgid "attempt to use function `%s' as an array" -#~ msgstr "cố gắng dùng hàm “%s” như mảng" - #~ msgid "reference to uninitialized element `%s[\"%.*s\"]'" #~ msgstr "tham chiếu đến phần tử chưa khởi tạo “%s[”%.*s”]”" @@ -3564,7 +3629,7 @@ #~ msgstr "“nextfile” (tập tin kế tiếp) là một phần mở rộng gawk" #~ msgid "`delete array' is a gawk extension" -#~ msgstr "“delete array” (xoá mảng) là một phần mở rộng gawk" +#~ msgstr "“delete array” (xóa mảng) là một phần mở rộng gawk" #~ msgid "use of non-array as array" #~ msgstr "việc dùng cái khác mảng như là mảng" diff -urN gawk-4.1.1/posix/ChangeLog gawk-4.1.2/posix/ChangeLog --- gawk-4.1.1/posix/ChangeLog 2014-04-08 20:35:43.000000000 +0300 +++ gawk-4.1.2/posix/ChangeLog 2015-04-29 08:53:16.000000000 +0300 @@ -1,3 +1,7 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff -urN gawk-4.1.1/profile.c gawk-4.1.2/profile.c --- gawk-4.1.1/profile.c 2014-02-27 05:37:57.000000000 +0200 +++ gawk-4.1.2/profile.c 2015-04-28 16:49:46.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1999-2013 the Free Software Foundation, Inc. + * Copyright (C) 1999-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -65,9 +65,29 @@ void set_prof_file(const char *file) { + int fd; + assert(file != NULL); - prof_fp = fopen(file, "w"); + fd = devopen_simple(file, "w", true); + if (fd == INVALID_HANDLE) + prof_fp = NULL; + else if (fd == fileno(stdout)) + prof_fp = stdout; + else if (fd == fileno(stderr)) + prof_fp = stderr; + else + prof_fp = fdopen(fd, "w"); + if (prof_fp == NULL) { + /* don't leak file descriptors */ + int e = errno; + + if ( fd != INVALID_HANDLE + && fd != fileno(stdout) + && fd != fileno(stderr)) + (void) close(fd); + + errno = e; warning(_("could not open `%s' for writing: %s"), file, strerror(errno)); warning(_("sending profile to standard error")); @@ -190,7 +210,7 @@ if (rule != Rule) { if (! rule_count[rule]++) - fprintf(prof_fp, _("\t# %s block(s)\n\n"), ruletab[rule]); + fprintf(prof_fp, _("\t# %s rule(s)\n\n"), ruletab[rule]); fprintf(prof_fp, "\t%s {\n", ruletab[rule]); ip = (pc + 1)->firsti; } else { @@ -395,7 +415,8 @@ case Op_unary_minus: case Op_not: t1 = pp_pop(); - if (is_binary(t1->type)) + if (is_binary(t1->type) + || (((OPCODE) t1->type) == pc->opcode && pc->opcode == Op_unary_minus)) pp_parenthesize(t1); /* optypes table (eval.c) includes space after ! */ @@ -731,20 +752,28 @@ ip = pc + 1; indent(ip->forloop_body->exec_count); fprintf(prof_fp, "%s (", op2str(pc->opcode)); - pprint(pc->nexti, ip->forloop_cond, true); - fprintf(prof_fp, "; "); - if (ip->forloop_cond->opcode == Op_no_op && - ip->forloop_cond->nexti == ip->forloop_body) + /* If empty for looop header, print it a little more nicely. */ + if ( pc->nexti->opcode == Op_no_op + && ip->forloop_cond == pc->nexti + && pc->target_continue->opcode == Op_jmp) { + fprintf(prof_fp, ";;"); + } else { + pprint(pc->nexti, ip->forloop_cond, true); fprintf(prof_fp, "; "); - else { - pprint(ip->forloop_cond, ip->forloop_body, true); - t1 = pp_pop(); - fprintf(prof_fp, "%s; ", t1->pp_str); - pp_free(t1); - } - pprint(pc->target_continue, pc->target_break, true); + if (ip->forloop_cond->opcode == Op_no_op && + ip->forloop_cond->nexti == ip->forloop_body) + fprintf(prof_fp, "; "); + else { + pprint(ip->forloop_cond, ip->forloop_body, true); + t1 = pp_pop(); + fprintf(prof_fp, "%s; ", t1->pp_str); + pp_free(t1); + } + + pprint(pc->target_continue, pc->target_break, true); + } fprintf(prof_fp, ") {\n"); indent_in(); pprint(ip->forloop_body->nexti, pc->target_continue, false); @@ -901,11 +930,11 @@ slen = strlen(str); for (count = 0; slen > 0; slen--, str++) { + print_func(fp, "%c", *str); if (++count >= BREAKPOINT && breaklines) { print_func(fp, "%c\n%c", delim, delim); count = 0; - } else - print_func(fp, "%c", *str); + } } efree(s); } @@ -992,25 +1021,25 @@ case Op_func_call: case Op_K_delete_loop: case Op_builtin: - return 15; + return 16; case Op_field_spec: case Op_field_spec_lhs: - return 14; - - case Op_exp: - case Op_exp_i: - return 13; + return 15; case Op_preincrement: case Op_predecrement: case Op_postincrement: case Op_postdecrement: - return 12; + return 14; + + case Op_exp: + case Op_exp_i: + return 13; case Op_unary_minus: case Op_not: - return 11; + return 12; case Op_times: case Op_times_i: @@ -1018,23 +1047,26 @@ case Op_quotient_i: case Op_mod: case Op_mod_i: - return 10; + return 11; case Op_plus: case Op_plus_i: case Op_minus: case Op_minus_i: - return 9; + return 10; case Op_concat: case Op_assign_concat: - return 8; + return 9; case Op_equal: case Op_notequal: case Op_greater: + case Op_less: case Op_leq: case Op_geq: + return 8; + case Op_match: case Op_nomatch: return 7; @@ -1043,7 +1075,6 @@ case Op_K_getline_redir: return 6; - case Op_less: case Op_in_array: return 5; @@ -1169,6 +1200,26 @@ sp->flags |= CAN_FREE; } +/* div_on_left_mul_on_right --- have / or % on left and * on right */ + +static bool +div_on_left_mul_on_right(int o1, int o2) +{ + OPCODE op1 = (OPCODE) o1; + OPCODE op2 = (OPCODE) o2; + + switch (op1) { + case Op_quotient: + case Op_quotient_i: + case Op_mod: + case Op_mod_i: + return (op2 == Op_times || op2 == Op_times_i); + + default: + return false; + } +} + /* parenthesize --- parenthesize two nodes relative to parent node type */ static void @@ -1178,9 +1229,11 @@ int lprec = prec_level(left->type); int prec = prec_level(type); - if (lprec < prec) + if (lprec < prec + || (lprec == prec && div_on_left_mul_on_right(left->type, type))) pp_parenthesize(left); - if (rprec < prec) + if (rprec < prec + || (rprec == prec && div_on_left_mul_on_right(type, right->type))) pp_parenthesize(right); } @@ -1271,16 +1324,30 @@ { #define PP_PRECISION 6 char *str; + size_t count; - emalloc(str, char *, PP_PRECISION + 10, "pp_number"); #ifdef HAVE_MPFR - if (is_mpg_float(n)) - mpfr_sprintf(str, "%0.*R*g", PP_PRECISION, ROUND_MODE, n->mpg_numbr); - else if (is_mpg_integer(n)) + if (is_mpg_float(n)) { + count = mpfr_get_prec(n->mpg_numbr) / 3; /* ~ 3.22 binary digits per decimal digit */ + emalloc(str, char *, count, "pp_number"); + /* + * 3/2015: Format string used to be "%0.*R*g". That padded + * with leading zeros. But it doesn't do that for regular + * numbers in the non-MPFR case. + */ + mpfr_sprintf(str, "%.*R*g", PP_PRECISION, ROUND_MODE, n->mpg_numbr); + } else if (is_mpg_integer(n)) { + count = mpz_sizeinbase(n->mpg_i, 10) + 2; /* +1 for sign, +1 for NUL at end */ + emalloc(str, char *, count, "pp_number"); mpfr_sprintf(str, "%Zd", n->mpg_i); - else + } else #endif - sprintf(str, "%0.*g", PP_PRECISION, n->numbr); + { + count = PP_PRECISION + 10; + emalloc(str, char *, count, "pp_number"); + sprintf(str, "%0.*g", PP_PRECISION, n->numbr); + } + return str; #undef PP_PRECISION } @@ -1352,6 +1419,14 @@ return str; } +/* is_unary_minus --- return true if string starts with unary minus */ + +static bool +is_unary_minus(const char *str) +{ + return str[0] == '-' && str[1] != '-'; +} + /* pp_concat --- handle concatenation and correct parenthesizing of expressions */ static char * @@ -1393,7 +1468,12 @@ pl_l = prec_level(pp_args[i]->type); pl_r = prec_level(pp_args[i+1]->type); - if (is_scalar(pp_args[i]->type) && is_scalar(pp_args[i+1]->type)) { + if (i >= 2 && is_unary_minus(r->pp_str)) { + *s++ = '('; + memcpy(s, r->pp_str, r->pp_len); + s += r->pp_len; + *s++ = ')'; + } else if (is_scalar(pp_args[i]->type) && is_scalar(pp_args[i+1]->type)) { memcpy(s, r->pp_str, r->pp_len); s += r->pp_len; } else if (pl_l <= pl_r || is_scalar(pp_args[i+1]->type)) { @@ -1415,7 +1495,7 @@ pl_l = prec_level(pp_args[nargs-1]->type); pl_r = prec_level(pp_args[nargs]->type); r = pp_args[nargs]; - if (pl_l >= pl_r && ! is_scalar(pp_args[nargs]->type)) { + if (is_unary_minus(r->pp_str) || ((pl_l >= pl_r && ! is_scalar(pp_args[nargs]->type)))) { *s++ = '('; memcpy(s, r->pp_str, r->pp_len); s += r->pp_len; diff -urN gawk-4.1.1/re.c gawk-4.1.2/re.c --- gawk-4.1.1/re.c 2014-02-21 13:43:55.000000000 +0200 +++ gawk-4.1.2/re.c 2015-04-28 16:49:46.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1991-2013 the Free Software Foundation, Inc. + * Copyright (C) 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -54,12 +54,9 @@ * It is 0, when the current character is a singlebyte character. */ size_t is_multibyte = 0; -#if MBS_SUPPORT mbstate_t mbs; - if (gawk_mb_cur_max > 1) - memset(&mbs, 0, sizeof(mbstate_t)); /* Initialize. */ -#endif + memset(&mbs, 0, sizeof(mbstate_t)); /* Initialize. */ if (first) { first = false; @@ -87,7 +84,6 @@ dest = buf; while (src < end) { -#if MBS_SUPPORT if (gawk_mb_cur_max > 1 && ! is_multibyte) { /* The previous byte is a singlebyte character, or last byte of a multibyte character. We check the next character. */ @@ -100,7 +96,6 @@ is_multibyte = 0; } } -#endif /* We skip multibyte character, since it must not be a special character. */ @@ -284,13 +279,18 @@ if (rp->dfa && ! no_bol && ! need_start) { char save; size_t count = 0; + struct dfa *superset = dfasuperset(rp->dfareg); /* * dfa likes to stick a '\n' right after the matched * text. So we just save and restore the character. */ save = str[start+len]; - ret = dfaexec(rp->dfareg, str+start, str+start+len, true, - &count, &try_backref); + if (superset) + ret = dfaexec(superset, str+start, str+start+len, + true, NULL, NULL); + if (ret) + ret = dfaexec(rp->dfareg, str+start, str+start+len, + true, &count, &try_backref); str[start+len] = save; } @@ -616,40 +616,3 @@ done: s[length] = save; } - -/* regexflags2str --- make regex flags printable */ - -const char * -regexflags2str(int flags) -{ - static const struct flagtab regextab[] = { - { RE_BACKSLASH_ESCAPE_IN_LISTS, "RE_BACKSLASH_ESCAPE_IN_LISTS" }, - { RE_BK_PLUS_QM, "RE_BK_PLUS_QM" }, - { RE_CHAR_CLASSES, "RE_CHAR_CLASSES" }, - { RE_CONTEXT_INDEP_ANCHORS, "RE_CONTEXT_INDEP_ANCHORS" }, - { RE_CONTEXT_INDEP_OPS, "RE_CONTEXT_INDEP_OPS" }, - { RE_CONTEXT_INVALID_OPS, "RE_CONTEXT_INVALID_OPS" }, - { RE_DOT_NEWLINE, "RE_DOT_NEWLINE" }, - { RE_DOT_NOT_NULL, "RE_DOT_NOT_NULL" }, - { RE_HAT_LISTS_NOT_NEWLINE, "RE_HAT_LISTS_NOT_NEWLINE" }, - { RE_INTERVALS, "RE_INTERVALS" }, - { RE_LIMITED_OPS, "RE_LIMITED_OPS" }, - { RE_NEWLINE_ALT, "RE_NEWLINE_ALT" }, - { RE_NO_BK_BRACES, "RE_NO_BK_BRACES" }, - { RE_NO_BK_PARENS, "RE_NO_BK_PARENS" }, - { RE_NO_BK_REFS, "RE_NO_BK_REFS" }, - { RE_NO_BK_VBAR, "RE_NO_BK_VBAR" }, - { RE_NO_EMPTY_RANGES, "RE_NO_EMPTY_RANGES" }, - { RE_UNMATCHED_RIGHT_PAREN_ORD, "RE_UNMATCHED_RIGHT_PAREN_ORD" }, - { RE_NO_POSIX_BACKTRACKING, "RE_NO_POSIX_BACKTRACKING" }, - { RE_NO_GNU_OPS, "RE_NO_GNU_OPS" }, - { RE_DEBUG, "RE_DEBUG" }, - { RE_INVALID_INTERVAL_ORD, "RE_INVALID_INTERVAL_ORD" }, - { RE_ICASE, "RE_ICASE" }, - { RE_CARET_ANCHORS_HERE, "RE_CARET_ANCHORS_HERE" }, - { RE_CONTEXT_INVALID_DUP, "RE_CONTEXT_INVALID_DUP" }, - { 0, NULL } - }; - - return genflags2str(flags, regextab); -} diff -urN gawk-4.1.1/regcomp.c gawk-4.1.2/regcomp.c --- gawk-4.1.1/regcomp.c 2014-04-03 21:37:49.000000000 +0300 +++ gawk-4.1.2/regcomp.c 2015-04-28 16:49:46.000000000 +0300 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2013 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -17,6 +17,14 @@ License along with the GNU C Library; if not, see . */ +#ifdef HAVE_STDINT_H +#include +#endif + +#ifdef _LIBC +# include +#endif + static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern, size_t length, reg_syntax_t syntax); static void re_compile_fastmap_iter (regex_t *bufp, @@ -149,7 +157,7 @@ gettext_noop ("Invalid back reference") /* REG_ESUBREG */ "\0" #define REG_EBRACK_IDX (REG_ESUBREG_IDX + sizeof "Invalid back reference") - gettext_noop ("Unmatched [ or [^") /* REG_EBRACK */ + gettext_noop ("Unmatched [, [^, [:, [., or [=") /* REG_EBRACK */ "\0" #define REG_EPAREN_IDX (REG_EBRACK_IDX + sizeof "Unmatched [ or [^") gettext_noop ("Unmatched ( or \\(") /* REG_EPAREN */ @@ -907,24 +915,13 @@ codeset_name = strchr (codeset_name, '.') + 1; # endif - /* strcasecmp isn't a standard interface. brute force check */ -#ifndef GAWK if (strcasecmp (codeset_name, "UTF-8") == 0 || strcasecmp (codeset_name, "UTF8") == 0) dfa->is_utf8 = 1; -#else - if ( (codeset_name[0] == 'U' || codeset_name[0] == 'u') - && (codeset_name[1] == 'T' || codeset_name[1] == 't') - && (codeset_name[2] == 'F' || codeset_name[2] == 'f') - && (codeset_name[3] == '-' - ? codeset_name[4] == '8' && codeset_name[5] == '\0' - : codeset_name[3] == '8' && codeset_name[4] == '\0')) - dfa->is_utf8 = 1; #if defined(GAWK) && defined(LIBC_IS_BORKED) if (gawk_mb_cur_max == 1) dfa->is_utf8 = 0; #endif /* defined(GAWK) && defined(LIBC_IS_BORKED) */ -#endif /* We check exhaustively in the loop below if this charset is a superset of ASCII. */ @@ -1220,7 +1217,12 @@ || dfa->eclosures == NULL, 0)) return REG_ESPACE; - dfa->subexp_map = re_malloc (int, preg->re_nsub); + /* some malloc()-checkers don't like zero allocations */ + if (preg->re_nsub > 0) + dfa->subexp_map = re_malloc (int, preg->re_nsub); + else + dfa->subexp_map = NULL; + if (dfa->subexp_map != NULL) { int i; @@ -2215,7 +2217,11 @@ { branch = parse_branch (regexp, preg, token, syntax, nest, err); if (BE (*err != REG_NOERROR && branch == NULL, 0)) - return NULL; + { + if (tree != NULL) + postorder (tree, free_tree, NULL); + return NULL; + } } else branch = NULL; @@ -2476,14 +2482,21 @@ while (token->type == OP_DUP_ASTERISK || token->type == OP_DUP_PLUS || token->type == OP_DUP_QUESTION || token->type == OP_OPEN_DUP_NUM) { - tree = parse_dup_op (tree, regexp, dfa, token, syntax, err); - if (BE (*err != REG_NOERROR && tree == NULL, 0)) - return NULL; + bin_tree_t *dup_tree = parse_dup_op (tree, regexp, dfa, token, syntax, err); + if (BE (*err != REG_NOERROR && dup_tree == NULL, 0)) + { + if (tree != NULL) + postorder (tree, free_tree, NULL); + return NULL; + } + tree = dup_tree; /* In BRE consecutive duplications are not allowed. */ if ((syntax & RE_CONTEXT_INVALID_DUP) && (token->type == OP_DUP_ASTERISK || token->type == OP_OPEN_DUP_NUM)) { + if (tree != NULL) + postorder (tree, free_tree, NULL); *err = REG_BADRPT; return NULL; } @@ -2632,6 +2645,8 @@ /* Duplicate ELEM before it is marked optional. */ elem = duplicate_tree (elem, dfa); + if (BE (elem == NULL, 0)) + goto parse_dup_op_espace; old_tree = tree; } else @@ -3128,8 +3143,8 @@ if (BE (sbcset == NULL, 0)) #endif /* RE_ENABLE_I18N */ { -#ifdef RE_ENABLE_I18N re_free (sbcset); +#ifdef RE_ENABLE_I18N re_free (mbcset); #endif *err = REG_ESPACE; @@ -3173,6 +3188,7 @@ re_token_t token2; start_elem.opr.name = start_name_buf; + start_elem.type = COLL_SYM; ret = parse_bracket_element (&start_elem, regexp, token, token_len, dfa, syntax, first_round); if (BE (ret != REG_NOERROR, 0)) @@ -3216,6 +3232,7 @@ if (is_range_exp == 1) { end_elem.opr.name = end_name_buf; + end_elem.type = COLL_SYM; ret = parse_bracket_element (&end_elem, regexp, &token2, token_len2, dfa, syntax, 1); if (BE (ret != REG_NOERROR, 0)) @@ -3489,8 +3506,6 @@ int32_t idx1, idx2; unsigned int ch; size_t len; - /* This #include defines a local function! */ -# include /* Calculate the index for equivalence class. */ cp = name; table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); @@ -3500,7 +3515,7 @@ _NL_COLLATE_EXTRAMB); indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); - idx1 = findidx (&cp, -1); + idx1 = findidx (table, indirect, extra, &cp, -1); if (BE (idx1 == 0 || *cp != '\0', 0)) /* This isn't a valid character. */ return REG_ECOLLATE; @@ -3512,7 +3527,7 @@ { char_buf[0] = ch; cp = char_buf; - idx2 = findidx (&cp, 1); + idx2 = findidx (table, indirect, extra, &cp, 1); /* idx2 = table[ch]; */ diff -urN gawk-4.1.1/regex.c gawk-4.1.2/regex.c --- gawk-4.1.1/regex.c 2014-02-20 20:49:15.000000000 +0200 +++ gawk-4.1.2/regex.c 2015-04-27 18:09:07.000000000 +0300 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . diff -urN gawk-4.1.1/regex.h gawk-4.1.2/regex.h --- gawk-4.1.1/regex.h 2014-02-20 20:49:15.000000000 +0200 +++ gawk-4.1.2/regex.h 2015-04-28 16:49:46.000000000 +0300 @@ -1,6 +1,6 @@ /* Definitions for data structures and routines for the regular expression library. - Copyright (C) 1985, 1989-2014 Free Software Foundation, Inc. + Copyright (C) 1985, 1989-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff -urN gawk-4.1.1/regex_internal.c gawk-4.1.2/regex_internal.c --- gawk-4.1.1/regex_internal.c 2014-03-10 22:39:05.000000000 +0200 +++ gawk-4.1.2/regex_internal.c 2015-04-27 18:09:07.000000000 +0300 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -545,7 +545,10 @@ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + char_idx]; if (BE (pstr->trans != NULL, 0)) ch = pstr->trans[ch]; - pstr->mbs[char_idx] = toupper (ch); + if (islower (ch)) + pstr->mbs[char_idx] = toupper (ch); + else + pstr->mbs[char_idx] = ch; } pstr->valid_len = char_idx; pstr->valid_raw_len = char_idx; @@ -683,7 +686,7 @@ pstr->valid_len - offset); pstr->valid_len -= offset; pstr->valid_raw_len -= offset; -#if DEBUG +#if defined DEBUG && DEBUG assert (pstr->valid_len > 0); #endif } @@ -940,7 +943,7 @@ int wc_idx = idx; while(input->wcs[wc_idx] == WEOF) { -#ifdef DEBUG +#if defined DEBUG && DEBUG /* It must not happen. */ assert (wc_idx >= 0); #endif diff -urN gawk-4.1.1/regex_internal.h gawk-4.1.2/regex_internal.h --- gawk-4.1.1/regex_internal.h 2014-02-20 20:49:15.000000000 +0200 +++ gawk-4.1.2/regex_internal.h 2015-04-27 18:09:07.000000000 +0300 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -26,18 +26,16 @@ #include #include -#include "mbsupport.h" /* gawk */ - #if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC # include #endif #if defined HAVE_LOCALE_H || defined _LIBC # include #endif -#if MBS_SUPPORT && (defined HAVE_WCHAR_H || defined _LIBC) +#if defined HAVE_WCHAR_H || defined _LIBC # include #endif /* HAVE_WCHAR_H || _LIBC */ -#if MBS_SUPPORT && (defined HAVE_WCTYPE_H || defined _LIBC) +#if defined HAVE_WCTYPE_H || defined _LIBC # include #endif /* HAVE_WCTYPE_H || _LIBC */ #if defined HAVE_STDBOOL_H || defined _LIBC @@ -81,7 +79,6 @@ # ifndef _RE_DEFINE_LOCALE_FUNCTIONS # define _RE_DEFINE_LOCALE_FUNCTIONS 1 # include -# include # include # endif #endif @@ -109,7 +106,7 @@ # define SIZE_MAX ((size_t) -1) #endif -#if MBS_SUPPORT || _LIBC +#if ! defined(__DJGPP__) && (defined(GAWK) || _LIBC) # define RE_ENABLE_I18N #endif @@ -470,8 +467,38 @@ # endif #endif +/* + * GAWK checks for zero-size allocations everywhere else, + * do it here too. + */ +#ifndef GAWK #define re_malloc(t,n) ((t *) malloc ((n) * sizeof (t))) #define re_realloc(p,t,n) ((t *) realloc (p, (n) * sizeof (t))) +#else +static void * +test_malloc(size_t count, const char *file, size_t line) +{ + if (count == 0) { + fprintf(stderr, "%s:%lu: allocation of zero bytes\n", + file, line); + exit(1); + } + return malloc(count); +} + +static void * +test_realloc(void *p, size_t count, const char *file, size_t line) +{ + if (count == 0) { + fprintf(stderr, "%s:%lu: reallocation of zero bytes\n", + file, line); + exit(1); + } + return realloc(p, count); +} +#define re_malloc(t,n) ((t *) test_malloc (((n) * sizeof (t)), __FILE__, __LINE__)) +#define re_realloc(p,t,n) ((t *) test_realloc (p, (n) * sizeof (t), __FILE__, __LINE__)) +#endif #define re_free(p) free (p) struct bin_tree_t @@ -794,7 +821,7 @@ indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); p = pstr->mbs + idx; - findidx (&p, pstr->len - idx); + findidx (table, indirect, extra, &p, pstr->len - idx); return p - pstr->mbs - idx; } else diff -urN gawk-4.1.1/regexec.c gawk-4.1.2/regexec.c --- gawk-4.1.1/regexec.c 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/regexec.c 2015-04-27 18:09:07.000000000 +0300 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2013 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -3381,7 +3381,7 @@ if (BE (ndests <= 0, 0)) { if (dests_node_malloced) - free (dests_alloc); + re_free (dests_alloc); /* Return 0 in case of an error, 1 otherwise. */ if (ndests == 0) { @@ -3413,18 +3413,18 @@ else #endif { - dest_states = (re_dfastate_t **) - malloc (ndests * 3 * sizeof (re_dfastate_t *)); + dest_states = + re_malloc (re_dfastate_t *, ndests * 3); if (BE (dest_states == NULL, 0)) { out_free: if (dest_states_malloced) - free (dest_states); + re_free (dest_states); re_node_set_free (&follows); for (i = 0; i < ndests; ++i) re_node_set_free (dests_node + i); if (dests_node_malloced) - free (dests_alloc); + re_free (dests_alloc); return 0; } dest_states_malloced = true; @@ -3555,14 +3555,14 @@ } if (dest_states_malloced) - free (dest_states); + re_free (dest_states); re_node_set_free (&follows); for (i = 0; i < ndests; ++i) re_node_set_free (dests_node + i); if (dests_node_malloced) - free (dests_alloc); + re_free (dests_alloc); return 1; } @@ -3762,6 +3762,10 @@ one collating element like '.', '[a-z]', opposite to the other nodes can only accept one byte. */ +# ifdef _LIBC +# include +# endif + static int internal_function check_node_accept_bytes (const re_dfa_t *dfa, int node_idx, @@ -3883,8 +3887,6 @@ const int32_t *table, *indirect; const unsigned char *weights, *extra; const char *collseqwc; - /* This #include defines a local function! */ -# include /* match with collating_symbol? */ if (cset->ncoll_syms) @@ -3940,7 +3942,7 @@ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB); indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); - int32_t idx = findidx (&cp, elem_len); + int32_t idx = findidx (table, indirect, extra, &cp, elem_len); if (idx > 0) for (i = 0; i < cset->nequiv_classes; ++i) { @@ -4223,7 +4225,7 @@ re_free (top->path->array); re_free (top->path); } - free (top); + re_free (top); } mctx->nsub_tops = 0; diff -urN gawk-4.1.1/replace.c gawk-4.1.2/replace.c --- gawk-4.1.1/replace.c 2014-02-20 20:25:24.000000000 +0200 +++ gawk-4.1.2/replace.c 2015-04-27 18:01:59.000000000 +0300 @@ -50,7 +50,7 @@ #include "missing_d/memmove.c" #endif /* HAVE_MEMMOVE */ -#ifndef HAVE_STRNCASECMP +#if !defined(HAVE_STRNCASECMP) || !defined(HAVE_STRCASECMP) #include "missing_d/strncasecmp.c" #endif /* HAVE_STRCASE */ @@ -111,6 +111,6 @@ #include "missing_d/strcoll.c" #endif -#if ! MBS_SUPPORT +#if defined(__DJGPP__) #include "missing_d/wcmisc.c" #endif diff -urN gawk-4.1.1/symbol.c gawk-4.1.2/symbol.c --- gawk-4.1.1/symbol.c 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/symbol.c 2015-04-27 18:09:07.000000000 +0300 @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2013 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -35,8 +35,8 @@ static NODE *symbol_list; static void (*install_func)(NODE *) = NULL; -static NODE *make_symbol(char *name, NODETYPE type); -static NODE *install(char *name, NODE *parm, NODETYPE type); +static NODE *make_symbol(const char *name, NODETYPE type); +static NODE *install(const char *name, NODE *parm, NODETYPE type); static void free_bcpool(INSTRUCTION *pl); static AWK_CONTEXT *curr_ctxt = NULL; @@ -75,7 +75,7 @@ */ NODE * -install_symbol(char *name, NODETYPE type) +install_symbol(const char *name, NODETYPE type) { return install(name, NULL, type); } @@ -112,14 +112,12 @@ continue; n = in_array(tables[i], tmp); - if (n != NULL) { - unref(tmp); - return n; - } + if (n != NULL) + break; } unref(tmp); - return n; /* NULL */ + return n; /* NULL or new place */ } /* make_params --- allocate function parameters for the symbol table */ @@ -155,11 +153,13 @@ if (func == NULL) return; + assert(func->type == Node_func); - if ((pcount = func->param_cnt) <= 0 - || (parms = func->fparms) == NULL - ) + + if ( (pcount = func->param_cnt) <= 0 + || (parms = func->fparms) == NULL) return; + for (i = 0; i < pcount; i++) (void) install(parms[i].param, parms + i, Node_param_list); } @@ -177,10 +177,11 @@ if (func == NULL) return; + assert(func->type == Node_func); - if ((pcount = func->param_cnt) <= 0 - || (parms = func->fparms) == NULL - ) + + if ( (pcount = func->param_cnt) <= 0 + || (parms = func->fparms) == NULL) return; for (i = pcount - 1; i >= 0; i--) { @@ -191,11 +192,11 @@ assert(p->type == Node_param_list); tmp = make_string(p->vname, strlen(p->vname)); tmp2 = in_array(param_table, tmp); - if (tmp2 != NULL && tmp2->dup_ent != NULL) { + if (tmp2 != NULL && tmp2->dup_ent != NULL) tmp2->dup_ent = tmp2->dup_ent->dup_ent; - } else { + else (void) assoc_remove(param_table, tmp); - } + unref(tmp); } @@ -274,7 +275,7 @@ /* make_symbol --- allocates a global symbol for the symbol table. */ static NODE * -make_symbol(char *name, NODETYPE type) +make_symbol(const char *name, NODETYPE type) { NODE *r; @@ -284,7 +285,7 @@ null_array(r); else if (type == Node_var) r->var_value = dupnode(Nnull_string); - r->vname = name; + r->vname = (char *) name; r->type = type; return r; @@ -293,7 +294,7 @@ /* install --- install a global name or function parameter in the symbol table */ static NODE * -install(char *name, NODE *parm, NODETYPE type) +install(const char *name, NODE *parm, NODETYPE type) { NODE *r; NODE **aptr; @@ -306,20 +307,22 @@ if (type == Node_param_list) { table = param_table; - } else if (type == Node_func || type == Node_ext_func) { + } else if ( type == Node_func + || type == Node_ext_func + || type == Node_builtin_func) { table = func_table; } else if (installing_specials) { table = global_table; } - if (parm != NULL) { + if (parm != NULL) r = parm; - } else { + else { /* global symbol */ r = make_symbol(name, type); if (type == Node_func) func_count++; - if (type != Node_ext_func && table != global_table) + if (type != Node_ext_func && type != Node_builtin_func && table != global_table) var_count++; /* total, includes Node_func */ } @@ -344,7 +347,6 @@ return r; } - /* comp_symbol --- compare two (variable or function) names */ static int @@ -393,7 +395,7 @@ for (i = count = 0; i < max; i += 2) { r = list[i+1]; - if (r->type == Node_ext_func) + if (r->type == Node_ext_func || r->type == Node_builtin_func) continue; assert(r->type == Node_func); table[count++] = r; @@ -508,7 +510,7 @@ symbol_list->rnode = p; } -/* release_symbol --- free symbol list and optionally remove symbol from symbol table */ +/* release_symbols --- free symbol list and optionally remove symbol from symbol table */ void release_symbols(NODE *symlist, int keep_globals) @@ -517,7 +519,8 @@ for (p = symlist->rnode; p != NULL; p = next) { if (! keep_globals) { - /* destroys globals, function, and params + /* + * destroys globals, function, and params * if still in symbol table */ destroy_symbol(p->lnode); @@ -538,7 +541,7 @@ NODE *sym_array; NODE **aptr; long i, j, max; - NODE *user, *extension, *untyped, *scalar, *array; + NODE *user, *extension, *untyped, *scalar, *array, *built_in; NODE **list; NODE *tables[4]; @@ -562,13 +565,13 @@ sym_array->parent_array = PROCINFO_node; sym_array->vname = estrdup("identifiers", 11); - make_aname(sym_array); user = make_string("user", 4); extension = make_string("extension", 9); scalar = make_string("scalar", 6); untyped = make_string("untyped", 7); array = make_string("array", 5); + built_in = make_string("builtin", 7); for (i = 0; tables[i] != NULL; i++) { list = assoc_list(tables[i], "@unsorted", ASORTI); @@ -579,6 +582,7 @@ r = list[j+1]; if ( r->type == Node_ext_func || r->type == Node_func + || r->type == Node_builtin_func || r->type == Node_var || r->type == Node_var_array || r->type == Node_var_new) { @@ -593,6 +597,9 @@ case Node_func: *aptr = dupnode(user); break; + case Node_builtin_func: + *aptr = dupnode(built_in); + break; case Node_var: *aptr = dupnode(scalar); break; @@ -618,6 +625,67 @@ unref(array); } +/* check_param_names --- make sure no parameter is the name of a function */ + +bool +check_param_names(void) +{ + int i, j; + NODE **list; + NODE *f; + long max; + bool result = true; + NODE n; + + if (func_table->table_size == 0) + return result; + + max = func_table->table_size * 2; + + memset(& n, 0, sizeof n); + n.type = Node_val; + n.flags = STRING|STRCUR; + n.stfmt = -1; + + /* + * assoc_list() returns an array with two elements per awk array + * element. Elements i and i+1 in the C array represent the key + * and value of element j in the awk array. Thus the loops use += 2 + * to go through the awk array. + * + * In this case, the name is in list[i], and the function is + * in list[i+1]. Just what we need. + */ + + list = assoc_list(func_table, "@unsorted", ASORTI); + + for (i = 0; i < max; i += 2) { + f = list[i+1]; + if (f->type == Node_builtin_func || f->param_cnt == 0) + continue; + + /* loop over each param in function i */ + for (j = 0; j < f->param_cnt; j++) { + /* compare to function names */ + + /* use a fake node to avoid malloc/free of make_string */ + n.stptr = f->fparms[j].param; + n.stlen = strlen(f->fparms[j].param); + + if (in_array(func_table, & n)) { + error( + _("function `%s': can't use function `%s' as a parameter name"), + list[i]->stptr, + f->fparms[j].param); + result = false; + } + } + } + + efree(list); + return result; +} + #define pool_size d.dl #define freei x.xi static INSTRUCTION *pool_list; diff -urN gawk-4.1.1/test/ChangeLog gawk-4.1.2/test/ChangeLog --- gawk-4.1.1/test/ChangeLog 2014-04-08 20:36:00.000000000 +0300 +++ gawk-4.1.2/test/ChangeLog 2015-04-29 08:54:57.000000000 +0300 @@ -1,3 +1,295 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + +2015-04-27 Andrew J. Schorr + + * Makefile.am (inpref): New test. + * inpref.awk, inpref.in, inpref.ok: New files. + +2015-04-27 Arnold D. Robbins + + * Makefile.am (regexpbrack2): New test. + * regexpbrack2.awk, regexpbrack2.in, regexpbrack2.ok: New files. + Thanks to Nelson Beebe. + +2015-04-14 Arnold D. Robbins + + * indirectbuiltin.awk: Add another test (gensub 3 args). + * indirectbuiltin.ok: Update good results. + +2015-04-13 Arnold D. Robbins + + * Makefile.am (negtime): New test. + * negtime.awk, negtime.ok: New files. + +2015-04-09 Arnold D. Robbins + + * fts.awk: Skip atime to avoid spurious timestamp + differences. Thanks to Nelson Beebe for pointing this out. + * Makefile.am (charset-all): Group the charset tests + inside a check for locale support. Thanks to Nelson Beebe + for finally motivating me to do this. + (charset-msg-start): Update test of message some. + +2015-04-08 Eli Zaretskii + + * Makefile.am (mpfrmemok1): Use -p- for portability and + compatibility with pc/Makefile.tst. + +2015-03-31 Arnold D. Robbins + + * Makefile.am (indirectbuiltin): New test. + * indirectbuiltin.awk, indirectbuiltin.ok: New files. + +2015-03-24 Arnold D. Robbins + + * id.ok: Update after fixes in code. + +2015-03-24 Andrew J. Schorr + + * Makefile.am (EXTRA_DIST): Add exitval3.awk and exitval3.ok. + (BASIC_TESTS): Add new test exitval3. + * exitval3.awk, exitval3.ok: New files. + +2015-03-17 Andrew J. Schorr + + * inplace1.ok, inplace2.ok, inplace3.ok: Update error message line + numbers to reflect changes to inplace.awk. + +2015-03-17 Arnold D. Robbins + + * Makefile.am (mpfrmemok1): New test. + * mpfrmemok1.awk, mpfrmemok1.ok: New files. + +2015-03-10 Arnold D. Robbins + + * Makefile.am (fpat4): New test. + * fpat4.awk, fpat4.ok: New files. + +2015-03-06 Arnold D. Robbins + + * charasbytes.awk, ofs1.awk, range1.awk, sortglos.awk, + sortglos.in: Remove execute permission. + +2015-02-26 Arnold D. Robbins + + * Makefile.am (EXTRA_DIST): Add profile0.in which got forgotten + earlier. Ooops. + +2015-02-24 Arnold D. Robbins + + * Makefile.am (crlf): New test. + * crlf.awk, crlf.ok: New files. + +2015-02-10 Arnold D. Robbins + + * Makefile.am (profile0): New test. + * profile0.awk, profile0.in, profile0.ok: New files. + +2015-02-01 Arnold D. Robbins + + * Makefile.am (paramasfunc1, paramasfunc2): Now need --posix. + * indirectcall.awk: Restore after code change. + +2015-01-30 Arnold D. Robbins + + * Makefile.am (callparam, paramasfunc1, paramasfunc2): New tests. + * callparam.awk, callparam.ok: New files. + * paramasfunc1.awk, paramasfunc1.ok: New files. + * paramasfunc2.awk, paramasfunc2.ok: New files. + * exit.sh, indirectcall.awk: Update after code change. + +2015-01-14 Arnold D. Robbins + + * Makefile.am (dumpvars): Grep out ENVIRON and PROCINFO since + those can be different depending on who runs the test. + * dumpvars.ok, id.ok: Updated after code changes. + +2015-01-07 Arnold D. Robbins + + * Makefile.am (regexpbrack): New test. + * regexpbrack.awk, regexpbrack.in, regexpbrack.ok: New files. + + Unrelated: + + * Makefile.am (printfbad4): New test. + * printfbad4.awk, printfbad4.ok: New files. + + Unrelated: + + * testext.ok: Adjust for code changes. + +2014-12-24 Arnold D. Robbins + + * Makefile.am (badbuild): New test. + * badbuild.awk, badbuild.in, badbuild.ok: New files. + +2014-12-24 Andrew J. Schorr + + * Makefile.am (check): If tests don't pass, run 'make diffout' + and exit 1. Should help distros to notice when they have built + gawk incorrectly. (Can you say "Fedora", boys and girls?) + +2014-11-26 Arnold D. Robbins + + * Gentests: Fix gensub call after adding warning. + +2014-11-26 Arnold D. Robbins + + * gensub2.ok: Update after code changes. + +2014-11-16 Arnold D. Robbins + + * Makefile.am (sortglos): New test. + * sortglos.awk, sortglos.in, sortglos.ok: New files. + +2014-11-09 Arnold D. Robbins + + * mbprintf4.awk: Add record and line number for debugging. + * mpprint4.ok: Adjust. + +2014-11-02 Arnold D. Robbins + + * Makefile.am (profile7): New test. + (profile6): Add missing @ in front of gawk run. + * profile7.awk, profile7.ok: New files. + +2014-11-01 Arnold D. Robbins + + * Makefile.am (profile6): Actually run profiling. Should make test + output consistent with what's in master. + * profile6.ok: Updated. + +2014-10-30 Arnold D. Robbins + + * Makefile.am (profile6): New test. + * profile6.awk, profile6.ok: New files. + +2014-10-17 Andrew J. Schorr + + * Makefile.am (profile1, testext): Use explicit ./foo.awk to avoid + assumptions about AWKPATH in the environment. + +2014-10-12 Arnold D. Robbins + + * Makefile.am (charset-msg-start): Add a list of needed locales. + Suggested by Shaun Jackman . + +2014-10-05 Arnold D. Robbins + + * profile2.ok, profile3.ok, profile4.ok, profile5.ok: + Adjusted after minor code change. Again. + +2014-10-04 Arnold D. Robbins + + * Makefile.am (genpot): New test. + * genpot.awk, genpot.ok: New files. + +2014-09-29 Arnold D. Robbins + + * testext.ok: Adjusted after minor code change. + +2014-09-27 Arnold D. Robbins + + * profile2.ok, profile3.ok, profile4.ok, profile5.ok: + Adjusted after minor code change. + +2014-09-18 Arnold D. Robbins + + * filefuncs.awk: Change to build directory instead of "..". + * Makefile.am (filefuncs): Pass in $(abs_top_builddir). + +2014-09-05 Arnold D. Robbins + + * functab4.awk: Changed to use stat instead of chdir since + /tmp isn't /tmp on all systems (e.g. Mac OS X). Thanks to + Hermann Peifer for the report. + + Sort of related: + + * indirectcall2.awk, indirectcall2.ok: New files. + * id.ok: Updated. + +2014-09-04 Arnold D. Robbins + + * profile2.ok: Update after code improvement in profiler. + * functab4.ok: Update after making indirect calls of + extension functions work. :-) + +2014-08-15 Arnold D. Robbins + + * badargs.ok: Adjust after revising text for -L option. + +2014-08-12 Arnold D. Robbins + + * ofs1.ok: Updated to match corrected behavior in gawk. + +2014-08-05 Arnold D. Robbins + + * Makefile.am (mpfrsqrt): New test. + * mpfrsqrt.awk, mpfrsqrt.ok: New files. + Test from Katie Wasserman . + +2014-07-25 Arnold D. Robbins + + * printhuge.awk: Add a newline to output. + * printhuge.ok: Adjust. + +2014-07-24 Arnold D. Robbins + + * badargs.ok: Adjust after correctly alphabetizing options. + +2014-07-10 Arnold D. Robbins + + * Makefile.am (printhuge): New test. + * printhuge.awk, printhuge.ok: New files. + Test from mail.green.fox@gmail.com. + +2014-06-19 Michael Forney + + * Makefile.am (poundbang): Fix relative path of AWKPROG. + +2014-06-08 Arnold D. Robbins + + * Makefile.am (dbugeval): Add leading @ to recipe. Ooops. + +2014-05-30 Arnold D. Robbins + + * Makefile.am (regnul1, regnul2): New tests. + * regnul1.awk, regnul1.ok, regnul1.awk, regnul2.ok: New files. + +2014-05-22 Andrew J. Schorr + + * lintwarn.ok: Updated. + +2014-05-13 Arnold D. Robbins + + * Makefile.am (EXTRA_DIST): Forgot dbugeval.ok. Ooops. + +2014-05-11 Arnold D. Robbins + + * Makefile.am (dbugeval): New test. + * dbugeval.in, dbugeval.ok: New files. + +2014-05-10 Andrew J. Schorr + + * Makefile.am (rsglstdin): New test. + * rsglstdin.ok: New file. + +2014-05-09 Andrew J. Schorr + + * Makefile.am (rebuf): Force buffer size to 4096 via AWKBUFSIZE + environment variable. + (rsgetline): New test. + * rsgetline.awk, rsgetline.in, rsgetline.ok: New files. + +2014-04-11 Arnold D. Robbins + + * Makefile.am (charset-msg-start): Add a warning message that tests + may fail without adequate locale support, per request from + Nelson H.F. Beebe. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff -urN gawk-4.1.1/test/Gentests gawk-4.1.2/test/Gentests --- gawk-4.1.1/test/Gentests 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/test/Gentests 2015-04-27 18:04:11.000000000 +0300 @@ -123,7 +123,7 @@ printf "WARNING: --lint-old target `%s' is missing.\n", x > "/dev/stderr" for (x in files) if (!(x in unused) && \ - !(gensub(/\.(awk|in)$/,"","",x) in targets)) + !(gensub(/\.(awk|in)$/,"",1,x) in targets)) printf "WARNING: unused file `%s'.\n", x > "/dev/stderr" } diff -urN gawk-4.1.1/test/Makefile.am gawk-4.1.2/test/Makefile.am --- gawk-4.1.1/test/Makefile.am 2014-04-08 19:12:01.000000000 +0300 +++ gawk-4.1.2/test/Makefile.am 2015-04-28 16:49:46.000000000 +0300 @@ -1,7 +1,7 @@ # # test/Makefile.am --- automake input file for gawk # -# Copyright (C) 1988-2014 the Free Software Foundation, Inc. +# Copyright (C) 1988-2015 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -123,12 +123,17 @@ badargs.ok \ badassign1.awk \ badassign1.ok \ + badbuild.awk \ + badbuild.in \ + badbuild.ok \ beginfile1.awk \ beginfile1.ok \ beginfile2.in \ beginfile2.ok \ beginfile2.sh \ binmode1.ok \ + callparam.awk \ + callparam.ok \ charasbytes.awk \ charasbytes.in \ charasbytes.ok \ @@ -164,9 +169,13 @@ concat4.ok \ convfmt.awk \ convfmt.ok \ + crlf.awk \ + crlf.ok \ datanonl.awk \ datanonl.in \ datanonl.ok \ + dbugeval.in \ + dbugeval.ok \ defref.awk \ defref.ok \ delargv.awk \ @@ -212,6 +221,8 @@ exitval2.awk \ exitval2.ok \ exitval2.w32 \ + exitval3.awk \ + exitval3.ok \ fcall_exit.awk \ fcall_exit.ok \ fcall_exit2.awk \ @@ -276,6 +287,8 @@ fpat3.awk \ fpat3.in \ fpat3.ok \ + fpat4.awk \ + fpat4.ok \ fpatnull.awk \ fpatnull.in \ fpatnull.ok \ @@ -322,6 +335,8 @@ fwtest3.awk \ fwtest3.in \ fwtest3.ok \ + genpot.awk \ + genpot.ok \ gensub.awk \ gensub.in \ gensub.ok \ @@ -391,6 +406,9 @@ icasers.awk \ icasers.in \ icasers.ok \ + inpref.awk \ + inpref.in \ + inpref.ok \ id.awk \ id.ok \ igncdym.awk \ @@ -416,9 +434,13 @@ include.awk \ include.ok \ include2.ok \ + indirectbuiltin.awk \ + indirectbuiltin.ok \ indirectcall.awk \ indirectcall.in \ indirectcall.ok \ + indirectcall2.awk \ + indirectcall2.ok \ inftest.awk \ inftest.ok \ inplace.in \ @@ -522,15 +544,21 @@ mpfrexprange.ok \ mpfrieee.awk \ mpfrieee.ok \ + mpfrmemok1.awk \ + mpfrmemok1.ok \ mpfrnegzero.awk \ mpfrnegzero.ok \ mpfrnr.awk \ mpfrnr.in \ mpfrnr.ok \ + mpfrrem.awk \ + mpfrrem.ok \ mpfrrnd.awk \ mpfrrnd.ok \ mpfrsort.awk \ mpfrsort.ok \ + mpfrsqrt.awk \ + mpfrsqrt.ok \ mtchi18n.awk \ mtchi18n.in \ mtchi18n.ok \ @@ -544,6 +572,8 @@ negexp.ok \ negrange.awk \ negrange.ok \ + negtime.awk \ + negtime.ok \ nested.awk \ nested.in \ nested.ok \ @@ -629,6 +659,10 @@ out1.ok \ out2.ok \ out3.ok \ + paramasfunc1.awk \ + paramasfunc1.ok \ + paramasfunc2.awk \ + paramasfunc2.ok \ paramdup.awk \ paramdup.ok \ paramres.awk \ @@ -679,7 +713,11 @@ printfbad2.ok \ printfbad3.awk \ printfbad3.ok \ + printfbad4.awk \ + printfbad4.ok \ printfloat.awk \ + printhuge.awk \ + printhuge.ok \ printlang.awk \ prmarscl.awk \ prmarscl.ok \ @@ -687,6 +725,9 @@ prmreuse.ok \ procinfs.awk \ procinfs.ok \ + profile0.awk \ + profile0.in \ + profile0.ok \ profile2.ok \ profile3.awk \ profile3.ok \ @@ -694,6 +735,10 @@ profile4.ok \ profile5.awk \ profile5.ok \ + profile6.awk \ + profile6.ok \ + profile7.awk \ + profile7.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -723,10 +768,20 @@ regeq.awk \ regeq.in \ regeq.ok \ + regexpbrack.awk \ + regexpbrack.in \ + regexpbrack.ok \ + regexpbrack2.awk \ + regexpbrack2.in \ + regexpbrack2.ok \ regexprange.awk \ regexprange.ok \ reginttrad.awk \ reginttrad.ok \ + regnul1.awk \ + regnul1.ok \ + regnul2.awk \ + regnul2.ok \ regrange.awk \ regrange.ok \ regtest.sh \ @@ -757,6 +812,10 @@ rs.awk \ rs.in \ rs.ok \ + rsgetline.awk \ + rsgetline.in \ + rsgetline.ok \ + rsglstdin.ok \ rsnul1nl.awk \ rsnul1nl.in \ rsnul1nl.ok \ @@ -807,6 +866,9 @@ sortfor.awk \ sortfor.in \ sortfor.ok \ + sortglos.awk \ + sortglos.in \ + sortglos.ok \ sortu.awk \ sortu.ok \ space.ok \ @@ -947,11 +1009,11 @@ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 arysubnm asgext awkpath \ - back89 backgsub badassign1 \ - childin clobber closebad clsflnam compare compare2 concat1 concat2 \ + back89 backgsub badassign1 badbuild \ + callparam childin clobber closebad clsflnam compare compare2 concat1 concat2 \ concat3 concat4 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ - eofsplit exit2 exitval1 exitval2 \ + eofsplit exit2 exitval1 exitval2 exitval3 \ fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \ fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \ fstabplus funsemnl funsmnam funstack \ @@ -959,20 +1021,21 @@ gsubasgn gsubtest gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6 \ gsubtst7 gsubtst8 \ hex hsprint \ - inputred intest intprec iobug1 \ + inpref inputred intest intprec iobug1 \ leaddig leadnl litoct longsub longwrds \ manglprm math membug1 messages minusstr mmap8k mtchi18n \ nasty nasty2 negexp negrange nested nfldstr nfloop nfneg nfset nlfldsep \ nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \ noparms nors nulrsend numindex numsubstr \ octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofs1 onlynl opasnidx opasnslf \ + paramasfunc1 paramasfunc2 \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval \ - rand range1 rebt8b1 redfilnm regeq regexprange regrange reindops \ + rand range1 rebt8b1 redfilnm regeq regexpbrack regexpbrack2 regexprange regrange reindops \ reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ - scalar sclforin sclifin sortempty splitargv splitarr splitdef \ + scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \ splitvar splitwht strcat1 strnum1 strtod subamp subi18n \ subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \ @@ -986,19 +1049,19 @@ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way delsub devfd devfd1 devfd2 dumpvars exit \ - fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ + colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ + fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ - gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ + genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ - include include2 indirectcall \ + include include2 indirectbuiltin indirectcall indirectcall2 \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ - nastyparm next nondec nondec2 \ - patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ - profile1 profile2 profile3 profile4 profile5 pty1 \ - rebuf regx8bit reginttrad reint reint2 rsstart1 \ + nastyparm negtime next nondec nondec2 \ + patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ + profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ + rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ @@ -1010,8 +1073,8 @@ MACHINE_TESTS = double1 double2 fmtspcl intformat -MPFR_TESTS = mpfrnr mpfrnegzero mpfrrnd mpfrieee mpfrexprange \ - mpfrsort mpfrbigint +MPFR_TESTS = mpfrnr mpfrnegzero mpfrmemok1 mpfrrem mpfrrnd mpfrieee \ + mpfrexprange mpfrsort mpfrsqrt mpfrbigint LOCALE_CHARSET_TESTS = \ asort asorti backbigs1 backsmalls1 backsmalls2 \ @@ -1070,10 +1133,10 @@ unix-msg-start unix-tests unix-msg-end \ extend-msg-start gawk-extensions extend-msg-end \ machine-msg-start machine-tests machine-msg-end \ - charset-msg-start charset-tests charset-msg-end \ + charset-tests-all \ shlib-msg-start shlib-tests shlib-msg-end \ mpfr-msg-start mpfr-tests mpfr-msg-end - @$(MAKE) pass-fail + @$(MAKE) pass-fail || { $(MAKE) diffout; exit 1; } basic: $(BASIC_TESTS) @@ -1081,6 +1144,16 @@ gawk-extensions: $(GAWK_EXT_TESTS) +charset-tests-all: + @if locale -a | grep -i 'en_US.UTF.*8' > /dev/null && \ + locale -a | grep -i 'ru_RU.UTF.*8' > /dev/null && \ + locale -a | grep -i 'ja_JP.UTF.*8' > /dev/null ; \ + then \ + $(MAKE) charset-msg-start charset-tests charset-msg-end; \ + else \ + echo %%%%%%%%%% Inadequate locale support: skipping charset tests. ; \ + fi + charset-tests: $(LOCALE_CHARSET_TESTS) extra: $(EXTRA_TESTS) inet @@ -1143,6 +1216,12 @@ charset-msg-start: @echo "======== Starting tests that can vary based on character set or locale support ========" + @echo "**************************************************************************" + @echo "* Some or all of these tests may fail if you have inadequate or missing *" + @echo "* locale support At least en_US.UTF-8, ru_RU.UTF-8 and ja_JP.UTF-8 are *" + @echo "* needed. However, if you see this message, the Makefile thinks you have *" + @echo "* what you need ... *" + @echo "**************************************************************************" charset-msg-end: @echo "======== Done with tests that can vary based on character set or locale support ========" @@ -1179,7 +1258,7 @@ @if ./_pbd.awk "$(srcdir)"/poundbang.awk > _`basename $@` ; \ then : ; \ else \ - sed "s;/tmp/gawk;../$(AWKPROG);" < "$(srcdir)"/poundbang.awk > ./_pbd.awk ; \ + sed "s;/tmp/gawk;$(AWKPROG);" < "$(srcdir)"/poundbang.awk > ./_pbd.awk ; \ chmod +x ./_pbd.awk ; \ LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} ./_pbd.awk "$(srcdir)"/poundbang.awk > _`basename $@`; \ fi @@ -1323,6 +1402,16 @@ $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ fi +rebuf:: + @echo $@ + @AWKBUFSIZE=4096 AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +rsglstdin:: + @echo $@ + @cat "$(srcdir)"/rsgetline.in | AWKPATH="$(srcdir)" $(AWK) -f rsgetline.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + reint:: @echo $@ @$(AWK) --re-interval -f "$(srcdir)"/reint.awk "$(srcdir)"/reint.in >_$@ @@ -1628,13 +1717,19 @@ dumpvars:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --dump-variables 1 < "$(srcdir)"/$@.in >/dev/null 2>&1 || echo EXIT CODE: $$? >>_$@ - @mv awkvars.out _$@ + @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +profile0: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ profile1: @echo $@ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1 - @$(AWK) -f ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out + @$(AWK) -f ./ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out @$(CMP) _$@.out1 _$@.out2 && rm _$@.out[12] || { echo EXIT CODE: $$? >>_$@ ; \ cp "$(srcdir)"/dtdgport.awk > $@.ok ; } @@ -1663,6 +1758,18 @@ @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile6: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +profile7: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + posix2008sub: @echo $@ @$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1 @@ -1719,6 +1826,21 @@ @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +mpfrsqrt: + @echo $@ + @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +mpfrrem: + @echo $@ + @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +mpfrmemok1: + @echo $@ + @$(AWK) -p- -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + jarebug:: @echo $@ @"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@" @@ -1815,7 +1937,7 @@ testext:: @echo $@ @$(AWK) '/^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk - @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk readdir: @@ -1910,6 +2032,43 @@ AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +dbugeval:: + @echo $@ + @$(AWK) --debug -f /dev/null < "$(srcdir)"/$@.in > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +printhuge:: + @echo $@ + @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ + AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +filefuncs: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -v builddir="$(abs_top_builddir)" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +genpot: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --gen-pot >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +paramasfunc1:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +paramasfunc2:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +negtime:: + @echo $@ + @TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + + # Targets generated for other tests: include Maketests diff -urN gawk-4.1.1/test/Makefile.in gawk-4.1.2/test/Makefile.in --- gawk-4.1.1/test/Makefile.in 2014-04-08 19:13:13.000000000 +0300 +++ gawk-4.1.2/test/Makefile.in 2015-04-29 08:35:51.000000000 +0300 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -17,7 +17,7 @@ # # test/Makefile.am --- automake input file for gawk # -# Copyright (C) 1988-2014 the Free Software Foundation, Inc. +# Copyright (C) 1988-2015 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -37,7 +37,17 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -100,9 +110,6 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(srcdir)/Maketests $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs ChangeLog \ - README subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \ @@ -118,6 +125,7 @@ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -142,6 +150,8 @@ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Maketests \ + $(top_srcdir)/mkinstalldirs ChangeLog README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -205,6 +215,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOCKET_LIBS = @SOCKET_LIBS@ @@ -369,12 +380,17 @@ badargs.ok \ badassign1.awk \ badassign1.ok \ + badbuild.awk \ + badbuild.in \ + badbuild.ok \ beginfile1.awk \ beginfile1.ok \ beginfile2.in \ beginfile2.ok \ beginfile2.sh \ binmode1.ok \ + callparam.awk \ + callparam.ok \ charasbytes.awk \ charasbytes.in \ charasbytes.ok \ @@ -410,9 +426,13 @@ concat4.ok \ convfmt.awk \ convfmt.ok \ + crlf.awk \ + crlf.ok \ datanonl.awk \ datanonl.in \ datanonl.ok \ + dbugeval.in \ + dbugeval.ok \ defref.awk \ defref.ok \ delargv.awk \ @@ -458,6 +478,8 @@ exitval2.awk \ exitval2.ok \ exitval2.w32 \ + exitval3.awk \ + exitval3.ok \ fcall_exit.awk \ fcall_exit.ok \ fcall_exit2.awk \ @@ -522,6 +544,8 @@ fpat3.awk \ fpat3.in \ fpat3.ok \ + fpat4.awk \ + fpat4.ok \ fpatnull.awk \ fpatnull.in \ fpatnull.ok \ @@ -568,6 +592,8 @@ fwtest3.awk \ fwtest3.in \ fwtest3.ok \ + genpot.awk \ + genpot.ok \ gensub.awk \ gensub.in \ gensub.ok \ @@ -637,6 +663,9 @@ icasers.awk \ icasers.in \ icasers.ok \ + inpref.awk \ + inpref.in \ + inpref.ok \ id.awk \ id.ok \ igncdym.awk \ @@ -662,9 +691,13 @@ include.awk \ include.ok \ include2.ok \ + indirectbuiltin.awk \ + indirectbuiltin.ok \ indirectcall.awk \ indirectcall.in \ indirectcall.ok \ + indirectcall2.awk \ + indirectcall2.ok \ inftest.awk \ inftest.ok \ inplace.in \ @@ -768,15 +801,21 @@ mpfrexprange.ok \ mpfrieee.awk \ mpfrieee.ok \ + mpfrmemok1.awk \ + mpfrmemok1.ok \ mpfrnegzero.awk \ mpfrnegzero.ok \ mpfrnr.awk \ mpfrnr.in \ mpfrnr.ok \ + mpfrrem.awk \ + mpfrrem.ok \ mpfrrnd.awk \ mpfrrnd.ok \ mpfrsort.awk \ mpfrsort.ok \ + mpfrsqrt.awk \ + mpfrsqrt.ok \ mtchi18n.awk \ mtchi18n.in \ mtchi18n.ok \ @@ -790,6 +829,8 @@ negexp.ok \ negrange.awk \ negrange.ok \ + negtime.awk \ + negtime.ok \ nested.awk \ nested.in \ nested.ok \ @@ -875,6 +916,10 @@ out1.ok \ out2.ok \ out3.ok \ + paramasfunc1.awk \ + paramasfunc1.ok \ + paramasfunc2.awk \ + paramasfunc2.ok \ paramdup.awk \ paramdup.ok \ paramres.awk \ @@ -925,7 +970,11 @@ printfbad2.ok \ printfbad3.awk \ printfbad3.ok \ + printfbad4.awk \ + printfbad4.ok \ printfloat.awk \ + printhuge.awk \ + printhuge.ok \ printlang.awk \ prmarscl.awk \ prmarscl.ok \ @@ -933,6 +982,9 @@ prmreuse.ok \ procinfs.awk \ procinfs.ok \ + profile0.awk \ + profile0.in \ + profile0.ok \ profile2.ok \ profile3.awk \ profile3.ok \ @@ -940,6 +992,10 @@ profile4.ok \ profile5.awk \ profile5.ok \ + profile6.awk \ + profile6.ok \ + profile7.awk \ + profile7.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -969,10 +1025,20 @@ regeq.awk \ regeq.in \ regeq.ok \ + regexpbrack.awk \ + regexpbrack.in \ + regexpbrack.ok \ + regexpbrack2.awk \ + regexpbrack2.in \ + regexpbrack2.ok \ regexprange.awk \ regexprange.ok \ reginttrad.awk \ reginttrad.ok \ + regnul1.awk \ + regnul1.ok \ + regnul2.awk \ + regnul2.ok \ regrange.awk \ regrange.ok \ regtest.sh \ @@ -1003,6 +1069,10 @@ rs.awk \ rs.in \ rs.ok \ + rsgetline.awk \ + rsgetline.in \ + rsgetline.ok \ + rsglstdin.ok \ rsnul1nl.awk \ rsnul1nl.in \ rsnul1nl.ok \ @@ -1053,6 +1123,9 @@ sortfor.awk \ sortfor.in \ sortfor.ok \ + sortglos.awk \ + sortglos.in \ + sortglos.ok \ sortu.awk \ sortu.ok \ space.ok \ @@ -1192,11 +1265,11 @@ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 arysubnm asgext awkpath \ - back89 backgsub badassign1 \ - childin clobber closebad clsflnam compare compare2 concat1 concat2 \ + back89 backgsub badassign1 badbuild \ + callparam childin clobber closebad clsflnam compare compare2 concat1 concat2 \ concat3 concat4 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ - eofsplit exit2 exitval1 exitval2 \ + eofsplit exit2 exitval1 exitval2 exitval3 \ fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \ fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \ fstabplus funsemnl funsmnam funstack \ @@ -1204,20 +1277,21 @@ gsubasgn gsubtest gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6 \ gsubtst7 gsubtst8 \ hex hsprint \ - inputred intest intprec iobug1 \ + inpref inputred intest intprec iobug1 \ leaddig leadnl litoct longsub longwrds \ manglprm math membug1 messages minusstr mmap8k mtchi18n \ nasty nasty2 negexp negrange nested nfldstr nfloop nfneg nfset nlfldsep \ nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \ noparms nors nulrsend numindex numsubstr \ octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofs1 onlynl opasnidx opasnslf \ + paramasfunc1 paramasfunc2 \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval \ - rand range1 rebt8b1 redfilnm regeq regexprange regrange reindops \ + rand range1 rebt8b1 redfilnm regeq regexpbrack regexpbrack2 regexprange regrange reindops \ reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ - scalar sclforin sclifin sortempty splitargv splitarr splitdef \ + scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \ splitvar splitwht strcat1 strnum1 strtod subamp subi18n \ subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \ @@ -1231,19 +1305,19 @@ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way delsub devfd devfd1 devfd2 dumpvars exit \ - fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ + colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ + fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ - gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ + genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ - include include2 indirectcall \ + include include2 indirectbuiltin indirectcall indirectcall2 \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ - nastyparm next nondec nondec2 \ - patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ - profile1 profile2 profile3 profile4 profile5 pty1 \ - rebuf regx8bit reginttrad reint reint2 rsstart1 \ + nastyparm negtime next nondec nondec2 \ + patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ + profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ + rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ @@ -1252,8 +1326,8 @@ EXTRA_TESTS = inftest regtest INET_TESTS = inetdayu inetdayt inetechu inetecht MACHINE_TESTS = double1 double2 fmtspcl intformat -MPFR_TESTS = mpfrnr mpfrnegzero mpfrrnd mpfrieee mpfrexprange \ - mpfrsort mpfrbigint +MPFR_TESTS = mpfrnr mpfrnegzero mpfrmemok1 mpfrrem mpfrrnd mpfrieee \ + mpfrexprange mpfrsort mpfrsqrt mpfrbigint LOCALE_CHARSET_TESTS = \ asort asorti backbigs1 backsmalls1 backsmalls2 \ @@ -1320,7 +1394,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -1329,6 +1402,7 @@ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(srcdir)/Maketests $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -1487,6 +1561,8 @@ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am +.PRECIOUS: Makefile + # Message stuff is to make it a little easier to follow. # Make the pass-fail last and dependent on others to avoid @@ -1497,10 +1573,10 @@ unix-msg-start unix-tests unix-msg-end \ extend-msg-start gawk-extensions extend-msg-end \ machine-msg-start machine-tests machine-msg-end \ - charset-msg-start charset-tests charset-msg-end \ + charset-tests-all \ shlib-msg-start shlib-tests shlib-msg-end \ mpfr-msg-start mpfr-tests mpfr-msg-end - @$(MAKE) pass-fail + @$(MAKE) pass-fail || { $(MAKE) diffout; exit 1; } basic: $(BASIC_TESTS) @@ -1508,6 +1584,16 @@ gawk-extensions: $(GAWK_EXT_TESTS) +charset-tests-all: + @if locale -a | grep -i 'en_US.UTF.*8' > /dev/null && \ + locale -a | grep -i 'ru_RU.UTF.*8' > /dev/null && \ + locale -a | grep -i 'ja_JP.UTF.*8' > /dev/null ; \ + then \ + $(MAKE) charset-msg-start charset-tests charset-msg-end; \ + else \ + echo %%%%%%%%%% Inadequate locale support: skipping charset tests. ; \ + fi + charset-tests: $(LOCALE_CHARSET_TESTS) extra: $(EXTRA_TESTS) inet @@ -1570,6 +1656,12 @@ charset-msg-start: @echo "======== Starting tests that can vary based on character set or locale support ========" + @echo "**************************************************************************" + @echo "* Some or all of these tests may fail if you have inadequate or missing *" + @echo "* locale support At least en_US.UTF-8, ru_RU.UTF-8 and ja_JP.UTF-8 are *" + @echo "* needed. However, if you see this message, the Makefile thinks you have *" + @echo "* what you need ... *" + @echo "**************************************************************************" charset-msg-end: @echo "======== Done with tests that can vary based on character set or locale support ========" @@ -1604,7 +1696,7 @@ @if ./_pbd.awk "$(srcdir)"/poundbang.awk > _`basename $@` ; \ then : ; \ else \ - sed "s;/tmp/gawk;../$(AWKPROG);" < "$(srcdir)"/poundbang.awk > ./_pbd.awk ; \ + sed "s;/tmp/gawk;$(AWKPROG);" < "$(srcdir)"/poundbang.awk > ./_pbd.awk ; \ chmod +x ./_pbd.awk ; \ LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} ./_pbd.awk "$(srcdir)"/poundbang.awk > _`basename $@`; \ fi @@ -1748,6 +1840,16 @@ $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ fi +rebuf:: + @echo $@ + @AWKBUFSIZE=4096 AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +rsglstdin:: + @echo $@ + @cat "$(srcdir)"/rsgetline.in | AWKPATH="$(srcdir)" $(AWK) -f rsgetline.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + reint:: @echo $@ @$(AWK) --re-interval -f "$(srcdir)"/reint.awk "$(srcdir)"/reint.in >_$@ @@ -2053,13 +2155,19 @@ dumpvars:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --dump-variables 1 < "$(srcdir)"/$@.in >/dev/null 2>&1 || echo EXIT CODE: $$? >>_$@ - @mv awkvars.out _$@ + @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +profile0: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ profile1: @echo $@ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1 - @$(AWK) -f ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out + @$(AWK) -f ./ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out @$(CMP) _$@.out1 _$@.out2 && rm _$@.out[12] || { echo EXIT CODE: $$? >>_$@ ; \ cp "$(srcdir)"/dtdgport.awk > $@.ok ; } @@ -2087,6 +2195,18 @@ @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile6: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +profile7: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + posix2008sub: @echo $@ @$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1 @@ -2143,6 +2263,21 @@ @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +mpfrsqrt: + @echo $@ + @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +mpfrrem: + @echo $@ + @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +mpfrmemok1: + @echo $@ + @$(AWK) -p- -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + jarebug:: @echo $@ @"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@" @@ -2239,7 +2374,7 @@ testext:: @echo $@ @$(AWK) '/^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk - @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk readdir: @@ -2333,6 +2468,42 @@ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +dbugeval:: + @echo $@ + @$(AWK) --debug -f /dev/null < "$(srcdir)"/$@.in > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +printhuge:: + @echo $@ + @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ + AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +filefuncs: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -v builddir="$(abs_top_builddir)" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +genpot: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --gen-pot >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +paramasfunc1:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +paramasfunc2:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +negtime:: + @echo $@ + @TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: @@ -2460,6 +2631,16 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +badbuild: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +callparam: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + childin: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -2555,6 +2736,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +exitval3: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fcall_exit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -2725,6 +2911,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +inpref: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + inputred: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3027,6 +3218,16 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +regexpbrack: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +regexpbrack2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + regexprange: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3112,6 +3313,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +sortglos: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + splitargv: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3277,6 +3483,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +crlf: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + delsub: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3302,6 +3513,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +fpat4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fpatnull: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3412,11 +3628,21 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +indirectbuiltin: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + indirectcall: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +indirectcall2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + lint: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3477,6 +3703,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +printfbad4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + procinfs: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3487,9 +3718,14 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -rebuf: +regnul1: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +regnul2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ regx8bit: @@ -3497,6 +3733,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +rsgetline: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + rstest6: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3630,11 +3871,6 @@ @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - -filefuncs: - @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ fork: @echo $@ diff -urN gawk-4.1.1/test/Maketests gawk-4.1.2/test/Maketests --- gawk-4.1.1/test/Maketests 2014-04-08 19:13:12.000000000 +0300 +++ gawk-4.1.2/test/Maketests 2015-04-28 16:49:46.000000000 +0300 @@ -125,6 +125,16 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +badbuild: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +callparam: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + childin: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -220,6 +230,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +exitval3: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fcall_exit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -390,6 +405,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +inpref: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + inputred: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -692,6 +712,16 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +regexpbrack: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +regexpbrack2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + regexprange: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -777,6 +807,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +sortglos: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + splitargv: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -942,6 +977,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +crlf: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + delsub: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -967,6 +1007,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +fpat4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fpatnull: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1077,11 +1122,21 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +indirectbuiltin: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + indirectcall: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +indirectcall2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + lint: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1142,6 +1197,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +printfbad4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + procinfs: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1152,9 +1212,14 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -rebuf: +regnul1: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +regnul2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ regx8bit: @@ -1162,6 +1227,11 @@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +rsgetline: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + rstest6: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1295,11 +1365,6 @@ @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - -filefuncs: - @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ fork: @echo $@ diff -urN gawk-4.1.1/test/badargs.ok gawk-4.1.2/test/badargs.ok --- gawk-4.1.1/test/badargs.ok 2014-01-20 21:53:00.000000000 +0200 +++ gawk-4.1.2/test/badargs.ok 2015-04-05 11:13:50.000000000 +0300 @@ -17,10 +17,10 @@ -h --help -i includefile --include=includefile -l library --load=library - -L [fatal] --lint[=fatal] - -n --non-decimal-data + -L[fatal|invalid] --lint[=fatal|invalid] -M --bignum -N --use-lc-numeric + -n --non-decimal-data -o[file] --pretty-print[=file] -O --optimize -p[file] --profile[=file] diff -urN gawk-4.1.1/test/badbuild.awk gawk-4.1.2/test/badbuild.awk --- gawk-4.1.1/test/badbuild.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/badbuild.awk 2015-04-27 18:07:32.000000000 +0300 @@ -0,0 +1,6 @@ +$1 == $2 == $3 { + print "Gawk was built incorrectly." + print "Use bison, not byacc or something else!" + print "(Really, why aren't you using the awkgram.c in the distribution?)" + exit 42 +} diff -urN gawk-4.1.1/test/badbuild.in gawk-4.1.2/test/badbuild.in --- gawk-4.1.1/test/badbuild.in 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/badbuild.in 2015-04-27 18:07:32.000000000 +0300 @@ -0,0 +1 @@ +a a 1 diff -urN gawk-4.1.1/test/badbuild.ok gawk-4.1.2/test/badbuild.ok --- gawk-4.1.1/test/badbuild.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/badbuild.ok 2015-04-27 18:07:32.000000000 +0300 @@ -0,0 +1,3 @@ +gawk: badbuild.awk:1: $1 == $2 == $3 { +gawk: badbuild.awk:1: ^ syntax error +EXIT CODE: 1 diff -urN gawk-4.1.1/test/callparam.awk gawk-4.1.2/test/callparam.awk --- gawk-4.1.1/test/callparam.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/callparam.awk 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,6 @@ +BEGIN { f() } + +function f( a, b) +{ + a = b() +} diff -urN gawk-4.1.1/test/callparam.ok gawk-4.1.2/test/callparam.ok --- gawk-4.1.1/test/callparam.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/callparam.ok 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,2 @@ +gawk: callparam.awk:5: error: attempt to use non-function `b' in function call +EXIT CODE: 1 diff -urN gawk-4.1.1/test/crlf.awk gawk-4.1.2/test/crlf.awk --- gawk-4.1.1/test/crlf.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/crlf.awk 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,11 @@ +BEGIN { + print \ + "hi there" + print "hello \ +world" + if ("foo" ~ /fo\ +o/) + print "matches" + else + print "does not match!" +} diff -urN gawk-4.1.1/test/crlf.ok gawk-4.1.2/test/crlf.ok --- gawk-4.1.1/test/crlf.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/crlf.ok 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,3 @@ +hi there +hello world +matches diff -urN gawk-4.1.1/test/dbugeval.in gawk-4.1.2/test/dbugeval.in --- gawk-4.1.1/test/dbugeval.in 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/dbugeval.in 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,2 @@ +eval "" +eval "" diff -urN gawk-4.1.1/test/dbugeval.ok gawk-4.1.2/test/dbugeval.ok --- gawk-4.1.1/test/dbugeval.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/dbugeval.ok 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1 @@ +EXIT CODE: 2 diff -urN gawk-4.1.1/test/exit.sh gawk-4.1.2/test/exit.sh --- gawk-4.1.1/test/exit.sh 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/exit.sh 2015-04-27 18:09:07.000000000 +0300 @@ -30,7 +30,7 @@ $AWK 'BEGIN { print "a\nb" }' | $AWK "$x" echo "-- 5" -y='function strip(f) { sub(/.*\//, "", f); return f };' +y='function strip(val) { sub(/.*\//, "", val); return val };' x='BEGINFILE{if(++i==1) exit;}; END{print i, strip(FILENAME)}' $AWK "$y$x" /dev/null $0 diff -urN gawk-4.1.1/test/exitval3.awk gawk-4.1.2/test/exitval3.awk --- gawk-4.1.1/test/exitval3.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/exitval3.awk 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,2 @@ +BEGIN { exit 42 } +END { exit } diff -urN gawk-4.1.1/test/exitval3.ok gawk-4.1.2/test/exitval3.ok --- gawk-4.1.1/test/exitval3.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/exitval3.ok 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1 @@ +EXIT CODE: 42 diff -urN gawk-4.1.1/test/filefuncs.awk gawk-4.1.2/test/filefuncs.awk --- gawk-4.1.1/test/filefuncs.awk 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/filefuncs.awk 2015-04-05 11:13:50.000000000 +0300 @@ -1,7 +1,7 @@ @load "filefuncs" BEGIN { - if (chdir("..") < 0) { + if (chdir(builddir) < 0) { printf "Error: chdir failed with ERRNO %s\n", ERRNO exit 1 } diff -urN gawk-4.1.1/test/fpat4.awk gawk-4.1.2/test/fpat4.awk --- gawk-4.1.1/test/fpat4.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/fpat4.awk 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,105 @@ +BEGIN { + false = 0 + true = 1 + + fpat[1] = "([^,]*)|(\"[^\"]+\")" + fpat[2] = fpat[1] + fpat[3] = fpat[1] + fpat[4] = "aa+" + fpat[5] = fpat[4] + fpat[6] = "[a-z]" + + data[1] = "Robbins,,Arnold," + data[2] = "Smith,,\"1234 A Pretty Place, NE\",Sometown,NY,12345-6789,USA" + data[3] = "Robbins,Arnold,\"1234 A Pretty Place, NE\",Sometown,NY,12345-6789,USA" + data[4] = "bbbaaacccdddaaaaaqqqq" + data[5] = "bbbaaacccdddaaaaaqqqqa" # should get trailing qqqa + data[6] = "aAbBcC" + + for (i = 1; i in data; i++) { + printf("Splitting: <%s>\n", data[i]) + n = mypatsplit(data[i], fields, fpat[i], seps) + m = patsplit(data[i], fields2, fpat[i], seps2) + print "n =", n, "m =", m + if (n != m) { + printf("ERROR: counts wrong!\n") > "/dev/stderr" + exit 1 + } + for (j = 1; j <= n; j++) { + printf("fields[%d] = <%s>\tfields2[%d] = <%s>\n", j, fields[j], j, fields2[j]) + if (fields[j] != fields2[j]) { + printf("ERROR: data %d, field %d mismatch!\n", i, j) > "/dev/stderr" + exit 1 + } + } + for (j = 0; j in seps; j++) { + printf("seps[%d] = <%s>\tseps2[%d] = <%s>\n", j, seps[j], j, seps2[j]) + if (seps[j] != seps2[j]) { + printf("ERROR: data %d, separator %d mismatch!\n", i, j) > "/dev/stderr" + exit 1 + } + } + } +} + +function mypatsplit(string, array, pattern, seps, + eosflag, non_empty, nf) # locals +{ + delete array + delete seps + if (length(string) == 0) + return 0 + + eosflag = non_empty = false + nf = 0 + while (match(string, pattern)) { + if (RLENGTH > 0) { # easy case + non_empty = true + if (! (nf in seps)) { + if (RSTART == 1) # match at front of string + seps[nf] = "" + else + seps[nf] = substr(string, 1, RSTART - 1) + } + array[++nf] = substr(string, RSTART, RLENGTH) + string = substr(string, RSTART+RLENGTH) + if (length(string) == 0) + break + } else if (non_empty) { + # last match was non-empty, and at the + # current character we get a zero length match, + # which we don't want, so skip over it + non_empty = false + seps[nf] = substr(string, 1, 1) + string = substr(string, 2) + } else { + # 0 length match + if (! (nf in seps)) { + if (RSTART == 1) + seps[nf] = "" + else + seps[nf] = substr(string, 1, RSTART - 1) + } + array[++nf] = "" + if (! non_empty && ! eosflag) { # prev was empty + seps[nf] = substr(string, 1, 1) + } + if (RSTART == 1) { + string = substr(string, 2) + } else { + string = substr(string, RSTART + 1) + } + non_empty = false + } + if (length(string) == 0) { + if (eosflag) + break + else + eosflag = true + } + } + if (length(string) > 0) + seps[nf] = string + + return length(array) +} diff -urN gawk-4.1.1/test/fpat4.ok gawk-4.1.2/test/fpat4.ok --- gawk-4.1.1/test/fpat4.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/fpat4.ok 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,65 @@ +Splitting: +n = 4 m = 4 +fields[1] = fields2[1] = +fields[2] = <> fields2[2] = <> +fields[3] = fields2[3] = +fields[4] = <> fields2[4] = <> +seps[0] = <> seps2[0] = <> +seps[1] = <,> seps2[1] = <,> +seps[2] = <,> seps2[2] = <,> +seps[3] = <,> seps2[3] = <,> +Splitting: +n = 7 m = 7 +fields[1] = fields2[1] = +fields[2] = <> fields2[2] = <> +fields[3] = <"1234 A Pretty Place, NE"> fields2[3] = <"1234 A Pretty Place, NE"> +fields[4] = fields2[4] = +fields[5] = fields2[5] = +fields[6] = <12345-6789> fields2[6] = <12345-6789> +fields[7] = fields2[7] = +seps[0] = <> seps2[0] = <> +seps[1] = <,> seps2[1] = <,> +seps[2] = <,> seps2[2] = <,> +seps[3] = <,> seps2[3] = <,> +seps[4] = <,> seps2[4] = <,> +seps[5] = <,> seps2[5] = <,> +seps[6] = <,> seps2[6] = <,> +Splitting: +n = 7 m = 7 +fields[1] = fields2[1] = +fields[2] = fields2[2] = +fields[3] = <"1234 A Pretty Place, NE"> fields2[3] = <"1234 A Pretty Place, NE"> +fields[4] = fields2[4] = +fields[5] = fields2[5] = +fields[6] = <12345-6789> fields2[6] = <12345-6789> +fields[7] = fields2[7] = +seps[0] = <> seps2[0] = <> +seps[1] = <,> seps2[1] = <,> +seps[2] = <,> seps2[2] = <,> +seps[3] = <,> seps2[3] = <,> +seps[4] = <,> seps2[4] = <,> +seps[5] = <,> seps2[5] = <,> +seps[6] = <,> seps2[6] = <,> +Splitting: +n = 2 m = 2 +fields[1] = fields2[1] = +fields[2] = fields2[2] = +seps[0] = seps2[0] = +seps[1] = seps2[1] = +seps[2] = seps2[2] = +Splitting: +n = 2 m = 2 +fields[1] = fields2[1] = +fields[2] = fields2[2] = +seps[0] = seps2[0] = +seps[1] = seps2[1] = +seps[2] = seps2[2] = +Splitting: +n = 3 m = 3 +fields[1] =
fields2[1] = +fields[2] = fields2[2] = +fields[3] = fields2[3] = +seps[0] = <> seps2[0] = <> +seps[1] = seps2[1] = +seps[2] = seps2[2] = +seps[3] = seps2[3] = diff -urN gawk-4.1.1/test/fts.awk gawk-4.1.2/test/fts.awk --- gawk-4.1.1/test/fts.awk 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/fts.awk 2015-04-27 18:09:07.000000000 +0300 @@ -69,7 +69,9 @@ traverse(data[i]) } Level-- - } else { + } else if (data[i] != "atime") { + # 4/2015: skip for atime, since there can + # occasionally be small differences. indent() printf("%s --> %s\n", i, data[i]) > output } diff -urN gawk-4.1.1/test/functab4.awk gawk-4.1.2/test/functab4.awk --- gawk-4.1.1/test/functab4.awk 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/functab4.awk 2015-04-05 11:13:50.000000000 +0300 @@ -6,9 +6,25 @@ } BEGIN { - x = FUNCTAB["chdir"] - print "x =", x - @x("/tmp") - printf "we are now in --> " - system("/bin/pwd || /usr/bin/pwd") + f = FUNCTAB["foo"] + @f() + + ret1 = stat(".", data1) + print "ret1 =", ret1 + + f = "stat" + ret2 = @f(".", data2) + print "ret2 =", ret2 + + problem = 0 + for (i in data1) { + if (! isarray(data1[i])) { +# print i, data1[i] + if (! (i in data2) || data1[i] != data2[i]) { + printf("mismatch element \"%s\"\n", i) + problems++ + } + } + } + print(problems ? (problems+0) "encountered" : "no problems encountered") } diff -urN gawk-4.1.1/test/functab4.ok gawk-4.1.2/test/functab4.ok --- gawk-4.1.1/test/functab4.ok 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/functab4.ok 2015-04-05 11:13:50.000000000 +0300 @@ -1,3 +1,4 @@ -x = chdir -gawk: functab4.awk:11: fatal: cannot (yet) call extension functions indirectly -EXIT CODE: 2 +foo! +ret1 = 0 +ret2 = 0 +no problems encountered diff -urN gawk-4.1.1/test/genpot.awk gawk-4.1.2/test/genpot.awk --- gawk-4.1.1/test/genpot.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/genpot.awk 2015-04-05 13:19:19.000000000 +0300 @@ -0,0 +1 @@ +{print _"This string is so long that gawk --gen-pot will break it and lose a letter at the break."} diff -urN gawk-4.1.1/test/genpot.ok gawk-4.1.2/test/genpot.ok --- gawk-4.1.1/test/genpot.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/genpot.ok 2015-04-05 13:19:19.000000000 +0300 @@ -0,0 +1,5 @@ +#: genpot.awk:1 +msgid "This string is so long that gawk --gen-pot will break it and lose a l" +"etter at the break." +msgstr "" + diff -urN gawk-4.1.1/test/gensub2.ok gawk-4.1.2/test/gensub2.ok --- gawk-4.1.1/test/gensub2.ok 2012-05-03 21:13:57.000000000 +0300 +++ gawk-4.1.2/test/gensub2.ok 2015-04-27 18:04:11.000000000 +0300 @@ -1,3 +1,4 @@ xy xy +gawk: gensub2.awk:4: warning: gensub: third argument `a' treated as 1 yx diff -urN gawk-4.1.1/test/id.ok gawk-4.1.2/test/id.ok --- gawk-4.1.1/test/id.ok 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/id.ok 2015-04-28 16:49:46.000000000 +0300 @@ -1,32 +1,74 @@ -FUNCTAB -> array -ARGV -> array -SYMTAB -> array -ORS -> scalar -ROUNDMODE -> scalar -i -> untyped OFS -> scalar +rand -> builtin +ARGC -> scalar +dcgettext -> builtin +gsub -> builtin +PREC -> scalar +match -> builtin +ARGIND -> scalar +int -> builtin ERRNO -> scalar +ARGV -> array +log -> builtin +sprintf -> builtin +ROUNDMODE -> scalar +strftime -> builtin +systime -> builtin +length -> builtin +and -> builtin +srand -> builtin FNR -> scalar +asort -> builtin +atan2 -> builtin +cos -> builtin +TEXTDOMAIN -> scalar +ORS -> scalar +split -> builtin +RSTART -> scalar +compl -> builtin +bindtextdomain -> builtin +exp -> builtin +or -> builtin +fflush -> builtin +gensub -> builtin LINT -> scalar +dcngettext -> builtin +index -> builtin IGNORECASE -> scalar -NR -> scalar -function1 -> user -ARGIND -> scalar -NF -> scalar -TEXTDOMAIN -> scalar +system -> builtin CONVFMT -> scalar +sqrt -> builtin +rshift -> builtin +tolower -> builtin +FS -> scalar +BINMODE -> scalar +sin -> builtin +asorti -> builtin FIELDWIDTHS -> scalar -ARGC -> scalar +function1 -> user +FILENAME -> scalar +close -> builtin +mktime -> builtin +FUNCTAB -> array +NF -> scalar +isarray -> builtin an_array -> untyped -PROCINFO -> array -PREC -> scalar +patsplit -> builtin +NR -> scalar SUBSEP -> scalar -FPAT -> scalar -RS -> scalar -FS -> scalar +extension -> builtin +i -> untyped +sub -> builtin OFMT -> scalar RLENGTH -> scalar +substr -> builtin +FPAT -> scalar +RS -> scalar +xor -> builtin RT -> scalar -BINMODE -> scalar -FILENAME -> scalar -RSTART -> scalar +PROCINFO -> array +lshift -> builtin +SYMTAB -> array +strtonum -> builtin +toupper -> builtin +ENVIRON -> array diff -urN gawk-4.1.1/test/indirectbuiltin.awk gawk-4.1.2/test/indirectbuiltin.awk --- gawk-4.1.1/test/indirectbuiltin.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/indirectbuiltin.awk 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,377 @@ +function print_result(category, fname, builtin_result, indirect_result) +{ + if (builtin_result == indirect_result) + printf("%s: %s: pass\n", category, fname) + else { + printf("%s: %s: fail: builtin: %s \tindirect: %s\n", category, fname, + builtin_result, indirect_result) + exit 1 + } +} + + +BEGIN { +# math functions + + fun = "and" + b1 = and(0x11, 0x01) + i1 = @fun(0x11, 0x01) + print_result("math", fun, b1, i1) + + fun = "atan2" + b1 = atan2(-1, 0) + i1 = @fun(-1, 0) + print_result("math", fun, b1, i1) + + fun = "compl" + b1 = compl(0x1111) + i1 = @fun(0x1111) + print_result("math", fun, b1, i1) + + fun = "cos" + b1 = cos(3.1415927 / 4) + i1 = @fun(3.1415927 / 4) + print_result("math", fun, b1, i1) + + fun = "exp" + b1 = exp(2) + i1 = @fun(2) + print_result("math", fun, b1, i1) + + fun = "int" + b1 = int(3.1415927) + i1 = @fun(3.1415927) + print_result("math", fun, b1, i1) + + fun = "log" + b1 = log(10) + i1 = @fun(10) + print_result("math", fun, b1, i1) + + fun = "lshift" + b1 = lshift(1, 2) + i1 = @fun(1, 2) + print_result("math", fun, b1, i1) + + fun = "or" + b1 = or(0x10, 0x01) + i1 = @fun(0x10, 0x01) + print_result("math", fun, b1, i1) + + fun = "rand" + srand(1) + b1 = rand(); + srand(1) + i1 = @fun() + print_result("math", fun, b1, i1) + + fun = "rshift" + b1 = rshift(0x10, 1) + i1 = @fun(0x10, 1) + print_result("math", fun, b1, i1) + + fun = "sin" + b1 = sin(3.1415927 / 4) + i1 = @fun(3.1415927 / 4) + print_result("math", fun, b1, i1) + + fun = "sqrt" + b1 = sqrt(2) + i1 = @fun(2) + print_result("math", fun, b1, i1) + + srand() + fun = "srand" + b1 = srand() + i1 = @fun() + print_result("math", fun, b1, i1) + + fun = "xor" + b1 = xor(0x11, 0x01) + i1 = @fun(0x11, 0x01) + print_result("math", fun, b1, i1) + +# string functions + + fun = "gensub" + b1 = gensub("f", "q", "g", "ff11bb") + i1 = @fun("f", "q", "g", "ff11bb") + print_result("string", fun, b1, i1) + + fun = "gensub" + $0 = "ff11bb" + b1 = gensub("f", "q", "g") + i1 = @fun("f", "q", "g") + print_result("string", fun " (3 args)", b1, i1) + + fun = "gsub" + $0 = "ff11bb" + b1 = gsub("f", "q") + b2 = $0 + $0 = "ff11bb" + i1 = @fun("f", "q") + i2 = $0 + print_result("string", fun, b1, i1) + if (b2 != i2) { + printf("string: %s: fail: $0 (%s) != $0 (%s)\n", + fun, b2, i2) + exit 1 + } + + fun = "index" + b1 = index("hi, how are you", "how") + i1 = @fun("hi, how are you", "how") + print_result("string", fun, b1, i1) + + fun = "dcgettext" + b1 = dcgettext("hello, world") + i1 = @fun("hello, world") + print_result("string", fun, b1, i1) + + fun = "dcngettext" + b1 = dcngettext("hello, world", "howdy", 2) + i1 = @fun("hello, world", "howdy", 2) + print_result("string", fun, b1, i1) + + fun = "length" + b1 = length("hi, how are you") + i1 = @fun("hi, how are you") + print_result("string", fun, b1, i1) + + fun = "sprintf" + b1 = sprintf("%s world", "hello") + i1 = @fun("%s world", "hello") + print_result("string", fun, b1, i1) + + fun = "strtonum" + b1 = strtonum("0xdeadbeef") + i1 = @fun("0xdeadbeef") + print_result("string", fun, b1, i1) + + fun = "sub" + $0 = "ff11bb" + b1 = sub("f", "q") + b2 = $0 + $0 = "ff11bb" + i1 = @fun("f", "q") + i2 = $0 + print_result("string", fun, b1, i1) + if (b2 != i2) { + printf("string: %s: fail: $0 (%s) != $0 (%s)\n", + fun, b2, i2) + exit 1 + } + + fun = "substr" + b1 = substr("0xdeadbeef", 7, 4) + i1 = @fun("0xdeadbeef", 7, 4) + print_result("string", fun, b1, i1) + + fun = "tolower" + b1 = tolower("0xDeAdBeEf") + i1 = @fun("0xDeAdBeEf") + print_result("string", fun, b1, i1) + + fun = "toupper" + b1 = toupper("0xDeAdBeEf") + i1 = @fun("0xDeAdBeEf") + print_result("string", fun, b1, i1) + +# time functions + + fun = "mktime" + b1 = mktime("1990 02 11 12 00 00") + i1 = @fun("1990 02 11 12 00 00") + print_result("time", fun, b1, i1) + + then = b1 + fun = "strftime" + b1 = strftime(PROCINFO["strftime"], then) + i1 = @fun(PROCINFO["strftime"], then) + print_result("time", fun, b1, i1) + + fun = "systime" + b1 = systime() + i1 = @fun() + print_result("time", fun, b1, i1) + +# regexp functions + + fun = "match" + b1 = match("o+", "fooob") + rstart = RSTART + rlength = RLENGTH + i1 = @fun("o+", "fooob") + print_result("regexp", fun, b1, i1) + if (rstart != RSTART) { + printf("match: failure: biRSTART (%d) != iRSTART (%d)\n", + rstart, RSTART) + exit 1 + } + if (rlength != RLENGTH) { + printf("match: failure: biRLENGTH (%d) != iRLENGTH (%d)\n", + rlength, RLENGTH) + exit 1 + } + + ############## start patsplit ############## + fun = "patsplit" + delete data + delete data2 + delete seps + delete seps2 + b1 = patsplit("a:b:c:d", data, ":", seps) + i1 = @fun("a:b:c:d", data2, ":", seps2) + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("patsplit1a: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + for (i in seps) { + if ((! (i in seps2)) || seps[i] != seps2[i]) { + printf("patsplit1b: fail: builtin seps[%d] (%s) != indirect seps[%d] (%s)\n", + i, seps[i], i, seps2[i]) + exit 1 + } + } + + fun = "patsplit" + delete data + delete data2 + b1 = patsplit("a:b:c:d", data, ":") + i1 = @fun("a:b:c:d", data2, ":") + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("patsplit2: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + + fun = "patsplit" + delete data + delete data2 + FPAT = "[a-z]+" + b1 = patsplit("a b c d", data) + i1 = @fun("a b c d", data2) + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("patsplit3: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + ############## end patsplit ############## + + ############## start split ############## + fun = "split" + delete data + delete data2 + delete seps + delete seps2 + b1 = split("a:b:c:d", data, ":", seps) + i1 = @fun("a:b:c:d", data2, ":", seps2) + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("split1a: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + for (i in seps) { + if ((! (i in seps2)) || seps[i] != seps2[i]) { + printf("split1b: fail: builtin seps[%d] (%s) != indirect seps[%d] (%s)\n", + i, seps[i], i, seps2[i]) + exit 1 + } + } + + fun = "split" + delete data + delete data2 + b1 = split("a:b:c:d", data, ":") + i1 = @fun("a:b:c:d", data2, ":") + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("split2: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + + fun = "split" + delete data + delete data2 + b1 = split("a b c d", data) + i1 = @fun("a b c d", data2) + print_result("regexp", fun, b1, i1) + for (i in data) { + if ((! (i in data2)) || data[i] != data2[i]) { + printf("split3: fail: builtin data[%d] (%s) != indirect data[%d] (%s)\n", + i, data[i], i, data2[i]) + exit 1 + } + } + ############## end split ############## + +# array functions + + split("z y x w v u t", data) + fun = "asort" + asort(data, newdata) + @fun(data, newdata2) + print_result("array", fun, b1, i1) + for (i in newdata) { + if (! (i in newdata2) || newdata[i] != newdata2[i]) { + print fun ": failed, index", i + exit + } + } + + for (i in data) + data2[data[i]] = i + + fun = "asorti" + asorti(data2, newdata) + @fun(data2, newdata2) + print_result("array", fun, b1, i1) + for (i in newdata) { + if (! (i in newdata2) || newdata[i] != newdata2[i]) { + print fun ": failed, index", i, "value", newdata[i], newdata2[i] + exit + } + } + + arr[1] = arr[2] = 42 + fun = "isarray" + b1 = isarray(arr) + i1 = @fun(arr) + print_result("array", fun, b1, i1) + +# i/o functions + + print("hi") > "x1.out" + print("hi") > "x2.out" + + fun = "fflush" + b1 = fflush("x1.out") + i1 = @fun("x2.out") + print_result("i/o", fun, b1, i1) + + fun = "close" + b1 = close("x1.out") + i1 = @fun("x2.out") + print_result("i/o", fun, b1, i1) + + fun = "system" + b1 = system("rm x1.out") + i1 = @fun("rm x2.out") + print_result("i/o", fun, b1, i1) +} diff -urN gawk-4.1.1/test/indirectbuiltin.ok gawk-4.1.2/test/indirectbuiltin.ok --- gawk-4.1.1/test/indirectbuiltin.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/indirectbuiltin.ok 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,44 @@ +math: and: pass +math: atan2: pass +math: compl: pass +math: cos: pass +math: exp: pass +math: int: pass +math: log: pass +math: lshift: pass +math: or: pass +math: rand: pass +math: rshift: pass +math: sin: pass +math: sqrt: pass +math: srand: pass +math: xor: pass +string: gensub: pass +string: gensub (3 args): pass +string: gsub: pass +string: index: pass +string: dcgettext: pass +string: dcngettext: pass +string: length: pass +string: sprintf: pass +string: strtonum: pass +string: sub: pass +string: substr: pass +string: tolower: pass +string: toupper: pass +time: mktime: pass +time: strftime: pass +time: systime: pass +regexp: match: pass +regexp: patsplit: pass +regexp: patsplit: pass +regexp: patsplit: pass +regexp: split: pass +regexp: split: pass +regexp: split: pass +array: asort: pass +array: asorti: pass +array: isarray: pass +i/o: fflush: pass +i/o: close: pass +i/o: system: pass diff -urN gawk-4.1.1/test/indirectcall2.awk gawk-4.1.2/test/indirectcall2.awk --- gawk-4.1.1/test/indirectcall2.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/indirectcall2.awk 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,11 @@ +BEGIN { + Quarter_pi = 3.1415927 / 4 + print sin(Quarter_pi) + + f = "sin" + print @f(Quarter_pi) + + print substr("abcdefgh", 2, 3) + f = "substr" + print @f("abcdefgh", 2, 3) +} diff -urN gawk-4.1.1/test/indirectcall2.ok gawk-4.1.2/test/indirectcall2.ok --- gawk-4.1.1/test/indirectcall2.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/indirectcall2.ok 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,4 @@ +0.707107 +0.707107 +bcd +bcd diff -urN gawk-4.1.1/test/inplace1.ok gawk-4.1.2/test/inplace1.ok --- gawk-4.1.1/test/inplace1.ok 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/inplace1.ok 2015-04-27 18:09:07.000000000 +0300 @@ -1,5 +1,5 @@ before -gawk: inplace:9: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' +gawk: inplace:14: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' stdin start is bar replaced? stdin end diff -urN gawk-4.1.1/test/inplace2.ok gawk-4.1.2/test/inplace2.ok --- gawk-4.1.1/test/inplace2.ok 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/inplace2.ok 2015-04-27 18:09:07.000000000 +0300 @@ -1,5 +1,5 @@ before -gawk: inplace:9: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' +gawk: inplace:14: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' stdin start is bar replaced? stdin end diff -urN gawk-4.1.1/test/inplace3.ok gawk-4.1.2/test/inplace3.ok --- gawk-4.1.1/test/inplace3.ok 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/inplace3.ok 2015-04-27 18:09:07.000000000 +0300 @@ -1,11 +1,11 @@ before -gawk: inplace:9: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' +gawk: inplace:14: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' stdin start is bar replaced? stdin end after Before -gawk: inplace:9: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' +gawk: inplace:14: warning: inplace_begin: disabling in-place editing for invalid FILENAME `-' stdin start is foo replaced? stdin end diff -urN gawk-4.1.1/test/inpref.awk gawk-4.1.2/test/inpref.awk --- gawk-4.1.1/test/inpref.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/inpref.awk 2015-04-28 16:49:35.000000000 +0300 @@ -0,0 +1,9 @@ +function test(x) { + print x + getline + print x +} + +{ + test($0) +} diff -urN gawk-4.1.1/test/inpref.in gawk-4.1.2/test/inpref.in --- gawk-4.1.1/test/inpref.in 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/inpref.in 2015-04-28 16:49:35.000000000 +0300 @@ -0,0 +1,2 @@ +hello +goodbye diff -urN gawk-4.1.1/test/inpref.ok gawk-4.1.2/test/inpref.ok --- gawk-4.1.1/test/inpref.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/inpref.ok 2015-04-28 16:49:35.000000000 +0300 @@ -0,0 +1,2 @@ +hello +hello diff -urN gawk-4.1.1/test/lintwarn.ok gawk-4.1.2/test/lintwarn.ok --- gawk-4.1.1/test/lintwarn.ok 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/lintwarn.ok 2015-04-05 11:13:50.000000000 +0300 @@ -1,6 +1,6 @@ gawk: lintwarn.awk:2: warning: `BEGINFILE' is a gawk extension -gawk: lintwarn.awk:3: error: `getline var' invalid inside `BEGINFILE' rule -gawk: lintwarn.awk:4: error: `getline' invalid inside `BEGINFILE' rule +gawk: lintwarn.awk:3: error: non-redirected `getline' invalid inside `BEGINFILE' rule +gawk: lintwarn.awk:4: error: non-redirected `getline' invalid inside `BEGINFILE' rule gawk: lintwarn.awk:8: warning: statement may have no effect gawk: lintwarn.awk:9: warning: plain `print' in BEGIN or END rule should probably be `print ""' gawk: lintwarn.awk:10: error: `nextfile' used in BEGIN action diff -urN gawk-4.1.1/test/mbprintf4.awk gawk-4.1.2/test/mbprintf4.awk --- gawk-4.1.1/test/mbprintf4.awk 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/mbprintf4.awk 2015-04-27 18:01:59.000000000 +0300 @@ -1,32 +1,35 @@ # printf with multi-byte text encoding, %c and %s, width and precision, and left-alignment. { - print "printf %c " $0 - printf "|%c|\n", $0 - printf "|%1c|\n", $0 - printf "|%3c|\n", $0 + count = 1 + + print NR, count++, "printf %c " $0 + printf "%d:%d: |%c|\n", NR, count++, $0 + printf "%d:%d: |%1c|\n", NR, count++, $0 + printf "%d:%d: |%3c|\n", NR, count++, $0 # precision is ignored by %c. - printf "|%3.1c|\n", $0 - printf "|%3.5c|\n", $0 - print "printf %-c " $0 - printf "|%-c|\n", $0 - printf "|%-1c|\n", $0 - printf "|%-3c|\n", $0 + printf "%d:%d: |%3.1c|\n", NR, count++, $0 + printf "%d:%d: |%3.5c|\n", NR, count++, $0 + print NR, count++, "printf %-c " $0 + printf "%d:%d: |%-c|\n", NR, count++, $0 + printf "%d:%d: |%-1c|\n", NR, count++, $0 + printf "%d:%d: |%-3c|\n", NR, count++, $0 # precision is ignored by %c. - printf "|%-3.1c|\n", $0 - printf "|%-3.5c|\n", $0 + printf "%d:%d: |%-3.1c|\n", NR, count++, $0 + printf "%d:%d: |%-3.5c|\n", NR, count++, $0 printf ORS - print "printf %s " $0 - printf "|%s|\n", $0 - printf "|%1s|\n", $0 - printf "|%3s|\n", $0 - printf "|%3.1s|\n", $0 - printf "|%3.5s|\n", $0 - print "printf %-s " $0 - printf "|%-s|\n", $0 - printf "|%-1s|\n", $0 - printf "|%-3s|\n", $0 - printf "|%-3.1s|\n", $0 - printf "|%-3.5s|\n", $0 + print NR, count++, "printf %s " $0 + printf "%d:%d: |%s|\n", NR, count++, $0 + printf "%d:%d: |%1s|\n", NR, count++, $0 + printf "%d:%d: |%3s|\n", NR, count++, $0 + printf "%d:%d: |%3.1s|\n", NR, count++, $0 + printf "%d:%d: |%3.5s|\n", NR, count++, $0 + + print NR, count++, "printf %-s " $0 + printf "%d:%d: |%-s|\n", NR, count++, $0 + printf "%d:%d: |%-1s|\n", NR, count++, $0 + printf "%d:%d: |%-3s|\n", NR, count++, $0 + printf "%d:%d: |%-3.1s|\n", NR, count++, $0 + printf "%d:%d: |%-3.5s|\n", NR, count++, $0 printf ORS ORS } diff -urN gawk-4.1.1/test/mbprintf4.ok gawk-4.1.2/test/mbprintf4.ok --- gawk-4.1.1/test/mbprintf4.ok 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/mbprintf4.ok 2015-04-27 18:01:59.000000000 +0300 @@ -1,81 +1,81 @@ -printf %c ú -|ú| -|ú| -| ú| -| ú| -| ú| -printf %-c ú -|ú| -|ú| -|ú | -|ú | -|ú | - -printf %s ú -|ú| -|ú| -| ú| -| ú| -| ú| -printf %-s ú -|ú| -|ú| -|ú | -|ú | -|ú | - - -printf %c último -|ú| -|ú| -| ú| -| ú| -| ú| -printf %-c último -|ú| -|ú| -|ú | -|ú | -|ú | - -printf %s último -|último| -|último| -|último| -| ú| -|últim| -printf %-s último -|último| -|último| -|último| -|ú | -|últim| - - -printf %c áé -|á| -|á| -| á| -| á| -| á| -printf %-c áé -|á| -|á| -|á | -|á | -|á | - -printf %s áé -|áé| -|áé| -| áé| -| á| -| áé| -printf %-s áé -|áé| -|áé| -|áé | -|á | -|áé | +1 1 printf %c ú +1:2: |ú| +1:3: |ú| +1:4: | ú| +1:5: | ú| +1:6: | ú| +1 7 printf %-c ú +1:8: |ú| +1:9: |ú| +1:10: |ú | +1:11: |ú | +1:12: |ú | + +1 13 printf %s ú +1:14: |ú| +1:15: |ú| +1:16: | ú| +1:17: | ú| +1:18: | ú| +1 19 printf %-s ú +1:20: |ú| +1:21: |ú| +1:22: |ú | +1:23: |ú | +1:24: |ú | + + +2 1 printf %c último +2:2: |ú| +2:3: |ú| +2:4: | ú| +2:5: | ú| +2:6: | ú| +2 7 printf %-c último +2:8: |ú| +2:9: |ú| +2:10: |ú | +2:11: |ú | +2:12: |ú | + +2 13 printf %s último +2:14: |último| +2:15: |último| +2:16: |último| +2:17: | ú| +2:18: |últim| +2 19 printf %-s último +2:20: |último| +2:21: |último| +2:22: |último| +2:23: |ú | +2:24: |últim| + + +3 1 printf %c áé +3:2: |á| +3:3: |á| +3:4: | á| +3:5: | á| +3:6: | á| +3 7 printf %-c áé +3:8: |á| +3:9: |á| +3:10: |á | +3:11: |á | +3:12: |á | + +3 13 printf %s áé +3:14: |áé| +3:15: |áé| +3:16: | áé| +3:17: | á| +3:18: | áé| +3 19 printf %-s áé +3:20: |áé| +3:21: |áé| +3:22: |áé | +3:23: |á | +3:24: |áé | diff -urN gawk-4.1.1/test/mpfrmemok1.awk gawk-4.1.2/test/mpfrmemok1.awk --- gawk-4.1.1/test/mpfrmemok1.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/mpfrmemok1.awk 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,7 @@ +# This program tests that -M works with profiling. +# It does not do anything real, but there should not be glibc memory +# errors and it should be valgrind-clean too. + +BEGIN { + v = 0x0100000000000000000000000000000000 +} diff -urN gawk-4.1.1/test/mpfrmemok1.ok gawk-4.1.2/test/mpfrmemok1.ok --- gawk-4.1.1/test/mpfrmemok1.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/mpfrmemok1.ok 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,7 @@ + + # BEGIN rule(s) + + BEGIN { + 1 v = 340282366920938463463374607431768211456 + } + diff -urN gawk-4.1.1/test/mpfrrem.awk gawk-4.1.2/test/mpfrrem.awk --- gawk-4.1.1/test/mpfrrem.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/mpfrrem.awk 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,6 @@ +BEGIN { + print "15 % 7 =", 15 % 7 + print "15 % -7 =", 15 % -7 + print "-15 % 7 =", -15 % 7 + print "-15 % -7 =", -15 % -7 +} diff -urN gawk-4.1.1/test/mpfrrem.ok gawk-4.1.2/test/mpfrrem.ok --- gawk-4.1.1/test/mpfrrem.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/mpfrrem.ok 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,4 @@ +15 % 7 = 1 +15 % -7 = 1 +-15 % 7 = -1 +-15 % -7 = -1 diff -urN gawk-4.1.1/test/mpfrsqrt.awk gawk-4.1.2/test/mpfrsqrt.awk --- gawk-4.1.1/test/mpfrsqrt.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/mpfrsqrt.awk 2015-04-28 16:49:46.000000000 +0300 @@ -0,0 +1,82 @@ +# Date: Sat, 02 Aug 2014 12:27:00 -0400 +# To: bug-gawk@gnu.org +# From: Katherine Wasserman +# Message-ID: +# Subject: [bug-gawk] GAWK 4.1 SQRT() bug +# +# In version 4.1.60 of GAWK the sqrt() function does not work correctly on bignums. +# Here's a demo of the problem along with, a function that does work correctly. +# +# Running this program (sqrt-bug.awk): +# -------------------------------------------------------------------- +BEGIN { +a=11111111111111111111111111111111111111111111111111111111111 +print sqrt(a^2) +#print sq_root(a^2) + +# ADR: Added for gawk-4.1-stable which doesn't have built-in div() function +if (PROCINFO["version"] < "4.1.60") + print sq_root2(a^2) +else + print sq_root(a^2) +} + + +function sq_root(x, temp,r,z) +{ temp=substr(x,1,length(x)/2) + 0 # a good first guess + z=0 + while (abs(z-temp)>1) + { z=temp + div(x,temp,r) + temp=r["quotient"] + temp + div(temp,2,r) + temp=r["quotient"] + } + return temp +} + +function sq_root2(x, temp,r,z) +{ temp=substr(x,1,length(x)/2) + 0 # a good first guess + z=0 + while (abs(z-temp)>1) + { z=temp + awk_div(x,temp,r) + temp=r["quotient"] + temp + awk_div(temp,2,r) + temp=r["quotient"] + } + return temp +} + +function abs(x) +{ return (x<0 ? -x : x) +} +# +# -------------------------------------------------------------------- +# gawk -M -f sqrt-bug.awk +# +# results in: +# 11111111111111111261130863809439559987542611609749437808640 +# 11111111111111111111111111111111111111111111111111111111111 +# +# Thanks, +# Katie +# + +# div --- do integer division + +function awk_div(numerator, denominator, result, i, save_PREC) +{ + save_PREC = PREC + PREC = 400 # good enough for this test + + split("", result) + + numerator = int(numerator) + denominator = int(denominator) + result["quotient"] = int(numerator / denominator) + result["remainder"] = int(numerator % denominator) + + PREC = save_PREC + return 0.0 +} diff -urN gawk-4.1.1/test/mpfrsqrt.ok gawk-4.1.2/test/mpfrsqrt.ok --- gawk-4.1.1/test/mpfrsqrt.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/mpfrsqrt.ok 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,2 @@ +11111111111111111111111111111111111111111111111111111111111 +11111111111111111111111111111111111111111111111111111111111 diff -urN gawk-4.1.1/test/negtime.awk gawk-4.1.2/test/negtime.awk --- gawk-4.1.1/test/negtime.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/negtime.awk 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,4 @@ +BEGIN { +then = mktime("1959 12 15 7 00 00") +print strftime(PROCINFO["strftime"], then) +} diff -urN gawk-4.1.1/test/negtime.ok gawk-4.1.2/test/negtime.ok --- gawk-4.1.1/test/negtime.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/negtime.ok 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1 @@ +Tue Dec 15 07:00:00 GMT 1959 diff -urN gawk-4.1.1/test/ofs1.ok gawk-4.1.2/test/ofs1.ok --- gawk-4.1.1/test/ofs1.ok 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/ofs1.ok 2015-04-05 11:13:50.000000000 +0300 @@ -1,7 +1,7 @@ -a:x:c +a x c a x c a x c a -a:x:c a x c -a:x:c +a x c +a x c diff -urN gawk-4.1.1/test/paramasfunc1.awk gawk-4.1.2/test/paramasfunc1.awk --- gawk-4.1.1/test/paramasfunc1.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/paramasfunc1.awk 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,9 @@ +BEGIN{ X() } + +function X( abc) +{ + abc = "stamp out " + print abc abc() +} + +function abc() { return "dark corners" } diff -urN gawk-4.1.1/test/paramasfunc1.ok gawk-4.1.2/test/paramasfunc1.ok --- gawk-4.1.1/test/paramasfunc1.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/paramasfunc1.ok 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,3 @@ +gawk: paramasfunc1.awk:6: error: attempt to use non-function `abc' in function call +gawk: error: function `X': can't use function `abc' as a parameter name +EXIT CODE: 1 diff -urN gawk-4.1.1/test/paramasfunc2.awk gawk-4.1.2/test/paramasfunc2.awk --- gawk-4.1.1/test/paramasfunc2.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/paramasfunc2.awk 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,10 @@ +BEGIN{ X() } + +function abc() { return "dark corners" } + +function X( abc) +{ + abc = "stamp out " + print abc abc() +} + diff -urN gawk-4.1.1/test/paramasfunc2.ok gawk-4.1.2/test/paramasfunc2.ok --- gawk-4.1.1/test/paramasfunc2.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/paramasfunc2.ok 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,3 @@ +gawk: paramasfunc2.awk:8: error: attempt to use non-function `abc' in function call +gawk: error: function `X': can't use function `abc' as a parameter name +EXIT CODE: 1 diff -urN gawk-4.1.1/test/printfbad4.awk gawk-4.1.2/test/printfbad4.awk --- gawk-4.1.1/test/printfbad4.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/printfbad4.awk 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,5 @@ +BEGIN { + for (i = 1; i <= 10; i++) { + printf "%03$*d %2$d \n", 4, 5, i + } +} diff -urN gawk-4.1.1/test/printfbad4.ok gawk-4.1.2/test/printfbad4.ok --- gawk-4.1.1/test/printfbad4.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/printfbad4.ok 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,2 @@ +gawk: printfbad4.awk:3: fatal: fatal: must use `count$' on all formats or none +EXIT CODE: 2 diff -urN gawk-4.1.1/test/printhuge.awk gawk-4.1.2/test/printhuge.awk --- gawk-4.1.1/test/printhuge.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/printhuge.awk 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,3 @@ +BEGIN { + printf("%c\n", sprintf("%c", (0xffffff00+255))) +} diff -urN gawk-4.1.1/test/printhuge.ok gawk-4.1.2/test/printhuge.ok --- gawk-4.1.1/test/printhuge.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/printhuge.ok 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1 @@ + diff -urN gawk-4.1.1/test/profile0.awk gawk-4.1.2/test/profile0.awk --- gawk-4.1.1/test/profile0.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/profile0.awk 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1 @@ +NR == 1 diff -urN gawk-4.1.1/test/profile0.in gawk-4.1.2/test/profile0.in --- gawk-4.1.1/test/profile0.in 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/profile0.in 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,2 @@ +line 1 +line 2 diff -urN gawk-4.1.1/test/profile0.ok gawk-4.1.2/test/profile0.ok --- gawk-4.1.1/test/profile0.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/profile0.ok 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,6 @@ + # Rule(s) + + 2 NR == 1 { # 1 + 1 print $0 + } + diff -urN gawk-4.1.1/test/profile2.ok gawk-4.1.2/test/profile2.ok --- gawk-4.1.1/test/profile2.ok 2014-02-20 20:36:56.000000000 +0200 +++ gawk-4.1.2/test/profile2.ok 2015-04-05 13:19:19.000000000 +0300 @@ -1,4 +1,4 @@ - # BEGIN block(s) + # BEGIN rule(s) BEGIN { 1 if (sortcmd == "") { @@ -7,7 +7,7 @@ 1 asplit("BEGIN:END:atan2:break:close:continue:cos:delete:" "do:else:exit:exp:for:getline:gsub:if:in:index:int:" "length:log:match:next:print:printf:rand:return:sin:" "split:sprintf:sqrt:srand:sub:substr:system:while", keywords, ":") 1 split("00:00:00:00:00:00:00:00:00:00:" "20:10:10:12:12:11:07:00:00:00:" "08:08:08:08:08:33:08:00:00:00:" "08:44:08:36:08:08:08:00:00:00:" "08:44:45:42:42:41:08", machine, ":") 1 state = 1 - 571 for (; ; ) { + 571 for (;;) { 571 symb = lex() 571 nextstate = substr(machine[state symb], 1, 1) 571 act = substr(machine[state symb], 2, 1) @@ -109,7 +109,7 @@ 571 function lex() { - 1702 for (; ; ) { + 1702 for (;;) { 1702 if (tok == "(eof)") { return 7 } diff -urN gawk-4.1.1/test/profile3.ok gawk-4.1.2/test/profile3.ok --- gawk-4.1.1/test/profile3.ok 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/profile3.ok 2015-04-05 13:19:19.000000000 +0300 @@ -1,4 +1,4 @@ - # BEGIN block(s) + # BEGIN rule(s) BEGIN { 1 the_func = "p" diff -urN gawk-4.1.1/test/profile4.ok gawk-4.1.2/test/profile4.ok --- gawk-4.1.1/test/profile4.ok 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/profile4.ok 2015-04-28 16:49:46.000000000 +0300 @@ -1,4 +1,4 @@ - # BEGIN block(s) + # BEGIN rule(s) BEGIN { a = "foo" (c = "bar") diff -urN gawk-4.1.1/test/profile5.ok gawk-4.1.2/test/profile5.ok --- gawk-4.1.1/test/profile5.ok 2014-02-20 20:36:56.000000000 +0200 +++ gawk-4.1.2/test/profile5.ok 2015-04-28 16:49:46.000000000 +0300 @@ -1,4 +1,4 @@ - # BEGIN block(s) + # BEGIN rule(s) BEGIN { _addlib("_BASE") @@ -263,7 +263,7 @@ _END() } - # END block(s) + # END rule(s) END { _EXIT() diff -urN gawk-4.1.1/test/profile6.awk gawk-4.1.2/test/profile6.awk --- gawk-4.1.1/test/profile6.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/profile6.awk 2015-04-05 13:19:19.000000000 +0300 @@ -0,0 +1,7 @@ +BEGIN { + x = 3 + print -(-x) + Q = "|" + print -3 Q (-4) + print -3 Q (-4) (-5) +} diff -urN gawk-4.1.1/test/profile6.ok gawk-4.1.2/test/profile6.ok --- gawk-4.1.1/test/profile6.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/profile6.ok 2015-04-05 13:19:19.000000000 +0300 @@ -0,0 +1,10 @@ + # BEGIN rule(s) + + BEGIN { + 1 x = 3 + 1 print -(-x) + 1 Q = "|" + 1 print -3 Q (-4) + 1 print -3 Q (-4) (-5) + } + diff -urN gawk-4.1.1/test/profile7.awk gawk-4.1.2/test/profile7.awk --- gawk-4.1.1/test/profile7.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/profile7.awk 2015-04-27 18:01:59.000000000 +0300 @@ -0,0 +1,12 @@ +BEGIN { + print 1 / 10 * 10 + print 1 / (10 * 10) + print 1 % 10 * 10 + print 1 % (10 * 10) + print (10 * 5) / 2 + print 10 * (5 / 2) + a = 5 + b = 3 + print a - 1 - b + print a + 1 - b +} diff -urN gawk-4.1.1/test/profile7.ok gawk-4.1.2/test/profile7.ok --- gawk-4.1.1/test/profile7.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/profile7.ok 2015-04-27 18:01:59.000000000 +0300 @@ -0,0 +1,15 @@ + # BEGIN rule(s) + + BEGIN { + 1 print 1 / 10 * 10 + 1 print 1 / (10 * 10) + 1 print 1 % 10 * 10 + 1 print 1 % (10 * 10) + 1 print 10 * 5 / 2 + 1 print 10 * 5 / 2 + 1 a = 5 + 1 b = 3 + 1 print a - 1 - b + 1 print a + 1 - b + } + diff -urN gawk-4.1.1/test/regexpbrack.awk gawk-4.1.2/test/regexpbrack.awk --- gawk-4.1.1/test/regexpbrack.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/regexpbrack.awk 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,2 @@ +/[]+()0-9.,$%/'"-]*$/ +/^[]+()0-9.,$%/'"-]*$/ diff -urN gawk-4.1.1/test/regexpbrack2.awk gawk-4.1.2/test/regexpbrack2.awk --- gawk-4.1.1/test/regexpbrack2.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/regexpbrack2.awk 2015-04-28 16:49:35.000000000 +0300 @@ -0,0 +1,2 @@ +NR == 1 { gsub(/\\\\[;?!,()<>|+@%\]\[]/, " ") ; print "\"" $0 "\"" } +NR == 2 { gsub(/\\\\[;?!,()<>|+@%\]\[^]/, " ") ; print "\"" $0 "\"" } diff -urN gawk-4.1.1/test/regexpbrack2.in gawk-4.1.2/test/regexpbrack2.in --- gawk-4.1.1/test/regexpbrack2.in 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/regexpbrack2.in 2015-04-28 16:49:35.000000000 +0300 @@ -0,0 +1,2 @@ +test: \\; \\? \\! +test: \\; \\? \\! diff -urN gawk-4.1.1/test/regexpbrack2.ok gawk-4.1.2/test/regexpbrack2.ok --- gawk-4.1.1/test/regexpbrack2.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/regexpbrack2.ok 2015-04-28 16:49:35.000000000 +0300 @@ -0,0 +1,2 @@ +"test: " +"test: " diff -urN gawk-4.1.1/test/regnul1.awk gawk-4.1.2/test/regnul1.awk --- gawk-4.1.1/test/regnul1.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/regnul1.awk 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,84 @@ +# From denis@gissoft.eu Thu May 29 09:07:56 IDT 2014 +# Article: 8400 of comp.lang.awk +# X-Received: by 10.236.81.99 with SMTP id l63mr3912466yhe.3.1401224812642; +# Tue, 27 May 2014 14:06:52 -0700 (PDT) +# X-Received: by 10.140.37.148 with SMTP id r20mr578874qgr.0.1401224812310; Tue, +# 27 May 2014 14:06:52 -0700 (PDT) +# Path: eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!hl10no6493021igb.0!news-out.google.com!gi6ni15574igc.0!nntp.google.com!hl10no6493018igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail +# Newsgroups: comp.lang.awk +# Date: Tue, 27 May 2014 14:06:52 -0700 (PDT) +# Complaints-To: groups-abuse@google.com +# Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.253.50.165; +# posting-account=zNhVLgoAAACsg-WfVe_or2VV7loUhx8H +# NNTP-Posting-Host: 85.253.50.165 +# User-Agent: G2/1.0 +# MIME-Version: 1.0 +# Message-ID: <3112e356-d2e1-45cd-ba55-2f939ee50105@googlegroups.com> +# Subject: \0 character can't be implement inside regexp in some cases? +# From: denis@gissoft.eu +# Injection-Date: Tue, 27 May 2014 21:06:52 +0000 +# Content-Type: text/plain; charset=ISO-8859-1 +# Xref: news.eternal-september.org comp.lang.awk:8400 +# +# Hello, +# +# while doing some experiments with the gawk(4.1.1) i was found problem in implementing character \x00 inside regexp for two cases: +# +# str~/\0/ +# +# and +# +# switch ( str ) { case /\0/: ... } +# +# the following code try to match given string(=="\x00") with the regexp /^\0$/ using different ways provided by gawk: +# +func _chm(t) { + _ch("match()",match(t,/^\0$/)) + _ch("split()",split(t,A,/^\0$/)>1) + _ch("patsplit()",patsplit(t,A,/^\0$/)) + _ch("gsub()",gsub(/^\0$/,"&",t)) + _ch("sub()",sub(/^\0$/,"&",t)) + _ch("gensub()",!gensub(/^\0$/,"","G",t)) + _ch("str~/rexp/",t~/^\0$/) + a=0; switch ( t ) { case /^\0$/: a=1 }; _ch("switch-case //",a) } + +func _ch(fn,bool) { + print substr(fn ": ",1,16) (bool ? "+" : "-") } + +BEGIN{ _chm("\000") } +# +# output: +# +# > gawk -f _null.gwk +# match(): + +# split(): + +# patsplit(): + +# gsub(): + +# sub(): + +# gensub(): + +# str~/rexp/: - +# switch-case //: - +# +# can someone explain me: +# +# why in case using match(), split(), patsplit(), gsub(), sub() and gensub() the given string "\x00" matches with the /^\0$/ +# +# but in cases: +# +# "\x00"~/^\0$/ +# +# and +# +# switch ( "\x00" ) { case /^\0$/: doesn't match? } +# +# +# thank You +# +# +# GNU Awk 4.1.1, API: 1.1 (GNU MPFR 3.1.0-p8, GNU MP 5.0.2) +# Copyright (C) 1989, 1991-2014 Free Software Foundation. +# downloaded from ezwinports +# +# windows 7x64; cmd +# +# diff -urN gawk-4.1.1/test/regnul1.ok gawk-4.1.2/test/regnul1.ok --- gawk-4.1.1/test/regnul1.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/regnul1.ok 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,8 @@ +match(): + +split(): + +patsplit(): + +gsub(): + +sub(): + +gensub(): + +str~/rexp/: + +switch-case //: + diff -urN gawk-4.1.1/test/regnul2.awk gawk-4.1.2/test/regnul2.awk --- gawk-4.1.1/test/regnul2.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/regnul2.awk 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,112 @@ +# From denis@gissoft.eu Thu May 29 09:10:18 IDT 2014 +# Article: 8408 of comp.lang.awk +# X-Received: by 10.182.128.166 with SMTP id np6mr93689obb.16.1401289466734; +# Wed, 28 May 2014 08:04:26 -0700 (PDT) +# X-Received: by 10.140.36.6 with SMTP id o6mr4939qgo.26.1401289466607; Wed, 28 +# May 2014 08:04:26 -0700 (PDT) +# Path: eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!c1no19185457igq.0!news-out.google.com!qf4ni13600igc.0!nntp.google.com!c1no19185454igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail +# Newsgroups: comp.lang.awk +# Date: Wed, 28 May 2014 08:04:26 -0700 (PDT) +# In-Reply-To: +# Complaints-To: groups-abuse@google.com +# Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.131.35.51; posting-account=zNhVLgoAAACsg-WfVe_or2VV7loUhx8H +# NNTP-Posting-Host: 82.131.35.51 +# References: <3112e356-d2e1-45cd-ba55-2f939ee50105@googlegroups.com> +# +# +# User-Agent: G2/1.0 +# MIME-Version: 1.0 +# Message-ID: <79828a24-d265-4e88-8de1-e61ecbaa6701@googlegroups.com> +# Subject: Re: \0 character can't be implement inside regexp in some cases? +# From: Denis Shirokov +# Injection-Date: Wed, 28 May 2014 15:04:26 +0000 +# Content-Type: text/plain; charset=ISO-8859-1 +# Xref: news.eternal-september.org comp.lang.awk:8408 +# +# +# All of the other use-cases just cluttered up your posting. +# +# oh, really? +# +# 1. where in the Janis code the case with the `switch-case'? +# 2. how do you know about that there is only two cases? may be you know it because my code contains the other test cases? +# 3. fine. do you know what situation with the dynamic regexps? no? +# 4. do you know what situation with RS,FS and /.../ in the middle-area? how you can say that there is only two cases if you absolutely do not know it? +# +# i'm asking: WHO will perform testing other cases? You? gawk-team? the God? +# what is that point of view: that it will be enough to say: +# Oh! my match(t,/^\0$/) is matching "\x00" but t~/^\0$/ is not. why oh why? +# +# where is the test cover? or you think that other peoples will doing its instead of You? instead of Me? +# +# and the second point: guys you are screaming about two levels of stack. really, you kidding? =) +# +# however, i'm attaching some additional information about dynrexp: +# +func _chmd(t,r) { + _ch("match()",match(t,r)) + _ch("split()",split(t,A,r)>1) + _ch("patsplit()",patsplit(t,A,r)) + _ch("gsub()",gsub(r,"&",t)) + t2=t; _ch("sub()",sub(r,"&",t2)) + _ch("gensub()",!gensub(r,"","G",t)) + _ch("str~/rexp/",t~r) + # switch-case is not applicable with dynrxp + _conline() } + +func _ch(fn,bool) { + print substr(fn ": ",1,16) (bool ? "+" : "-") } + +func _conline() { + print "__________________________"; print } + +BEGIN{ _chmd("\x01","^\1$") #testing that all doings right; all match + _chmd("\x00","^\1$") #testing that all doings right; all not match + _chmd("\x00","^\0$") #tesing dynrexp +} +# +# output: +# +# match(): + +# split(): + +# patsplit(): + +# gsub(): + +# sub(): + +# gensub(): + +# str~/rexp/: + +# __________________________ +# +# match(): - +# split(): - +# patsplit(): - +# gsub(): - +# sub(): - +# gensub(): - +# str~/rexp/: - +# __________________________ +# +# match(): + +# split(): + +# patsplit(): + +# gsub(): + +# sub(): + +# gensub(): + +# str~/rexp/: - +# +# it's looks like with the dynamic regexp the same story. +# +# i found another one moment that is possible near with the reason of this issue: +# +# i was testing what characters can be present in doublestring and regexp "directly" (just as the character) and what characters must be present as escape sequence (\qqq) +# +# so, i found the following: +# +# t="abc" +# if ( match(t,/^abc[NUL]def/) ) ... - where [NUL] is the character \x00 +# +# it's seems that in that case the regular expression is processed until [NUL]character and the other part is ignored because the example above gives TRUE +# +# friendship +# Denis Shirokov +# +# diff -urN gawk-4.1.1/test/regnul2.ok gawk-4.1.2/test/regnul2.ok --- gawk-4.1.1/test/regnul2.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/regnul2.ok 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,27 @@ +match(): + +split(): + +patsplit(): + +gsub(): + +sub(): + +gensub(): + +str~/rexp/: + +__________________________ + +match(): - +split(): - +patsplit(): - +gsub(): - +sub(): - +gensub(): - +str~/rexp/: - +__________________________ + +match(): + +split(): + +patsplit(): + +gsub(): + +sub(): + +gensub(): + +str~/rexp/: + +__________________________ + diff -urN gawk-4.1.1/test/rsgetline.awk gawk-4.1.2/test/rsgetline.awk --- gawk-4.1.1/test/rsgetline.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/rsgetline.awk 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,23 @@ +# Date: Sun, 4 May 2014 18:09:01 +0200 +# From: Davide Brini +# To: bug-gawk@gnu.org +# Subject: Re: [bug-gawk] Computed regex and getline bug / issue +# +# I have been able to reduce the behavior to these simple test cases, which +# (unless I'm missing something obvious) should behave identically but don't: +# +# $ printf '1,2,' | gawk 'BEGIN{RS="[,]+"}{print; a = getline; print "-"a"-"; print}' +# 1 +# -0- +# 1 + +BEGIN { + RS = "[,]+" +} + +{ + printf "[%s] [%s]\n", $0, RT + a = getline + print "-"a"-" + printf "[%s] [%s]\n", $0, RT +} diff -urN gawk-4.1.1/test/rsgetline.in gawk-4.1.2/test/rsgetline.in --- gawk-4.1.1/test/rsgetline.in 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/rsgetline.in 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1 @@ +1,2, \ No newline at end of file diff -urN gawk-4.1.1/test/rsgetline.ok gawk-4.1.2/test/rsgetline.ok --- gawk-4.1.1/test/rsgetline.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/rsgetline.ok 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,3 @@ +[1] [,] +-1- +[2] [,] diff -urN gawk-4.1.1/test/rsglstdin.ok gawk-4.1.2/test/rsglstdin.ok --- gawk-4.1.1/test/rsglstdin.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/rsglstdin.ok 2015-04-05 11:13:50.000000000 +0300 @@ -0,0 +1,3 @@ +[1] [,] +-1- +[2] [,] diff -urN gawk-4.1.1/test/sortglos.awk gawk-4.1.2/test/sortglos.awk --- gawk-4.1.1/test/sortglos.awk 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/sortglos.awk 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,51 @@ +BEGIN { + pr="y"; + npre=0; + po="n"; + npos=0; + } + +pr=="y" { npre++; pre[npre]=$0; } +$1=="@table" && $2=="@asis" { pr="n";nite++; next; } + +po=="y" { npos++; pos[npos]=$0; } +$1=="@end" && $2=="table" { + po="y"; + npos++; + pos[npos]=$0; + # last item... + vec[nite]=nlin; +} + + { nite++; } + +END { + for ( i=1; i<=npre; i++ ) { print pre[i]; } + if ( srt=="y" ) { + n=asorti(entr,ital); + ##print "n=",n; + for ( i=1; i<=n; i++ ) { + #printf("=========> %3.3d %s\n",i,ital[i]); + # ital[i] is the sorted key; + j=entr[ital[i]]; + # j is the original item number + for ( k=1; k<=vec[j]; k++ ) { + print dat[j,k]; + } + } + } + if ( srt=="n" ) { + for ( i=1; i<=nite; i++ ) { + printf("=========> %3.3d %2.2d %s\n",i,vec[i],titl[i]); + for ( j=1; j<=vec[i]; j++ ) { + print dat[i,j]; + } + } + print "========================= END"; + } + for ( i=1; i<=npos; i++ ) { print pos[i]; } + print "@c npre=" npre; + print "@c nite=" nite; + print "@c npos=" npos; +} + diff -urN gawk-4.1.1/test/sortglos.in gawk-4.1.2/test/sortglos.in --- gawk-4.1.1/test/sortglos.in 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/sortglos.in 2015-04-27 18:09:07.000000000 +0300 @@ -0,0 +1,22 @@ +@node Glossario +@unnumbered Glossario + +@table @asis +@item Azione +Una serie di istruzioni @command{awk} associate a una regola. Se +l'espressione di ricerca della regola individua un record in input, +@command{awk} esegue su quel record l'azione relativa. Le azioni sono +sempre racchiuse fra parentesi graffe. +(@xref{Panoramica sulle azioni}). + +@item Spazio bianco +Una sequenza di spazi, TAB, o caratteri di "a capo" presenti in un record in +input o in una stringa. +@end table + +@end ifclear + +@c The GNU General Public License. + +@c aggiornato alla versione: settembre 2014 +@c ultimo aggiornamento: 14 novembre 2014 diff -urN gawk-4.1.1/test/sortglos.ok gawk-4.1.2/test/sortglos.ok --- gawk-4.1.1/test/sortglos.ok 1970-01-01 02:00:00.000000000 +0200 +++ gawk-4.1.2/test/sortglos.ok 2015-04-27 18:01:59.000000000 +0300 @@ -0,0 +1,15 @@ +@node Glossario +@unnumbered Glossario + +@table @asis +@end table + +@end ifclear + +@c The GNU General Public License. + +@c aggiornato alla versione: settembre 2014 +@c ultimo aggiornamento: 14 novembre 2014 +@c npre=4 +@c nite=22 +@c npos=8 diff -urN gawk-4.1.1/test/testext.ok gawk-4.1.2/test/testext.ok --- gawk-4.1.1/test/testext.ok 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/test/testext.ok 2015-04-28 16:49:46.000000000 +0300 @@ -15,6 +15,7 @@ try_modify_environ: marking element "testext" for deletion try_del_environ() could not delete element - pass try_del_environ() could not add an element - pass +var_test: sym_lookup of PROCINFO passed - got a value! var_test: sym_lookup of ARGC passed - got a value! var_test: sym_update of ARGC failed - correctly var_test: sym_update("testvar") succeeded diff -urN gawk-4.1.1/vms/ChangeLog gawk-4.1.2/vms/ChangeLog --- gawk-4.1.1/vms/ChangeLog 2014-04-08 20:36:03.000000000 +0300 +++ gawk-4.1.2/vms/ChangeLog 2015-04-29 08:54:00.000000000 +0300 @@ -1,3 +1,30 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + +2015-04-08 John E. Malmberg + + * generate_config_vms_h_gawk.com: Add custom.h include. + +2015-04-07 Arnold D. Robbins + + * vmsbuild.com, descrip.mms: Bump patchlevel. + +2014-10-17 John E. Malmberg + + * config_h.com: Use sys$disk: instead of prj_root: for + copying the configure file. + * gawk_alias_setup.com: Fix removal of out of date aliases. + * vmsbuild.com: Fix a typo for symbol CNAME and a case sensitive + test for "VAX" .eq. "vax" that failed. Also disable verify + while looking up the actual version. + * vmstest.com: Make sure that the test directory exists when + using a search list. + +2014-04-18 John E. Malmberg + + * gawk_alias_setup.com: Fix problem with file links on Vax/VMS. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff -urN gawk-4.1.1/vms/config_h.com gawk-4.1.2/vms/config_h.com --- gawk-4.1.1/vms/config_h.com 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/vms/config_h.com 2015-04-05 13:19:19.000000000 +0300 @@ -104,7 +104,7 @@ $! on a NFS mounted volume. So copy it to sys$scratch: $! $if f$search(configure_script) .nes. "" then delete 'configure_script';* -$copy PRJ_ROOT:configure 'configure_script' +$copy sys$disk:configure 'configure_script' $! $! $! Write out the header diff -urN gawk-4.1.1/vms/descrip.mms gawk-4.1.2/vms/descrip.mms --- gawk-4.1.1/vms/descrip.mms 2014-04-08 19:12:01.000000000 +0300 +++ gawk-4.1.2/vms/descrip.mms 2015-04-27 18:09:07.000000000 +0300 @@ -122,7 +122,7 @@ # Release of gawk REL=4.1 -PATCHLVL=1 +PATCHLVL=2 # generic target all : gawk diff -urN gawk-4.1.1/vms/gawk_alias_setup.com gawk-4.1.2/vms/gawk_alias_setup.com --- gawk-4.1.1/vms/gawk_alias_setup.com 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/vms/gawk_alias_setup.com 2015-04-05 11:13:50.000000000 +0300 @@ -59,14 +59,43 @@ $ endif $ if f$search(file) .nes. "" $ then +$ fid = "" +$ mess = f$environment("message") +$ if f$search(alias) .nes. "" +$ then +$ on warn then goto fix_link +$ set message/nofac/nosev/noident/notext +$ fid = f$file_attributes(alias, "FID") +$ endif +$ goto fix_link_end +$fix_link: +$ set file/remove 'alias'; +$fix_link_end: +$ set message'mess' $ if f$search(alias) .eqs. "" $ then $ set file/enter='alias' 'file' $ endif $ alias1 = alias + "exe" -$ if (ftype .eqs. ".") .and. (f$search(alias1) .eqs. "") +$ if (ftype .eqs. ".") $ then +$ fid = "" +$ mess = f$environment("message") +$ if f$search(alias1) .nes. "" +$ then +$ on warn then goto fix_link1 +$ set message/nofac/nosev/noident/notext +$ fid = f$file_attributes(alias1, "FID") +$ endif +$ goto fix_link_end1 +$fix_link1: +$ set file/remove 'alias1'; +$fix_link_end1: +$ set message'mess' +$ if (f$search(alias1) .eqs. "") +$ then $ set file/enter='alias1' 'file' +$ endif $ endif $ endif $ exit @@ -78,7 +107,7 @@ $ ftype = f$element(1, ".", p1) $ if ftype .eqs. "." $ then -$ file = "gnv$gnu:''p2'''p1'.EXE" +$ file = "gnv$gnu:''p2'gnv$''p1'.EXE" $ alias = "gnv$gnu:''p4'''p3'." $ else $ file = "gnv$gnu:''p2'''p1'" diff -urN gawk-4.1.1/vms/generate_config_vms_h_gawk.com gawk-4.1.2/vms/generate_config_vms_h_gawk.com --- gawk-4.1.1/vms/generate_config_vms_h_gawk.com 2014-02-20 20:49:15.000000000 +0200 +++ gawk-4.1.2/vms/generate_config_vms_h_gawk.com 2015-04-27 18:09:07.000000000 +0300 @@ -287,6 +287,9 @@ $ write cvh " }" $ write cvh " decc$exit(vms_status);" $ write cvh "}" +$ write cvh "" +$ write cvh "#include ""custom.h""" +$ write cvh "" $! $! Close out the file $! diff -urN gawk-4.1.1/vms/vax/ChangeLog gawk-4.1.2/vms/vax/ChangeLog --- gawk-4.1.1/vms/vax/ChangeLog 2014-04-08 20:36:15.000000000 +0300 +++ gawk-4.1.2/vms/vax/ChangeLog 2015-04-29 08:54:11.000000000 +0300 @@ -1,3 +1,7 @@ +2015-04-29 Arnold D. Robbins + + * 4.1.2: Release tar ball made. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff -urN gawk-4.1.1/vms/vmsbuild.com gawk-4.1.2/vms/vmsbuild.com --- gawk-4.1.1/vms/vmsbuild.com 2014-04-08 19:12:01.000000000 +0300 +++ gawk-4.1.2/vms/vmsbuild.com 2015-04-27 18:09:07.000000000 +0300 @@ -12,9 +12,10 @@ $! gawk 4.0.0 revd, May'11 $! gawk 4.1.0 revd, May'13 $! gawk 4.1.1 revd, Apr'14 +$! gawk 4.1.2 revd, Apr'15 $! $ REL = "4.1" !release version number -$ PATCHLVL = "1" +$ PATCHLVL = "2" $! $ if (f$getsyi("HW_MODEL") .lt. 1024) $ then @@ -48,7 +49,7 @@ $ LIBS = "sys$share:vaxcrtl.exe/Shareable" $ else !!VAXC $! neither GNUC nor VAXC, assume DECC (same for either VAX or Alpha) -$ if arch_name .eqs. "vax" +$ if arch_name .eqs. "VAX" $ then $ CFLOAT = "" $ else @@ -58,7 +59,7 @@ $ CNAME = "/NAME=(AS_IS,SHORT) $ CINC = "/NESTED_INCLUDE=NONE" $ CFLAGS = "/Incl=([],[.vms])/Obj=[]/Def=(''CDEFS')''CINC'''CCFLAGS'" -$ CFLAGS = CNAMES + CFLOAT + CFLAGS +$ CFLAGS = CNAME + CFLOAT + CFLAGS $ LIBS = "" ! DECC$SHR instead of VAXCRTL, no special link option needed $ endif !VAXC $ endif !GNUC @@ -147,8 +148,8 @@ stack=48 !preallocate more pages (default is 20) iosegment=128 !ditto (default is 32) $! -$ v1 = f$verify(1) $ @[.vms]gawk_ident.com +$ v1 = f$verify(1) $ open/append Fopt gawk.opt $ write Fopt libs $ close Fopt diff -urN gawk-4.1.1/vms/vmstest.com gawk-4.1.2/vms/vmstest.com --- gawk-4.1.1/vms/vmstest.com 2014-02-20 20:49:15.000000000 +0200 +++ gawk-4.1.2/vms/vmstest.com 2015-04-05 13:19:19.000000000 +0300 @@ -27,6 +27,9 @@ $ AWKPATH_srcdir = "define/User AWKPATH sys$disk:[]" $ AWKLIBPATH_dir = "define/User AWKLIBPATH sys$disk:[-]" $ +$! Make sure that the default directory exists on a search list. +$ def_dir = f$environment("default") +$ create/dir 'def_dir' $ listdepth = 0 $ pipeok = 0 $ floatmode = -1 ! 0: D_float, 1: G_float, 2: IEEE T_float diff -urN gawk-4.1.1/xalloc.h gawk-4.1.2/xalloc.h --- gawk-4.1.1/xalloc.h 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/xalloc.h 2015-04-05 11:13:50.000000000 +0300 @@ -136,6 +136,8 @@ #ifdef GAWK #include +extern void r_fatal(const char *msg, ...) ATTRIBUTE_NORETURN ; + /* Allocate an array of N objects, each with S bytes of memory, dynamically, with error checking. S must be nonzero. Clear the contents afterwards. */ @@ -165,8 +167,6 @@ void xalloc_die (void) { - extern void r_fatal(const char *msg, ...) ATTRIBUTE_NORETURN ; - r_fatal(_("xalloc: malloc failed: %s"), strerror(errno)); } @@ -179,6 +179,22 @@ { return memcpy (xmalloc (s), p, s); } + +/* xstrdup --- strdup and die if fails */ +char *xstrdup(const char *s) +{ + char *p; + int l; + + if (s == NULL) + r_fatal(_("xstrdup: null parameter")); + + l = strlen(s); + p = xmemdup(s, l + 1); + p[l] = '\0'; + + return p; +} #endif /* Change the size of an allocated block of memory P to an array of N @@ -260,7 +276,7 @@ requests, when the invoking code specifies an old size of zero. 64 bytes is the largest "small" request for the GNU C library malloc. */ - enum { DEFAULT_MXFAST = 64 }; + enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 }; n = DEFAULT_MXFAST / s; n += !n; @@ -274,7 +290,7 @@ worth the trouble. */ if ((size_t) -1 / 3 * 2 / s <= n) xalloc_die (); - n += (n + 1) / 2; + n += n / 2 + 1; } *pn = n; diff -urN gawk-4.1.1/ylwrap gawk-4.1.2/ylwrap --- gawk-4.1.1/ylwrap 2014-01-20 21:53:01.000000000 +0200 +++ gawk-4.1.2/ylwrap 2015-04-27 18:09:07.000000000 +0300 @@ -1,9 +1,9 @@ #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. -scriptversion=2012-07-14.08; # UTC +scriptversion=2013-01-12.17; # UTC -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # Written by Tom Tromey . # @@ -40,12 +40,13 @@ # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. -guard() +guard () { - printf '%s\n' "$from" \ - | sed \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ - -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' + printf '%s\n' "$1" \ + | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ + -e 's/__*/_/g' } # quote_for_sed [STRING] @@ -95,17 +96,17 @@ # The input. -input="$1" +input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` -case "$input" in +case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. - input="`pwd`/$input" + input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` @@ -121,12 +122,18 @@ # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 + # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. -rename_sed= -while test "$#" -ne 0; do - if test "$1" = "--"; then +sed_fix_filenames= + +# Also rename header guards, as Bison 2.7 for instance uses its header +# guard in its implementation file. +sed_fix_header_guards= + +while test $# -ne 0; do + if test x"$1" = x"--"; then shift break fi @@ -141,20 +148,19 @@ shift to=$1 shift - rename_sed="${rename_sed}s|"`quote_for_sed "$from"`"|$to|g;" + sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" + sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. -prog="$1" +prog=$1 shift # Make any relative path in $prog absolute. -case "$prog" in +case $prog in [\\/]* | ?:[\\/]*) ;; - *[\\/]*) prog="`pwd`/$prog" ;; + *[\\/]*) prog=`pwd`/$prog ;; esac -# FIXME: add hostname here for parallel makes that run commands on -# other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 @@ -174,13 +180,13 @@ if test $ret -eq 0; then for from in * do - to=`printf '%s\n' "$from" | sed "$rename_sed"` + to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; - *) target="../$to";; + *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless @@ -189,7 +195,7 @@ # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then - realtarget="$target" + realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi @@ -197,10 +203,11 @@ # debug information point at an absolute srcdir. Use the real # output file name, not yy.lex.c for instance. Adjust the # include guards too. - FROM=`guard "$from"` - TARGET=`guard "$to"` - sed -e "/^#/!b" -e "s|$input_rx|$input_sub_rx|" -e "$rename_sed" \ - -e "s|$FROM|$TARGET|" "$from" >"$target" || ret=$? + sed -e "/^#/!b" \ + -e "s|$input_rx|$input_sub_rx|" \ + -e "$sed_fix_filenames" \ + -e "$sed_fix_header_guards" \ + "$from" >"$target" || ret=$? # Check whether files must be updated. if test "$from" != "$parser"; then EOF chmod 755 compile extension/build-aux/compile # Final cleanup echo Sleeping and touching files to update timestamps. # touch list of zero length files # touch .... sleep 2 touch Makefile.in */Makefile.in touch ./aclocal.m4 ./extension/aclocal.m4 touch configh.in ./extension/configh.in sleep 2 touch configure extension/configure echo Remove any .orig or "'~'" files that may remain. echo Use '"configure && make"' to rebuild any dependent files. echo Use "'make distclean'" to clean up.