]> granicus.if.org Git - nethack/commitdiff
Use extern.h for regexes.
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Fri, 3 Apr 2015 19:08:29 +0000 (15:08 -0400)
committerSean Hunt <scshunt@csclub.uwaterloo.ca>
Sun, 12 Apr 2015 15:46:54 +0000 (11:46 -0400)
I was planning to do this anyway, but it created an include loop that
was breaking it on Windows.

include/color.h
include/extern.h
include/nhregex.h [deleted file]
src/options.c
sys/share/cppregex.cpp

index 56c43af1546304f366b73007bc97650ff0fb9e14..a772dd84cf30335ab49d6b2c5a88769856a09775 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.5 color.h $NHDT-Date: 1428084467 2015/04/03 18:07:47 $  $NHDT-Branch: scshunt-regex $:$NHDT-Revision: 1.7 $ */
+/* NetHack 3.5 color.h $NHDT-Date: 1428088106 2015/04/03 19:08:26 $  $NHDT-Branch: scshunt-regex $:$NHDT-Revision: 1.8 $ */
 /* NetHack 3.5 color.h $Date: 2009/05/06 10:44:34 $  $Revision: 1.5 $ */
 /*     SCCS Id: @(#)color.h    3.5     1992/02/02      */
 /* Copyright (c) Steve Linhart, Eric Raymond, 1989. */
@@ -7,8 +7,6 @@
 #ifndef COLOR_H
 #define COLOR_H
 
-#include <nhregex.h>
-
 /*
  * The color scheme used is tailored for an IBM PC.  It consists of the
  * standard 8 colors, folowed by their bright counterparts.  There are
index 199201925ccbb624c11d8fa38e2540e986c01eb2..997885882447e1a3cb6c121e4e3120ef45442b84 100644 (file)
@@ -1,5 +1,4 @@
 /* NetHack 3.5 extern.h        $NHDT-Date: 1428806395 2015/04/12 02:39:55 $  $NHDT-Branch: master $:$NHDT-Revision: 1.455 $ */
-/* NetHack 3.5 extern.h        $Date: 2013/11/05 00:57:53 $  $Revision: 1.380 $ */
 /* Copyright (c) Steve Creps, 1988.                              */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1488,6 +1487,13 @@ E void NDECL(init_lan_features);
 E char *NDECL(lan_username);
 #endif
 
+/* ### nhregex.c ### */
+E struct nhregex * NDECL(regex_init);
+E boolean FDECL(regex_compile, (const char *, struct nhregex *));
+E const char *FDECL(regex_error_desc, (struct nhregex *));
+E boolean FDECL(regex_match, (const char *, struct nhregex*));
+E void FDECL(regex_free, (struct nhregex *));
+
 /* ### nttty.c ### */
 
 #ifdef WIN32CON
diff --git a/include/nhregex.h b/include/nhregex.h
deleted file mode 100644 (file)
index 1708b56..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* NetHack 3.5 nhregex.h       $NHDT-Date: 1428084467 2015/04/03 18:07:47 $  $NHDT-Branch: scshunt-regex $:$NHDT-Revision: 1.0 $ */
-/* NetHack 3.5 nhregex.h       $Date: 2009/05/06 10:44:33 $  $Revision: 1.4 $ */
-/* Copyright (c) Sean Hunt  2015.                                 */
-/* NetHack may be freely redistributed.  See license for details. */
-
-#ifndef NHREGEX_H
-#define NHREGEX_H
-
-#include <hack.h>
-
-struct nhregex;
-
-struct nhregex *regex_init(void);
-boolean regex_compile(const char *s, struct nhregex *re);
-const char *regex_error_desc(struct nhregex *re);
-boolean regex_match(const char *s, struct nhregex *re);
-void regex_free(struct nhregex *re);
-
-#endif
index 3925b2a14048481f968e1d9b903cc7543f50fbd0..83c3c0abffc49eade06d7bef81f265ea9cf6c27c 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.5 options.c       $NHDT-Date: 1428084467 2015/04/03 18:07:47 $  $NHDT-Branch: scshunt-regex $:$NHDT-Revision: 1.181 $ */
+/* NetHack 3.5 options.c       $NHDT-Date: 1428088105 2015/04/03 19:08:25 $  $NHDT-Branch: scshunt-regex $:$NHDT-Revision: 1.182 $ */
 /* NetHack 3.5 options.c       $Date: 2012/04/09 02:56:30 $  $Revision: 1.153 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -15,7 +15,6 @@ NEARDATA struct instance_flags iflags;        /* provide linkage */
 #define static
 #else
 #include "hack.h"
-#include "nhregex.h"
 #include "tcap.h"
 #include <ctype.h>
 #endif
index 446929cc561d40ed94d0b085b39e7b0b77f5c1d9..8d0704fde71dbbc8852f41113795cf58bc2cba5c 100644 (file)
@@ -7,7 +7,7 @@
 #include <memory>
 
 extern "C" {
-  #include <nhregex.h>
+  #include <hack.h>
 
   struct nhregex {
     std::unique_ptr<std::regex> re;