Just a various run-through

CAVNESS@utxvms.cc.utexas.edu
Date: 10/20/94


Yes, folks, that infamous signal is annoying me to hell. Sometimes, for the
oddest reason, when a person loses link, their architecture or program, whichever it is, sends a SIGPIPE(or whatever happens.)

This is quite annoying, for the obvious reasons. Is there any easy way to fix
it? (or uneasy way either.
)


On another note, for those of you that are waiting for the StrangeMUD
magic files so Vice Island or Oceania will work, stay tuned. I should have
it out by October 25th.

Thanks!


Finally, I have a problem with a rewriting of do_reboot that I made when 
I was tired of doing the same things over and over. Basically, what it SHOULD
do is allow you to reload any text file and, based on what you want to do with
it, it can take as little as one line of addition or an infinite amount, if
you wish to manipulate the data in the file.

Here is the code:
#define TERM_ARRAY_CHAR '\n'

#define NULL_FILE "\0"
struct reboot_data {
   char reboot_option[MAX_STRING_LENGTH];
   char reboot_file[MAX_STRING_LENGTH];
   char *whichfile;
 };
#define RB_OP(data) (data).reboot_option
#define RB_FILE(data) (data).reboot_file
#define RB_FILE_PTR(data) (data).which#define REREAD_FILE(file) file_to_string

#define DO_ALL(str) ((is_abbrev((str), "all")) || *(str) == '*')
#define DO_L
IST(str) ((is_abbrev((str), "list")) || *(str) == '?')

ACMD(do_reboot)
{
   int  i;
   STRING(debug);

   struct reboot_data reboot_info[] =
   {
     {    "credits", CREDITS_FILE,    credits},
     {       "news", NULL_FILE,       '\0'},   
     {       "motd", MOTD_FILE,
       motd},
     {    "kwdhelp", NULL_FILE,       '\0'},
     {   "pagehelp", HELP_PAGE_FIL
E,  help}, 
     {       "info", INFO_FILE,       info}, 
     {    "wizlist", WIZLIST_FILE,    wizlist},
     {      "poses", NULL_FILE,       '\0'},
     {      "imotd", IMOTD_FILE,      imotd},
     {   "policies", POLICIES_FILE,   policies},
     {   "handbook", HANDBOOK_FILE,   handbook},
     { "background", BACKGROUND_FILE, background},
     { "sacrifice",  NULL_FILE,       '\0'},
     {    "houses",  HOUSE_FILE,      houses},
     { "marriages",  MARRIAGES_FILE,  marriages},
     {   "qmanual",  QMANUAL_FILE,    qmanual},
     { "greetings",  GREETINGS_FILE,  GREETINGS},
     { "socials",    NULL_FILE,       '\0'},
     {        "\n",  NULL_FILE,       '\0'}
   };

   one_argument(argument, arg);
 
   if(!*arg)
   {
     send_to_char("Reboot what?\n\r",ch);
     return;
   }

   if(DO_LIST(arg))
   {
    send_to_char("The following reload options are ava
ilable:\n\r", ch);
    for(i = 0;*RB_OP(reboot_info[i]) != TERM_ARRAY_CHAR; i++)
      {
        sprintf(buf,"%s\n\r", RB_OP(reboot_info[i]));
        send_to_char(buf, ch);
      }
    return;
  }
  else
    if(!DO_ALL(arg))
    {
        for(i = 0; *RB_OP(reboot_info[i]) != TERM_ARRAY_CHAR; i++)
          if(is_abbrev(arg, RB_OP(reboot_info[i]))) break;
    }
    else
    {
     for(i = 0; *RB_OP(reboot_info[i]) != TERM_ARRAY_CHAR; i++)  
       if(str_cmp(RB_FILE(reboot_info[i]), NULL_FILE))
       {
         sprintf(debug, "Rebooting_file: %s\n\r", RB_FILE(reboot_info[
i]));
         send_to_char(debug, ch);
         if(REREAD_FILE(reboot_info[i])
 < 0)
            send_to_char("ERROR! That file could not be reloaded!\n\r", c
h);
    
       }
      OK(ch); 
      return;
     }
   
   /* if the two strings DON'T compare */
   if(str_cmp(RB_FILE(reboot_info[i]), NULL_FILE))
   {
       sprintf(debug, "Okay, rebooting file: %s\n\r", RB_FILE(reboot_info[i]));
       send_to_char(debug, ch);
       if(REREAD_FILE(reboot_info[i])< 0)
         send_to_char("Could not reboot the file!!", ch);
       OK(ch);
       return;
   }
   else
   {
     switch(i)
     {
       case 1:
             send_to_char("Reloading the news files\n\r", ch);
            file_to_string_alloc(NEWS_FILE, &news);
            file_to_string_alloc(NEWSVERSION, &nv);
            if(*news) newsversion = atoi(nv);
            OK(ch); 
            break;
       case 3: /* this is for the keyword file */
         send_to_char("Loading the help file again\n\r", ch);
         if (help_fl)
           fclose(help_fl);
         if (!(help_fl = fopen(HELP_KWRD_FILE, "r"))) return;
         else 
         { 
             for (i = 0; i < top_of_helpt; i++)
               free(help_index[i].keyword);
            free(help_index);
             help_index = build_help_index(help_fl, &top_of_helpt);
         }
         OK(ch);
        break;
        case 7: /* this is for the poses file */
        send_to_char("Loading the poses file =)\n\r", ch);
        boot_poses(); break;
      case 12: /* sacrifice messages */
        send_to_char("Rebooting sacrifice messages", ch);
        boot_sacrifi
ces();
        break;
      case 17:
        send_to_char("Rebooting socials.\n\r", ch);
        boot_social_messages();
        break;
       }
      return;
   }

      /* If all of this fails, then you KNOW it didn't work. */

      send_to_char("Unknown reload option.\n\r", ch);
      send_to_char("Correct format: reload list | all | ? | * | <option>", ch);

      return;
}







*************
I know that this is a lot to look at, but I'm hoping that someone will take
the time out to look at it and find what I'm doing wrong. In my honest opinion,
it has _no_ reason to do it!!! (ARGH) The best made plans of mice and men and
all that.



Signing off..

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cavness@utxvms.cc.utexas.edu        |       The Great Holy Star Goat
Kenneth G. Cavness                  |          is with all of us,
"Supreme Diva"                      |         braised be Its name.
"I'm pro-choice--please don't       |
shoot me in the back."              |     Braise the name of Our Lard!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                    

--BAA20992.782544118/marble.bu.edu--


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cavness@utxvms.cc.utexas.edu        |       The Great Holy Star Goat
Kenneth G. Cavness                  |          is with all of us,
"Supreme Diva"                      |         braised be Its name.
"I'm pro-choice--please don't       |
shoot me in the back."              |     Braise the name of Our Lard!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                    

--CAA21738.782548540/marble.bu.edu--


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cavness@utxvms.cc.utexas.edu        |       The Great Holy Star Goat
Kenneth G. Cavness                  |          is with all of us,
"Supreme Diva"                      |         braised be Its name.
"I'm pro-choice--please don't       |
shoot me in the back."              |     Braise the name of Our Lard!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                    



This archive was generated by hypermail 2b30 : 12/07/00 PST