Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
version: "3.7"

services:
fbmuck:
build:
Expand Down
12 changes: 9 additions & 3 deletions include/boolexp.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
#include "config.h"
#include "props.h"

#define MAX_LOCK_DEPTH 50 /**< Recursion limit */

/* These are the different elements of a boolean expression */
#define BOOLEXP_AND 0 /**< AND is the default */
#define BOOLEXP_OR 1 /**< OR expression */
#define BOOLEXP_NOT 2 /**< NOT expression */
#define BOOLEXP_CONST 3 /**< CONST expression */
#define BOOLEXP_PROP 4 /**< property expression */
#define BOOLEXP_MPI 5 /**< MPI expression */

/* True is a null boolean expression */
#define TRUE_BOOLEXP ((struct boolexp *) 0) /**< Boolean TRUE expression */
Expand All @@ -28,14 +31,17 @@
* Boolean expressions are trees of expression nodes that are recursively
* evaluated.
*
* Leaf nodes are always either BOOLEXP_PROP or BOOLEXP_CONST.
* Leaf nodes are always either BOOLEXP_CONST, BOOLEXP_PROP, or BOOLEXP_MPI..
*/
struct boolexp {
short type; /**< Type of node */
struct boolexp *sub1; /**< 'Left' side subexpression */
struct boolexp *sub2; /**< 'Right' side subexpression */
dbref thing; /**< Value for type constant */
struct plist *prop_check; /**< Value for type property */
union {
dbref thing; /**< Value for type constant */
struct plist *prop_check; /**< Value for type property */
char *mpi; /**< Value for type MPI */
} data;
};

/**
Expand Down
76 changes: 44 additions & 32 deletions include/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -1859,6 +1859,50 @@ extern dbref db_top;
*/
extern int recyclable;

/**
* Clear a DB object
*
* This will take a ref and zero out the object, making it suitable for
* use (or reuse, in the case of recycled garbage).
*
* This does NOT clear out memory, so you SHOULD NOT use clear out an
* object with allocated memory -- this should only be used with objects
* that are brand new (i.e. freshly allocated) or that have been totally
* cleaned out already (garbage).
*
* Flags must be initialized after this is called. Also, type-specific
* fields must also be initialized. The object is not set dirty by this.
*
* @param i the dbref of the object to clear out.
*/
void db_clear_object(dbref i);

/**
* Clones a thing.
*
* Uses an error parameter to communicate the reason for failure. This
* should be at least SMALL_BUFFER_LEN in size.
*
* @param thing the thing to clone
* @param player the player for determining the cloned thing's home
* @param copy_hidden_props if true, this copies hidden properties
* @param[out] error why the create failed
* @return the dbref of the cloned thing, or NOTHING if it failed.
*/
dbref clone_thing(dbref thing, dbref player, int copy_hidden_props, char *error);

/**
* Helper function to collect object statistics.
*
* Populates the stats array with counts of owned objects: total, rooms, exits,
* things, programs, players, and garbage.
*
* @param player the player running the command
* @param ref the player dbref to query (or NOTHING for MUCK-wide stats)
* @param stats output array for the statistics
*/
void collect_dbstats(dbref player, dbref ref, int stats[7]);

/**
* Determine if 'who' controls object 'what'
*
Expand Down Expand Up @@ -1968,38 +2012,6 @@ dbref create_room(dbref player, const char *name, dbref parent, char *error);
*/
dbref create_thing(dbref player, const char *name, dbref location, char *error);

/**
* Clones a thing.
*
* Uses an error parameter to communicate the reason for failure. This
* should be at least SMALL_BUFFER_LEN in size.
*
* @param thing the thing to clone
* @param player the player for determining the cloned thing's home
* @param copy_hidden_props if true, this copies hidden properties
* @param[out] error why the create failed
* @return the dbref of the cloned thing, or NOTHING if it failed.
*/
dbref clone_thing(dbref thing, dbref player, int copy_hidden_props, char *error);

/**
* Clear a DB object
*
* This will take a ref and zero out the object, making it suitable for
* use (or reuse, in the case of recycled garbage).
*
* This does NOT clear out memory, so you SHOULD NOT use clear out an
* object with allocated memory -- this should only be used with objects
* that are brand new (i.e. freshly allocated) or that have been totally
* cleaned out already (garbage).
*
* Flags must be initialized after this is called. Also, type-specific
* fields must also be initialized. The object is not set dirty by this.
*
* @param i the dbref of the object to clear out.
*/
void db_clear_object(dbref i);

/**
* Free the memory for the whole database
*
Expand Down
Loading
Loading