From: Sean Hunt Date: Fri, 3 Apr 2015 19:08:29 +0000 (-0400) Subject: Use extern.h for regexes. X-Git-Tag: NetHack-3.6.0_RC01~480^2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=80aa109855d54c88561bbfdee79c894ac5d28ebe;p=nethack Use extern.h for regexes. I was planning to do this anyway, but it created an include loop that was breaking it on Windows. --- diff --git a/include/color.h b/include/color.h index 56c43af15..a772dd84c 100644 --- a/include/color.h +++ b/include/color.h @@ -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 - /* * The color scheme used is tailored for an IBM PC. It consists of the * standard 8 colors, folowed by their bright counterparts. There are diff --git a/include/extern.h b/include/extern.h index 199201925..997885882 100644 --- a/include/extern.h +++ b/include/extern.h @@ -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 index 1708b565e..000000000 --- a/include/nhregex.h +++ /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 - -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 diff --git a/src/options.c b/src/options.c index 3925b2a14..83c3c0abf 100644 --- a/src/options.c +++ b/src/options.c @@ -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 #endif diff --git a/sys/share/cppregex.cpp b/sys/share/cppregex.cpp index 446929cc5..8d0704fde 100644 --- a/sys/share/cppregex.cpp +++ b/sys/share/cppregex.cpp @@ -7,7 +7,7 @@ #include extern "C" { - #include + #include struct nhregex { std::unique_ptr re;