diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cavegen.c | 11 | ||||
-rw-r--r-- | src/cavegen.h | 11 | ||||
-rw-r--r-- | src/common.h | 11 | ||||
-rw-r--r-- | src/display.c | 11 | ||||
-rw-r--r-- | src/display.h | 11 | ||||
-rw-r--r-- | src/entity.h | 11 | ||||
-rw-r--r-- | src/ht.c | 11 | ||||
-rw-r--r-- | src/ht.h | 11 | ||||
-rw-r--r-- | src/main.c | 46 |
9 files changed, 132 insertions, 2 deletions
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 +<https://www.gnu.org/licenses/>. +*/ #include "cavegen.h" #include <stdbool.h> 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 +<https://www.gnu.org/licenses/>. +*/ #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 +<https://www.gnu.org/licenses/>. +*/ #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 +<https://www.gnu.org/licenses/>. +*/ #include "display.h" #include <curses.h> 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 +<https://www.gnu.org/licenses/>. +*/ #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 +<https://www.gnu.org/licenses/>. +*/ #ifndef ENTITY_H_ #define 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 +<https://www.gnu.org/licenses/>. +*/ #include "ht.h" #include <stdio.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 +<https://www.gnu.org/licenses/>. +*/ #ifndef HT_H_ #define HT_H_ @@ -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 +<https://www.gnu.org/licenses/>. +*/ #include <curses.h> +#include <getopt.h> #include <locale.h> #include <stdlib.h> #include <time.h> +#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(); |