/
driver3.2@242/autoconf/
driver3.2@242/doc/LPC/
driver3.2@242/hosts/
driver3.2@242/hosts/amiga/NetIncl/
driver3.2@242/hosts/amiga/NetIncl/netinet/
driver3.2@242/hosts/amiga/NetIncl/sys/
driver3.2@242/hosts/atari/
driver3.2@242/hosts/fcrypt/
driver3.2@242/mudlib/
driver3.2@242/mudlib/sys/
driver3.2@242/util/
driver3.2@242/util/indent/hosts/next/
driver3.2@242/util/make_docs/
#ifndef SHSTR_NEXT

#include "config.h"
#include "lint.h"

#define SHSTR_NEXT(str)	(*(char **)((char *) (str) - sizeof(unsigned short)\
						   - sizeof(char *)))
#define SHSTR_REFS(str)	(*(unsigned short *)((char *) (str)\
						   - sizeof(unsigned short)))
#define SHSTR_BLOCK(str) ((char *)(str) - sizeof(unsigned short)\
					- sizeof(char *))

#ifdef MALLOC_smalloc
#include "smalloc.h"
extern int malloc_size_mask PROT((void));
#define shstr_malloced_size(str) ( *( \
	(p_uint *)(str-sizeof(char*)-sizeof(unsigned short))\
	- SMALLOC_OVERHEAD) )
#else
#define malloc_size_mask() (~0)
#define shstr_malloced_size(str) (\
	(sizeof(char*) + sizeof(char *) + sizeof(short) +\
	strlen(str) + 1 + sizeof(char *) - 1) >> 2)
#endif

extern mp_int stralloc_allocd_strings, stralloc_allocd_bytes;

#if !defined(NO_INCREMENT_STRING_REF) && !defined(STRALLOC)
static INLINE
void increment_string_ref(str)
char *str;
{
        stralloc_allocd_strings++;
        stralloc_allocd_bytes += shstr_malloced_size(str);
        if (SHSTR_REFS(str))
            SHSTR_REFS(str)++;
}
#endif

#endif /* SHSTR_NEXT */