+-+-+-+ Beginning of part 6 +-+-+-+ Xvoid com_close(int upd_count); X X/* From DIGEST.C */ X Vvoid digest_run(FILE * note, struct rule_info * rule, struct list_info * list X); X X/* And now for some global variables */ X Xextern char * version;`009`009`009/* BBOARD Version string */ Xextern unsigned int mail_received;`009/* How many entries since start-up */ Xextern char host[];`009`009`009/* What's the local host name? */ Xextern SYSTIM bboard_start;`009`009/* When did we start the hook? */ Xextern unsigned int new_count;`009`009/* How many unposted notes? */ Xextern int postings_suspended;`009`009/* Can we write to Notes? */ Xextern int shutdown_state;`009`009/* Are we shutting down? */ Xextern int log_available;`009`009/* Can we use the Jnet log? */ Xextern int setuname_used;`009`009/* Was SETUNAME used? */ X X/* Some fake globals */ X Xextern int mode;`009`009`009/* Used by jan_ calls */ Xextern int status;`009`009`009/* Status from SYS$, etc. calls */ Xextern char temp[512];`009`009`009/* Temporary string space */ X X#ifdef DESCRIP_H_DEFINED `009`009/* For VAX C, pre-V3.1 */ X#define __DESCRIP_LOADED 1 X#endif X X#ifdef __DESCRIP_LOADED Xextern struct dsc$descriptor hook_name; Xextern struct dsc$descriptor root_dir; Xextern struct dsc$descriptor scratch_dir; Xextern struct dsc$descriptor control_file; X Xextern struct dsc$descriptor log_file; Xextern struct dsc$descriptor error_conf; Xextern struct dsc$descriptor local_contact; X#endif Xextern SYSTIM bboard_time_interval; Xextern unsigned int bboard_count_interval; X X/* Some default values */ X X#define DEF_HOOK_NAME`009 "BBOARD" X#define DEF_ROOT_DIR`009 "SYS$SYSDEVICE:[BBOARD]" X#define DEF_SCRATCH_DIR "SYS$SYSDEVICE:[BBOARD.SCRATCH]" X#define DEF_CONTROL_FILE "BBOARD_DIR:BBOARD.CTL" X#define DEF_LOG_FILE`009 "BBOARD_DIR:BBOARD.NOTELOG" X#define DEF_ERR_CONF`009 "X-Unknown" X#define DEF_TIME_INTERVAL "0 00:05:00.00" X#define DEF_COUNT_INTERVAL 5 X X#ifndef TEST X#define LOG_HOOK_NAME`009 "BBOARD_HOOK_NAME" X#define LOG_ROOT_DIR`009 "BBOARD_DIR" X#define LOG_SCRATCH_DIR`009 "BBOARD_SCRATCH_DIR" X#define LOG_CONTROL_FILE "BBOARD_CONTROL_FILE" X#else X#define LOG_HOOK_NAME`009 "TESTBB_HOOK_NAME" X#define LOG_ROOT_DIR`009 "TESTBB_DIR" X#define LOG_SCRATCH_DIR`009 "TESTBB_SCRATCH_DIR" X#define LOG_CONTROL_FILE "TESTBB_CONTROL_FILE" X#endif $ GOSUB UNPACK_FILE $ FILE_IS = "BBOARD_MAKE_CONF.COM" $ CHECKSUM_IS = 259234204 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X$! Original author - Ben Cohen - 16-Feb-1990 X$ X$! X$! BMC 16-Feb-1990 X$!`009Initial version X$! X$ V$ Name_Chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY XZ_" X$ Name_Chars_len = f$length(Name_Chars) X$ Account = "ECHO" X$ X$ Name = f$parse( f$environment( "PROCEDURE" ),,, "NAME" ) X$ info = "%" + Name + "-I, " ! Information message X$ warn = "%" + Name + "-W, " ! Warning message X$ fatal = "%" + Name + "-F, " ! Fatal error message X$ TRUE = (1.eq.1) X$ FALSE = (1.eq.0) X$ say = "Write SYS$OUTPUT" ! Write on the log file (if any) X$ X$ secondary = "Terry" ! Who else gets moderator status? X$ X$ set symbol/scope=noglobal X$ esc[0,8]=27 X$ clr=esc+"[2J"+esc+"[1;1H" X$ X$ say clr X$ say " " X$ say " MAKE SKELETON CONFERENCE" X$ say " Version 1.00 16-Feb-1990" X$ say " " X$ say "This command procedure is a first attempt in creating a process by" X$ say "which to build a new conference for BBoard. The BBoard supervisor" X$ say "invokes this procedure, supplying the name of the Internet conf-" X$ say "erence and other support information. Then the text of the first" X$ say "note is edited via EDT. The conference is then created and note" X$ say "numbers 2, 3 and 4 are reserved for later use by the moderators." X$ say "" X$ say "Not real pretty, but it works. Enhancements are welcome!!" X$ say " X$! X$ set noon`009`009`009`009! We want to be able to intercept those X$ on Control_Y then goto End`009`009! Make sure we can clean ourselves up X$! X$ set mess /nofac /nosev /noid /notext X$ save_notes$command = f$trnlnm("notes$command","lnm$process_table") X$ define notes$command shell.tmp6`009! in case there's one that might hurt X$ close shell X$ delete shell.tmp%;* X$ set mess /fac /sev /id /text X$! X$ user = f$edit(f$getjpi(0,"USERNAME"), "COMPRESS,TRIM,UPCASE") X$! X$Get_Conf_Name: X$! X$ read /prompt="Enter the Internet conference name: " sys$command foo X$ c_name = f$edit(foo, "COMPRESS,TRIM") X$! X$Rid_Blanks: X$! X$ nextb = f$locate(" ", c_name) X$ if nextb .eq. f$length(c_name) then goto Get_Notes_Name X$ c_name[nextb,1] := "_" X$ goto Rid_Blanks X$! X$Get_Notes_Name: X$! X$ conf_name = "X-" + c_name X$! V$ read /prompt="Enter the Notes conference name [''conf_name']: " sys$command X - X`009foo X$ foo = f$edit(foo, "COMPRESS,TRIM") X$ if foo .nes. "" then conf_name = foo X$! X$ full_name = f$parse("''conf_name'.note",,,,"SYNTAX_ONLY") X$ j1 = f$locate(";",full_name) X$ full_name = f$extract(0,j1,full_name) X$! X$ title = "Echo of Internet ''c_name' mailing list" X$ say "Enter a one line concise title for the conference:" X$ say " Default: ''title'" X$ read/prompt=": " sys$command foo X$ foo = f$edit(foo, "COMPRESS,TRIM") X$ if foo .nes. "" then title = foo X$! X$Want_conference_user: X$! X$ read/prompt="Do you want an alias username for replying? " sys$command foo X$ if foo then goto Guess_Conference_User X$! X$ build_user = FALSE X$ goto Enter_Initial_Text X$! X$Guess_Conference_User: X$! X$ build_user = TRUE X$ foo = "" X$ i = -1 X$ c_name_len = f$len(c_name) X$User_name_fondle_top: X$`009i = i + 1 X$`009if i .gt. c_name_len then goto Get_user_name X$`009y = f$extract(i, 1, c_name) X$`009if f$locate(y, Name_Chars) .lt. Name_Chars_len then goto User_char_OK X$`009goto User_name_fondle_top X$User_char_OK: X$`009foo = foo + y X$ goto User_name_fondle_top X$! X$Get_user_name: X$! X$ uname = foo V$ read /prompt="Alias username for reply purposes: [''uname']" sys$command fo Xo X$ foo = f$edit(foo, "COMPRESS,TRIM") X$ if foo .nes. "" then uname = foo X$! X$ read /prompt="What UIC group to use? " sys$command foo X$ uic_grp = f$edit(foo, "COLLAPSE,UPCASE") X$! X$! X$ UAF$W_MEM = %x24 X$ UAF$W_GRP = %x26 X$! X$ SysUAF = f$parse( "SYSUAF", "SYS$SYSTEM:.DAT;" ) X$! X$! Try to treat it as a name... X$ grp = f$identifier(uic_grp, "NAME_TO_NUMBER" ) / %x10000 X$! ...if name not found, treat as an integer X$ if grp .eq. 0 then grp = f$integer( "%o''uic_grp'" ) X$! X$ group = "****" ! Pre-extend the group keyword X$ group[ 0, 16 ] = 0`009`009`009! Start at member 0 X$ group[ 16, 16 ] = grp `009`009! ...in the selected group X$! X$ nxt_mem = -1`009`009`009`009! Assume no next member X$ nxt_UIC = ""`009`009`009`009! '' '' '' '' X$ expected_member = 1`009`009`009! Expect to start with member 1 X$! X$ open /read /error=UAF_Open_Err SysUAF_file &SysUAF`009! Open the UAF file X$! X$ on Control_Y then goto End_UAF`009! Make sure we can clean ourselves up X$! X$ read /error=UAF_Read_Err /index=1 /match=GE /key=&group SysUAF_file record X$! If the group doesn't match, then exit X$ if f$cvui(UAF$W_GRP*8, 16, record ) .ne. grp then goto UAF_UIC_Not_Found X$10$: X$ member = f$cvui(UAF$W_MEM*8, 16, record )`009! Get current member number X$ if expected_member .lt. member then goto 15$`009! If we found a gap, use it X$! ...else expected is next entry X$ if expected_member .eq. member then expected_member = member + 1 X$ read /error=15$ /index=1 SysUAF_file record`009! Read next record X$! If the group doesn't match, then exit X$ if f$cvui(UAF$W_GRP*8, 16, record ) .ne. grp then goto 15$ X$ goto 10$ X$! X$15$: X$ nxt_mem = expected_member`009`009! Return next member number... X$ nxt_uic = F$Fao( "[!OL,!OL]", grp, nxt_mem ) ! ...and next UIC X$ close SysUAF_file X$ goto Enter_Initial_Text`009`009! ...and continue X$! X$UAF_UIC_Not_Found: X$ say Fatal, f$fao("Unable to find matching UIC group for ""!AS""", uic_grp) X$ goto End_UAF X$! X$UAF_Read_Err: X$ say Fatal, f$fao( "Error reading from ""!AS""!/!AS", SYSUAF, - X`009f$message( $STATUS ) ) X$ goto End_UAF X$! X$UAF_Open_Err: X$ say Fatal, f$fao( "Failed to open ""!AS""!/!AS", SYSUAF, - X`009f$message( $STATUS ) ) X$ goto End X$! X$Enter_Initial_Text: X$! X$ on Control_Y then goto End`009`009! Back to normal X$ X$ say "Modify the text for the introductory topic of your conference." X$ open/write shell shell.tmp3 V$ write shell "This conference is a read-only echo of the Internet ''c_name' X conference." X$ write shell "" X$ write shell "''c_name' is a discussion forum " X$ close shell X$ define/user sys$input 'f$trnlnm("SYS$OUTPUT")' X$ edit/edt shell.tmp3 ! In EDT creating note 1.0 X$ say "" X$ say "Please wait a moment while the conference is created." X$ say "The processing of the new conference will be finished when" X$ say "you are returned to the dollar (""$"") prompt." X$ say "" X$ say "Processing..." X$ say "" X$ wait 0:0:03`009`009`009`009! give them time to read the paragraph X$ open/write shell shell.tmp6 X$ write shell "!Empty" X$ close shell X$ X$ !note 2 X$ X$ open/write shell shell.tmp5_n2 V$ write shell " The most current internal directory for this conferenc Xe" X$ write shell " will be posted as responses to this topic. " X$ close shell X$ open/write shell shell.tmp5_n3 X$ write shell " The most current information concerning moderation" X$ write shell " will be posted as responses to this topic. " X$ close shell X$ open/write shell shell.tmp5_n4 X$ write shell " Additional note for moderators" X$ close shell X$ open/write shell shell.tmp1 X$ write shell "$ copy shell.tmp3 'p2" ! Magic X$ close shell X$ open/write shell shell.tmp4 X$! X$ if .not. build_user then goto Start_conf_build X$ write shell "$ mcr authorize" V$ write shell "add ''uname'/uic=''nxt_uic'/flags=disuser/account=''Account' - X" X$ write shell "/dir=[echo.''uname']/own=""''c_name' Mailing Address""" X$ write shell "$ mcr diskquota" X$ write shell "use dua0:" X$ write shell "add ''uname'/perm=1000/over=0" X$ write shell "$ create/dir dua0:[echo.''uname']/own=''uname'" X$Start_conf_build: X$ write shell "$ define/user notes$library DUA2:[NOTES$LIBRARY]" X$ write shell "$ Notes/nonotebook" X$ write shell "set prof /edit=(""@", f$env("default"), - X`009`009"shell.tmp1"",spawn) /temp" ! More X$ write shell "create conference ", f$env("default"), "shell.tmp2" X$ write shell "''conf_name'" X$ write shell "Welcome to the ''conf_name' conference" X$ write shell "y" X$ if secondary .nes. "" then write shell - V "Add member ''secondary'/priv=m/access=spcvxa::''secondary'/mail=0::",secon Xdary X$ write shell "modify member ",user,"/mail=0::",user X$ write shell "add member bboard /access=spcvxa::bboard/priv=m/nomail" X$ if build_user then - X write shell "add member ''uname' /access=spcvxa::''uname'/priv=m/nomail" X$ write shell "add member system /priv=m/node=spcvxa/nomail" X$ write shell "write/noed shell.tmp5_n2" X$ write shell "This topic reserved for future internal directory" X$ write shell "y" X$ write shell "write/noed shell.tmp5_n3" X$ write shell "This topic reserved for future use by the moderator" X$ write shell "y" X$ write shell "write/noed shell.tmp5_n4" X$ write shell "This topic reserved for future use by the moderator" X$ write shell "y" X$ write shell "show member" X$ write shell "set mod" X$ write shell "set note 1/nowrite" X$ write shell "set note 2/nowrite" X$ write shell "set note 3/nowrite" X$ write shell "set note 4/nowrite" X$ write shell "set conf/notice=""",title,"""" X$ write shell "set conf/nowrite" X$ write shell "exit" X$ close shell X$ @shell.tmp4 X$ set prot=(o:rwed) shell.tmp2 X$ rename shell.tmp2 'full_name' X$ set prot=(o:rwe) 'full_name' X$ say "" X$ say "Conference creation is FINISHED!" X$ say "" X$ say "To change the title of a note the moderator can use the X$ say "SET NOTE/TITLE=""This is a new title"" command after" X$ say "turning on the moderator privs via SET MODERATOR." X$ say " " X$ say " T H A N K S F O R Y O U R H E L P ! ! ! ! ! ! " X$ goto End X$! X$End_UAF: X$ Close /Error=20$ SYSUAF_FILE X$End: X$ delete shell.tmp*;* X$ deassign notes$command X$ define notes$command 'save_notes$command' X$! X$ exit ! Whew $ GOSUB UNPACK_FILE $ FILE_IS = "BBSUPP.C" $ CHECKSUM_IS = 2114393882 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include "bboard.h" X X/* Translate a logical name, putting it into an xmalloc()ed buffer. */ X Xchar * log_tran(char * log_name) X`123 X static struct dsc$descriptor_s table_name = X`009`123 16, DSC$K_DTYPE_T, DSC$K_CLASS_S, "LNM$SYSTEM_TABLE" `125; X X struct item_list `123 X`009unsigned short buf_len; `009/* Length of return buffer */ X`009unsigned short item_code;`009/* What do we want about this log.? */ X`009void * addr;`009`009`009/* Where's the buffer */ X`009int * ret_len;`009`009`009/* And how long was the info? */ X `125 log_list[2];`009`009`009/* One and one NULL to terminate */ X X char * logical;`009`009`009/* Ptr to logical name buffer */ X X struct dsc$descriptor name; `009/* Logical to translate */ X int log_len;`009`009`009/* How long was the info */ X int attr;`009`009`009`009/* How do we scan for it? */ X X /* Do some setup */ X X logical = xmalloc(256);`009`009/* Build a buffer */ X str_desc(&name, log_name);`009`009/* Descriptor for the name */ X attr = LNM$M_CASE_BLIND;`009`009/* Ignore case for translating */ X X log_list[0].buf_len = 255;`009`009/* buffer is 255 (+1 for '\0') */ X log_list[0].item_code = LNM$_STRING; /* Want the string itself */ X log_list[0].addr = logical; `009/* Where the translation goes */ X log_list[0].ret_len = &log_len;`009/* How long is the translation? */ X X log_list[1].buf_len = 0;`009`009/* Nothing for the second */ X log_list[1].item_code = 0; X X /* Now actually do the translation */ X X status = sys$trnlnm(&attr, &table_name, &name, 0, &log_list); X X /* Did it happen? */ X X if ((status == SS$_NOLOGNAM) `124`124 !(status & 1)) `123 X`009log_len = 0; X `125 X X /* Terminate the string, please */ X X logical[log_len & 0xff] = '\0'; X X /* If it didn't work, release the memory used */ X X if (logical[0] == 0) `123 X`009xfree(logical); X`009logical = NULL; X `125 X X /* And where's the buffer? */ X X return (logical); X`125 X X/* Figure out what the current version is */ X Xchar * get_vms_ver(void) X`123 X static char ver[9]; `009`009/* Version string */ X int len;`009`009`009`009/* How long is it? */ X struct item `123 X`009short buf_len;`009`009`009/* How long is the buffer */ X`009short code;`009`009`009/* What do we want */ X`009void * buffer;`009`009`009/* Where is the buffer */ X`009int * ret_len;`009`009`009/* How long is the info? */ -+-+-+-+-+ End of part 6 +-+-+-+-+-