Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
49b125f3
Commit
49b125f3
authored
Nov 13, 2008
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix examples (they all compile now), and init parent list in list
example.
parent
7beaa344
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
46 additions
and
17 deletions
+46
-17
ccan/alignof/_info.c
ccan/alignof/_info.c
+2
-1
ccan/alloc/_info.c
ccan/alloc/_info.c
+5
-2
ccan/build_assert/_info.c
ccan/build_assert/_info.c
+8
-0
ccan/container_of/_info.c
ccan/container_of/_info.c
+11
-3
ccan/grab_file/_info.c
ccan/grab_file/_info.c
+2
-1
ccan/list/_info.c
ccan/list/_info.c
+5
-2
ccan/noerr/_info.c
ccan/noerr/_info.c
+4
-0
ccan/str/_info.c
ccan/str/_info.c
+2
-1
ccan/str_talloc/_info.c
ccan/str_talloc/_info.c
+3
-3
ccan/talloc/_info.c
ccan/talloc/_info.c
+3
-3
ccan/tap/_info.c
ccan/tap/_info.c
+1
-1
No files found.
ccan/alignof/_info.c
View file @
49b125f3
...
@@ -16,7 +16,8 @@
...
@@ -16,7 +16,8 @@
*
*
* Example:
* Example:
* #include <stdio.h>
* #include <stdio.h>
* #include "alignof/alignof.h"
* #include <stdlib.h>
* #include <ccan/alignof/alignof.h>
*
*
* int main(int argc, char *argv[])
* int main(int argc, char *argv[])
* {
* {
...
...
ccan/alloc/_info.c
View file @
49b125f3
...
@@ -20,14 +20,17 @@
...
@@ -20,14 +20,17 @@
* #include <unistd.h>
* #include <unistd.h>
* #include <sys/types.h>
* #include <sys/types.h>
* #include <err.h>
* #include <err.h>
* #include "alloc/alloc.h"
* #include <sys/stat.h>
* #include <fcntl.h>
* #include <string.h>
* #include <ccan/alloc/alloc.h>
*
*
* static void usage(const char *name)
* static void usage(const char *name)
* {
* {
* errx(1, "Usage: %s --create <mapfile>\n"
* errx(1, "Usage: %s --create <mapfile>\n"
* " %s --check <mapfile>\n"
* " %s --check <mapfile>\n"
* " %s --alloc <mapfile>\n"
* " %s --alloc <mapfile>\n"
* " %s --free=<offset> <mapfile>\n", name, name, name);
* " %s --free=<offset> <mapfile>\n", name, name, name
, name
);
* }
* }
*
*
* // Create a memory mapped file, and allocate from within it
* // Create a memory mapped file, and allocate from within it
...
...
ccan/build_assert/_info.c
View file @
49b125f3
...
@@ -18,6 +18,14 @@
...
@@ -18,6 +18,14 @@
* you would catch such changes in your code like so:
* you would catch such changes in your code like so:
*
*
* Example:
* Example:
* #include <stddef.h>
* #include <ccan/build_assert/build_assert.h>
*
* struct foo {
* char string[5];
* int x;
* };
*
* char *foo_string(struct foo *foo)
* char *foo_string(struct foo *foo)
* {
* {
* // This trick requires that the string be first in the structure
* // This trick requires that the string be first in the structure
...
...
ccan/container_of/_info.c
View file @
49b125f3
...
@@ -14,8 +14,14 @@
...
@@ -14,8 +14,14 @@
* callback.
* callback.
*
*
* Example:
* Example:
* struct info
* #include <stdio.h>
* {
* #include <ccan/container_of/container_of.h>
*
* struct timer {
* void *members;
* };
*
* struct info {
* int my_stuff;
* int my_stuff;
* struct timer timer;
* struct timer timer;
* };
* };
...
@@ -31,7 +37,9 @@
...
@@ -31,7 +37,9 @@
* struct info info = { .my_stuff = 1 };
* struct info info = { .my_stuff = 1 };
*
*
* register_timer(&info.timer);
* register_timer(&info.timer);
* ...
* // ...
* return 0;
* }
*
*
* Licence: LGPL (2 or any later version)
* Licence: LGPL (2 or any later version)
*/
*/
...
...
ccan/grab_file/_info.c
View file @
49b125f3
...
@@ -8,10 +8,11 @@
...
@@ -8,10 +8,11 @@
* This contains simple functions for getting the contents of a file.
* This contains simple functions for getting the contents of a file.
*
*
* Example:
* Example:
* #include "grab_file/grab_file.h"
* #include <err.h>
* #include <err.h>
* #include <stdio.h>
* #include <stdio.h>
* #include <string.h>
* #include <string.h>
* #include <ccan/grab_file/grab_file.h>
* #include <ccan/talloc/talloc.h> // For talloc_free()
*
*
* int main(int argc, char *argv[])
* int main(int argc, char *argv[])
* {
* {
...
...
ccan/list/_info.c
View file @
49b125f3
...
@@ -12,7 +12,9 @@
...
@@ -12,7 +12,9 @@
*
*
* Example:
* Example:
* #include <err.h>
* #include <err.h>
* #include "list/list.h"
* #include <stdio.h>
* #include <stdlib.h>
* #include <ccan/list/list.h>
*
*
* struct parent {
* struct parent {
* const char *name;
* const char *name;
...
@@ -35,7 +37,8 @@
...
@@ -35,7 +37,8 @@
* errx(1, "Usage: %s parent children...", argv[0]);
* errx(1, "Usage: %s parent children...", argv[0]);
*
*
* p.name = argv[1];
* p.name = argv[1];
* for (i = 2; i < argc, i++) {
* list_head_init(&p.children);
* for (i = 2; i < argc; i++) {
* c = malloc(sizeof(*c));
* c = malloc(sizeof(*c));
* c->name = argv[i];
* c->name = argv[i];
* list_add(&p.children, &c->list);
* list_add(&p.children, &c->list);
...
...
ccan/noerr/_info.c
View file @
49b125f3
...
@@ -14,6 +14,10 @@
...
@@ -14,6 +14,10 @@
* #include <sys/types.h>
* #include <sys/types.h>
* #include <sys/stat.h>
* #include <sys/stat.h>
* #include <fcntl.h>
* #include <fcntl.h>
* #include <stdbool.h>
* #include <string.h>
* #include <errno.h>
* #include <ccan/noerr/noerr.h>
*
*
* bool write_string_to_file(const char *file, const char *string)
* bool write_string_to_file(const char *file, const char *string)
* {
* {
...
...
ccan/str/_info.c
View file @
49b125f3
...
@@ -9,7 +9,8 @@
...
@@ -9,7 +9,8 @@
* the standard string.h.
* the standard string.h.
*
*
* Example:
* Example:
* #include "str/str.h"
* #include <stdio.h>
* #include <ccan/str/str.h>
*
*
* int main(int argc, char *argv[])
* int main(int argc, char *argv[])
* {
* {
...
...
ccan/str_talloc/_info.c
View file @
49b125f3
...
@@ -10,9 +10,9 @@
...
@@ -10,9 +10,9 @@
* string utilities in "str.h".
* string utilities in "str.h".
*
*
* Example:
* Example:
* #include
"str_talloc/str_talloc.h"
* #include
<ccan/str_talloc/str_talloc.h>
* #include
"talloc/talloc.h"
* #include
<ccan/talloc/talloc.h>
* #include
"grab_file/grab_file.h"
* #include
<ccan/grab_file/grab_file.h>
* #include <err.h>
* #include <err.h>
*
*
* // Dumb demo program to double-linespace a file.
* // Dumb demo program to double-linespace a file.
...
...
ccan/talloc/_info.c
View file @
49b125f3
...
@@ -31,9 +31,9 @@
...
@@ -31,9 +31,9 @@
* #include <stdio.h>
* #include <stdio.h>
* #include <stdarg.h>
* #include <stdarg.h>
* #include <err.h>
* #include <err.h>
* #include
"talloc/talloc.h"
* #include
<ccan/talloc/talloc.h>
*
*
* // A structure containing a popened comman.
* // A structure containing a popened comman
d
.
* struct command
* struct command
* {
* {
* FILE *f;
* FILE *f;
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
* struct command *cmd;
* struct command *cmd;
*
*
* if (argc != 2)
* if (argc != 2)
* errx(1, "Usage: %s <command>\n");
* errx(1, "Usage: %s <command>\n"
, argv[0]
);
*
*
* cmd = open_output_cmd(NULL, "%s hello", argv[1]);
* cmd = open_output_cmd(NULL, "%s hello", argv[1]);
* if (!cmd)
* if (!cmd)
...
...
ccan/tap/_info.c
View file @
49b125f3
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
*
*
* Example:
* Example:
* #include <string.h>
* #include <string.h>
* #include
"tap/tap.h"
* #include
<ccan/tap/tap.h>
*
*
* // Run some simple (but overly chatty) tests on strcmp().
* // Run some simple (but overly chatty) tests on strcmp().
* int main(int argc, char *argv[])
* int main(int argc, char *argv[])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment