From 3cf8438856230a7c4ff89816534854427f035b4a Mon Sep 17 00:00:00 2001 From: jacob janzen <53062115+JacobJanzen@users.noreply.github.com> Date: Wed, 14 Feb 2024 20:46:05 -0600 Subject: license under GPL (#6) --- src/cavegen.c | 11 +++++++++++ src/cavegen.h | 11 +++++++++++ src/common.h | 11 +++++++++++ src/display.c | 11 +++++++++++ src/display.h | 11 +++++++++++ src/entity.h | 11 +++++++++++ src/ht.c | 11 +++++++++++ src/ht.h | 11 +++++++++++ src/main.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 9 files changed, 132 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cavegen.c b/src/cavegen.c index 1365e9d..cdc4ce6 100644 --- a/src/cavegen.c +++ b/src/cavegen.c @@ -1,3 +1,14 @@ +/* +This file is part of urlg. +urlg 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 3 of the License, or (at your option) any later version. urlg 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 Foobar. If not, see +. +*/ #include "cavegen.h" #include diff --git a/src/cavegen.h b/src/cavegen.h index b6ed1e4..7f3ee0d 100644 --- a/src/cavegen.h +++ b/src/cavegen.h @@ -1,3 +1,14 @@ +/* +This file is part of urlg. +urlg 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 3 of the License, or (at your option) any later version. urlg 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 Foobar. If not, see +. +*/ #ifndef CAVEGEN_H_ #define CAVEGEN_H_ diff --git a/src/common.h b/src/common.h index 11b11d4..f88099e 100644 --- a/src/common.h +++ b/src/common.h @@ -1,3 +1,14 @@ +/* +This file is part of urlg. +urlg 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 3 of the License, or (at your option) any later version. urlg 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 Foobar. If not, see +. +*/ #ifndef COMMON_H_ #define COMMON_H_ diff --git a/src/display.c b/src/display.c index cc0a06b..37970a2 100644 --- a/src/display.c +++ b/src/display.c @@ -1,3 +1,14 @@ +/* +This file is part of urlg. +urlg 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 3 of the License, or (at your option) any later version. urlg 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 Foobar. If not, see +. +*/ #include "display.h" #include diff --git a/src/display.h b/src/display.h index d9c66bb..4d79270 100644 --- a/src/display.h +++ b/src/display.h @@ -1,3 +1,14 @@ +/* +This file is part of urlg. +urlg 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 3 of the License, or (at your option) any later version. urlg 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 Foobar. If not, see +. +*/ #ifndef DISPLAY_H_ #define DISPLAY_H_ diff --git a/src/entity.h b/src/entity.h index b003efe..ce4bfa3 100644 --- a/src/entity.h +++ b/src/entity.h @@ -1,3 +1,14 @@ +/* +This file is part of urlg. +urlg 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 3 of the License, or (at your option) any later version. urlg 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 Foobar. If not, see +. +*/ #ifndef ENTITY_H_ #define ENTITY_H_ diff --git a/src/ht.c b/src/ht.c index f44ea12..7a3eb23 100644 --- a/src/ht.c +++ b/src/ht.c @@ -1,3 +1,14 @@ +/* +This file is part of urlg. +urlg 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 3 of the License, or (at your option) any later version. urlg 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 Foobar. If not, see +. +*/ #include "ht.h" #include diff --git a/src/ht.h b/src/ht.h index ef15540..61164e8 100644 --- a/src/ht.h +++ b/src/ht.h @@ -1,3 +1,14 @@ +/* +This file is part of urlg. +urlg 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 3 of the License, or (at your option) any later version. urlg 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 Foobar. If not, see +. +*/ #ifndef HT_H_ #define HT_H_ diff --git a/src/main.c b/src/main.c index 758fc92..4ec71fa 100644 --- a/src/main.c +++ b/src/main.c @@ -1,8 +1,21 @@ +/* +This file is part of urlg. +urlg 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 3 of the License, or (at your option) any later version. urlg 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 Foobar. If not, see +. +*/ #include +#include #include #include #include +#include "../config.h" #include "cavegen.h" #include "common.h" #include "display.h" @@ -86,8 +99,38 @@ bool game_update( return false; } -int main(void) +void print_version(void) { + printf("%s\n", PACKAGE_STRING); + printf("Copyright (C) 2024 Jacob Janzen\n"); + printf("This is free software; see the source for copying conditions.\n"); + printf( + "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n" + ); + printf("PARTICULAR PURPOSE.\n"); +} + +int main(int argc, char **argv) +{ + int option_index = 0; + int ch; + int version_flag = 0; + struct option longopts[] = { + {"version", no_argument, &version_flag, 'v'}, + }; + while ((ch = getopt_long(argc, argv, ":v", longopts, &option_index)) != -1 + ) { + switch (ch) { + case 'v' : version_flag = 1; break; + case 0 : break; + default : break; + } + } + if (version_flag) { + print_version(); + return EXIT_SUCCESS; + } + unsigned int seed = time(NULL); srand(seed); @@ -132,7 +175,6 @@ int main(void) display_status(disp, &player); display_message(disp, ""); - int ch; bool done = false; while (!done) { enum action action = display_process_input(); -- cgit v1.2.3