Debian Codegraph @

po/fr/man3/getsubopt.3.po

raw
1 # French translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Christophe Blaess <https://www.blaess.fr/christophe/>, 1996-2003.
5 # Stéphan Rafin <[email protected]>, 2002.
6 # Thierry Vignaud <[email protected]>, 1999, 2002.
7 # François Micaux, 2002.
8 # Alain Portal <[email protected]>, 2003-2008.
9 # Jean-Philippe Guérard <[email protected]>, 2005-2006.
10 # Jean-Luc Coulon (f5ibh) <[email protected]>, 2006-2007.
11 # Julien Cristau <[email protected]>, 2006-2007.
12 # Thomas Huriaux <[email protected]>, 2006-2008.
13 # Nicolas François <[email protected]>, 2006-2008.
14 # Florentin Duneau <[email protected]>, 2006-2010.
15 # Simon Paillard <[email protected]>, 2006, 2013.
16 # Denis Barbier <[email protected]>, 2006, 2010.
17 # David Prévot <[email protected]>, 2010, 2012-2014.
18 # Jean-Pierre Giraud <[email protected]>, 2024-2026.
19 msgid ""
20 msgstr ""
21 "Project-Id-Version: manpages-l10n 4.30\n"
22 "POT-Creation-Date: 2026-06-05 06:26+0200\n"
23 "PO-Revision-Date: 2026-04-03 09:33+0200\n"
24 "Last-Translator: Jean-Pierre Giraud <[email protected]>\n"
25 "Language-Team: French <[email protected]>\n"
26 "Language: fr\n"
27 "MIME-Version: 1.0\n"
28 "Content-Type: text/plain; charset=UTF-8\n"
29 "Content-Transfer-Encoding: 8bit\n"
30 "Plural-Forms: nplurals=2; plural=n > 1;\n"
31 "X-Generator: Lokalize 25.04.0\n"
32
33 #. type: TH
34 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
35 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
36 #, no-wrap
37 msgid "getsubopt"
38 msgstr "getsubopt"
39
40 #. type: TH
41 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
42 #: opensuse-tumbleweed
43 #, no-wrap
44 msgid "2026-02-08"
45 msgstr "8 février 2026"
46
47 #. type: TH
48 #: archlinux debian-unstable
49 #, no-wrap
50 msgid "Linux man-pages 6.18"
51 msgstr "Pages du manuel de Linux 6.18"
52
53 #. type: SH
54 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
55 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
56 #, no-wrap
57 msgid "NAME"
58 msgstr "NOM"
59
60 #. type: Plain text
61 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
62 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
63 msgid "getsubopt - parse suboption arguments from a string"
64 msgstr "getsubopt – Parcourir les arguments des sous-options depuis une chaîne"
65
66 #. type: SH
67 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
68 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
69 #, no-wrap
70 msgid "LIBRARY"
71 msgstr "BIBLIOTHÈQUE"
72
73 #. type: Plain text
74 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
75 #: opensuse-leap-16-1 opensuse-tumbleweed
76 msgid "Standard C library (I<libc>,\\ I<-lc>)"
77 msgstr "Bibliothèque C standard (I<libc>,\\ I<-lc>)"
78
79 #. type: SH
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 #, no-wrap
83 msgid "SYNOPSIS"
84 msgstr "SYNOPSIS"
85
86 #. type: Plain text
87 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
88 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
89 #, no-wrap
90 msgid "B<#include E<lt>stdlib.hE<gt>>\n"
91 msgstr "B<#include E<lt>stdlib.hE<gt>>\n"
92
93 #. type: Plain text
94 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
95 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
96 #, no-wrap
97 msgid ""
98 "B<int getsubopt(char **restrict >I<optionp>B<, char *const *restrict >I<tokens>B<,>\n"
99 "B< char **restrict >I<valuep>B<);>\n"
100 msgstr ""
101 "B<int getsubopt(char **restrict >I<optionp>B<, char *const *restrict >I<tokens>B<,>\n"
102 "B< char **restrict >I<valuep>B<);>\n"
103
104 #. type: Plain text
105 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
106 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
107 msgid ""
108 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
109 msgstr ""
110 "Exigences de macros de test de fonctionnalités pour la glibc (consulter "
111 "B<feature_test_macros>(7)) :"
112
113 #. type: Plain text
114 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
115 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
116 msgid "B<getsubopt>():"
117 msgstr "B<getsubopt>() :"
118
119 #. || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
120 #. type: Plain text
121 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
122 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
123 #, no-wrap
124 msgid ""
125 " _XOPEN_SOURCE E<gt>= 500\n"
126 " || /* Since glibc 2.12: */ _POSIX_C_SOURCE E<gt>= 200809L\n"
127 msgstr ""
128 " _XOPEN_SOURCE E<gt>= 500\n"
129 " || /* Depuis la glibc 2.12 : */ _POSIX_C_SOURCE E<gt>= 200809L\n"
130
131 #. type: SH
132 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
133 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
134 #, no-wrap
135 msgid "DESCRIPTION"
136 msgstr "DESCRIPTION"
137
138 #. type: Plain text
139 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
140 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
141 msgid ""
142 "B<getsubopt>() parses the list of comma-separated suboptions provided in "
143 "I<optionp>. (Such a suboption list is typically produced when B<getopt>(3) "
144 "is used to parse a command line; see for example the I<-o> option of "
145 "B<mount>(8).) Each suboption may include an associated value, which is "
146 "separated from the suboption name by an equal sign. The following is an "
147 "example of the kind of string that might be passed in I<optionp>:"
148 msgstr ""
149 "B<getsubopt>() parcourt la liste des sous-options séparées par des virgules "
150 "fournie dans I<optionp> (une liste de sous-options est typiquement créée "
151 "lorsque B<getopt>(3) est utilisée pour parcourir une ligne de commande\\ ; "
152 "consultez par exemple l'option I<-o> de B<mount>(8)). Chaque sous-option "
153 "peut être associée à une valeur qui est séparée de son nom par un signe "
154 "égal. La suite est un exemple de ce type de chaîne qui peut être passé à "
155 "I<optionp>\\ :"
156
157 #. type: Plain text
158 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
159 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
160 #, no-wrap
161 msgid "B<ro,name=xyz>\n"
162 msgstr "B<ro,name=xyz>\n"
163
164 # NOTE: doivent être des chaînes distinctes, terminées par un caractère nul,
165 #. type: Plain text
166 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
167 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
168 msgid ""
169 "The I<tokens> argument is a pointer to a NULL-terminated array of pointers "
170 "to the tokens that B<getsubopt>() will look for in I<optionp>. The tokens "
171 "should be distinct, null-terminated strings containing at least one "
172 "character, with no embedded equal signs or commas."
173 msgstr ""
174 "L'argument I<tokens> est un pointeur vers un tableau de pointeurs (terminé "
175 "par NULL) vers les marqueurs que B<getsubopt>() recherche dans I<optionp>. "
176 "Les marqueurs doivent être distincts, contenant des chaînes terminées par un "
177 "caractère nul d'au moins un caractère, sans signe égal ou virgule."
178
179 #. type: Plain text
180 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
181 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
182 msgid ""
183 "Each call to B<getsubopt>() returns information about the next unprocessed "
184 "suboption in I<optionp>. The first equal sign in a suboption (if any) is "
185 "interpreted as a separator between the name and the value of that "
186 "suboption. The value extends to the next comma, or (for the last suboption) "
187 "to the end of the string. If the name of the suboption matches a known name "
188 "from I<tokens>, and a value string was found, B<getsubopt>() sets "
189 "I<*valuep> to the address of that string. The first comma in I<optionp> is "
190 "overwritten with a null byte, so I<*valuep> is precisely the \"value "
191 "string\" for that suboption."
192 msgstr ""
193 "Chaque appel à B<getsubopt>() renvoie une information sur la prochaine sous-"
194 "option contenue dans I<optionp> qui n'a pas été traitée. Le premier signal "
195 "égal (s'il existe) est interprété comme un séparateur entre un nom et une "
196 "valeur de sous-option. La valeur se termine à la prochaine virgule ou (pour "
197 "la dernière sous-option) à la fin de la chaîne. Si le nom d'une sous-option "
198 "correspond à un nom de I<tokens> et qu'une chaîne de valeur est trouvée, "
199 "B<getsubopt>() définit I<*valuep> à l'adresse de cette chaîne. La première "
200 "virgule in I<optionp> est surpassée par un octet nul, ainsi I<*valuep> est "
201 "exactement «\\ la chaîne de valeur\\ » de cette sous-option."
202
203 #. type: Plain text
204 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
205 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
206 msgid ""
207 "If the suboption is recognized, but no value string was found, I<*valuep> is "
208 "set to NULL."
209 msgstr ""
210 "Si la sous-option est reconnue, mais qu'aucune chaîne de valeur n'existe, "
211 "I<*valuep> est défini à NULL."
212
213 #. type: Plain text
214 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
215 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
216 msgid ""
217 "When B<getsubopt>() returns, I<optionp> points to the next suboption, or to "
218 "the null byte (\\[aq]\\[rs]0\\[aq]) at the end of the string if the last "
219 "suboption was just processed."
220 msgstr ""
221 "Lorsque B<getsubopt>() renvoie, I<optionp> pointe vers la prochaine sous-"
222 "option, ou vers l'octet nul (« \\[rs]0 ») en fin de chaîne, si la dernière "
223 "sous-option vient juste d'être traitée."
224
225 #. type: SH
226 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
227 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
228 #, no-wrap
229 msgid "RETURN VALUE"
230 msgstr "VALEUR RENVOYÉE"
231
232 #. type: Plain text
233 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
234 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
235 msgid ""
236 "If the first suboption in I<optionp> is recognized, B<getsubopt>() returns "
237 "the index of the matching suboption element in I<tokens>. Otherwise, -1 is "
238 "returned and I<*valuep> is the entire I<name>B<[=>I<value>B<]> string."
239 msgstr ""
240 "Si la première sous-option de I<optionp> est reconnue, B<getsubopt>() "
241 "renvoie l'index de l'élément de I<tokens> correspondant à la sous-option. "
242 "Sinon, -1 est renvoyé et I<*valuep> correspond à la chaîne "
243 "I<nom>B<[=>I<valeur>B<]>."
244
245 #. type: Plain text
246 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
247 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
248 msgid ""
249 "Since I<*optionp> is changed, the first suboption before the call to "
250 "B<getsubopt>() is not (necessarily) the same as the first suboption after "
251 "B<getsubopt>()."
252 msgstr ""
253 "Puisque I<*optionp> est modifié, la première sous-option avant l'appel à "
254 "B<getsubopt>() n'est pas nécessairement la même qu'après."
255
256 #. type: SH
257 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
258 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
259 #, no-wrap
260 msgid "ATTRIBUTES"
261 msgstr "ATTRIBUTS"
262
263 #. type: Plain text
264 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
265 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
266 msgid ""
267 "For an explanation of the terms used in this section, see B<attributes>(7)."
268 msgstr ""
269 "Pour une explication des termes utilisés dans cette section, consulter "
270 "B<attributes>(7)."
271
272 #. type: tbl table
273 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
274 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
275 #, no-wrap
276 msgid "Interface"
277 msgstr "Interface"
278
279 #. type: tbl table
280 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
281 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
282 #, no-wrap
283 msgid "Attribute"
284 msgstr "Attribut"
285
286 #. type: tbl table
287 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
288 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
289 #, no-wrap
290 msgid "Value"
291 msgstr "Valeur"
292
293 #. type: tbl table
294 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
295 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
296 #, no-wrap
297 msgid ".na\n"
298 msgstr ".na\n"
299
300 #. type: tbl table
301 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
302 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
303 #, no-wrap
304 msgid ".nh\n"
305 msgstr ".nh\n"
306
307 #. type: tbl table
308 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
309 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
310 #, no-wrap
311 msgid "B<getsubopt>()"
312 msgstr "B<getsubopt>()"
313
314 #. type: tbl table
315 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
316 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
317 #, no-wrap
318 msgid "Thread safety"
319 msgstr "Sécurité des threads"
320
321 #. type: tbl table
322 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
323 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
324 #, no-wrap
325 msgid "MT-Safe"
326 msgstr "MT-Safe"
327
328 #. type: SH
329 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
330 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
331 #, no-wrap
332 msgid "STANDARDS"
333 msgstr "NORMES"
334
335 #. type: Plain text
336 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
337 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
338 msgid "POSIX.1-2008."
339 msgstr "POSIX.1-2008."
340
341 #. type: SH
342 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
343 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
344 #, no-wrap
345 msgid "HISTORY"
346 msgstr "HISTORIQUE"
347
348 #. type: Plain text
349 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
350 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
351 msgid "POSIX.1-2001."
352 msgstr "POSIX.1-2001."
353
354 #. type: SH
355 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
356 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
357 #, no-wrap
358 msgid "NOTES"
359 msgstr "NOTES"
360
361 #. type: Plain text
362 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
363 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
364 msgid ""
365 "Since B<getsubopt>() overwrites any commas it finds in the string "
366 "I<*optionp>, that string must be writable; it cannot be a string constant."
367 msgstr ""
368 "Puisque B<getsubopt>() réécrit toutes les virgules trouvées dans la chaîne "
369 "I<*optionp>, cette chaîne doit être accessible en écriture, elle ne peut pas "
370 "être une chaîne constante."
371
372 #. type: SH
373 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
374 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
375 #, no-wrap
376 msgid "EXAMPLES"
377 msgstr "EXEMPLES"
378
379 #. type: Plain text
380 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
381 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
382 msgid "The following program expects suboptions following a \"-o\" option."
383 msgstr ""
384 "Le programme suivant attend des sous-options après l'option «\\ -o\\ »."
385
386 #. type: Plain text
387 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
388 #: opensuse-tumbleweed
389 #, no-wrap
390 msgid ""
391 "#define _XOPEN_SOURCE 500\n"
392 "#include E<lt>stdio.hE<gt>\n"
393 "#include E<lt>stdlib.hE<gt>\n"
394 "\\&\n"
395 "#include E<lt>assert.hE<gt>\n"
396 "\\&\n"
397 "int\n"
398 "main(int argc, char *argv[])\n"
399 "{\n"
400 " enum {\n"
401 " RO_OPT = 0,\n"
402 " RW_OPT,\n"
403 " NAME_OPT\n"
404 " };\n"
405 " char *const token[] = {\n"
406 " [RO_OPT] = \"ro\",\n"
407 " [RW_OPT] = \"rw\",\n"
408 " [NAME_OPT] = \"name\",\n"
409 " NULL\n"
410 " };\n"
411 " char *subopts;\n"
412 " char *value;\n"
413 " int opt;\n"
414 "\\&\n"
415 " int readonly = 0;\n"
416 " int readwrite = 0;\n"
417 " char *name = NULL;\n"
418 " int errfnd = 0;\n"
419 "\\&\n"
420 " while ((opt = getopt(argc, argv, \"o:\")) != -1) {\n"
421 " switch (opt) {\n"
422 " case \\[aq]o\\[aq]:\n"
423 " subopts = optarg;\n"
424 " while (*subopts != \\[aq]\\[rs]0\\[aq] && !errfnd) {\n"
425 "\\&\n"
426 " switch (getsubopt(&subopts, token, &value)) {\n"
427 " case RO_OPT:\n"
428 " readonly = 1;\n"
429 " break;\n"
430 "\\&\n"
431 " case RW_OPT:\n"
432 " readwrite = 1;\n"
433 " break;\n"
434 "\\&\n"
435 " case NAME_OPT:\n"
436 " if (value == NULL) {\n"
437 " fprintf(stderr,\n"
438 " \"Missing value for suboption \\[aq]%s\\[aq]\\[rs]n\",\n"
439 " token[NAME_OPT]);\n"
440 " errfnd = 1;\n"
441 " continue;\n"
442 " }\n"
443 "\\&\n"
444 " name = value;\n"
445 " break;\n"
446 "\\&\n"
447 " default:\n"
448 " fprintf(stderr,\n"
449 " \"No match found for token: /%s/\\[rs]n\", value);\n"
450 " errfnd = 1;\n"
451 " break;\n"
452 " }\n"
453 " }\n"
454 " if (readwrite && readonly) {\n"
455 " fprintf(stderr,\n"
456 " \"Only one of \\[aq]%s\\[aq] and \\[aq]%s\\[aq] can be specified\\[rs]n\",\n"
457 " token[RO_OPT], token[RW_OPT]);\n"
458 " errfnd = 1;\n"
459 " }\n"
460 " break;\n"
461 "\\&\n"
462 " default:\n"
463 " errfnd = 1;\n"
464 " }\n"
465 " }\n"
466 "\\&\n"
467 " if (errfnd || argc == 1) {\n"
468 " fprintf(stderr, \"\\[rs]nUsage: %s -o E<lt>suboptstringE<gt>\\[rs]n\", argv[0]);\n"
469 " fprintf(stderr,\n"
470 " \"suboptions are \\[aq]ro\\[aq], \\[aq]rw\\[aq], and \\[aq]name=E<lt>valueE<gt>\\[aq]\\[rs]n\");\n"
471 " exit(EXIT_FAILURE);\n"
472 " }\n"
473 "\\&\n"
474 " /* Remainder of program... */\n"
475 "\\&\n"
476 " exit(EXIT_SUCCESS);\n"
477 "}\n"
478 msgstr ""
479 "#define _XOPEN_SOURCE 500\n"
480 "#include E<lt>stdio.hE<gt>\n"
481 "#include E<lt>stdlib.hE<gt>\n"
482 "\\&\n"
483 "#include E<lt>assert.hE<gt>\n"
484 "\\&\n"
485 "int\n"
486 "main(int argc, char *argv[])\n"
487 "{\n"
488 " enum {\n"
489 " RO_OPT = 0,\n"
490 " RW_OPT,\n"
491 " NAME_OPT\n"
492 " };\n"
493 " char *const token[] = {\n"
494 " [RO_OPT] = \"ro\",\n"
495 " [RW_OPT] = \"rw\",\n"
496 " [NAME_OPT] = \"name\",\n"
497 " NULL\n"
498 " };\n"
499 " char *subopts;\n"
500 " char *value;\n"
501 " int opt;\n"
502 "\\&\n"
503 " int readonly = 0;\n"
504 " int readwrite = 0;\n"
505 " char *name = NULL;\n"
506 " int errfnd = 0;\n"
507 "\\&\n"
508 " while ((opt = getopt(argc, argv, \"o:\")) != -1) {\n"
509 " switch (opt) {\n"
510 " case \\[aq]o\\[aq]:\n"
511 " subopts = optarg;\n"
512 " while (*subopts != \\[aq]\\[rs]0\\[aq] && !errfnd) {\n"
513 "\\&\n"
514 " switch (getsubopt(&subopts, token, &value)) {\n"
515 " case RO_OPT:\n"
516 " readonly = 1;\n"
517 " break;\n"
518 "\\&\n"
519 " case RW_OPT:\n"
520 " readwrite = 1;\n"
521 " break;\n"
522 "\\&\n"
523 " case NAME_OPT:\n"
524 " if (value == NULL) {\n"
525 " fprintf(stderr,\n"
526 " \"Valeur absente pour la sous-option \\[aq]%s\\[aq]\\[rs]n\",\n"
527 " token[NAME_OPT]);\n"
528 " errfnd = 1;\n"
529 " continue;\n"
530 " }\n"
531 "\\&\n"
532 " name = value;\n"
533 " break;\n"
534 "\\&\n"
535 " default:\n"
536 " fprintf(stderr,\n"
537 " \"Pas de correspondance trouvée pour le marqueur : /%s/\\[rs]n\", value);\n"
538 " errfnd = 1;\n"
539 " break;\n"
540 " }\n"
541 " }\n"
542 " if (readwrite && readonly) {\n"
543 " fprintf(stderr,\n"
544 " \"Seul un de \\[aq]%s\\[aq] et \\[aq]%s\\[aq] peut être spécifié\\[rs]n\",\n"
545 " token[RO_OPT], token[RW_OPT]);\n"
546 " errfnd = 1;\n"
547 " }\n"
548 " break;\n"
549 "\\&\n"
550 " default:\n"
551 " errfnd = 1;\n"
552 " }\n"
553 " }\n"
554 "\\&\n"
555 " if (errfnd || argc == 1) {\n"
556 " fprintf(stderr, \"\\[rs]nUtilisation : %s -o E<lt>suboptstringE<gt>\\[rs]n\", argv[0]);\n"
557 " fprintf(stderr,\n"
558 " \"les sous-options sont \\[aq]ro\\[aq], \\[aq]rw\\[aq], and \\[aq]name=E<lt>valueE<gt>\\[aq]\\[rs]n\");\n"
559 " exit(EXIT_FAILURE);\n"
560 " }\n"
561 "\\&\n"
562 " /* Reste du programme... */\n"
563 "\\&\n"
564 " exit(EXIT_SUCCESS);\n"
565 "}\n"
566
567 #. SRC END
568 #. type: SH
569 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
570 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
571 #, no-wrap
572 msgid "SEE ALSO"
573 msgstr "VOIR AUSSI"
574
575 #. type: Plain text
576 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
577 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
578 msgid "B<getopt>(3)"
579 msgstr "B<getopt>(3)"
580
581 #. type: TH
582 #: debian-trixie
583 #, no-wrap
584 msgid "2024-06-15"
585 msgstr "15 juin 2024"
586
587 #. type: TH
588 #: debian-trixie
589 #, no-wrap
590 msgid "Linux man-pages 6.9.1"
591 msgstr "Pages du manuel de Linux 6.9.1"
592
593 #. type: Plain text
594 #: debian-trixie
595 msgid "Standard C library (I<libc>, I<-lc>)"
596 msgstr "Bibliothèque C standard (I<libc>, I<-lc>)"
597
598 #. type: Plain text
599 #: debian-trixie fedora-44 fedora-rawhide
600 #, no-wrap
601 msgid ""
602 "#define _XOPEN_SOURCE 500\n"
603 "#include E<lt>stdio.hE<gt>\n"
604 "#include E<lt>stdlib.hE<gt>\n"
605 "\\&\n"
606 "#include E<lt>assert.hE<gt>\n"
607 "\\&\n"
608 "int\n"
609 "main(int argc, char *argv[])\n"
610 "{\n"
611 " enum {\n"
612 " RO_OPT = 0,\n"
613 " RW_OPT,\n"
614 " NAME_OPT\n"
615 " };\n"
616 " char *const token[] = {\n"
617 " [RO_OPT] = \"ro\",\n"
618 " [RW_OPT] = \"rw\",\n"
619 " [NAME_OPT] = \"name\",\n"
620 " NULL\n"
621 " };\n"
622 " char *subopts;\n"
623 " char *value;\n"
624 " int opt;\n"
625 "\\&\n"
626 " int readonly = 0;\n"
627 " int readwrite = 0;\n"
628 " char *name = NULL;\n"
629 " int errfnd = 0;\n"
630 "\\&\n"
631 " while ((opt = getopt(argc, argv, \"o:\")) != -1) {\n"
632 " switch (opt) {\n"
633 " case \\[aq]o\\[aq]:\n"
634 " subopts = optarg;\n"
635 " while (*subopts != \\[aq]\\[rs]0\\[aq] && !errfnd) {\n"
636 "\\&\n"
637 " switch (getsubopt(&subopts, token, &value)) {\n"
638 " case RO_OPT:\n"
639 " readonly = 1;\n"
640 " break;\n"
641 "\\&\n"
642 " case RW_OPT:\n"
643 " readwrite = 1;\n"
644 " break;\n"
645 "\\&\n"
646 " case NAME_OPT:\n"
647 " if (value == NULL) {\n"
648 " fprintf(stderr,\n"
649 " \"Missing value for suboption \\[aq]%s\\[aq]\\[rs]n\",\n"
650 " token[NAME_OPT]);\n"
651 " errfnd = 1;\n"
652 " continue;\n"
653 " }\n"
654 "\\&\n"
655 " name = value;\n"
656 " break;\n"
657 "\\&\n"
658 " default:\n"
659 " fprintf(stderr,\n"
660 " \"No match found for token: /%s/\\[rs]n\", value);\n"
661 " errfnd = 1;\n"
662 " break;\n"
663 " }\n"
664 " }\n"
665 " if (readwrite && readonly) {\n"
666 " fprintf(stderr,\n"
667 " \"Only one of \\[aq]%s\\[aq] and \\[aq]%s\\[aq] can be specified\\[rs]n\",\n"
668 " token[RO_OPT], token[RW_OPT]);\n"
669 " errfnd = 1;\n"
670 " }\n"
671 " break;\n"
672 "\\&\n"
673 " default:\n"
674 " errfnd = 1;\n"
675 " }\n"
676 " }\n"
677 "\\&\n"
678 " if (errfnd || argc == 1) {\n"
679 " fprintf(stderr, \"\\[rs]nUsage: %s -o E<lt>suboptstringE<gt>\\[rs]n\", argv[0]);\n"
680 " fprintf(stderr,\n"
681 " \"suboptions are \\[aq]ro\\[aq], \\[aq]rw\\[aq], and \\[aq]name=E<lt>valueE<gt>\\[aq]\\[rs]n\");\n"
682 " exit(EXIT_FAILURE);\n"
683 " }\n"
684 "\\&\n"
685 " /* Remainder of program... */\n"
686 "\\&\n"
687 " exit(EXIT_SUCCESS);\n"
688 "}\n"
689 msgstr ""
690 "#define _XOPEN_SOURCE 500\n"
691 "#include E<lt>stdio.hE<gt>\n"
692 "#include E<lt>stdlib.hE<gt>\n"
693 "\\&\n"
694 "#include E<lt>assert.hE<gt>\n"
695 "\\&\n"
696 "int\n"
697 "main(int argc, char *argv[])\n"
698 "{\n"
699 " enum {\n"
700 " RO_OPT = 0,\n"
701 " RW_OPT,\n"
702 " NAME_OPT\n"
703 " };\n"
704 " char *const token[] = {\n"
705 " [RO_OPT] = \"ro\",\n"
706 " [RW_OPT] = \"rw\",\n"
707 " [NAME_OPT] = \"name\",\n"
708 " NULL\n"
709 " };\n"
710 " char *subopts;\n"
711 " char *value;\n"
712 " int opt;\n"
713 "\\&\n"
714 " int readonly = 0;\n"
715 " int readwrite = 0;\n"
716 " char *name = NULL;\n"
717 " int errfnd = 0;\n"
718 "\\&\n"
719 " while ((opt = getopt(argc, argv, \"o:\")) != -1) {\n"
720 " switch (opt) {\n"
721 " case \\[aq]o\\[aq]:\n"
722 " subopts = optarg;\n"
723 " while (*subopts != \\[aq]\\[rs]0\\[aq] && !errfnd) {\n"
724 "\\&\n"
725 " switch (getsubopt(&subopts, token, &value)) {\n"
726 " case RO_OPT:\n"
727 " readonly = 1;\n"
728 " break;\n"
729 "\\&\n"
730 " case RW_OPT:\n"
731 " readwrite = 1;\n"
732 " break;\n"
733 "\\&\n"
734 " case NAME_OPT:\n"
735 " if (value == NULL) {\n"
736 " fprintf(stderr,\n"
737 " \"Valeur absente pour la sous-option \\[aq]%s\\[aq]\\[rs]n\",\n"
738 " token[NAME_OPT]);\n"
739 " errfnd = 1;\n"
740 " continue;\n"
741 " }\n"
742 "\\&\n"
743 " name = value;\n"
744 " break;\n"
745 "\\&\n"
746 " default:\n"
747 " fprintf(stderr,\n"
748 " \"Pas de correspondance trouvée pour le marqueur : /%s/\\[rs]n\", value);\n"
749 " errfnd = 1;\n"
750 " break;\n"
751 " }\n"
752 " }\n"
753 " if (readwrite && readonly) {\n"
754 " fprintf(stderr,\n"
755 " \"Seul un de \\[aq]%s\\[aq] et \\[aq]%s\\[aq] peut être spécifié\\[rs]n\",\n"
756 " token[RO_OPT], token[RW_OPT]);\n"
757 " errfnd = 1;\n"
758 " }\n"
759 " break;\n"
760 "\\&\n"
761 " default:\n"
762 " errfnd = 1;\n"
763 " }\n"
764 " }\n"
765 "\\&\n"
766 " if (errfnd || argc == 1) {\n"
767 " fprintf(stderr, \"\\[rs]nUtilisation : %s -o E<lt>suboptstringE<gt>\\[rs]n\", argv[0]);\n"
768 " fprintf(stderr,\n"
769 " \"les sous-options sont \\[aq]ro\\[aq], \\[aq]rw\\[aq], and \\[aq]name=E<lt>valueE<gt>\\[aq]\\[rs]n\");\n"
770 " exit(EXIT_FAILURE);\n"
771 " }\n"
772 "\\&\n"
773 " /* Reste du programme... */\n"
774 "\\&\n"
775 " exit(EXIT_SUCCESS);\n"
776 "}\n"
777
778 #. type: TH
779 #: fedora-44 fedora-rawhide
780 #, no-wrap
781 msgid "2024-07-23"
782 msgstr "23 juillet 2024"
783
784 #. type: TH
785 #: fedora-44 fedora-rawhide
786 #, no-wrap
787 msgid "Linux man-pages 6.13"
788 msgstr "Pages du manuel de Linux 6.13"
789
790 #. type: TH
791 #: mageia-cauldron
792 #, no-wrap
793 msgid "Linux man-pages 6.17"
794 msgstr "Pages du manuel de Linux 6.17"
795
796 #. type: TH
797 #: opensuse-leap-16-1 opensuse-tumbleweed
798 #, no-wrap
799 msgid "Linux man-pages (unreleased)"
800 msgstr "Pages du manuel de Linux (non publiées)"