Online Social editting
======================

(c) 1996,97 Erwin S. Andreasen <erwin@andreasen.org>

See the file "License" first for license information.

This module has been tested with MERC as well as Envy 1.0 and 2.0. It should
work under Linux, SunOS as well as BSDI. Brian Castle has supplied a version
for ROM 2.4 (see the files in the ROM/ directory).

Installation
============

This should be rather easy. Insert the social-edit file in your Makefile.

Check out and modify the value of SOCIAL_FILE in social-edit.c.

Also, insert printf_to_char in somewhere, like comm.c. Remember to include
the prototype for it in merc.h. printf_to_char is a rather handy thing,
which I found in John Booth's EOD source. Also, remeber to add 

#include <stdarg.h>

at top of comm.c.

The file sedit.hlp contains a help entry.


Step 1 - saving the old social table:
======

Be sure that CONST_SOCIAL is defined in sedit-social.c.

Make a call to save_social_table() somewhere, for example at the end of
boot_db(). You might want to declare the prototypes for load_social_table()
and save_social_table() in merc.h:

void load_social_table();
void save_social_table();

Start up the MUD, make sure the file is saved, shutdown.


Step 2 - removing the old socials.
======

Remove the whole social table from interp.c. Then replace, in merc.h, the
old const social table, with this non-constant one:

extern struct social_type *social_table;

Also, change the social_type structure in merc.h, removing all the "const".


Step 3 - adding loading of social table
======

Remove the #define CONST_SOCIAL. Add call to load_social_table somewhere in
boot_db(). Compile. Run. Try the commands out, but be SURE to havea backup
of the social file around.

Note: there are maxSocial socials in the social_table, but the table is one
larger than that. The last entry has its name == "", for backwards
compatibility with whatever uses social_table now.

Also add the SEDIT command, used for online editting of the socials.
The procedure for adding commands is in the doc files accompanying
MERC/Envy. This should be an immortal command


Technical issues
================

For easy backwards compatbility, I use realloc to allocate the new larger
social table when a new social is created. I do not know if this will
fragment the memory. The alternative would be a linked list of socials, but
I felt lazy. This way, the new table is nicely backwards compatible.

The whole social table is written to disk when a social is added. The social
file contains first the number of socials in the file, followed by the
socials.


Updates since last version
==========================

Changes for version 6:

* ROM support from Brian Castle <bcastle@prevuenet.com>

Changes for version 5:
* Changed buggy size calculation in SEDIT NEW
* Added smash_tilde() to do_sedit.


Changes for versions 1-4:
* Undocumented :)





