Lines Matching +full:foo +full:- +full:queue
2 .\" Copyright (c) 1995-2025 The FreeBSD Project
44 .Bd -literal
50 * VERY important single-line comments look like this.
53 /* Most single-line comments look like this. */
58 * Multi-line comments look like this. Make them real sentences. Fill
64 Single-line comments should be consistently either C or C++ within a file.
65 Multi-line comments should also be consistently either C or C++, but may differ
66 from single-line comments.
68 The copyright header should be a multi-line comment like so:
69 .Bd -literal
71 * Copyright (c) 1984-2025 John Q. Public
73 * SPDX-License-Identifier: BSD-2-Clause
79 Write the copyright lines before the appropriate SPDX-License-Identifier.
87 a pre-existing
106 Non-C/C++ source files follow the example above, while C/C++ source files
151 .Bd -literal
152 #include <sys/types.h> /* Non-local includes in angle brackets. */
156 #include <sys/queue.h>
160 .Bd -literal
176 .Bd -literal
186 .Bd -literal
191 .Bd -literal
204 The expansions of expression-like macros are either a single token
215 Right-justify the
223 Any final statement-terminating semicolon should be
225 for pretty-printers and editors.
226 .Bd -literal
271 .Dq Li defined(FOO)
273 .Dq Li FOO .
275 .Dq Ic #ifndef Li FOO
277 .Dq Ic #if Li !defined(FOO) .
278 .Bd -literal
297 .St -isoC-99
301 .Bx Ns -style
307 .Bx Ns -style .
308 Like white-space commits, care should be taken in making
341 .Bd -literal
353 .Ic typedef Ns -names
376 .Bd -literal
377 struct foo {
378 struct foo *next; /* List of active foo. */
383 struct foo *foohead; /* Head of global foo list. */
387 .Xr queue 3
391 .Bd -literal
392 #include <sys/queue.h>
394 struct foo {
395 LIST_ENTRY(foo) link; /* Use queue macros for foo lists. */
400 LIST_HEAD(, foo) foohead; /* Head of global foo list. */
410 Typedefs are difficult to use in stand-alone header files:
414 back-door mechanism for obtaining the typedef.
422 .Bd -literal
427 typedef int foo; /* This is foo. */
459 .Bd -literal
470 .Bd -literal
475 .Bd -literal
481 .Bd -literal
482 static char *function(int _arg, const char *_arg2, struct foo *_arg3,
517 Code which is unreachable for non-obvious reasons may be marked /*
520 .Bd -literal
521 while ((ch = getopt(argc, argv, "abNn:")) != -1)
535 warnx("illegal number, -n argument -- %s",
544 argc -= optind;
562 .Bd -literal
583 .Bd -literal
593 .Bd -literal
603 .Bd -literal
620 .Bd -literal
642 .Bd -literal
654 .Bd -literal
655 a = b->c[0] + ~d == (e || f) || g && h ? i : j >> 1;
660 .Bd -literal
672 .Bd -literal
685 .Bd -literal
686 struct foo one, *two;
730 .Bd -literal
735 .Bd -literal
743 .Bd -literal
748 .Bd -literal
753 .Bd -literal
758 .Bd -literal
776 .Bd -literal
777 if ((four = malloc(sizeof(struct foo))) == NULL)
794 .Bd -literal
833 .Bl -enum
860 .Dq either-or
864 .Bd -literal -offset 4n
865 "usage: f [-aDde] [-b b_arg] [-m m_arg] req1 req2 [opt1 [opt2]]\en"
866 "usage: f [-a | -b] [-c [-dEe] [-n number]]\en"
868 .Bd -literal
869 (void)fprintf(stderr, "usage: f [-ab]\en");
883 The guidelines for third-party maintained modules and device drivers are more
921 .Bl -tag -width indent