projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8bd947b
)
Some vocabulary lookup code can be hidden from main.c.
author
Eric S. Raymond
<esr@thyrsus.com>
Thu, 20 Jul 2017 14:38:59 +0000
(10:38 -0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Thu, 20 Jul 2017 14:38:59 +0000
(10:38 -0400)
advent.h
patch
|
blob
|
history
misc.c
patch
|
blob
|
history
diff --git
a/advent.h
b/advent.h
index 47688656260292377df2c8fdbc34aa7ae502be7e..fc6ce9478ad8d77ed14dd2f53cc88e9f41ec219d 100644
(file)
--- a/
advent.h
+++ b/
advent.h
@@
-212,10
+212,6
@@
extern int word_count(char*);
extern char* get_input(void);
extern bool silent_yes(void);
extern bool yes(const char*, const char*, const char*);
extern char* get_input(void);
extern bool silent_yes(void);
extern bool yes(const char*, const char*, const char*);
-extern int get_motion_vocab_id(const char*);
-extern int get_object_vocab_id(const char*);
-extern int get_action_vocab_id(const char*);
-extern int get_special_vocab_id(const char*);
extern void get_vocab_metadata(const char*, long*, enum wordtype*);
extern void juggle(obj_t);
extern void move(obj_t, loc_t);
extern void get_vocab_metadata(const char*, long*, enum wordtype*);
extern void juggle(obj_t);
extern void move(obj_t, loc_t);
diff --git
a/misc.c
b/misc.c
index d33bc510c9b7fa05d500c569df9cc7f7a4e5585e..752838b02190ac7cc00033462a9d515b17d8c1c5 100644
(file)
--- a/
misc.c
+++ b/
misc.c
@@
-378,7
+378,7
@@
bool yes(const char* question, const char* yes_response, const char* no_response
/* Data structure routines */
/* Data structure routines */
-int get_motion_vocab_id(const char* word)
+
static
int get_motion_vocab_id(const char* word)
// Return the first motion number that has 'word' as one of its words.
{
for (int i = 0; i < NMOTIONS; ++i) {
// Return the first motion number that has 'word' as one of its words.
{
for (int i = 0; i < NMOTIONS; ++i) {
@@
-393,7
+393,7
@@
int get_motion_vocab_id(const char* word)
return (WORD_NOT_FOUND);
}
return (WORD_NOT_FOUND);
}
-int get_object_vocab_id(const char* word)
+
static
int get_object_vocab_id(const char* word)
// Return the first object number that has 'word' as one of its words.
{
for (int i = 0; i < NOBJECTS + 1; ++i) { // FIXME: the + 1 should go when 1-indexing for objects is removed
// Return the first object number that has 'word' as one of its words.
{
for (int i = 0; i < NOBJECTS + 1; ++i) { // FIXME: the + 1 should go when 1-indexing for objects is removed
@@
-406,7
+406,7
@@
int get_object_vocab_id(const char* word)
return (WORD_NOT_FOUND);
}
return (WORD_NOT_FOUND);
}
-int get_action_vocab_id(const char* word)
+
static
int get_action_vocab_id(const char* word)
// Return the first motion number that has 'word' as one of its words.
{
for (int i = 0; i < NACTIONS; ++i) {
// Return the first motion number that has 'word' as one of its words.
{
for (int i = 0; i < NACTIONS; ++i) {
@@
-421,7
+421,7
@@
int get_action_vocab_id(const char* word)
return (WORD_NOT_FOUND);
}
return (WORD_NOT_FOUND);
}
-int get_special_vocab_id(const char* word)
+
static
int get_special_vocab_id(const char* word)
// Return the first special number that has 'word' as one of its words.
{
for (int i = 0; i < NSPECIALS; ++i) {
// Return the first special number that has 'word' as one of its words.
{
for (int i = 0; i < NSPECIALS; ++i) {