diff options
| author | Roland McGrath <roland@hack.frob.com> | 2012-03-02 16:50:06 -0800 |
|---|---|---|
| committer | Roland McGrath <roland@hack.frob.com> | 2012-03-02 16:52:01 -0800 |
| commit | d9a17c075e61609bee2b2c3014b53f8630f533a4 (patch) | |
| tree | 5a5e4fea365808b94153776a884cab7481383e92 /manual/examples | |
| parent | 7181dda8d5bf4f793181f7a672b8605adcb6b700 (diff) | |
| download | glibc-d9a17c075e61609bee2b2c3014b53f8630f533a4.tar.xz glibc-d9a17c075e61609bee2b2c3014b53f8630f533a4.zip | |
BZ #13792: License manual example source files under GPL.
Diffstat (limited to 'manual/examples')
42 files changed, 728 insertions, 31 deletions
diff --git a/manual/examples/README b/manual/examples/README new file mode 100644 index 0000000000..7d0070fdd5 --- /dev/null +++ b/manual/examples/README @@ -0,0 +1,8 @@ +These are source files for example code that appears in The GNU C +Library Reference Manual. + +While the manual itself is licensed under the terms of the GNU Free +Documentation License, you can use these source files on their own +under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License, or (at your +option) any later version. diff --git a/manual/examples/add.c b/manual/examples/add.c index e4b1bba365..d4b9af9c99 100644 --- a/manual/examples/add.c +++ b/manual/examples/add.c @@ -1,3 +1,20 @@ +/* Example of a Variadic Function + Copyright (C) 1991-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, if not, see <http://www.gnu.org/licenses/>. +*/ + #include <stdarg.h> #include <stdio.h> diff --git a/manual/examples/argp-ex1.c b/manual/examples/argp-ex1.c index 931a8264a5..01c3639218 100644 --- a/manual/examples/argp-ex1.c +++ b/manual/examples/argp-ex1.c @@ -1,4 +1,19 @@ -/* Argp example #1 -- a minimal program using argp */ +/* Argp example #1 -- a minimal program using argp + Copyright (C) 1991-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, if not, see <http://www.gnu.org/licenses/>. +*/ /* This is (probably) the smallest possible program that uses argp. It won't do much except give an error diff --git a/manual/examples/argp-ex2.c b/manual/examples/argp-ex2.c index 097ce7622c..0e038bbc90 100644 --- a/manual/examples/argp-ex2.c +++ b/manual/examples/argp-ex2.c @@ -1,4 +1,19 @@ -/* Argp example #2 -- a pretty minimal program using argp */ +/* Argp example #2 -- a pretty minimal program using argp + Copyright (C) 1991-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, if not, see <http://www.gnu.org/licenses/>. +*/ /* This program doesn't use any options or arguments, but uses argp to be compliant with the GNU standard command line diff --git a/manual/examples/argp-ex3.c b/manual/examples/argp-ex3.c index d5896ee139..689d7cfdaa 100644 --- a/manual/examples/argp-ex3.c +++ b/manual/examples/argp-ex3.c @@ -1,4 +1,19 @@ -/* Argp example #3 -- a program with options and arguments using argp */ +/* Argp example #3 -- a program with options and arguments using argp + Copyright (C) 1991-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, if not, see <http://www.gnu.org/licenses/>. +*/ /* This program uses the same features as example 2, and uses options and arguments. diff --git a/manual/examples/argp-ex4.c b/manual/examples/argp-ex4.c index 2b61358c7e..b946dd106b 100644 --- a/manual/examples/argp-ex4.c +++ b/manual/examples/argp-ex4.c @@ -1,4 +1,19 @@ -/* Argp example #4 -- a program with somewhat more complicated options */ +/* Argp example #4 -- a program with somewhat more complicated options + Copyright (C) 1991-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, if not, see <http://www.gnu.org/licenses/>. +*/ /* This program uses the same features as example 3, but has more options, and somewhat more structure in the -help output. It diff --git a/manual/examples/atexit.c b/manual/examples/atexit.c index 42bba71126..5f07c87511 100644 --- a/manual/examples/atexit.c +++ b/manual/examples/atexit.c @@ -1,7 +1,24 @@ +/* Cleanups on Exit + Copyright (C) 1991-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, if not, see <http://www.gnu.org/licenses/>. +*/ + #include <stdio.h> #include <stdlib.h> -void +void bye (void) { puts ("Goodbye, cruel world...."); diff --git a/manual/examples/db.c b/manual/examples/db.c index 1a1cb0c0d7..d6405e50d1 100644 --- a/manual/examples/db.c +++ b/manual/examples/db.c @@ -1,3 +1,20 @@ +/* User and Group Database Example + Copyright (C) 1991-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, if not, see <http://www.gnu.org/licenses/>. +*/ + #include <grp.h> #include <pwd.h> #include <sys/types.h> diff --git a/manual/examples/dir.c b/manual/examples/dir.c index 8ab77dc34c..9ca63fec0e 100644 --- a/manual/examples/dir.c +++ b/manual/examples/dir.c @@ -1,3 +1,20 @@ +/* Simple Program to List a Directory + Copyright (C) 1991-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, if not, see <http://www.gnu.org/licenses/>. +*/ + /*@group*/ #include <stdio.h> #include <sys/types.h> diff --git a/manual/examples/dir2.c b/manual/examples/dir2.c index a75c885742..7f095c84d9 100644 --- a/manual/examples/dir2.c +++ b/manual/examples/dir2.c @@ -1,3 +1,20 @@ +/* Simple Program to List a Directory, Mark II + Copyright (C) 1991-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, if not, see <http://www.gnu.org/licenses/>. +*/ + /*@group*/ #include <stdio.h> #include <dirent.h> diff --git a/manual/examples/execinfo.c b/manual/examples/execinfo.c index 5a04901957..18a3a29731 100644 --- a/manual/examples/execinfo.c +++ b/manual/examples/execinfo.c @@ -1,3 +1,20 @@ +/* Obtain a backtrace and print it. + Copyright (C) 1991-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, if not, see <http://www.gnu.org/licenses/>. +*/ + #include <execinfo.h> #include <stdio.h> #include <stdlib.h> diff --git a/manual/examples/filecli.c b/manual/examples/filecli.c index 9f64445fa9..71dc461800 100644 --- a/manual/examples/filecli.c +++ b/manual/examples/filecli.c @@ -1,3 +1,20 @@ +/* Example of Reading Datagrams + Copyright (C) 1991-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, if not, see <http://www.gnu.org/licenses/>. +*/ + #include <stdio.h> #include <errno.h> #include <unistd.h> diff --git a/manual/examples/filesrv.c b/manual/examples/filesrv.c index 32507c6555..e1f80aa7bd 100644 --- a/manual/examples/filesrv.c +++ b/manual/examples/filesrv.c @@ -1,3 +1,20 @@ +/* Datagram Socket Example + Copyright (C) 1991-2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, if not, see <http://www.gnu.org/licenses/>. +*/ |
