Debian Codegraph @

po/ar/man3/getsubopt.3.po

raw
1 # Arabic translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # زايد السعيدي <[email protected]>, 2026.
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: manpages-l10n 4.30.2\n"
8 "POT-Creation-Date: 2026-06-05 06:26+0200\n"
9 "PO-Revision-Date: 2026-06-01 17:46+0400\n"
10 "Last-Translator: Zayed Al-Saidi <[email protected]>\n"
11 "Language-Team: Arabic <[email protected]>\n"
12 "Language: ar\n"
13 "MIME-Version: 1.0\n"
14 "Content-Type: text/plain; charset=UTF-8\n"
15 "Content-Transfer-Encoding: 8bit\n"
16 "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
17 "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
18 "X-Generator: Lokalize 23.08.5\n"
19
20 #. type: TH
21 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
22 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
23 #, no-wrap
24 msgid "getsubopt"
25 msgstr "getsubopt"
26
27 #. type: TH
28 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
29 #: opensuse-tumbleweed
30 #, no-wrap
31 msgid "2026-02-08"
32 msgstr "8 فبراير 2026"
33
34 #. type: TH
35 #: archlinux debian-unstable
36 #, no-wrap
37 msgid "Linux man-pages 6.18"
38 msgstr "صفحات دليل لينكس 6.18"
39
40 #. type: SH
41 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
42 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
43 #, no-wrap
44 msgid "NAME"
45 msgstr "الاسم"
46
47 #. type: Plain text
48 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
49 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
50 msgid "getsubopt - parse suboption arguments from a string"
51 msgstr "getsubopt - تحليل وسائط الخيارات الفرعية من سلسلة محارف"
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 "LIBRARY"
58 msgstr "المكتبة"
59
60 #. type: Plain text
61 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
62 #: opensuse-leap-16-1 opensuse-tumbleweed
63 msgid "Standard C library (I<libc>,\\ I<-lc>)"
64 msgstr "مكتبة سي المعيارية (I<libc>،\\ I<-lc>)"
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 "SYNOPSIS"
71 msgstr "موجز"
72
73 #. type: Plain text
74 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
75 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
76 #, no-wrap
77 msgid "B<#include E<lt>stdlib.hE<gt>>\n"
78 msgstr "B<#include E<lt>stdlib.hE<gt>>\n"
79
80 #. type: Plain text
81 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
82 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
83 #, no-wrap
84 msgid ""
85 "B<int getsubopt(char **restrict >I<optionp>B<, char *const *restrict >I<tokens>B<,>\n"
86 "B< char **restrict >I<valuep>B<);>\n"
87 msgstr ""
88 "B<int getsubopt(char **restrict >I<optionp>B<, char *const *restrict >I<tokens>B<,>\n"
89 "B< char **restrict >I<valuep>B<);>\n"
90
91 #. type: Plain text
92 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
93 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
94 msgid ""
95 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
96 msgstr ""
97 "متطلبات ماكروات اختبار الميزات لـ glibc (انظر B<feature_test_macros>(7)):"
98
99 #. type: Plain text
100 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
101 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
102 msgid "B<getsubopt>():"
103 msgstr "B<getsubopt>():"
104
105 #. || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
106 #. type: Plain text
107 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
108 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
109 #, no-wrap
110 msgid ""
111 " _XOPEN_SOURCE E<gt>= 500\n"
112 " || /* Since glibc 2.12: */ _POSIX_C_SOURCE E<gt>= 200809L\n"
113 msgstr ""
114 " _XOPEN_SOURCE E<gt>= 500\n"
115 " || /* منذ glibc 2.12: */ _POSIX_C_SOURCE E<gt>= 200809L\n"
116
117 #. type: SH
118 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
119 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
120 #, no-wrap
121 msgid "DESCRIPTION"
122 msgstr "الوصف"
123
124 #. type: Plain text
125 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
126 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
127 msgid ""
128 "B<getsubopt>() parses the list of comma-separated suboptions provided in "
129 "I<optionp>. (Such a suboption list is typically produced when B<getopt>(3) "
130 "is used to parse a command line; see for example the I<-o> option of "
131 "B<mount>(8).) Each suboption may include an associated value, which is "
132 "separated from the suboption name by an equal sign. The following is an "
133 "example of the kind of string that might be passed in I<optionp>:"
134 msgstr ""
135 "B<getsubopt>() يُحلل قائمة الخيارات الفرعية المفصولة بفواصل والمُقدمة في "
136 "I<optionp>. (تُنتج قائمة الخيارات الفرعية هذه عادةً عند استخدام B<getopt>(3) "
137 "لتحليل سطر أوامر؛ انظر مثلاً الخيار I<-o> من B<mount>(8).) قد يتضمن كل خيار "
138 "فرعي قيمة مرتبطة، تُفصل عن اسم الخيار الفرعي بعلامة يساوي. فيما يلي مثال على "
139 "نوع السلسلة التي قد تُمرر في I<optionp>:"
140
141 #. type: Plain text
142 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
143 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
144 #, no-wrap
145 msgid "B<ro,name=xyz>\n"
146 msgstr "B<ro,name=xyz>\n"
147
148 #. type: Plain text
149 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
150 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
151 msgid ""
152 "The I<tokens> argument is a pointer to a NULL-terminated array of pointers "
153 "to the tokens that B<getsubopt>() will look for in I<optionp>. The tokens "
154 "should be distinct, null-terminated strings containing at least one "
155 "character, with no embedded equal signs or commas."
156 msgstr ""
157 "وسيط I<tokens> هو مؤشر لمصفوفة منتهية بـ NULL من المؤشرات إلى الرموز التي "
158 "سيبحث عنها B<getsubopt>() في I<optionp>. يجب أن تكون الرموز سلاسل محارف "
159 "مميزة ومنتهية بـ null وتحتوي على حرف واحد على الأقل، دون علامات يساوي أو "
160 "فواصل مضمنة."
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 "Each call to B<getsubopt>() returns information about the next unprocessed "
167 "suboption in I<optionp>. The first equal sign in a suboption (if any) is "
168 "interpreted as a separator between the name and the value of that "
169 "suboption. The value extends to the next comma, or (for the last suboption) "
170 "to the end of the string. If the name of the suboption matches a known name "
171 "from I<tokens>, and a value string was found, B<getsubopt>() sets "
172 "I<*valuep> to the address of that string. The first comma in I<optionp> is "
173 "overwritten with a null byte, so I<*valuep> is precisely the \"value "
174 "string\" for that suboption."
175 msgstr ""
176 "كل استدعاء لـ B<getsubopt>() يُرجع معلومات عن الخيار الفرعي التالي غير "
177 "المعالج في I<optionp>. تُفسر أول علامة يساوي في خيار فرعي (إن وُجدت) كفاصل "
178 "بين اسم وقيمة ذلك الخيار الفرعي. تمتد القيمة إلى الفاصلة التالية، أو "
179 "(للخيار الفرعي الأخير) إلى نهاية السلسلة. إذا طابق اسم الخيار الفرعي اسمًا "
180 "معروفًا من I<tokens>، ووُجدت سلسلة قيمة، يضبط B<getsubopt>() I<*valuep> على "
181 "عنوان تلك السلسلة. تُستبدل أول فاصلة في I<optionp> ببايت فارغ، لذا يكون "
182 "I<*valuep> بدقة \"سلسلة القيمة\" لذلك الخيار الفرعي."
183
184 #. type: Plain text
185 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
186 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
187 msgid ""
188 "If the suboption is recognized, but no value string was found, I<*valuep> is "
189 "set to NULL."
190 msgstr ""
191 "إذا تم التعرف على الخيار الفرعي، ولكن لم تُوجد سلسلة قيمة، يُضبط I<*valuep> "
192 "على NULL."
193
194 #. type: Plain text
195 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
196 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
197 msgid ""
198 "When B<getsubopt>() returns, I<optionp> points to the next suboption, or to "
199 "the null byte (\\[aq]\\[rs]0\\[aq]) at the end of the string if the last "
200 "suboption was just processed."
201 msgstr ""
202 "عندما يُرجع B<getsubopt>()، يشير I<optionp> إلى الخيار الفرعي التالي، أو إلى "
203 "البايت الفارغ (\\[aq]\\[rs]0\\[aq]) في نهاية السلسلة إذا كان الخيار الفرعي "
204 "الأخير قد عُولج لتوه."
205
206 #. type: SH
207 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
208 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
209 #, no-wrap
210 msgid "RETURN VALUE"
211 msgstr "قيمة الإرجاع"
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 "If the first suboption in I<optionp> is recognized, B<getsubopt>() returns "
218 "the index of the matching suboption element in I<tokens>. Otherwise, -1 is "
219 "returned and I<*valuep> is the entire I<name>B<[=>I<value>B<]> string."
220 msgstr ""
221 "إذا تم التعرف على أول خيار فرعي في I<optionp>، يُرجع B<getsubopt>() فهرس عنصر "
222 "الخيار الفرعي المطابق في I<tokens>. وإلا، يُرجع -1 ويكون I<*valuep> هو "
223 "السلسلة الكاملة I<name>B<[=>I<value>B<]>."
224
225 #. type: Plain text
226 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
227 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
228 msgid ""
229 "Since I<*optionp> is changed, the first suboption before the call to "
230 "B<getsubopt>() is not (necessarily) the same as the first suboption after "
231 "B<getsubopt>()."
232 msgstr ""
233 "بما أن I<*optionp> قد تغير، فإن أول خيار فرعي قبل استدعاء B<getsubopt>() ليس "
234 "(بالضرورة) نفس أول خيار فرعي بعد B<getsubopt>()."
235
236 #. type: SH
237 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
238 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
239 #, no-wrap
240 msgid "ATTRIBUTES"
241 msgstr "السمات"
242
243 #. type: Plain text
244 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
245 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
246 msgid ""
247 "For an explanation of the terms used in this section, see B<attributes>(7)."
248 msgstr ""
249 "للاطلاع على شرح للمصطلحات المستخدمة في هذا القسم، انظر B<attributes>(7)."
250
251 #. type: tbl table
252 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
253 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
254 #, no-wrap
255 msgid "Interface"
256 msgstr "الواجهة"
257
258 #. type: tbl table
259 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
260 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
261 #, no-wrap
262 msgid "Attribute"
263 msgstr "السمة"
264
265 #. type: tbl table
266 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
267 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
268 #, no-wrap
269 msgid "Value"
270 msgstr "القيمة"
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 ".na\n"
277 msgstr ".na\n"
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 ".nh\n"
284 msgstr ".nh\n"
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 "B<getsubopt>()"
291 msgstr "B<getsubopt>()"
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 "Thread safety"
298 msgstr "سلامة الخيوط"
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 "MT-Safe"
305 msgstr "MT-Safe"
306
307 #. type: SH
308 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
309 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
310 #, no-wrap
311 msgid "STANDARDS"
312 msgstr "المعايير"
313
314 #. type: Plain text
315 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
316 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
317 msgid "POSIX.1-2008."
318 msgstr "POSIX.1-2008."
319
320 #. type: SH
321 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
322 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
323 #, no-wrap
324 msgid "HISTORY"
325 msgstr "التاريخ"
326
327 #. type: Plain text
328 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
329 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
330 msgid "POSIX.1-2001."
331 msgstr "POSIX.1-2001."
332
333 #. type: SH
334 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
335 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
336 #, no-wrap
337 msgid "NOTES"
338 msgstr "ملاحظات"
339
340 #. type: Plain text
341 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
342 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
343 msgid ""
344 "Since B<getsubopt>() overwrites any commas it finds in the string "
345 "I<*optionp>, that string must be writable; it cannot be a string constant."
346 msgstr ""
347 "بما أن B<getsubopt>() يستبدل أي فواصل يجدها في السلسلة I<*optionp>، يجب أن "
348 "تكون تلك السلسلة قابلة للكتابة؛ لا يمكن أن تكون ثابت سلسلة."
349
350 #. type: SH
351 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
352 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
353 #, no-wrap
354 msgid "EXAMPLES"
355 msgstr "أمثلة"
356
357 #. type: Plain text
358 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
359 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
360 msgid "The following program expects suboptions following a \"-o\" option."
361 msgstr "يتوقع البرنامج التالي خيارات فرعية تتبع خيار \"-o\"."
362
363 #. type: Plain text
364 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
365 #: opensuse-tumbleweed
366 #, no-wrap
367 msgid ""
368 "#define _XOPEN_SOURCE 500\n"
369 "#include E<lt>stdio.hE<gt>\n"
370 "#include E<lt>stdlib.hE<gt>\n"
371 "\\&\n"
372 "#include E<lt>assert.hE<gt>\n"
373 "\\&\n"
374 "int\n"
375 "main(int argc, char *argv[])\n"
376 "{\n"
377 " enum {\n"
378 " RO_OPT = 0,\n"
379 " RW_OPT,\n"
380 " NAME_OPT\n"
381 " };\n"
382 " char *const token[] = {\n"
383 " [RO_OPT] = \"ro\",\n"
384 " [RW_OPT] = \"rw\",\n"
385 " [NAME_OPT] = \"name\",\n"
386 " NULL\n"
387 " };\n"
388 " char *subopts;\n"
389 " char *value;\n"
390 " int opt;\n"
391 "\\&\n"
392 " int readonly = 0;\n"
393 " int readwrite = 0;\n"
394 " char *name = NULL;\n"
395 " int errfnd = 0;\n"
396 "\\&\n"
397 " while ((opt = getopt(argc, argv, \"o:\")) != -1) {\n"
398 " switch (opt) {\n"
399 " case \\[aq]o\\[aq]:\n"
400 " subopts = optarg;\n"
401 " while (*subopts != \\[aq]\\[rs]0\\[aq] && !errfnd) {\n"
402 "\\&\n"
403 " switch (getsubopt(&subopts, token, &value)) {\n"
404 " case RO_OPT:\n"
405 " readonly = 1;\n"
406 " break;\n"
407 "\\&\n"
408 " case RW_OPT:\n"
409 " readwrite = 1;\n"
410 " break;\n"
411 "\\&\n"
412 " case NAME_OPT:\n"
413 " if (value == NULL) {\n"
414 " fprintf(stderr,\n"
415 " \"Missing value for suboption \\[aq]%s\\[aq]\\[rs]n\",\n"
416 " token[NAME_OPT]);\n"
417 " errfnd = 1;\n"
418 " continue;\n"
419 " }\n"
420 "\\&\n"
421 " name = value;\n"
422 " break;\n"
423 "\\&\n"
424 " default:\n"
425 " fprintf(stderr,\n"
426 " \"No match found for token: /%s/\\[rs]n\", value);\n"
427 " errfnd = 1;\n"
428 " break;\n"
429 " }\n"
430 " }\n"
431 " if (readwrite && readonly) {\n"
432 " fprintf(stderr,\n"
433 " \"Only one of \\[aq]%s\\[aq] and \\[aq]%s\\[aq] can be specified\\[rs]n\",\n"
434 " token[RO_OPT], token[RW_OPT]);\n"
435 " errfnd = 1;\n"
436 " }\n"
437 " break;\n"
438 "\\&\n"
439 " default:\n"
440 " errfnd = 1;\n"
441 " }\n"
442 " }\n"
443 "\\&\n"
444 " if (errfnd || argc == 1) {\n"
445 " fprintf(stderr, \"\\[rs]nUsage: %s -o E<lt>suboptstringE<gt>\\[rs]n\", argv[0]);\n"
446 " fprintf(stderr,\n"
447 " \"suboptions are \\[aq]ro\\[aq], \\[aq]rw\\[aq], and \\[aq]name=E<lt>valueE<gt>\\[aq]\\[rs]n\");\n"
448 " exit(EXIT_FAILURE);\n"
449 " }\n"
450 "\\&\n"
451 " /* Remainder of program... */\n"
452 "\\&\n"
453 " exit(EXIT_SUCCESS);\n"
454 "}\n"
455 msgstr ""
456 "#define _XOPEN_SOURCE 500\n"
457 "#include E<lt>stdio.hE<gt>\n"
458 "#include E<lt>stdlib.hE<gt>\n"
459 "\\&\n"
460 "#include E<lt>assert.hE<gt>\n"
461 "\\&\n"
462 "int\n"
463 "main(int argc, char *argv[])\n"
464 "{\n"
465 " enum {\n"
466 " RO_OPT = 0,\n"
467 " RW_OPT,\n"
468 " NAME_OPT\n"
469 " };\n"
470 " char *const token[] = {\n"
471 " [RO_OPT] = \"ro\",\n"
472 " [RW_OPT] = \"rw\",\n"
473 " [NAME_OPT] = \"name\",\n"
474 " NULL\n"
475 " };\n"
476 " char *subopts;\n"
477 " char *value;\n"
478 " int opt;\n"
479 "\\&\n"
480 " int readonly = 0;\n"
481 " int readwrite = 0;\n"
482 " char *name = NULL;\n"
483 " int errfnd = 0;\n"
484 "\\&\n"
485 " while ((opt = getopt(argc, argv, \"o:\")) != -1) {\n"
486 " switch (opt) {\n"
487 " case \\[aq]o\\[aq]:\n"
488 " subopts = optarg;\n"
489 " while (*subopts != \\[aq]\\[rs]0\\[aq] && !errfnd) {\n"
490 "\\&\n"
491 " switch (getsubopt(&subopts, token, &value)) {\n"
492 " case RO_OPT:\n"
493 " readonly = 1;\n"
494 " break;\n"
495 "\\&\n"
496 " case RW_OPT:\n"
497 " readwrite = 1;\n"
498 " break;\n"
499 "\\&\n"
500 " case NAME_OPT:\n"
501 " if (value == NULL) {\n"
502 " fprintf(stderr,\n"
503 " \"Missing value for suboption \\[aq]%s\\[aq]\\[rs]n\",\n"
504 " token[NAME_OPT]);\n"
505 " errfnd = 1;\n"
506 " continue;\n"
507 " }\n"
508 "\\&\n"
509 " name = value;\n"
510 " break;\n"
511 "\\&\n"
512 " default:\n"
513 " fprintf(stderr,\n"
514 " \"No match found for token: /%s/\\[rs]n\", value);\n"
515 " errfnd = 1;\n"
516 " break;\n"
517 " }\n"
518 " }\n"
519 " if (readwrite && readonly) {\n"
520 " fprintf(stderr,\n"
521 " \"Only one of \\[aq]%s\\[aq] and \\[aq]%s\\[aq] can be specified\\[rs]n\",\n"
522 " token[RO_OPT], token[RW_OPT]);\n"
523 " errfnd = 1;\n"
524 " }\n"
525 " break;\n"
526 "\\&\n"
527 " default:\n"
528 " errfnd = 1;\n"
529 " }\n"
530 " }\n"
531 "\\&\n"
532 " if (errfnd || argc == 1) {\n"
533 " fprintf(stderr, \"\\[rs]nUsage: %s -o E<lt>suboptstringE<gt>\\[rs]n\", argv[0]);\n"
534 " fprintf(stderr,\n"
535 " \"suboptions are \\[aq]ro\\[aq], \\[aq]rw\\[aq], and \\[aq]name=E<lt>valueE<gt>\\[aq]\\[rs]n\");\n"
536 " exit(EXIT_FAILURE);\n"
537 " }\n"
538 "\\&\n"
539 " /* Remainder of program... */\n"
540 "\\&\n"
541 " exit(EXIT_SUCCESS);\n"
542 "}\n"
543
544 #. SRC END
545 #. type: SH
546 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
547 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
548 #, no-wrap
549 msgid "SEE ALSO"
550 msgstr "انظر أيضًا"
551
552 #. type: Plain text
553 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
554 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
555 msgid "B<getopt>(3)"
556 msgstr "B<getopt>(3)"
557
558 #. type: TH
559 #: debian-trixie
560 #, no-wrap
561 msgid "2024-06-15"
562 msgstr "15 يونيو 2024"
563
564 #. type: TH
565 #: debian-trixie
566 #, no-wrap
567 msgid "Linux man-pages 6.9.1"
568 msgstr "صفحات دليل لينكس 6.9.1"
569
570 #. type: Plain text
571 #: debian-trixie
572 msgid "Standard C library (I<libc>, I<-lc>)"
573 msgstr "مكتبة سي المعيارية (I<libc>، I<-lc>)"
574
575 #. type: Plain text
576 #: debian-trixie fedora-44 fedora-rawhide
577 #, no-wrap
578 msgid ""
579 "#define _XOPEN_SOURCE 500\n"
580 "#include E<lt>stdio.hE<gt>\n"
581 "#include E<lt>stdlib.hE<gt>\n"
582 "\\&\n"
583 "#include E<lt>assert.hE<gt>\n"
584 "\\&\n"
585 "int\n"
586 "main(int argc, char *argv[])\n"
587 "{\n"
588 " enum {\n"
589 " RO_OPT = 0,\n"
590 " RW_OPT,\n"
591 " NAME_OPT\n"
592 " };\n"
593 " char *const token[] = {\n"
594 " [RO_OPT] = \"ro\",\n"
595 " [RW_OPT] = \"rw\",\n"
596 " [NAME_OPT] = \"name\",\n"
597 " NULL\n"
598 " };\n"
599 " char *subopts;\n"
600 " char *value;\n"
601 " int opt;\n"
602 "\\&\n"
603 " int readonly = 0;\n"
604 " int readwrite = 0;\n"
605 " char *name = NULL;\n"
606 " int errfnd = 0;\n"
607 "\\&\n"
608 " while ((opt = getopt(argc, argv, \"o:\")) != -1) {\n"
609 " switch (opt) {\n"
610 " case \\[aq]o\\[aq]:\n"
611 " subopts = optarg;\n"
612 " while (*subopts != \\[aq]\\[rs]0\\[aq] && !errfnd) {\n"
613 "\\&\n"
614 " switch (getsubopt(&subopts, token, &value)) {\n"
615 " case RO_OPT:\n"
616 " readonly = 1;\n"
617 " break;\n"
618 "\\&\n"
619 " case RW_OPT:\n"
620 " readwrite = 1;\n"
621 " break;\n"
622 "\\&\n"
623 " case NAME_OPT:\n"
624 " if (value == NULL) {\n"
625 " fprintf(stderr,\n"
626 " \"Missing value for suboption \\[aq]%s\\[aq]\\[rs]n\",\n"
627 " token[NAME_OPT]);\n"
628 " errfnd = 1;\n"
629 " continue;\n"
630 " }\n"
631 "\\&\n"
632 " name = value;\n"
633 " break;\n"
634 "\\&\n"
635 " default:\n"
636 " fprintf(stderr,\n"
637 " \"No match found for token: /%s/\\[rs]n\", value);\n"
638 " errfnd = 1;\n"
639 " break;\n"
640 " }\n"
641 " }\n"
642 " if (readwrite && readonly) {\n"
643 " fprintf(stderr,\n"
644 " \"Only one of \\[aq]%s\\[aq] and \\[aq]%s\\[aq] can be specified\\[rs]n\",\n"
645 " token[RO_OPT], token[RW_OPT]);\n"
646 " errfnd = 1;\n"
647 " }\n"
648 " break;\n"
649 "\\&\n"
650 " default:\n"
651 " errfnd = 1;\n"
652 " }\n"
653 " }\n"
654 "\\&\n"
655 " if (errfnd || argc == 1) {\n"
656 " fprintf(stderr, \"\\[rs]nUsage: %s -o E<lt>suboptstringE<gt>\\[rs]n\", argv[0]);\n"
657 " fprintf(stderr,\n"
658 " \"suboptions are \\[aq]ro\\[aq], \\[aq]rw\\[aq], and \\[aq]name=E<lt>valueE<gt>\\[aq]\\[rs]n\");\n"
659 " exit(EXIT_FAILURE);\n"
660 " }\n"
661 "\\&\n"
662 " /* Remainder of program... */\n"
663 "\\&\n"
664 " exit(EXIT_SUCCESS);\n"
665 "}\n"
666 msgstr ""
667 "#define _XOPEN_SOURCE 500\n"
668 "#include E<lt>stdio.hE<gt>\n"
669 "#include E<lt>stdlib.hE<gt>\n"
670 "\\&\n"
671 "#include E<lt>assert.hE<gt>\n"
672 "\\&\n"
673 "int\n"
674 "main(int argc, char *argv[])\n"
675 "{\n"
676 " enum {\n"
677 " RO_OPT = 0,\n"
678 " RW_OPT,\n"
679 " NAME_OPT\n"
680 " };\n"
681 " char *const token[] = {\n"
682 " [RO_OPT] = \"ro\",\n"
683 " [RW_OPT] = \"rw\",\n"
684 " [NAME_OPT] = \"name\",\n"
685 " NULL\n"
686 " };\n"
687 " char *subopts;\n"
688 " char *value;\n"
689 " int opt;\n"
690 "\\&\n"
691 " int readonly = 0;\n"
692 " int readwrite = 0;\n"
693 " char *name = NULL;\n"
694 " int errfnd = 0;\n"
695 "\\&\n"
696 " while ((opt = getopt(argc, argv, \"o:\")) != -1) {\n"
697 " switch (opt) {\n"
698 " case \\[aq]o\\[aq]:\n"
699 " subopts = optarg;\n"
700 " while (*subopts != \\[aq]\\[rs]0\\[aq] && !errfnd) {\n"
701 "\\&\n"
702 " switch (getsubopt(&subopts, token, &value)) {\n"
703 " case RO_OPT:\n"
704 " readonly = 1;\n"
705 " break;\n"
706 "\\&\n"
707 " case RW_OPT:\n"
708 " readwrite = 1;\n"
709 " break;\n"
710 "\\&\n"
711 " case NAME_OPT:\n"
712 " if (value == NULL) {\n"
713 " fprintf(stderr,\n"
714 " \"Missing value for suboption \\[aq]%s\\[aq]\\[rs]n\",\n"
715 " token[NAME_OPT]);\n"
716 " errfnd = 1;\n"
717 " continue;\n"
718 " }\n"
719 "\\&\n"
720 " name = value;\n"
721 " break;\n"
722 "\\&\n"
723 " default:\n"
724 " fprintf(stderr,\n"
725 " \"No match found for token: /%s/\\[rs]n\", value);\n"
726 " errfnd = 1;\n"
727 " break;\n"
728 " }\n"
729 " }\n"
730 " if (readwrite && readonly) {\n"
731 " fprintf(stderr,\n"
732 " \"Only one of \\[aq]%s\\[aq] and \\[aq]%s\\[aq] can be specified\\[rs]n\",\n"
733 " token[RO_OPT], token[RW_OPT]);\n"
734 " errfnd = 1;\n"
735 " }\n"
736 " break;\n"
737 "\\&\n"
738 " default:\n"
739 " errfnd = 1;\n"
740 " }\n"
741 " }\n"
742 "\\&\n"
743 " if (errfnd || argc == 1) {\n"
744 " fprintf(stderr, \"\\[rs]nUsage: %s -o E<lt>suboptstringE<gt>\\[rs]n\", argv[0]);\n"
745 " fprintf(stderr,\n"
746 " \"suboptions are \\[aq]ro\\[aq], \\[aq]rw\\[aq], and \\[aq]name=E<lt>valueE<gt>\\[aq]\\[rs]n\");\n"
747 " exit(EXIT_FAILURE);\n"
748 " }\n"
749 "\\&\n"
750 " /* Remainder of program... */\n"
751 "\\&\n"
752 " exit(EXIT_SUCCESS);\n"
753 "}\n"
754
755 #. type: TH
756 #: fedora-44 fedora-rawhide
757 #, no-wrap
758 msgid "2024-07-23"
759 msgstr "23 يوليو 2024"
760
761 #. type: TH
762 #: fedora-44 fedora-rawhide
763 #, no-wrap
764 msgid "Linux man-pages 6.13"
765 msgstr "صفحات دليل لينكس 6.13"
766
767 #. type: TH
768 #: mageia-cauldron
769 #, no-wrap
770 msgid "Linux man-pages 6.17"
771 msgstr "صفحات دليل لينكس 6.17"
772
773 #. type: TH
774 #: opensuse-leap-16-1 opensuse-tumbleweed
775 #, no-wrap
776 msgid "Linux man-pages (unreleased)"
777 msgstr "صفحات دليل لينكس (لم تصدر بعد)"