/* ************************************************************************
* File: comm.h Part of CircleMUD *
* Usage: header file: prototypes of public communication functions *
* *
* 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 __COMM_H__
#define __COMM_H__
#include "base.h"
#include "bits.h"
#define NUM_RESERVED_DESCS 8
/* comm.c */
size_t send_to_char(charData_t *ch, const char *messg, ...) __attribute__ ((format (printf, 2, 3)));
void send_to_all(const char *messg, ...) __attribute__ ((format (printf, 1, 2)));
void send_to_room(roomData_t *room, const char *messg, ...) __attribute__ ((format (printf, 2, 3)));
void send_to_outdoor(const char *messg, ...) __attribute__ ((format (printf, 1, 2)));
void close_socket(descriptorData_t *d);
void perform_act(const char *orig, charData_t *ch,
itemData_t *obj, const void *vict_obj, const charData_t *to);
void act(const char *str, int hide_invisible, charData_t *ch,
itemData_t *obj, const void *vict_obj, bitvector_t type);
/**
* The act type constants.
* @{
*/
#define TO_CHAR BIT_00 /**< Send the message to the actor. */
#define TO_OTHERS BIT_01 /**< Send the message to others. */
#define TO_SLEEP BIT_02 /**< Send the message to sleepers. */
#define TO_VICT BIT_03 /**< Send the message to the victim.*/
/** @} */
/**
* A convenience act type macro.
* @def (TO_CHAR | TO_OTHERS | TO_VICT)
*/
#define TO_ALL \
(TO_CHAR | TO_OTHERS | TO_VICT)
/**
* A legacy name for TO_OTHERS.
* @def TO_OTHERS
*/
#define TO_NOTVICT \
(TO_OTHERS)
/**
* A convenience act type macro.
* @def (TO_OTHERS | TO_VICT)
*/
#define TO_ROOM \
(TO_OTHERS | TO_VICT)
/* I/O functions */
void write_to_q(const char *txt, textQueue_t *queue, int aliased);
int write_to_descriptor(socket_t desc, const char *txt);
size_t write_to_output(descriptorData_t *d, const char *txt, ...) __attribute__ ((format (printf, 2, 3)));
size_t vwrite_to_output(descriptorData_t *d, const char *format, va_list args);
void string_add(descriptorData_t *d, char *str);
void string_write(descriptorData_t *d, char **txt, size_t len, long mailto, void *data);
#define PAGE_LENGTH 22
#define PAGE_WIDTH 80
void page_string(descriptorData_t *d, char *str, int keep_internal);
typedef RETSIGTYPE sigfunc(int);
#endif /* __COMM_H__ */