/* ************************************************************************ * File: interpreter.h Part of CircleMUD * * Usage: header file: public procs, macro defs, subcommand defines * * * * All rights reserved. See license.doc for complete information. * * * * Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * ************************************************************************ */ #ifndef __INTERPRETER_H__ #define __INTERPRETER_H__ ssize_t search_block(const char *arg, const char **list, bool exact); char lower( char c ); char *one_argument(char *argument, char *first_arg); char *one_word(char *argument, char *first_arg); char *any_one_arg(char *argument, char *first_arg); char *two_arguments(char *argument, char *first_arg, char *second_arg); int fill_word(char *argument); void half_chop(char *string, char *arg1, char *arg2); void nanny(descriptorData_t *d, char *arg); int is_abbrev(const char *arg1, const char *arg2); void skip_spaces(char **string); char *delete_doubledollar(char *string); int numWords(char *string); /** * Gets whether a string represents a numeric value. * @param string the string to be tested * @return <code>true</code> if the specified string represents an integer or * floating point numeric value; <code>false</code> otherwise */ bool isNumber(const char *string); /** * Reads one token from a source string. * @param buf the buffer into which the token is to be written * @param buflen the length of the specified buffer * @param delims the list of characters delimiting the next token * @param src the source string from which the token is to be read * @return a pointer to the character in the source string that bounds the * token written into the specified buffer, or NULL if some error occurs */ const char *onetoken(char *buf, size_t buflen, const char *delims, const char *src); /** * Returns whether a string a valid integer. * @param str the string to be tested * @param allowSign whether an initial + or - sign is permitted * @return TRUE if the string is a valid integer; * FALSE otherwise */ bool isInteger(const char *str, bool allowSign); /** * Trims a string of superfluous whitespace. * @param str the string to be trimmed * @return the trimmed string, or NULL */ char *trim(char *str); #endif /* __INTERPRETER_H__ */