| 1 |
# SOME DESCRIPTIVE TITLE |
| 2 |
# Copyright (C) YEAR Free Software Foundation, Inc. |
| 3 |
# This file is distributed under the same license as the PACKAGE package. |
| 4 |
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
| 5 |
# |
| 6 |
#, fuzzy |
| 7 |
msgid "" |
| 8 |
msgstr "" |
| 9 |
"Project-Id-Version: PACKAGE VERSION\n" |
| 10 |
"POT-Creation-Date: 2026-06-05 06:26+0200\n" |
| 11 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
| 12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
| 13 |
"Language-Team: LANGUAGE <[email protected]>\n" |
| 14 |
"Language: \n" |
| 15 |
"MIME-Version: 1.0\n" |
| 16 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 17 |
"Content-Transfer-Encoding: 8bit\n" |
| 18 |
|
| 19 |
#. type: TH |
| 20 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 21 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 22 |
#, no-wrap |
| 23 |
msgid "getsubopt" |
| 24 |
msgstr "" |
| 25 |
|
| 26 |
#. type: TH |
| 27 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 28 |
#: opensuse-tumbleweed |
| 29 |
#, no-wrap |
| 30 |
msgid "2026-02-08" |
| 31 |
msgstr "" |
| 32 |
|
| 33 |
#. type: TH |
| 34 |
#: archlinux debian-unstable |
| 35 |
#, no-wrap |
| 36 |
msgid "Linux man-pages 6.18" |
| 37 |
msgstr "" |
| 38 |
|
| 39 |
#. type: SH |
| 40 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 41 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 42 |
#, no-wrap |
| 43 |
msgid "NAME" |
| 44 |
msgstr "" |
| 45 |
|
| 46 |
#. type: Plain text |
| 47 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 48 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 49 |
msgid "getsubopt - parse suboption arguments from a string" |
| 50 |
msgstr "" |
| 51 |
|
| 52 |
#. type: SH |
| 53 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 54 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 55 |
#, no-wrap |
| 56 |
msgid "LIBRARY" |
| 57 |
msgstr "" |
| 58 |
|
| 59 |
#. type: Plain text |
| 60 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 61 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 62 |
msgid "Standard C library (I<libc>,\\ I<-lc>)" |
| 63 |
msgstr "" |
| 64 |
|
| 65 |
#. type: SH |
| 66 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 67 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 68 |
#, no-wrap |
| 69 |
msgid "SYNOPSIS" |
| 70 |
msgstr "" |
| 71 |
|
| 72 |
#. type: Plain text |
| 73 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 74 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 75 |
#, no-wrap |
| 76 |
msgid "B<#include E<lt>stdlib.hE<gt>>\n" |
| 77 |
msgstr "" |
| 78 |
|
| 79 |
#. type: Plain text |
| 80 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 81 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 82 |
#, no-wrap |
| 83 |
msgid "" |
| 84 |
"B<int getsubopt(char **restrict >I<optionp>B<, char *const *restrict >I<tokens>B<,>\n" |
| 85 |
"B< char **restrict >I<valuep>B<);>\n" |
| 86 |
msgstr "" |
| 87 |
|
| 88 |
#. type: Plain text |
| 89 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 90 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 91 |
msgid "" |
| 92 |
"Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):" |
| 93 |
msgstr "" |
| 94 |
|
| 95 |
#. type: Plain text |
| 96 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 97 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 98 |
msgid "B<getsubopt>():" |
| 99 |
msgstr "" |
| 100 |
|
| 101 |
#. || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED |
| 102 |
#. type: Plain text |
| 103 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 104 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 105 |
#, no-wrap |
| 106 |
msgid "" |
| 107 |
" _XOPEN_SOURCE E<gt>= 500\n" |
| 108 |
" || /* Since glibc 2.12: */ _POSIX_C_SOURCE E<gt>= 200809L\n" |
| 109 |
msgstr "" |
| 110 |
|
| 111 |
#. type: SH |
| 112 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 113 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 114 |
#, no-wrap |
| 115 |
msgid "DESCRIPTION" |
| 116 |
msgstr "" |
| 117 |
|
| 118 |
#. type: Plain text |
| 119 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 120 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 121 |
msgid "" |
| 122 |
"B<getsubopt>() parses the list of comma-separated suboptions provided in " |
| 123 |
"I<optionp>. (Such a suboption list is typically produced when B<getopt>(3) " |
| 124 |
"is used to parse a command line; see for example the I<-o> option of " |
| 125 |
"B<mount>(8).) Each suboption may include an associated value, which is " |
| 126 |
"separated from the suboption name by an equal sign. The following is an " |
| 127 |
"example of the kind of string that might be passed in I<optionp>:" |
| 128 |
msgstr "" |
| 129 |
|
| 130 |
#. type: Plain text |
| 131 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 132 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 133 |
#, no-wrap |
| 134 |
msgid "B<ro,name=xyz>\n" |
| 135 |
msgstr "" |
| 136 |
|
| 137 |
#. type: Plain text |
| 138 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 139 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 140 |
msgid "" |
| 141 |
"The I<tokens> argument is a pointer to a NULL-terminated array of pointers " |
| 142 |
"to the tokens that B<getsubopt>() will look for in I<optionp>. The tokens " |
| 143 |
"should be distinct, null-terminated strings containing at least one " |
| 144 |
"character, with no embedded equal signs or commas." |
| 145 |
msgstr "" |
| 146 |
|
| 147 |
#. type: Plain text |
| 148 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 149 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 150 |
msgid "" |
| 151 |
"Each call to B<getsubopt>() returns information about the next unprocessed " |
| 152 |
"suboption in I<optionp>. The first equal sign in a suboption (if any) is " |
| 153 |
"interpreted as a separator between the name and the value of that " |
| 154 |
"suboption. The value extends to the next comma, or (for the last suboption) " |
| 155 |
"to the end of the string. If the name of the suboption matches a known name " |
| 156 |
"from I<tokens>, and a value string was found, B<getsubopt>() sets " |
| 157 |
"I<*valuep> to the address of that string. The first comma in I<optionp> is " |
| 158 |
"overwritten with a null byte, so I<*valuep> is precisely the \"value " |
| 159 |
"string\" for that suboption." |
| 160 |
msgstr "" |
| 161 |
|
| 162 |
#. type: Plain text |
| 163 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 164 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 165 |
msgid "" |
| 166 |
"If the suboption is recognized, but no value string was found, I<*valuep> is " |
| 167 |
"set to NULL." |
| 168 |
msgstr "" |
| 169 |
|
| 170 |
#. type: Plain text |
| 171 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 172 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 173 |
msgid "" |
| 174 |
"When B<getsubopt>() returns, I<optionp> points to the next suboption, or to " |
| 175 |
"the null byte (\\[aq]\\[rs]0\\[aq]) at the end of the string if the last " |
| 176 |
"suboption was just processed." |
| 177 |
msgstr "" |
| 178 |
|
| 179 |
#. type: SH |
| 180 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 181 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 182 |
#, no-wrap |
| 183 |
msgid "RETURN VALUE" |
| 184 |
msgstr "" |
| 185 |
|
| 186 |
#. type: Plain text |
| 187 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 188 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 189 |
msgid "" |
| 190 |
"If the first suboption in I<optionp> is recognized, B<getsubopt>() returns " |
| 191 |
"the index of the matching suboption element in I<tokens>. Otherwise, -1 is " |
| 192 |
"returned and I<*valuep> is the entire I<name>B<[=>I<value>B<]> string." |
| 193 |
msgstr "" |
| 194 |
|
| 195 |
#. type: Plain text |
| 196 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 197 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 198 |
msgid "" |
| 199 |
"Since I<*optionp> is changed, the first suboption before the call to " |
| 200 |
"B<getsubopt>() is not (necessarily) the same as the first suboption after " |
| 201 |
"B<getsubopt>()." |
| 202 |
msgstr "" |
| 203 |
|
| 204 |
#. type: SH |
| 205 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 206 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 207 |
#, no-wrap |
| 208 |
msgid "ATTRIBUTES" |
| 209 |
msgstr "" |
| 210 |
|
| 211 |
#. type: Plain text |
| 212 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 213 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 214 |
msgid "" |
| 215 |
"For an explanation of the terms used in this section, see B<attributes>(7)." |
| 216 |
msgstr "" |
| 217 |
|
| 218 |
#. type: tbl table |
| 219 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 220 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 221 |
#, no-wrap |
| 222 |
msgid "Interface" |
| 223 |
msgstr "" |
| 224 |
|
| 225 |
#. type: tbl table |
| 226 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 227 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 228 |
#, no-wrap |
| 229 |
msgid "Attribute" |
| 230 |
msgstr "" |
| 231 |
|
| 232 |
#. type: tbl table |
| 233 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 234 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 235 |
#, no-wrap |
| 236 |
msgid "Value" |
| 237 |
msgstr "" |
| 238 |
|
| 239 |
#. type: tbl table |
| 240 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 241 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 242 |
#, no-wrap |
| 243 |
msgid ".na\n" |
| 244 |
msgstr "" |
| 245 |
|
| 246 |
#. type: tbl table |
| 247 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 248 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 249 |
#, no-wrap |
| 250 |
msgid ".nh\n" |
| 251 |
msgstr "" |
| 252 |
|
| 253 |
#. type: tbl table |
| 254 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 255 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 256 |
#, no-wrap |
| 257 |
msgid "B<getsubopt>()" |
| 258 |
msgstr "" |
| 259 |
|
| 260 |
#. type: tbl table |
| 261 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 262 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 263 |
#, no-wrap |
| 264 |
msgid "Thread safety" |
| 265 |
msgstr "" |
| 266 |
|
| 267 |
#. type: tbl table |
| 268 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 269 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 270 |
#, no-wrap |
| 271 |
msgid "MT-Safe" |
| 272 |
msgstr "" |
| 273 |
|
| 274 |
#. type: SH |
| 275 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 276 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 277 |
#, no-wrap |
| 278 |
msgid "STANDARDS" |
| 279 |
msgstr "" |
| 280 |
|
| 281 |
#. type: Plain text |
| 282 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 283 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 284 |
msgid "POSIX.1-2008." |
| 285 |
msgstr "" |
| 286 |
|
| 287 |
#. type: SH |
| 288 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 289 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 290 |
#, no-wrap |
| 291 |
msgid "HISTORY" |
| 292 |
msgstr "" |
| 293 |
|
| 294 |
#. type: Plain text |
| 295 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 296 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 297 |
msgid "POSIX.1-2001." |
| 298 |
msgstr "" |
| 299 |
|
| 300 |
#. type: SH |
| 301 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 302 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 303 |
#, no-wrap |
| 304 |
msgid "NOTES" |
| 305 |
msgstr "" |
| 306 |
|
| 307 |
#. type: Plain text |
| 308 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 309 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 310 |
msgid "" |
| 311 |
"Since B<getsubopt>() overwrites any commas it finds in the string " |
| 312 |
"I<*optionp>, that string must be writable; it cannot be a string constant." |
| 313 |
msgstr "" |
| 314 |
|
| 315 |
#. type: SH |
| 316 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 317 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 318 |
#, no-wrap |
| 319 |
msgid "EXAMPLES" |
| 320 |
msgstr "" |
| 321 |
|
| 322 |
#. type: Plain text |
| 323 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 324 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 325 |
msgid "The following program expects suboptions following a \"-o\" option." |
| 326 |
msgstr "" |
| 327 |
|
| 328 |
#. type: Plain text |
| 329 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 330 |
#: opensuse-tumbleweed |
| 331 |
#, no-wrap |
| 332 |
msgid "" |
| 333 |
"#define _XOPEN_SOURCE 500\n" |
| 334 |
"#include E<lt>stdio.hE<gt>\n" |
| 335 |
"#include E<lt>stdlib.hE<gt>\n" |
| 336 |
"\\&\n" |
| 337 |
"#include E<lt>assert.hE<gt>\n" |
| 338 |
"\\&\n" |
| 339 |
"int\n" |
| 340 |
"main(int argc, char *argv[])\n" |
| 341 |
"{\n" |
| 342 |
" enum {\n" |
| 343 |
" RO_OPT = 0,\n" |
| 344 |
" RW_OPT,\n" |
| 345 |
" NAME_OPT\n" |
| 346 |
" };\n" |
| 347 |
" char *const token[] = {\n" |
| 348 |
" [RO_OPT] = \"ro\",\n" |
| 349 |
" [RW_OPT] = \"rw\",\n" |
| 350 |
" [NAME_OPT] = \"name\",\n" |
| 351 |
" NULL\n" |
| 352 |
" };\n" |
| 353 |
" char *subopts;\n" |
| 354 |
" char *value;\n" |
| 355 |
" int opt;\n" |
| 356 |
"\\&\n" |
| 357 |
" int readonly = 0;\n" |
| 358 |
" int readwrite = 0;\n" |
| 359 |
" char *name = NULL;\n" |
| 360 |
" int errfnd = 0;\n" |
| 361 |
"\\&\n" |
| 362 |
" while ((opt = getopt(argc, argv, \"o:\")) != -1) {\n" |
| 363 |
" switch (opt) {\n" |
| 364 |
" case \\[aq]o\\[aq]:\n" |
| 365 |
" subopts = optarg;\n" |
| 366 |
" while (*subopts != \\[aq]\\[rs]0\\[aq] && !errfnd) {\n" |
| 367 |
"\\&\n" |
| 368 |
" switch (getsubopt(&subopts, token, &value)) {\n" |
| 369 |
" case RO_OPT:\n" |
| 370 |
" readonly = 1;\n" |
| 371 |
" break;\n" |
| 372 |
"\\&\n" |
| 373 |
" case RW_OPT:\n" |
| 374 |
" readwrite = 1;\n" |
| 375 |
" break;\n" |
| 376 |
"\\&\n" |
| 377 |
" case NAME_OPT:\n" |
| 378 |
" if (value == NULL) {\n" |
| 379 |
" fprintf(stderr,\n" |
| 380 |
" \"Missing value for suboption \\[aq]%s\\[aq]\\[rs]n\",\n" |
| 381 |
" token[NAME_OPT]);\n" |
| 382 |
" errfnd = 1;\n" |
| 383 |
" continue;\n" |
| 384 |
" }\n" |
| 385 |
"\\&\n" |
| 386 |
" name = value;\n" |
| 387 |
" break;\n" |
| 388 |
"\\&\n" |
| 389 |
" default:\n" |
| 390 |
" fprintf(stderr,\n" |
| 391 |
" \"No match found for token: /%s/\\[rs]n\", value);\n" |
| 392 |
" errfnd = 1;\n" |
| 393 |
" break;\n" |
| 394 |
" }\n" |
| 395 |
" }\n" |
| 396 |
" if (readwrite && readonly) {\n" |
| 397 |
" fprintf(stderr,\n" |
| 398 |
" \"Only one of \\[aq]%s\\[aq] and \\[aq]%s\\[aq] can be specified\\[rs]n\",\n" |
| 399 |
" token[RO_OPT], token[RW_OPT]);\n" |
| 400 |
" errfnd = 1;\n" |
| 401 |
" }\n" |
| 402 |
" break;\n" |
| 403 |
"\\&\n" |
| 404 |
" default:\n" |
| 405 |
" errfnd = 1;\n" |
| 406 |
" }\n" |
| 407 |
" }\n" |
| 408 |
"\\&\n" |
| 409 |
" if (errfnd || argc == 1) {\n" |
| 410 |
" fprintf(stderr, \"\\[rs]nUsage: %s -o E<lt>suboptstringE<gt>\\[rs]n\", argv[0]);\n" |
| 411 |
" fprintf(stderr,\n" |
| 412 |
" \"suboptions are \\[aq]ro\\[aq], \\[aq]rw\\[aq], and \\[aq]name=E<lt>valueE<gt>\\[aq]\\[rs]n\");\n" |
| 413 |
" exit(EXIT_FAILURE);\n" |
| 414 |
" }\n" |
| 415 |
"\\&\n" |
| 416 |
" /* Remainder of program... */\n" |
| 417 |
"\\&\n" |
| 418 |
" exit(EXIT_SUCCESS);\n" |
| 419 |
"}\n" |
| 420 |
msgstr "" |
| 421 |
|
| 422 |
#. SRC END |
| 423 |
#. type: SH |
| 424 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 425 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 426 |
#, no-wrap |
| 427 |
msgid "SEE ALSO" |
| 428 |
msgstr "" |
| 429 |
|
| 430 |
#. type: Plain text |
| 431 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 432 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 433 |
msgid "B<getopt>(3)" |
| 434 |
msgstr "" |
| 435 |
|
| 436 |
#. type: TH |
| 437 |
#: debian-trixie |
| 438 |
#, no-wrap |
| 439 |
msgid "2024-06-15" |
| 440 |
msgstr "" |
| 441 |
|
| 442 |
#. type: TH |
| 443 |
#: debian-trixie |
| 444 |
#, no-wrap |
| 445 |
msgid "Linux man-pages 6.9.1" |
| 446 |
msgstr "" |
| 447 |
|
| 448 |
#. type: Plain text |
| 449 |
#: debian-trixie |
| 450 |
msgid "Standard C library (I<libc>, I<-lc>)" |
| 451 |
msgstr "" |
| 452 |
|
| 453 |
#. type: Plain text |
| 454 |
#: debian-trixie fedora-44 fedora-rawhide |
| 455 |
#, no-wrap |
| 456 |
msgid "" |
| 457 |
"#define _XOPEN_SOURCE 500\n" |
| 458 |
"#include E<lt>stdio.hE<gt>\n" |
| 459 |
"#include E<lt>stdlib.hE<gt>\n" |
| 460 |
"\\&\n" |
| 461 |
"#include E<lt>assert.hE<gt>\n" |
| 462 |
"\\&\n" |
| 463 |
"int\n" |
| 464 |
"main(int argc, char *argv[])\n" |
| 465 |
"{\n" |
| 466 |
" enum {\n" |
| 467 |
" RO_OPT = 0,\n" |
| 468 |
" RW_OPT,\n" |
| 469 |
" NAME_OPT\n" |
| 470 |
" };\n" |
| 471 |
" char *const token[] = {\n" |
| 472 |
" [RO_OPT] = \"ro\",\n" |
| 473 |
" [RW_OPT] = \"rw\",\n" |
| 474 |
" [NAME_OPT] = \"name\",\n" |
| 475 |
" NULL\n" |
| 476 |
" };\n" |
| 477 |
" char *subopts;\n" |
| 478 |
" char *value;\n" |
| 479 |
" int opt;\n" |
| 480 |
"\\&\n" |
| 481 |
" int readonly = 0;\n" |
| 482 |
" int readwrite = 0;\n" |
| 483 |
" char *name = NULL;\n" |
| 484 |
" int errfnd = 0;\n" |
| 485 |
"\\&\n" |
| 486 |
" while ((opt = getopt(argc, argv, \"o:\")) != -1) {\n" |
| 487 |
" switch (opt) {\n" |
| 488 |
" case \\[aq]o\\[aq]:\n" |
| 489 |
" subopts = optarg;\n" |
| 490 |
" while (*subopts != \\[aq]\\[rs]0\\[aq] && !errfnd) {\n" |
| 491 |
"\\&\n" |
| 492 |
" switch (getsubopt(&subopts, token, &value)) {\n" |
| 493 |
" case RO_OPT:\n" |
| 494 |
" readonly = 1;\n" |
| 495 |
" break;\n" |
| 496 |
"\\&\n" |
| 497 |
" case RW_OPT:\n" |
| 498 |
" readwrite = 1;\n" |
| 499 |
" break;\n" |
| 500 |
"\\&\n" |
| 501 |
" case NAME_OPT:\n" |
| 502 |
" if (value == NULL) {\n" |
| 503 |
" fprintf(stderr,\n" |
| 504 |
" \"Missing value for suboption \\[aq]%s\\[aq]\\[rs]n\",\n" |
| 505 |
" token[NAME_OPT]);\n" |
| 506 |
" errfnd = 1;\n" |
| 507 |
" continue;\n" |
| 508 |
" }\n" |
| 509 |
"\\&\n" |
| 510 |
" name = value;\n" |
| 511 |
" break;\n" |
| 512 |
"\\&\n" |
| 513 |
" default:\n" |
| 514 |
" fprintf(stderr,\n" |
| 515 |
" \"No match found for token: /%s/\\[rs]n\", value);\n" |
| 516 |
" errfnd = 1;\n" |
| 517 |
" break;\n" |
| 518 |
" }\n" |
| 519 |
" }\n" |
| 520 |
" if (readwrite && readonly) {\n" |
| 521 |
" fprintf(stderr,\n" |
| 522 |
" \"Only one of \\[aq]%s\\[aq] and \\[aq]%s\\[aq] can be specified\\[rs]n\",\n" |
| 523 |
" token[RO_OPT], token[RW_OPT]);\n" |
| 524 |
" errfnd = 1;\n" |
| 525 |
" }\n" |
| 526 |
" break;\n" |
| 527 |
"\\&\n" |
| 528 |
" default:\n" |
| 529 |
" errfnd = 1;\n" |
| 530 |
" }\n" |
| 531 |
" }\n" |
| 532 |
"\\&\n" |
| 533 |
" if (errfnd || argc == 1) {\n" |
| 534 |
" fprintf(stderr, \"\\[rs]nUsage: %s -o E<lt>suboptstringE<gt>\\[rs]n\", argv[0]);\n" |
| 535 |
" fprintf(stderr,\n" |
| 536 |
" \"suboptions are \\[aq]ro\\[aq], \\[aq]rw\\[aq], and \\[aq]name=E<lt>valueE<gt>\\[aq]\\[rs]n\");\n" |
| 537 |
" exit(EXIT_FAILURE);\n" |
| 538 |
" }\n" |
| 539 |
"\\&\n" |
| 540 |
" /* Remainder of program... */\n" |
| 541 |
"\\&\n" |
| 542 |
" exit(EXIT_SUCCESS);\n" |
| 543 |
"}\n" |
| 544 |
msgstr "" |
| 545 |
|
| 546 |
#. type: TH |
| 547 |
#: fedora-44 fedora-rawhide |
| 548 |
#, no-wrap |
| 549 |
msgid "2024-07-23" |
| 550 |
msgstr "" |
| 551 |
|
| 552 |
#. type: TH |
| 553 |
#: fedora-44 fedora-rawhide |
| 554 |
#, no-wrap |
| 555 |
msgid "Linux man-pages 6.13" |
| 556 |
msgstr "" |
| 557 |
|
| 558 |
#. type: TH |
| 559 |
#: mageia-cauldron |
| 560 |
#, no-wrap |
| 561 |
msgid "Linux man-pages 6.17" |
| 562 |
msgstr "" |
| 563 |
|
| 564 |
#. type: TH |
| 565 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 566 |
#, no-wrap |
| 567 |
msgid "Linux man-pages (unreleased)" |
| 568 |
msgstr "" |