aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacob janzen <53062115+JacobJanzen@users.noreply.github.com>2024-02-14 20:46:05 -0600
committerGitHub <noreply@github.com>2024-02-15 02:46:05 +0000
commit3cf8438856230a7c4ff89816534854427f035b4a (patch)
treee3b1908ecba45667bf25f853f17cbae848f13f67 /src
parent048939f36e25d8b8beaeb8aa41802a4145d554aa (diff)
license under GPL (#6)
Diffstat (limited to 'src')
-rw-r--r--src/cavegen.c11
-rw-r--r--src/cavegen.h11
-rw-r--r--src/common.h11
-rw-r--r--src/display.c11
-rw-r--r--src/display.h11
-rw-r--r--src/entity.h11
-rw-r--r--src/ht.c11
-rw-r--r--src/ht.h11
-rw-r--r--src/main.c46
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_
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
+<https://www.gnu.org/licenses/>.
+*/
#include "ht.h"
#include <stdio.h>
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
+<https://www.gnu.org/licenses/>.
+*/
#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
+<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();