Skip to content

Commit

Permalink
Merge pull request #895 from cspiegel/sync-jacl
Browse files Browse the repository at this point in the history
Sync with upstream JACL
  • Loading branch information
cspiegel authored Oct 2, 2024
2 parents 070f414 + cae1cc7 commit da1ab09
Show file tree
Hide file tree
Showing 23 changed files with 5,383 additions and 5,359 deletions.
9 changes: 7 additions & 2 deletions terps/jacl/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
#define TOUCHED 8388608
#define SCORED 16777216
#define SITTING 33554432
#define NPC 67108864
#define NPC 67108864
#define DONE 134217728
#define GAS 268435456
#define GAS 268435456
#define NO_TAB 536870912
#define NOT_IMPORTANT 1073741824

Expand Down Expand Up @@ -102,12 +102,17 @@
#define MULTI_PREFIX integer_resolve("multi_prefix")
#define NOTIFY integer_resolve("notify")
#define DEBUG integer_resolve("debug")
#define LOCAL integer_resolve("local")
#define LOCAL_X integer_resolve("local_x")
#define LOCAL_Y integer_resolve("local_y")
#define LOCAL_A integer_resolve("local_a")

/* SYSTEM INTEGER CONSTANTS */

#define SOUND_SUPPORTED cinteger_resolve("sound_supported")
#define GRAPHICS_SUPPORTED cinteger_resolve("graphics_supported")
#define TIMER_SUPPORTED cinteger_resolve("timer_supported")
#define REMOTE_USER_USED cinteger_resolve("remote_user")

/* ABBREVIATIONS */

Expand Down
65 changes: 16 additions & 49 deletions terps/jacl/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,11 @@
#include "language.h"
#include "types.h"
#include "prototypes.h"

extern char temp_buffer[];
extern char function_name[];

extern struct object_type *object[];
extern struct variable_type *variable[];

extern char *word[];

extern int player;
extern int wp;
extern int objects;
extern int custom_error;

extern int spaced;
#include "encapsulate.h"
#include "parser.h"

int
check_light(where)
int where;
check_light(int where)
{
int index;

Expand All @@ -34,17 +20,15 @@ check_light(where)
else {
for (index = 1; index <= objects; index++) {
if ((object[index]->attributes & LUMINOUS)
&& scope(index, "*present"))
&& scope(index, "*present", FALSE))
return (TRUE);
}
}
return (FALSE);
}

char *
sentence_output(index, capital)
int index;
int capital;
sentence_output(int index, int capital)
{
if (!strcmp(object[index]->article, "name")) {
strcpy(temp_buffer, object[index]->inventory);
Expand All @@ -61,8 +45,7 @@ sentence_output(index, capital)
}

char *
isnt_output(index)
int index;
isnt_output(int index)
{
if (object[index]->attributes & PLURAL)
return (cstring_resolve("ARENT")->value);
Expand All @@ -71,8 +54,7 @@ isnt_output(index)
}

char *
is_output(index)
int index;
is_output(int index)
{
if (object[index]->attributes & PLURAL)
return (cstring_resolve("ARE")->value);
Expand All @@ -81,9 +63,7 @@ is_output(index)
}

char *
sub_output(index, capital)
int index;
int capital;
sub_output(int index, int capital)
{
if (object[index]->attributes & PLURAL) {
strcpy(temp_buffer, cstring_resolve("THEY_WORD")->value);
Expand All @@ -108,9 +88,7 @@ sub_output(index, capital)
}

char *
obj_output(index, capital)
int index;
int capital;
obj_output(int index, int capital)
{
if (object[index]->attributes & PLURAL) {
strcpy(temp_buffer, cstring_resolve("THEM_WORD")->value);
Expand All @@ -135,8 +113,7 @@ obj_output(index, capital)
}

char *
it_output(index)
int index;
it_output(int index)
{
if (object[index]->attributes & ANIMATE) {
return sentence_output(index, FALSE);
Expand All @@ -150,9 +127,7 @@ it_output(index)
}

char *
that_output(index, capital)
int index;
int capital;
that_output(int index, int capital)
{
if (object[index]->attributes & PLURAL) {
strcpy(temp_buffer, cstring_resolve("THOSE_WORD")->value);
Expand All @@ -167,8 +142,7 @@ that_output(index, capital)
}

char *
doesnt_output(index)
int index;
doesnt_output(int index)
{
if (object[index]->attributes & PLURAL)
return (cstring_resolve("DONT")->value);
Expand All @@ -177,8 +151,7 @@ doesnt_output(index)
}

char *
does_output(index)
int index;
does_output(int index)
{
if (object[index]->attributes & PLURAL)
return (cstring_resolve("DO")->value);
Expand All @@ -187,9 +160,7 @@ does_output(index)
}

char *
list_output(index, capital)
int index;
int capital;
list_output(int index, int capital)
{
if (!strcmp(object[index]->article, "name")) {
strcpy(temp_buffer, object[index]->inventory);
Expand All @@ -206,9 +177,7 @@ list_output(index, capital)
}

char *
plain_output(index, capital)
int index;
int capital;
plain_output(int index, int capital)
{
strcpy(temp_buffer, object[index]->inventory);

Expand All @@ -219,8 +188,7 @@ plain_output(index, capital)
}

char *
long_output(index)
int index;
long_output(int index)
{
if (!strcmp(object[index]->described, "function")) {
strcpy(function_name, "long_");
Expand Down Expand Up @@ -289,4 +257,3 @@ look_around()

execute("+after_look");
}

7 changes: 4 additions & 3 deletions terps/jacl/encapsulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "jacl.h"
#include "types.h"
#include "prototypes.h"
#include "encapsulate.h"
#include <string.h>

extern struct synonym_type *synonym_table;
Expand All @@ -15,9 +16,9 @@ char text_buffer[1024];

/* THIS IS A STRING CONSTANT TO POINT TO WHENEVER A COMMA IS
* USED IN THE PLAYER'S INPUT */
char *comma = "comma\0";
char *then = "then\0";
char *word[MAX_WORDS];
const char *comma = "comma\0";
const char *then = "then\0";
const char *word[MAX_WORDS];
int quoted[MAX_WORDS];
int percented[MAX_WORDS];
int wp;
Expand Down
22 changes: 22 additions & 0 deletions terps/jacl/encapsulate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* parser.h --- Parsing of player's commands
* Created by C.W. Betts on 1/7/22.
* (C) 2022 Stuart Allen, distribute and use
* according to GNU GPL, see file COPYING for details.
*/

#ifndef encapsulate_h
#define encapsulate_h

extern char text_buffer[];
extern const char *word[];
extern int noun[];
extern int quoted[];
extern int percented[];
extern int wp;

extern char function_name[];
extern char temp_buffer[];
extern char error_buffer[];
extern char proxy_buffer[];

#endif /* encapsulate_h */
Loading

0 comments on commit da1ab09

Please sign in to comment.