home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / vmsnet / sources / 312 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  46.8 KB

  1. Path: sparky!uunet!usc!elroy.jpl.nasa.gov!ames!network.ucsd.edu!mvb.saic.com!vmsnet-sources
  2. From: munroe@dmc.com (Dick Munroe)
  3. Newsgroups: vmsnet.sources
  4. Subject: UBBS, part 10/12
  5. Message-ID: <7868514@MVB.SAIC.COM>
  6. Date: Fri, 21 Aug 1992 20:22:38 GMT
  7. Organization: Doyle, Munroe Consultants, Inc., Hudson, MA
  8. Lines: 1597
  9. Approved: Mark.Berryman@Mvb.Saic.Com
  10.  
  11. Submitted-by: munroe@dmc.com (Dick Munroe)
  12. Posting-number: Volume 3, Issue 118
  13. Archive-name: ubbs/part10
  14. -+-+-+-+-+-+-+-+ START OF PART 10 -+-+-+-+-+-+-+-+
  15. X; Modified by Ned Freed, 16-Nov-86, to use proper global symbols.
  16. X;
  17. X;---------------------------------------------------------------------------
  18. X; This is invoked by MAIL when it encounters the foreign mail protocol.
  19. X; This module really has nothing protocol-specific to it and can be used
  20. X; to dispatch to any handler.  The handler should supply the following
  21. X; action routines:
  22. X;
  23. X;`09status := MAIL_OUT_CONNECT (context : unsigned;
  24. X;`09`09`09`09    LNK_C_OUT_CONNECT : immediate;
  25. X;`09`09`09`09    protocol, node : string_descriptor;
  26. X;`09`09`09`09    MAIL$_LOGLINK : immediate;
  27. X;`09`09`09`09    file_RAT, file_RFM : immediate;
  28. X;`09`09`09`09    MAIL$GL_FLAGS : immediate;
  29. X;`09`09`09`09    attached_file : descriptor := immediate 0)
  30. X;
  31. X;`09status := MAIL_OUT_LINE    (context : unsigned;
  32. X;`09`09`09`09    `5BLNK_C_OUT_SENDER `7C LNK_C_OUT_TO `7C
  33. X;`09`09`09`09     LNK_C_OUT_SUBJ`5D : immediate;
  34. X;`09`09`09`09    node, sender_name : string_descriptor)
  35. X;
  36. X;`09status := MAIL_OUT_CHECK   (context : unsigned;
  37. X;`09`09`09`09    `5BLNK_C_OUT_CKUSER `7C
  38. X;`09`09`09`09     LNK_C_OUT_CKSEND`5D : immediate;
  39. X;`09`09`09`09    node, addressee : string_descriptor;
  40. X;`09`09`09`09    procedure MAIL$READ_ERROR_TEXT);
  41. X;
  42. X;`09status := MAIL_OUT_FILE    (context : unsigned;
  43. X;`09`09`09`09    LNK_C_OUT_FILE : immediate;
  44. X;`09`09`09`09    node : string_descriptor;
  45. X;`09`09`09`09    rab : $RAB_TYPE;
  46. X;`09`09`09`09    procedure UTIL$REPORT_IO_ERROR);
  47. X;
  48. X;`09status := MAIL_OUT_DEACCESS (context : unsigned;
  49. X;`09`09`09`09     LNK_C_OUT_DEACCESS : immediate);
  50. X;
  51. X;`09status := MAIL_IN_CONNECT (context : unsigned;
  52. X;`09`09`09`09   LNK_C_IN_CONNECT : immediate;
  53. X;`09`09`09`09   input_tran : string_descriptor;
  54. X;`09`09`09`09   file_RAT, file_RFM : immediate;
  55. X;`09`09`09`09   MAIL$GL_FLAGS : immediate;
  56. X;`09`09`09`09   MAIL$Q_PROTOCOL : string_descriptor;
  57. X;`09`09`09`09   pflags : immediate);
  58. X;
  59. X;`09status := MAIL_IN_LINE   (context : unsigned;
  60. X;`09`09`09`09  `5BLNK_C_IN_SENDER `7C LNK_C_IN_CKUSER `7C
  61. X;`09`09`09`09   LNK_C_IN_TO `7C LNK_C_IN_SUBJ`5D : immediate;
  62. X;`09`09`09`09  returned_line : string_descriptor);
  63. X;
  64. X;`09status := MAIL_IN_FILE     (context : unsigned;
  65. X;`09`09`09`09    LNK_C_OUT_FILE : immediate;
  66. X;`09`09`09`09    0 : immediate;
  67. X;`09`09`09`09    rab : $RAB_TYPE;
  68. X;`09`09`09`09    procedure UTIL$REPORT_IO_ERROR);
  69. X;
  70. X;`09status := MAIL_IO_READ  (context : unsigned;
  71. X;`09`09`09`09 LNK_C_IO_READ : immediate;
  72. X;`09`09`09`09 returned_text_line : string_descriptor);
  73. X;
  74. X;`09status := MAIL_IO_WRITE (context : unsigned;
  75. X;`09`09`09`09 LNK_C_IO_WRITE : immediate;
  76. X;`09`09`09`09 text_line : string_descriptor);
  77. X;
  78. X;---------------------------------------------------------------------------
  79. X;
  80. X; Define major and minor protocol identifiers.  MAIL requires that these
  81. X; be 1.  The shareable image MUST be linked with the options file MAILSHR.OP
  82. VT
  83. X; that promotes these symbols to UNIVERSAL symbols so they will end up
  84. X; in the shareable image's symbol table.
  85. X;
  86. X`09`09MAIL$C_PROT_MAJOR == 1
  87. X`09`09MAIL$C_PROT_MINOR == 1
  88. X;
  89. X; Constants for dispatcher, taken from MAIL.SDL listing
  90. X;
  91. X`09LNK_C_FIRST = 0
  92. X`09LNK_C_OUT_CONNECT  == 0
  93. X`09LNK_C_OUT_SENDER   == 1
  94. X`09LNK_C_OUT_CKUSER   == 2
  95. X`09LNK_C_OUT_TO`09   == 3
  96. X`09LNK_C_OUT_SUBJ`09   == 4
  97. X`09LNK_C_OUT_FILE`09   == 5
  98. X`09LNK_C_OUT_CKSEND   == 6
  99. X`09LNK_C_OUT_DEACCESS == 7
  100. X
  101. X`09LNK_C_IN_CONNECT   == 8
  102. X`09LNK_C_IN_SENDER    == 9
  103. X`09LNK_C_IN_CKUSER    == 10
  104. X`09LNK_C_IN_TO`09   == 11
  105. X`09LNK_C_IN_SUBJ`09   == 12
  106. X`09LNK_C_IN_FILE`09   == 13
  107. X
  108. X`09LNK_C_IO_READ`09   == 14
  109. X`09LNK_C_IO_WRITE`09   == 15
  110. X`09LNK_C_LAST = 15
  111. X;
  112. X; Here's the main routine that is called by MAIL.  Note that we don't really
  113. X; do any work here, just dispatch the call to the appropriate handler.  The
  114. X; reason I do it this way is that I am not interested in writing the handler
  115. Vs
  116. X; in MACRO, and I cannot easily deal with different numbers of arguments in
  117. X; the same procedure in other languages.
  118. X;
  119. X
  120. X;
  121. X; General argument offset to the function code:
  122. X;
  123. X`09LNK_FUNCTION = 8
  124. X;
  125. X; Shareable image transfer vectors
  126. X;
  127. X`09.Transfer`09MAIL$PROTOCOL
  128. X`09.Mask`09`09MAIL$PROTOCOL
  129. X`09jmp`09L`5EMAIL$PROTOCOL + 2
  130. X
  131. X`09.Entry`09MAIL$PROTOCOL, `5EM<r2,r3>
  132. X
  133. X`09caseb`09LNK_FUNCTION(ap), #LNK_C_FIRST, -`09; Dispatch to handler
  134. X`09`09#<LNK_C_LAST - LNK_C_FIRST>
  135. X
  136. X10$:`09  .word`09Dispatch_out_connect - 10$`09`09; LNK_C_OUT_CONNECT
  137. X`09  .word`09Dispatch_out_line - 10$`09`09`09; LNK_C_OUT_SENDER
  138. X`09  .word`09Dispatch_out_check - 10$`09`09; LNK_C_OUT_CKUSER
  139. X`09  .word`09Dispatch_out_line - 10$`09`09`09; LNK_C_OUT_TO
  140. X`09  .word`09Dispatch_out_line - 10$`09`09`09; LNK_C_OUT_SUBJ
  141. X`09  .word`09Dispatch_out_file - 10$`09`09`09; LNK_C_OUT_FILE
  142. X`09  .word`09Dispatch_out_check - 10$`09`09; LNK_C_OUT_CKSEND
  143. X`09  .word`09Dispatch_out_deaccess - 10$`09`09; LNK_C_OUT_DEACCESS
  144. X
  145. X`09  .word`09Dispatch_in_connect - 10$`09`09; LNK_C_IN_CONNECT
  146. X`09  .word`09Dispatch_in_line - 10$`09`09`09; LNK_C_IN_SENDER
  147. X`09  .word`09Dispatch_in_line - 10$`09`09`09; LNK_C_IN_CKUSER
  148. X`09  .word`09Dispatch_in_line - 10$`09`09`09; LNK_C_IN_TO
  149. X`09  .word`09Dispatch_in_line - 10$`09`09`09; LNK_C_IN_SUBJ
  150. X`09  .word`09Dispatch_in_file - 10$`09`09`09; LNK_C_IN_FILE
  151. X
  152. X`09  .word`09Dispatch_IO_read - 10$`09`09`09; LNK_C_IO_READ
  153. X`09  .word`09Dispatch_IO_write - 10$`09`09`09; LNK_C_IO_WRITE
  154. X
  155. Xunknown:
  156. X`09pushl`09LNK_FUNCTION(ap)`09; FAO parameter in the function code
  157. X`09pushl`09#1
  158. X`09pushl`09#ubbsml__UNKFUNC`09; Signal unknown function code
  159. X`09calls`09#3, G`5ELIB$SIGNAL`09; if we fall through dispatcher.
  160. X`09movl`09#ubbsml__UNKFUNC, r0
  161. X`09ret
  162. X;
  163. X; The dispatchers
  164. X;
  165. XDispatch_out_connect:
  166. X`09callg`09(ap), MAIL_OUT_CONNECT
  167. X`09ret
  168. X
  169. XDispatch_out_line:
  170. X`09callg`09(ap), MAIL_OUT_LINE
  171. X`09ret
  172. X
  173. XDispatch_out_check:
  174. X`09callg`09(ap), MAIL_OUT_CHECK
  175. X`09ret
  176. X
  177. XDispatch_out_file:
  178. X`09callg`09(ap), MAIL_OUT_FILE
  179. X`09ret
  180. X
  181. XDispatch_out_deaccess:
  182. X`09callg`09(ap), MAIL_OUT_DEACCESS
  183. X`09ret
  184. X
  185. XDispatch_in_connect:
  186. X`09callg`09(ap), MAIL_IN_CONNECT
  187. X`09ret
  188. X
  189. XDispatch_in_line:
  190. X`09callg`09(ap), MAIL_IN_LINE
  191. X`09ret
  192. X
  193. XDispatch_in_file:
  194. X`09callg`09(ap), MAIL_IN_FILE
  195. X`09ret
  196. X
  197. XDispatch_IO_read:
  198. X`09callg`09(ap), MAIL_IO_READ
  199. X`09ret
  200. X
  201. XDispatch_IO_write:
  202. X`09callg`09(ap), MAIL_IO_WRITE
  203. X`09ret
  204. X
  205. X`09.end
  206. $ CALL UNPACK [.MAIL_PROTOCOL]MAILSHR.MAR;3 1813544556
  207. $ create 'f'
  208. Xuniversal=MAIL$C_PROT_MAJOR, MAIL$C_PROT_MINOR
  209. $ CALL UNPACK [.MAIL_PROTOCOL]MAILSHR.OPT;2 993680312
  210. $ create 'f'
  211. X`09parameter LNK_C_OUT_CONNECT  = 0 !(* MAIL protocol link actions.
  212. V           *)
  213. X`09parameter LNK_C_OUT_SENDER   = 1 !(* These are defined in MAILSHR.MAR
  214. V      *)
  215. X`09parameter LNK_C_OUT_CKUSER   = 2 !(* but because we cannot have external
  216. V   *)
  217. X`09parameter LNK_C_OUT_TO       = 3 !(* constants in Pascal, they are
  218. V         *)
  219. X`09parameter LNK_C_OUT_SUBJECT  = 4 !(* redefined here.
  220. V                       *)
  221. X`09parameter LNK_C_OUT_FILE     = 5
  222. X`09parameter LNK_C_OUT_CKSEND   = 6
  223. X`09parameter LNK_C_OUT_DEACCESS = 7
  224. X`09parameter LNK_C_IN_CONNECT = 8
  225. X`09parameter LNK_C_IN_SENDER  = 9
  226. X`09parameter LNK_C_IN_CKUSER  = 10
  227. X`09parameter LNK_C_IN_TO      = 11
  228. X`09parameter LNK_C_IN_SUBJ    = 12
  229. X`09parameter LNK_C_IN_FILE    = 13
  230. X`09parameter LNK_C_IO_READ  = 14
  231. X`09parameter LNK_C_IO_WRITE = 15
  232. X
  233. X`09character*80 from_string,to_string,subject_string,address(40)
  234. X`09common /mailchars/ from_string,to_string,subject_string,address
  235. X`09integer*4    num_addresses
  236. X`09common/mailints/ num_addresses
  237. $ CALL UNPACK [.MAIL_PROTOCOL]PROT_INC.FOR;7 320155909
  238. $ create 'f'
  239. X`09integer function mail_out_connect (context, function, protocol,
  240. X`091   node, mail$_loglink, file_rat, file_rfm, mail$gl_flags,
  241. X`092   attached_file)
  242. X
  243. Xc`09MAIL_OUT_CONNECT is called by VMS MAIL to initiate a send operation.
  244. X
  245. X`09implicit none
  246. X`09include '($ssdef)'
  247. X`09include 'prot_inc.for'
  248. X
  249. X`09integer*4 context,function,mail$_loglink,file_rat
  250. X`09integer*4 file_rfm,mail$gl_flags
  251. X`09integer*4 attached_file
  252. X`09character*(*) protocol
  253. X`09character*(*) node
  254. Xc`09character*(*) attached_file
  255. X`09character*12 filename
  256. X`09external uopen
  257. X`09external ubbsml__filopnerr
  258. X
  259. X
  260. X`09from_string = ' '
  261. X`09to_string = ' '
  262. X`09subject_string = ' '
  263. X`09num_addresses = 0
  264. X
  265. Xc`09open the userlog and message files
  266. X`09filename = 'USERLOG.DAT'
  267. X`09open(unit=1,file='ubbs_data:userlog.dat',status='old',`09
  268. X`091   organization='indexed',access='keyed',err=1000,
  269. X`092   recordtype='fixed',recl=50,shared,useropen=uopen)
  270. X`09filename = 'MESSAGE.HED'
  271. X`09open(unit=2,file='ubbs_data:message.hed',status='old',`09
  272. X`091   organization='relative',access='direct',err=1000,
  273. X`092   recordtype='fixed',recl=48,shared,useropen=uopen)
  274. X`09filename = 'MESSAGE.DAT'
  275. X`09open(unit=3,file='ubbs_data:message.dat',status='old',`09
  276. X`091   organization='relative',access='direct',err=1000,
  277. X`092   recordtype='fixed',recl=20,shared,useropen=uopen)
  278. X
  279. X`09mail_out_connect = ss$_normal
  280. X`09return
  281. X
  282. X 1000`09call lib$signal(ubbsml__filopnerr,
  283. X`091   %val(1), filename)
  284. X
  285. Xc`09Don't set return code to normal on error
  286. X`09return
  287. X`09end
  288. X`0C
  289. X`09integer function mail_out_line(context,function,node,line)
  290. X
  291. Xc`09MAIL_OUT_LINE is called by VMS MAIL whenever a single line of stuff
  292. Xc`09must be delivered to the UBBS mail interface.
  293. Xc`09These currently are the To:, From:, and Subject: lines.
  294. X`09implicit none
  295. X`09include '($ssdef)'
  296. X`09include 'prot_inc.for'
  297. X`09integer*4 context,function,node,func2
  298. X`09character*(*) line
  299. X
  300. Xc`09The following is because function is passed by value, and FORTRAN
  301. Xc`09thinks that it is an address.
  302. X
  303. X`09func2 = %loc(function)
  304. X
  305. X`09if(func2.eq.lnk_c_out_to) then
  306. X`09    to_string = line
  307. X`09else if (func2.eq.lnk_c_out_sender) then
  308. X`09    from_string = line
  309. X`09else if(func2.eq.lnk_c_out_subject) then
  310. X`09    subject_string = line
  311. X`09end if
  312. X
  313. X`09mail_out_line = ss$_normal
  314. X`09end
  315. X`0C
  316. X`09integer function MAIL_OUT_CHECK(context,function,node,addressee,error)
  317. Xc`09MAIL_OUT_CHECK is called once with each addressee for the current
  318. Xc`09message and once again after the message body has been sent.
  319. X
  320. X`09implicit none
  321. X`09include 'bbs_inc.for'
  322. X`09include 'prot_inc.for'
  323. X
  324. X`09integer context,function,func2,error,jj,istat
  325. X`09logical*1 valid
  326. X`09character*(*) node,addressee
  327. X`09character zmail_to*40,zfirst_name*20,zlast_name*20,yn*1
  328. X`09external ubbsml__usernoexist
  329. X
  330. X 1001`09format(a)
  331. X
  332. X`09func2 = %loc(function)
  333. X
  334. X`09if(func2.eq.lnk_c_out_ckuser) then
  335. X`09    if(len(addressee).eq.1.and.ichar(addressee(1:1)).eq.0) then
  336. X`09`09mail_out_check = ss$_normal
  337. X`09`09return
  338. X`09`09end if
  339. X`09    jj=index(addressee,'/')
  340. X`09    if(jj.eq.0) jj = len(addressee) + 1
  341. X`09    call str$upcase(zmail_to,addressee(1:jj-1))
  342. X`09    jj = index(zmail_to,' ')
  343. X`09    zfirst_name=zmail_to(1:jj-1)`09
  344. X`09    zlast_name=zmail_to(jj+1:30)
  345. X`09    ur.user_key=zlast_name//zfirst_name
  346. X`09    read(1,key=ur.user_key,iostat=istat)ur
  347. X`09    unlock(unit=1)
  348. X`09    if(istat.eq.0) then
  349. X`09`09num_addresses = num_addresses + 1
  350. X`09`09address(num_addresses) = addressee
  351. X`09    else
  352. X`09`09call lib$signal(ubbsml__usernoexist,%val(1), addressee)
  353. X`09`09write(*,*) 'Do you wish to make this a general message? `5BN`5D'
  354. X`09`09read(*,1001)yn
  355. X`09`09call str$upcase(yn,yn)
  356. X`09`09if(yn.ne.'Y') then
  357. X`09`09    mail_out_check = %loc(ubbsml__usernoexist)
  358. X`09`09    return
  359. X`09`09    end if
  360. X`09    end if
  361. X`09else if(func2.eq.lnk_c_out_cksend) then
  362. X`09    continue
  363. X`09end if
  364. X`09mail_out_check = ss$_normal
  365. X`09return
  366. X`09end
  367. X`0C
  368. X`09integer function MAIL_OUT_FILE(context,function,node,
  369. X`091    message_rab,error)
  370. Xc`09MAIL_OUT_FILE is called when the body of the message is ready to be
  371. Xc`09sent. The message is available as a file and must be read from this
  372. Xc`09temporary file using RMS. MAIL_OUT_FILE is where most of the actual
  373. Xc`09work takes place. The following steps are taken:
  374. Xc
  375. Xc   (1) The mode of the message file is set to record I/O (MAIL sometimes
  376. Xc       leaves the file in block mode).
  377. Xc
  378. Xc   (2) Put the message in the UBBS message files for each user.
  379. X
  380. X`09implicit none
  381. X`09include '($rabdef)'
  382. X`09include '($rmsdef)'
  383. X`09include 'prot_inc.for'
  384. X`09include 'bbs_inc.for'
  385. X`09integer context,function,error,length,num_lines,stat,ii,i,istat
  386. X`09integer jj,j
  387. X`09logical get_line,busy
  388. X`09character line*256,options*30,temp*30
  389. X`09character zfirst_name*20,zlast_name*20,zmail_to*30
  390. X`09character*(*) node
  391. X`09integer sys$get
  392. X`09external ubbsml__mesreaerr
  393. X`09external ubbsml__publmess
  394. X
  395. X`09record/rabdef/ message_rab
  396. X`09record/mail_header_structure/ mh
  397. X
  398. X
  399. Xc`09Do some fancy footwork with RMS to insure that the file is open
  400. Xc`09for sequential access and not block access. MAIL sometimes has
  401. Xc`09this file open in block mode. The only way to change modes is
  402. Xc`09to disconnect the RAB, diddle the mode bit and then reconnect it.
  403. X
  404. X`09call sys$disconnect (message_rab)
  405. X`09message_rab.rab$l_rop = message_rab.rab$l_rop .and. (.not.rab$m_bio)
  406. X`09call sys$connect (message_rab)
  407. X
  408. X`09call sys$rewind (message_rab)
  409. X`09
  410. X`09get_line = .true.
  411. X`09num_lines = 0
  412. X`09do while (get_line)
  413. X`09    message_rab.rab$l_ubf = %loc(line)
  414. X`09    message_rab.rab$w_usz = 256
  415. X`09    stat = sys$get (message_rab)
  416. X`09    if(mod(stat,2).eq.1) then
  417. X`09`09length = message_rab.rab$w_rsz
  418. X`09`09num_lines = num_lines + 1
  419. X`09    else if (stat .eq. rms$_eof) then
  420. X`09`09get_line = .false.
  421. X`09    else
  422. X`09`09call lib$signal (ubbsml__mesreaerr, 1, stat)
  423. X`09    end if
  424. X`09    end do
  425. X
  426. X`09i = index(from_string,'"')
  427. X`09if(i.ne.0) then
  428. X`09    from_string = from_string(i+1:)
  429. X`09    i=index(from_string,'"')
  430. X`09    if(i.ne.0) from_string = from_string(1:i-1)
  431. X`09    end if
  432. X
  433. X`09do ii = 1,num_addresses
  434. X
  435. X 3090`09read(2,rec=1)last_header,last_data,
  436. X`091   first_mnum,last_mnum,busy
  437. X`09if(busy) then
  438. X`09    unlock(unit=2)
  439. X`09     call lib$wait(1.0)
  440. X`09    go to 3090
  441. X`09    end if
  442. X
  443. X`09last_header=last_header+1
  444. X`09last_mnum=last_mnum+1
  445. X`09write(2,rec=1)last_header,last_data+num_lines,
  446. X`091   first_mnum,last_mnum,busy
  447. X`09call date(mh.mail_date)
  448. X`09call time(mh.mail_time)
  449. X
  450. X`09mh.mail_read=.false.
  451. X`09mh.mail_deleted=.false.
  452. X`09mh.mail_subject=subject_string
  453. X`09i = index(address(ii),'/')
  454. X`09if (i.eq.0) then
  455. X`09    i=31
  456. X`09    mh.mail_section = 0
  457. X`09    mh.mail_private = .true.
  458. X`09else
  459. X`09    options = address(ii)(i+1:)//'///'
  460. Xc`09    extract first option (private `5BY/N`5D)
  461. X`09    j = index(options,'/')
  462. X`09    temp = options(1:j)
  463. X`09    options = options(j+1:)
  464. X`09    if(temp(1:1).eq.'N') then
  465. X`09`09mh.mail_private = .false.
  466. X`09    else
  467. X`09`09mh.mail_private = .true.
  468. X`09    end if
  469. X`09end if
  470. X`09mh.mail_to=address(ii)(1:i-1)
  471. X`09mh.mail_reply_to=0
  472. X`09do i=1,10
  473. X`09    mh.mail_replys(i)=0
  474. X`09    end do
  475. X`09mh.mail_first=last_data+1
  476. X`09mh.mail_last=last_data+num_lines
  477. X`09mh.mail_from=from_string
  478. X`09mh.mail_messnum=last_mnum
  479. X`09call str$upcase(zmail_to,mh.mail_to)
  480. X`09jj = index(zmail_to,' ')
  481. X`09zfirst_name=zmail_to(1:jj-1)`09
  482. X`09zlast_name=zmail_to(jj+1:30)
  483. X`09ur.user_key=zlast_name//zfirst_name
  484. X`09read(1,key=ur.user_key,iostat=istat)ur
  485. X`09if(istat.eq.0) then
  486. X`09    mh.mail_person = .true.
  487. X`09else
  488. X`09    mh.mail_person = .false.
  489. X`09    mh.mail_private = .false.
  490. X`09    call lib$signal(ubbsml__publmess,%val(1),zmail_to)
  491. X
  492. X`09end if
  493. X`09write(2,rec=last_header) mh
  494. X`09call sys$rewind (message_rab)
  495. X`09get_line = .true.
  496. X`09num_lines = 0
  497. X`09do while (get_line)
  498. X`09    line = ' '
  499. X`09    message_rab.rab$l_ubf = %loc(line)
  500. X`09    message_rab.rab$w_usz = 256
  501. X`09    stat = sys$get (message_rab)
  502. X`09    if(mod(stat,2).eq.1) then
  503. X`09`09length = message_rab.rab$w_rsz
  504. X`09`09num_lines = num_lines + 1
  505. X`09`09write(3,rec=last_data+num_lines)line(1:80)
  506. X`09    else if (stat .eq. rms$_eof) then
  507. X`09`09get_line = .false.
  508. X`09    else
  509. X`09`09call lib$signal (ubbsml__mesreaerr, 1, stat)
  510. X`09    end if
  511. X`09    end do
  512. X`09    read(1,key=ur.user_key,iostat=istat)ur
  513. X`09    if(istat.eq.0) then
  514. X`09`09ur.num_unread = ur.num_unread + 1
  515. X`09`09rewrite(1)ur
  516. X`09    else
  517. X`09`09print*,'error on user log - istat=',istat
  518. X`09    end if
  519. X`09    end do
  520. X`09mail_out_file = ss$_normal
  521. X`09return
  522. X`09end
  523. X`0C
  524. X`09integer function MAIL_OUT_DEACCESS(context,function)
  525. X`09include '($ssdef)'
  526. X`09close(unit=1)
  527. X`09close(unit=2)
  528. X`09close(unit=3)
  529. X`09mail_out_deaccess = ss$_normal
  530. X`09return
  531. X`09end
  532. X`0C
  533. X`09integer function MAIL_IN_CONNECT
  534. X`09include '($ssdef)'
  535. X`09mail_in_connect = ss$_normal
  536. X`09return
  537. X`09end
  538. X`09integer function MAIL_IN_LINE
  539. X`09include '($ssdef)'
  540. X`09mail_in_line = ss$_normal
  541. X`09return
  542. X`09end
  543. X`09integer function MAIL_IN_FILE
  544. X`09include '($ssdef)'
  545. X`09mail_in_file = ss$_normal
  546. X`09return
  547. X`09end
  548. X`09integer function MAIL_IO_READ
  549. X`09include '($ssdef)'
  550. X`09mail_io_read = ss$_normal
  551. X`09return
  552. X`09end
  553. X`09integer function MAIL_IO_WRITE
  554. X`09include '($ssdef)'
  555. X`09mail_io_write = ss$_normal
  556. X`09return
  557. X`09end
  558. X`0C
  559. X`09integer function uopen(fab,rab,lun)
  560. X`09implicit none
  561. X
  562. X`09include '($rabdef)'
  563. X`09include '($fabdef)'
  564. X
  565. X`09record /rabdef/ rab
  566. X`09record /fabdef/ fab
  567. X`09integer sys$open,sys$connect
  568. X
  569. X`09integer lun,status
  570. X`09
  571. Xc`09modify the rab to simplify things
  572. X`09rab.rab$l_rop = ibset(rab.rab$l_rop, rab$v_wat)
  573. X
  574. Xc`09actually open the file
  575. X`09status=sys$open(fab)
  576. X`09if(status) status=sys$connect(rab)
  577. Xc`09return the status
  578. X`09uopen=status
  579. X`09return
  580. X`09end
  581. $ CALL UNPACK [.MAIL_PROTOCOL]UBBS_MAILSHR.FOR;6 1210369869
  582. $ create 'f'
  583. X`09  .Title`09UBBSMAIL error messages
  584. X
  585. X! Written by Dale Miller 17-Jan-1989
  586. X
  587. X`09  .Facility`09UBBSML,667/prefix=UBBSML__
  588. X`09  .Ident`09'UBBS_MAIL Version 1.0'
  589. X
  590. X     .Severity  fatal
  591. X
  592. X`09INTSTKOVR    <Internal error, stack overflow>
  593. X`09STKEMPTY     <Internal error, stack empty>
  594. X`09BADSTKELE    <Internal error, bad element found on stack>
  595. X
  596. X     .Severity`09error
  597. X
  598. X`09FILOPNERR    <Unable to open file "UBBS_DATA:!AS">/FAO=1
  599. X`09NOSUCHUSER   <No such user exists in USERLOG.DAT>
  600. X`09MESREAERR    <Error reading intermediate message file, status = !UL>/FAO=
  601. V1
  602. X        UNKFUNC      <Foreign MAIL protocol invoked with unknown function !U
  603. VL.>/FAO=1
  604. X
  605. X    .Severity`09warning
  606. X
  607. X        USERNOEXIST  <Specified user "!AS" does not exist>/FAO=1
  608. X
  609. X    .Severity`09information
  610. X
  611. X`09PUBLMESS     <Public message delivered to "!AS">/FAO=1
  612. X
  613. X     .End
  614. $ CALL UNPACK [.MAIL_PROTOCOL]UBBS_MAIL_ERR.MSG;7 796878843
  615. $ create 'f'
  616. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  617. Vcccc
  618. Xc
  619. Xc`09UBBS utilities - Convert_files.for
  620. Xc`09This program converts the FILES.DAT files into FILES.IDX files for
  621. Xc`09UBBS Rev. 4.0
  622. Xc`09Dale Miller - UALR
  623. Xc`0927-Jun-1986
  624. Xc
  625. Xc`09Rev. 4.0  27-Jun-1986
  626. Xc`09Rev. 6.0  06-Jun-1988
  627. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  628. Vcccc
  629. X`09implicit none
  630. X`09include 'bbs_inc.for'
  631. X`09character cdate*9,cdate2*11
  632. X`09integer str$upcase,istat,sys$bintim,txtlen
  633. X
  634. X`09record/file_description/ fd
  635. X
  636. X`09open(unit=1,file='files.dat',readonly,shared,status='old')
  637. X
  638. X`09open(unit=2,file='files.idx',status='new',organization='indexed',
  639. X`091   access='keyed',recl=192,form='unformatted',
  640. X`092   recordtype='variable',key=(1:18:character))
  641. X
  642. X 1001`09format(a18,i3,1x,a1,6x,a9,1x,q,a)
  643. X 1002`09format(67x,a11)
  644. X
  645. X`09fd.file_name='$Header'
  646. X`09fd.upload_name='DALE MILLER'
  647. X`09fd.keywords=' '
  648. X`09fd.times_down=0
  649. X`09fd.upload_text=' '
  650. X`09read(1,1002)cdate2
  651. X`09istat = str$upcase(cdate2,cdate2)
  652. X`09istat = sys$bintim(cdate2//' 00:00:00.00',fd.upload_date)
  653. X`09write(2)fd
  654. X`09read(1,1001)fd.file_name
  655. X
  656. X`09fd.upload_name=' '
  657. X`09fd.keywords=' '
  658. X`09fd.times_down=0
  659. X
  660. X 0010`09read(1,1001,end=99)fd.file_name,fd.file_size,
  661. X`091   fd.file_type,cdate,txtlen,fd.upload_text
  662. X`09fd.upload_text(txtlen+1:txtlen+1)=char(cr)
  663. X`09istat = str$upcase(cdate,cdate)
  664. X`09istat = sys$bintim(cdate(1:7)//'19'//
  665. X`091   cdate(8:9)//' 00:00:00.00',fd.upload_date)
  666. X`09print*,'file='//fd.file_name//' type='//fd.file_type//' date='//
  667. X`091   cdate
  668. X`09print*,'file_size=',fd.file_size
  669. X`09write(2)fd
  670. X`09go to 10
  671. X 0099`09print*,'finished'
  672. X`09end
  673. $ CALL UNPACK [.UPGRADE]CONVERT_FILES.FOR;2 571816888
  674. $ create 'f'
  675. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  676. Vcccc
  677. Xc
  678. Xc`09UBBS utilities - Crlf.for
  679. Xc`09Redo the userlog for UBBS V 3.0
  680. Xc`09Dale Miller - UALR
  681. Xc`0910-Feb-1985
  682. Xc
  683. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  684. Vcccc
  685. X`09implicit none
  686. X`09include 'bbs_inc.for'
  687. X`09include 'sys$library:foriosdef'
  688. X`09integer istat,str$upcase,sys$gettim,sys$asctim
  689. X`09character null4*4,lfcr*4,dummy_20*20
  690. X`09real*8 null8/'0000000000000000'x/
  691. X
  692. X`09character  zz*1,appstr*12
  693. X`09character*40 zeros/'0000000000000000000000000000000000000000'/
  694. X`09null4=char(0)//char(0)//char(0)//char(0)
  695. X`09lfcr=char(10)//char(13)//char(255)//' '
  696. X
  697. X`09open(unit=1,file='userlog.dat',status='old',`09
  698. X`091   organization='indexed',access='keyed',
  699. X`092   recordtype='fixed',recl=50,shared)
  700. X
  701. X`09ur.user_key=char(0)
  702. X`09
  703. X 0010`09read(1,keygt=ur.user_key,iostat=ios)ur
  704. X`09if(ios.eq.for$ios_sperecloc) go to 10
  705. X`09if(ios.ne.0) go to 5000
  706. X`09if(ur.user_key.eq.zeros) go to 10
  707. X 0011`09if(ur.approved) then
  708. X`09    appstr='* Approved *'
  709. X`09else
  710. X`09    appstr='Not Approved'
  711. X`09endif
  712. X
  713. Xc`09write(6,1000)ur.user_key,ur.city,ur.state,ur.phone_number(1:3),
  714. Xc`091   ur.phone_number(4:6),ur.phone_number(7:10),ur.computer,
  715. Xc`092   ur.last_log_date,ur.last_log_time,ur.num_logon,appstr
  716. X
  717. X 1000`09format(1x,a,1x,a,','a,1x,'(',a,')',a,'-',a,/,
  718. X`091   1x,a,1x,a,1x,a,i6,/,1x,a)
  719. X
  720. X`09if(ur.user_crlf.eq.null4) then
  721. X`09    ur.user_crlf=char(13)//char(10)//char(255)
  722. X`09    print*,'bad cr '//ur.user_key
  723. X`09    endif
  724. X`09if(ur.user_ff.eq.null4) then
  725. X`09    ur.user_ff=char(13)//char(10)//char(255)
  726. X`09    print*,'bad ff '//ur.user_key
  727. X`09    endif
  728. X`09if(ur.user_crlf.eq.lfcr) then
  729. X`09    ur.user_crlf=char(13)//char(10)//char(255)
  730. X`09    print*,'flip cr '//ur.user_key
  731. X`09    endif
  732. X`09if(ur.user_ff.eq.lfcr) then
  733. X`09    ur.user_ff=char(13)//char(10)//char(255)
  734. X`09    print*,'flip ff '//ur.user_key
  735. X`09    endif
  736. X`09if(ur.last_pass_chg.eq.null8) then
  737. X`09    istat=sys$gettim(%ref(ur.last_pass_chg))
  738. X`09    istat=sys$asctim(,dummy_20,%ref(ur.last_pass_chg),)
  739. X`09    print*,'bad password change date '//ur.user_key,dummy_20
  740. X`09    endif
  741. X
  742. X`09rewrite(1,err=90500,iostat=ios)ur
  743. X`09go to 10
  744. X
  745. X 5000`09close(unit=1)
  746. X`09print*,'ios=',ios
  747. X`09print*,'finished'
  748. X`09stop
  749. X
  750. X90500`09print*,'an error has occurred'
  751. X`09print*,'ios=',ios
  752. X`09stop
  753. X`09end
  754. $ CALL UNPACK [.UPGRADE]CRLF.FOR;1 940207298
  755. $ create 'f'
  756. X`09program cvtv6
  757. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  758. Vcccc
  759. Xc
  760. Xc`09UBBS utilities - Cvtv6.for
  761. Xc`09This program removes converts the FILES.IDX files for UBBS V6.0
  762. Xc
  763. Xc`09Dale Miller - UALR
  764. Xc
  765. Xc`09Rev. 6.0  06-Jun-1988
  766. Xc
  767. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  768. Vcccc
  769. X`09implicit none
  770. X`09include 'bbs_inc.for'
  771. X`09include '($rmsdef)'
  772. X`09include 'sys$library:foriosdef.for/nolist'
  773. X`09character filnam1*100,filnam2*100,darea*3,tempfile*50,dsp*1
  774. X`09integer d1,d2,dummy,istat,fc1,fc2,du1,du2,i,length
  775. X`09integer lib$find_file
  776. X`09integer str$trim,str$upcase,sys$gettim
  777. X`09external uopen
  778. X`09record/file_description/ fd
  779. X`09real*8   tempdate
  780. X
  781. X`09call sys$gettim(tempdate)
  782. X`09filnam1='bbs$files:`5B-`5D*.dir;*'
  783. X`09dummy=20
  784. X`09fc1=0
  785. X`09tempfile=filnam1
  786. X`09istat=rms$_nmf
  787. X`09istat=lib$find_file(tempfile,filnam1,fc1)
  788. X`09do while (istat.ne.rms$_nmf)
  789. X`09    d1=1
  790. X`09    do while(d1.ne.0)
  791. X`09`09d1=index(filnam1,'`5D')
  792. X`09`09filnam1=filnam1(d1+1:)
  793. X`09`09end do
  794. X`09    d2=index(filnam1,'.')-1
  795. X`09    darea=filnam1(:d2)
  796. X`09    write(6,1001)' Beginning '//darea
  797. Xc
  798. Xc Get the index file.
  799. Xc
  800. X`09open(unit=4,`09`09shared,
  801. X`091   file='bbs$files:`5B'//darea//'`5Dfiles.idx',
  802. X`092   status='old',`09organization='indexed',
  803. X`093   access='keyed',`09form='unformatted',
  804. X`094   recl=128,`09`09recordtype='fixed',
  805. X`095`09`09`09key=(1:18:character),
  806. X`096   useropen=uopen)
  807. X
  808. X`09open(unit=3,`09`09shared,
  809. X`091   file='bbs$files:`5B'//darea//'`5Dnew_files.idx',
  810. X`092   status='new',`09organization='indexed',
  811. X`093   access='keyed',`09form='unformatted',
  812. X`094   recl=192,`09`09recordtype='variable',
  813. X`095`09`09`09key=(1:18:character))
  814. X
  815. X`09fd.file_name=char(0)
  816. X`09read(4,keygt=fd.file_name,iostat=ios)fd
  817. X`09do while(ios.ne.for$ios_attaccnon)
  818. X`09    fd.archived=.false.
  819. X`09    fd.download_date = tempdate
  820. X`09    fd.keywords(50:79) = ' '
  821. X`09    write(3)fd
  822. X`09    read(4,keygt=fd.file_name,iostat=ios)fd
  823. X`09    end do
  824. X`09    close(unit=4)
  825. X
  826. Xc`09Now, go on to the next directory.
  827. X`09    istat=lib$find_file(tempfile,filnam1,fc1)
  828. X`09    end do
  829. X 1001`09format(a)
  830. X`09stop
  831. X`09end
  832. $ CALL UNPACK [.UPGRADE]CVTV6.FOR;1 1342395196
  833. $ create 'f'
  834. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  835. Vcccc
  836. Xc
  837. Xc`09UBBS utilities - Fixmess.for
  838. Xc`09This program add expiration dates to messages created by UBBS
  839. Xc`09previous to version 3.5.  New users may ignore its existance.
  840. Xc`09Dale Miller - UALR
  841. Xc
  842. Xc`09Rev. 3.5  20-Jun-1986
  843. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  844. Vcccc
  845. X`09implicit none
  846. X`09include 'bbs_inc.for'
  847. X`09character dummy_20*20
  848. X`09include 'sys$library:foriosdef/nolist'
  849. X`09external uopen
  850. X`09integer k,istat
  851. X`09integer sys$bintim,compquad
  852. X`09real*8  my_time,one_month,time_zero
  853. X
  854. X`09record /mail_header_structure/ mh
  855. X
  856. X`09istat=sys$bintim('18-DEC-1858 00:00:00',one_month)
  857. X`09istat=sys$bintim('19-JUN-1986 00:00:00',time_zero)
  858. X
  859. X`09open(unit=2,file='message.hed',status='old',
  860. X`091    organization='relative',access='direct',shared,
  861. X`092    recordtype='fixed',recl=48,useropen=uopen)
  862. X
  863. X 2100`09read(unit=2,rec=1,iostat=ios)last_header,
  864. X`091   last_data,first_mnum,last_mnum
  865. X`09if(ios.ne.0) then
  866. X`09    print*,'Error on header record ios=',ios
  867. X`09    stop
  868. X`09    end if
  869. X`09print*,'Last header=  ',last_header
  870. X`09print*,'Last data=    ',last_data
  871. X`09print*,'First message=',first_mnum
  872. X`09print*,'Last message= ',last_mnum
  873. X
  874. X`09do k=2,last_header
  875. Xc
  876. Xc`09Loop through all message headers to see if they need fixing
  877. Xc
  878. X `09    read(2,rec=k)mh
  879. X
  880. X`09    if(mh.mail_person) go to 30
  881. X
  882. X`09    dummy_20=mh.mail_date(1:7)//'19'//mh.mail_date(8:9)//' 00:00:00'
  883. X`09    istat=sys$bintim(dummy_20,my_time)
  884. X`09    istat=compquad(my_time,time_zero)
  885. X`09    if(istat.eq.1) go to 30
  886. X`09    call addquad(my_time,one_month,mh.mail_expire)
  887. X`09    write(2,rec=k)mh
  888. X`09    print*,'Fixed ',mh.mail_messnum,' from:'//mh.mail_from//
  889. X`091`09' To:'//mh.mail_to
  890. X 0030`09    continue
  891. X`09    end do
  892. X
  893. X`09close(unit=2)
  894. X`09stop
  895. X 9060`09print*,'could not open file'
  896. X`09stop
  897. X90000`09continue
  898. X`09print*,'Error reading record, ios=',ios
  899. X`09close(unit=2)
  900. X`09close(unit=3)
  901. X`09close(unit=4)
  902. X`09stop
  903. X`09end
  904. X`0C
  905. X`09integer function uopen(fab,rab,lun)
  906. X`09implicit none
  907. X
  908. X`09include '($rabdef)'
  909. X`09include '($fabdef)'
  910. X
  911. X`09record /rabdef/ rab
  912. X`09record /fabdef/ fab
  913. X`09integer sys$open,sys$connect
  914. X
  915. X`09integer lun,status
  916. X`09
  917. Xc`09modify the rab to simplify things
  918. X`09rab.rab$l_rop = ibset(rab.rab$l_rop, rab$v_wat)
  919. X
  920. Xc`09actually open the file
  921. X`09status=sys$open(fab)
  922. X`09if(status) status=sys$connect(rab)
  923. Xc`09return the status
  924. X`09uopen=status
  925. X`09return
  926. X`09end
  927. X`0C
  928. X`09integer function uopen2(fab,rab,lun)
  929. X`09implicit none
  930. X
  931. X`09include '($rabdef)'
  932. X`09include '($fabdef)'
  933. X
  934. X`09record /rabdef/ rab
  935. X`09record /fabdef/ fab
  936. X`09integer sys$open,sys$connect
  937. X
  938. X`09integer lun,status
  939. X`09
  940. Xc`09modify the rab to simplify things
  941. X`09rab.rab$l_rop = ibset(rab.rab$l_rop, rab$v_ulk)
  942. X
  943. Xc`09actually open the file
  944. X`09status=sys$open(fab)
  945. X`09if(status) status=sys$connect(rab)
  946. Xc`09return the status
  947. X`09uopen2=status
  948. X`09return
  949. X`09end
  950. $ CALL UNPACK [.UPGRADE]FIXMESS.FOR;1 2015459162
  951. $ create 'f'
  952. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  953. Vcccc
  954. Xc
  955. Xc`09UBBS utilities - Reformat_uploads.for
  956. Xc`09This program reformats binary files uploaded previous to Rev 4.7
  957. Xc`09to conform to the new standard.  It must be invoked for each file
  958. Xc`09to be converted.
  959. Xc`09New users may ignore its existance.
  960. Xc
  961. Xc`09Dale Miller - UALR
  962. Xc
  963. Xc`09Rev. 4.7  09-Dec-1986
  964. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  965. Vcccc
  966. X      implicit integer (a-z)
  967. X      character*1024 buff
  968. X      character*70 filnam
  969. X
  970. X      status=lib$get_foreign(filnam,'Enter file name: ',nodlen)
  971. X      if(nodlen.eq.0) go to 100
  972. X      open (unit=1,name=filnam,carriagecontrol='none',
  973. X     1    type='old',err=9000)
  974. X      open (unit=2,name=filnam,carriagecontrol='none',
  975. X     1    type='new',err=9000)
  976. X
  977. X`09length=0
  978. X 0010`09if(length.lt.128) then
  979. X`09    read(1,12,end=500)len2,buff(length+1:)
  980. X`09    length=length+len2
  981. X`09endif
  982. X`09write(2,13)buff(1:128)
  983. X`09buff=buff(129:)
  984. X`09length=length-128
  985. X`09go to 10
  986. X 0500`09if(length.gt.0) then
  987. X`09    buff(length+1:)=' '
  988. X`09    write(2,13)buff(1:128)
  989. X        endif
  990. X`09close(unit=1)
  991. X`09close(unit=2)
  992. X`09call exit
  993. X
  994. X 0012`09format(q,a)
  995. X 0013`09format(a)
  996. X
  997. X 9000`09write(6,*)'could not open file'
  998. X`09call exit
  999. X 0100`09print*,'No file name found'
  1000. X`09end
  1001. $ CALL UNPACK [.UPGRADE]REFORMAT_UPLOADS.FOR;2 809512967
  1002. $ create 'f'
  1003. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  1004. Vcccc
  1005. Xc
  1006. Xc`09UBBS utilities - Add_files.for
  1007. Xc`09This program reads a sequential file containing file descriptions and
  1008. Xc`09updates FILES.IDX accordingly.
  1009. Xc`09Dale Miller - UALR
  1010. Xc`0906-Jun-1988
  1011. Xc
  1012. Xc`09Rev. 6.0  06-Jun-1988
  1013. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  1014. Vcccc
  1015. X`09implicit none
  1016. X`09include 'bbs_inc.for'
  1017. X`09character cdate*9,cdate2*11,darea*3,infile*80,inline*80,tchar*1
  1018. X`09character type*5
  1019. X`09integer str$upcase,istat,sys$bintim,txtlen,fsize
  1020. X`09external getsize
  1021. X`09common/filesize/fsize
  1022. X`09record/file_description/ fd
  1023. X`09record/file_description/ fd2
  1024. X
  1025. X`09print*,'Area to update?'
  1026. X`09read(*,1003)darea
  1027. X`09open(unit=2,file='bbs$files:`5B'//darea//'`5Dfiles.idx',
  1028. X`091   status='old',organization='indexed',shared,
  1029. X`091   access='keyed',recl=192,form='unformatted',
  1030. X`092   recordtype='variable',key=(1:18:character))
  1031. X
  1032. X`09print*,'Input file name?'
  1033. X`09read(*,1003)infile
  1034. X`09open(unit=1,file=infile,readonly,shared,status='old')
  1035. X
  1036. X 1001`09format(a1,a)
  1037. X 1002`09format(67x,a11)
  1038. X 1003`09format(a)
  1039. X
  1040. X`09fd.file_name=' '
  1041. X`09fd.times_down=0
  1042. X`09fd.upload_text=' '
  1043. X`09call sys$gettim(fd.upload_date)
  1044. X`09fd.download_date = fd.upload_date
  1045. X`09fd.archived = .false.
  1046. X
  1047. X`09read(1,1001,end=99)tchar,inline
  1048. X
  1049. X 0010`09fd.file_name = inline(1:18)
  1050. X`09fd.file_type = inline(20:20)
  1051. X`09if(fd.file_type.eq.'A') then
  1052. X`09    type = '.asc`5D'
  1053. X`09else
  1054. X`09    type = '.bin`5D'
  1055. X`09end if
  1056. X`09fd.upload_name = inline(22:51)
  1057. X`09call sys$gettim(fd.upload_date)
  1058. X`09fd.download_date = fd.upload_date
  1059. X`09fd.archived = .false.
  1060. X`09fd.times_down=0
  1061. X
  1062. X`09read(1,1001,end=99)tchar,fd.keywords
  1063. X`09fd.upload_text = fd.keywords
  1064. X`09txtlen = 0
  1065. X 0011`09read(1,1001,end=99)tchar,inline
  1066. X`09if(tchar.eq.'`7E') then
  1067. X`09    open(unit=4,file='bbs$files:`5B'//darea//type//
  1068. X`091`09fd.file_name,status='old',readonly,
  1069. X`092`09useropen=getsize,err=12,iostat=istat)
  1070. X`09    close(unit=4)
  1071. X`09    fd.file_size = fsize
  1072. X`09    print*,'file='//fd.file_name//' type='//fd.file_type//
  1073. X`091`09' size=',fd.file_size
  1074. X`09    read(2,key=fd.file_name,err=13)fd2
  1075. X`09    delete(unit=2)
  1076. X
  1077. X`09    fd.download_date = fd2.download_date
  1078. X`09    fd.upload_date   = fd2.upload_date
  1079. X`09    fd.archived      = fd2.archived
  1080. X`09    fd.times_down    = fd2.times_down
  1081. X 0013`09    write(2)fd
  1082. X`09    go to 10
  1083. X 0012`09    print*,'Open failed, file='//fd.file_name//' - status=',istat
  1084. X`09    go to 10
  1085. X`09    end if
  1086. X
  1087. X`09fd.upload_text(txtlen+1:) = inline
  1088. X`09call str$trim(fd.upload_text,fd.upload_text,txtlen)
  1089. X`09if(txtlen.ge.400) then
  1090. X`09    print*,'********'//fd.file_name//' truncated description'
  1091. X`09else
  1092. X`09    fd.upload_text(txtlen+1:txtlen+1)=char(cr)
  1093. X`09    txtlen = txtlen+1
  1094. X`09end if
  1095. X`09go to 11
  1096. X
  1097. X
  1098. X 0099`09open(unit=4,file='bbs$files:`5B'//darea//type//
  1099. X`091   fd.file_name,status='old',readonly,
  1100. X`092   useropen=getsize,err=100,iostat=istat)
  1101. X`09close(unit=4)
  1102. X`09fd.file_size = fsize
  1103. X`09    print*,'file='//fd.file_name//' type='//fd.file_type//
  1104. X`091`09' size=',fd.file_size
  1105. X`09read(2,key=fd.file_name,err=101)fd2
  1106. X`09delete(unit=2)
  1107. X 0101`09write(2)fd
  1108. X`09go to 102
  1109. X
  1110. X 0100`09print*,'Open failed, file='//fd.file_name//' - status=',istat
  1111. X 0102`09close(unit=1)
  1112. X`09close(unit=2)
  1113. X`09print*,'finished'
  1114. X`09end
  1115. X`0C
  1116. X`09integer function getsize(fab,rab,lun)
  1117. Xc`09This user open finds out the file size.
  1118. X
  1119. X`09implicit none
  1120. X
  1121. X`09include '($rabdef)'
  1122. X`09include '($fabdef)/list'
  1123. X
  1124. X`09record /rabdef/ rab
  1125. X`09record /fabdef/ fab
  1126. X`09integer sys$open,sys$connect
  1127. X`09
  1128. X`09integer lun,status,fsize
  1129. X`09common/filesize/fsize
  1130. X`09
  1131. Xc`09actually open the file
  1132. X`09status=sys$open(fab)
  1133. X`09if(status) status=sys$connect(rab)
  1134. Xc`09return the status
  1135. X`09getsize=status
  1136. Xc`09store the size
  1137. X`09fsize=fab.fab$l_alq
  1138. X`09return
  1139. X`09end
  1140. $ CALL UNPACK [.UTILITY]ADD_FILES.FOR;2 2087216843
  1141. $ create 'f'
  1142. X$ define ubbs_data disk$user:`5Bualr_bbs.data`5D
  1143. X$ define ubbs_files psi$dua106:`5Bbbs_files.`5D
  1144. X$ define ubbs_sysop_1 "DALE MILLER"
  1145. X$ define ubbs_sysop_2 "MICHAEL SMITH"
  1146. X$ define ubbs_sysop_mail "DOMILLER"
  1147. X$! approved_mail_read = 01
  1148. X$! approved_mail_send = 02
  1149. X$! approved_cb        = 04
  1150. X$! approved_file_down = 08
  1151. X$! approved_file_up   = 16
  1152. X$ define ubbs_flags 25
  1153. $ CALL UNPACK [.UTILITY]ASSIGN.COM;2 1195448397
  1154. $ create 'f'
  1155. X$ bbs
  1156. X$ set verify
  1157. X$ on error then continue
  1158. X$fort/check=noover BBS
  1159. X$ on error then continue
  1160. X$fort/check=noover BBSCB
  1161. X$ on error then continue
  1162. X$fort/check=noover SYSOP
  1163. X$ on error then continue
  1164. X$fort/check=noover UBBS_SUBS
  1165. X$ on error then continue
  1166. X$macro quadmath
  1167. X$ LIBRARY/OBJECT/CREATE UBBS *.OBJ
  1168. X$ on error then continue
  1169. X$ link/notrace/EXEC=BBS UBBS/INCLUDE=(BBS_MAIN)/LIBRARY
  1170. $ CALL UNPACK [.UTILITY]COMPILE.COM;11 492907203
  1171. $ create 'f'
  1172. X$SET NOVERIFY
  1173. X$ DEFINE UBBS_DATA DISK$USER:`5BUALR_BBS.DATA`5D
  1174. X$ DEFINE UBBS_FILES DUA10:`5BBBS_FILES.`5D
  1175. X$ SET DEFAULT DISK$USER:`5BBBS`5D
  1176. X$ IF F$SEARCH("UBBS_DATA:TO_RESTORE.DAT") .EQS. "" THEN EXIT
  1177. X$ RENAME UBBS_DATA:TO_RESTORE.DAT `5B`5DTO_RESTORE.DAT
  1178. X$ APPEND TO_RESTORE.DAT;0 RESTORED.DAT
  1179. X$ SORT/NODUPLICATES TO_RESTORE.DAT TO_RESTORE.DAT
  1180. X$ FILES == F$LOGICAL("UBBS_FILES")
  1181. X$ FF = F$EXTRACT(F$LOCATE(":",FILES)+1,999,FILES)
  1182. X$ SHO SYM FF
  1183. X$ FF = F$EXTRACT(0,F$LENGTH(FF)-1,FF)
  1184. X$ DISK = F$EXTRACT(0,F$LOCATE(":",FILES)+1,FILES)
  1185. X$ OPEN/READ INFILE TO_RESTORE.DAT
  1186. X$ OPEN/WRITE OUTFILE FILELIST.DAT
  1187. X$ IBM = 0
  1188. X$ PCS = 0
  1189. X$ AOTHER = 0
  1190. X$ OTHER = 0
  1191. X$ LOOP:
  1192. X$ READ/END=EOF_INPUT INFILE INREC
  1193. X$ TYPE = F$EXTRACT(1,3,INREC)
  1194. X$ IF TYPE .EQS. "IBM" THEN IBM=IBM+1
  1195. X$ IF TYPE .EQS. "PCS" THEN PCS=PCS+1
  1196. X$ IF F$EXTRACT(0,1,TYPE) .EQS. "A" THEN AOTHER = AOTHER + 1
  1197. X$ IF (TYPE .NES. "IBM") .AND. (TYPE .NES. "PCS") .AND. -
  1198. X    (F$EXTRACT(0,1,TYPE) .NES. "A") THEN OTHER = OTHER+1
  1199. X$ INREC = FF+F$EXTRACT(1,F$LOCATE(" ",INREC)-1,INREC)
  1200. X$ WRITE OUTFILE INREC
  1201. X$ GOTO LOOP
  1202. X$ EOF_INPUT:
  1203. X$ CLOSE INFILE
  1204. X$ CLOSE OUTFILE
  1205. X$!
  1206. X$!`09PROCESS EACH OF THE 3 TAPES
  1207. X$!
  1208. X$ WRITE SYS$OUTPUT IBM," IBM FILES"
  1209. X$ WRITE SYS$OUTPUT PCS," PCS FILES"
  1210. X$ WRITE SYS$OUTPUT AOTHER," A-OTHER FILES"
  1211. X$ WRITE SYS$OUTPUT OTHER," OTHER FILES"
  1212. X$ SET VERIFY
  1213. X$ALOCWAIT MF TAPE_DRIVE
  1214. X$ IF IBM .EQ. 0 THEN GOTO NOIBM
  1215. X$!
  1216. X$FINDTAPE UBBS_IBM
  1217. X$MOUNT/BLOCK=32766/COMMENT="READ ONLY" TAPE_DRIVE 'TAPE'
  1218. X$RDBACK/LOG TAPE_DRIVE:IBM.BCK DISK$TEMP:`5BUALR_BBS`5DIBM.BCK FILELIST.DAT
  1219. X$ ON ERROR THEN CONTINUE
  1220. X$BACKUP DISK$TEMP:`5BUALR_BBS`5DIBM.BCK/SAVE_SET 'DISK'`5B*...`5D*.*;*/OWNER
  1221. V=ORIG
  1222. X$DISMOUNT TAPE_DRIVE
  1223. X$!
  1224. X$NOIBM:
  1225. X$!
  1226. X$IF PCS .EQ. 0 THEN GOTO NOPCS
  1227. X$FINDTAPE/gen=99 UBBS_PCS
  1228. X$MOUNT/BLOCK=32766/COMMENT="READ ONLY" TAPE_DRIVE 'TAPE'
  1229. X$RDBACK/LOG TAPE_DRIVE:PCS.BCK DISK$TEMP:`5BUALR_BBS`5DPCS.BCK FILELIST.DAT
  1230. X$ ON ERROR THEN CONTINUE
  1231. X$BACKUP DISK$TEMP:`5BUALR_BBS`5DPCS.BCK/SAVE_SET 'DISK'`5B*...`5D*.*;*/OWNER
  1232. V=ORIG
  1233. X$DISMOUNT TAPE_DRIVE
  1234. X$!
  1235. X$NOPCS:
  1236. X$IF AOTHER .EQ. 0 THEN GOTO NOAOTHER
  1237. X$FINDTAPE/gen=99 UBBS_AFILES
  1238. X$MOUNT/BLOCK=32766/COMMENT="READ ONLY" TAPE_DRIVE 'TAPE'
  1239. X$!
  1240. X$RDBACK/LOG TAPE_DRIVE:AMI.BCK DISK$TEMP:`5BUALR_BBS`5DAMI.BCK FILELIST.DAT
  1241. X$RDBACK/LOG TAPE_DRIVE:APP.BCK DISK$TEMP:`5BUALR_BBS`5DAPP.BCK FILELIST.DAT
  1242. X$RDBACK/LOG TAPE_DRIVE:AST.BCK DISK$TEMP:`5BUALR_BBS`5DAST.BCK FILELIST.DAT
  1243. X$RDBACK/LOG TAPE_DRIVE:ATA.BCK DISK$TEMP:`5BUALR_BBS`5DATA.BCK FILELIST.DAT
  1244. X$!
  1245. X$DISMOUNT TAPE_DRIVE
  1246. X$!
  1247. X$ ON ERROR THEN CONTINUE
  1248. X$BACKUP DISK$TEMP:`5BUALR_BBS`5DAMI.BCK/SAVE_SET 'DISK'`5B*...`5D*.*;*/OWNER
  1249. V=ORIG
  1250. X$ ON ERROR THEN CONTINUE
  1251. X$BACKUP DISK$TEMP:`5BUALR_BBS`5DAPP.BCK/SAVE_SET 'DISK'`5B*...`5D*.*;*/OWNER
  1252. V=ORIG
  1253. X$ ON ERROR THEN CONTINUE
  1254. X$BACKUP DISK$TEMP:`5BUALR_BBS`5DAST.BCK/SAVE_SET 'DISK'`5B*...`5D*.*;*/OWNER
  1255. V=ORIG
  1256. X$ ON ERROR THEN CONTINUE
  1257. X$BACKUP DISK$TEMP:`5BUALR_BBS`5DATA.BCK/SAVE_SET 'DISK'`5B*...`5D*.*;*/OWNER
  1258. V=ORIG
  1259. X$!
  1260. X$NOAOTHER:
  1261. X$IF OTHER .EQ. 0 THEN GOTO NOOTHER
  1262. X$FINDTAPE UBBS_FILES
  1263. X$MOUNT/BLOCK=32766/COMMENT="READ ONLY" TAPE_DRIVE 'TAPE'
  1264. X$!
  1265. X$RDBACK/LOG TAPE_DRIVE:100.BCK DISK$TEMP:`5BUALR_BBS`5D100.BCK FILELIST.DAT
  1266. X$RDBACK/LOG TAPE_DRIVE:128.BCK DISK$TEMP:`5BUALR_BBS`5D128.BCK FILELIST.DAT
  1267. X$RDBACK/LOG TAPE_DRIVE:COM.BCK DISK$TEMP:`5BUALR_BBS`5DCOM.BCK FILELIST.DAT
  1268. X$RDBACK/LOG TAPE_DRIVE:CPM.BCK DISK$TEMP:`5BUALR_BBS`5DCPM.BCK FILELIST.DAT
  1269. X$RDBACK/LOG TAPE_DRIVE:MAC.BCK DISK$TEMP:`5BUALR_BBS`5DMAC.BCK FILELIST.DAT
  1270. X$RDBACK/LOG TAPE_DRIVE:MIS.BCK DISK$TEMP:`5BUALR_BBS`5DMIS.BCK FILELIST.DAT
  1271. X$RDBACK/LOG TAPE_DRIVE:TRS.BCK DISK$TEMP:`5BUALR_BBS`5DTRS.BCK FILELIST.DAT
  1272. X$!
  1273. X$DISMOUNT TAPE_DRIVE
  1274. X$!
  1275. X$ ON ERROR THEN CONTINUE
  1276. X$BACKUP DISK$TEMP:`5BUALR_BBS`5D100.BCK/SAVE_SET 'DISK'`5B*...`5D*.*;*/OWNER
  1277. V=ORIG
  1278. X$ ON ERROR THEN CONTINUE
  1279. X$BACKUP DISK$TEMP:`5BUALR_BBS`5D128.BCK/SAVE_SET 'DISK'`5B*...`5D*.*;*/OWNER
  1280. V=ORIG
  1281. X$ ON ERROR THEN CONTINUE
  1282. X$BACKUP DISK$TEMP:`5BUALR_BBS`5DCOM.BCK/SAVE_SET 'DISK'`5B*...`5D*.*;*/OWNER
  1283. V=ORIG
  1284. X$ ON ERROR THEN CONTINUE
  1285. X$BACKUP DISK$TEMP:`5BUALR_BBS`5DCPM.BCK/SAVE_SET 'DISK'`5B*...`5D*.*;*/OWNER
  1286. V=ORIG
  1287. X$ ON ERROR THEN CONTINUE
  1288. X$BACKUP DISK$TEMP:`5BUALR_BBS`5DMAC.BCK/SAVE_SET 'DISK'`5B*...`5D*.*;*/OWNER
  1289. V=ORIG
  1290. X$ ON ERROR THEN CONTINUE
  1291. X$BACKUP DISK$TEMP:`5BUALR_BBS`5DMIS.BCK/SAVE_SET 'DISK'`5B*...`5D*.*;*/OWNER
  1292. V=ORIG
  1293. X$ ON ERROR THEN CONTINUE
  1294. X$BACKUP DISK$TEMP:`5BUALR_BBS`5DTRS.BCK/SAVE_SET 'DISK'`5B*...`5D*.*;*/OWNER
  1295. V=ORIG
  1296. X$!
  1297. X$NOOTHER:
  1298. X$DEALLOCATE TAPE_DRIVE
  1299. X$EXIT
  1300. $ CALL UNPACK [.UTILITY]DAILY_RESTORE.COM;2 1700535198
  1301. $ create 'f'
  1302. X`09program INIT_IDX
  1303. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  1304. Vcccc
  1305. Xc
  1306. Xc`09UBBS utilities  -  INIT_IDX
  1307. Xc`09This routine will initialize the FILES.IDX file for a download area.
  1308. Xc`09Dale Miller - UALR
  1309. Xc
  1310. Xc
  1311. Xc`09Rev. 4.3  01-Aug-1986
  1312. Xc
  1313. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  1314. Vcccc
  1315. X`09implicit none
  1316. X`09include 'bbs_inc.for'
  1317. X`09integer istat
  1318. X`09integer sys$gettim
  1319. X
  1320. X`09record/file_description/ fd
  1321. X
  1322. Xc`09Open the new indexed file.
  1323. X`09open(unit=4,`09`09shared,
  1324. X`091   file='files.idx',
  1325. X`092   status='new',`09organization='indexed',
  1326. X`093   access='keyed',`09form='unformatted',
  1327. X`094   recl=192,`09`09recordtype='variable',
  1328. X`095`09`09`09key=(1:18:character))
  1329. X
  1330. X
  1331. X`09fd.file_name='$Header'
  1332. X`09istat=sys$gettim(fd.upload_date)
  1333. X`09fd.upload_name=' '
  1334. X`09fd.upload_text=' '
  1335. X`09fd.keywords=' '
  1336. X`09write(4)fd
  1337. X`09close(4)
  1338. X`09end
  1339. $ CALL UNPACK [.UTILITY]INIT_IDX.FOR;2 457599999
  1340. $ create 'f'
  1341. X`09Program init_mess
  1342. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  1343. Vcccc
  1344. Xc
  1345. Xc`09UBBS utilities - Init_mess.for
  1346. Xc`09This program initializes the message file for creating UBBS.
  1347. Xc`09Dale Miller - UALR
  1348. Xc`0914-Nov-1985
  1349. Xc
  1350. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  1351. Vcccc
  1352. X`09implicit none
  1353. X`09character*80 spaces/' '/
  1354. X`09integer i
  1355. X`09include 'bbs_inc.for'
  1356. X`09
  1357. X`09record/mail_header_structure/ mh
  1358. X
  1359. X`09open(unit=2,file='message.hed',status='new',
  1360. X`091   organization='relative',access='direct',
  1361. X`092   recordtype='fixed',recl=48)
  1362. X
  1363. X`09open(unit=3,file='message.dat',status='new',`09
  1364. X`091   organization='relative',access='direct',
  1365. X`092   recordtype='fixed',recl=20)
  1366. X
  1367. Xc`09write the first record in the message header file
  1368. X`09last_header=1
  1369. X`09last_data=0
  1370. X`09first_mnum=0
  1371. X`09last_mnum=0
  1372. X`09write(2,rec=1)last_header,last_data,first_mnum,last_mnum
  1373. X
  1374. Xc`09write the rest of the records
  1375. X`09mh.mail_to=' '
  1376. X`09mh.mail_from=' '
  1377. X`09mh.mail_subject=' '
  1378. X`09mh.mail_date=' '
  1379. X`09mh.mail_time=' '
  1380. X`09mh.mail_section=0
  1381. X`09mh.mail_first=0
  1382. X`09mh.mail_last=0
  1383. X`09mh.mail_messnum=99999999
  1384. X`09mh.mail_private=.false.
  1385. X`09mh.mail_read=.false.
  1386. X`09mh.mail_deleted=.true.
  1387. X`09mh.mail_person=.false.
  1388. X`09mh.mail_reply_to=0
  1389. X`09do i=1,10
  1390. X`09    mh.mail_replys(i)=0
  1391. X`09    end do
  1392. X
  1393. X`09do i=2,1000
  1394. X`09    write(2,rec=i)mh
  1395. X`09    end do
  1396. X
  1397. X`09do i=1,5000
  1398. X`09    write(3,rec=i)spaces
  1399. X`09    end do
  1400. X
  1401. X`09print*,'The message files have been initialized.'
  1402. X`09stop
  1403. X`09end
  1404. $ CALL UNPACK [.UTILITY]INIT_MESS.FOR;2 241912306
  1405. $ create 'f'
  1406. X`09Program init_userlog
  1407. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  1408. Vcccc
  1409. Xc
  1410. Xc`09This program initializes the userlog.
  1411. Xc
  1412. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  1413. Vcccc
  1414. X
  1415. X`09character*40 zeros/'0000000000000000000000000000000000000000'/
  1416. X`09character*9 bull_date/'01-Jan-00'/
  1417. X`09integer*4 high_bull/0/
  1418. X`09integer*4 user_number/0/
  1419. X
  1420. X`09open(unit=1,file='userlog.dat',status='new',
  1421. X`091   organization='indexed',access='keyed',
  1422. X`092   recordtype='fixed',recl=50,shared,
  1423. X`093   key=(1:40:character))
  1424. X`09
  1425. X`09write(1)zeros,user_number,high_bull,
  1426. X`091    bull_date
  1427. X`09close(unit=1)
  1428. X`09print*,'The USERLOG.DAT file has been initialized.'
  1429. X`09stop
  1430. X`09end
  1431. $ CALL UNPACK [.UTILITY]INIT_USERLOG.FOR;2 492970626
  1432. $ create 'f'
  1433. X$ mcr install
  1434. Xubbs/delete
  1435. Xubbs/open/shared/header/priv=(detach,world,oper,sysnam,prmmbx,altpri)
  1436. X/exit
  1437. X$ deassign/system UBBS_STATUS
  1438. $ CALL UNPACK [.UTILITY]INSTBBS.COM;2 778393947
  1439. $ create 'f'
  1440. X$ link/notrace/EXEC=BBS UBBS/INCLUDE=(BBS_MAIN)/LIBRARY
  1441. X$ link/exec=sysop ubbs/include=(sysop)/library
  1442. $ CALL UNPACK [.UTILITY]L.COM;2 2136229065
  1443. $ create 'f'
  1444. X$ link/EXEC=BBS UBBS/INCLUDE=(BBS_MAIN)/LIBRARY
  1445. X$ link/exec=sysop ubbs/include=(sysop)/library
  1446. $ CALL UNPACK [.UTILITY]LT.COM;2 1879659445
  1447. $ create 'f'
  1448. X*DOMILLER* * * T E @`5BUALR_BBS`5DSYSOP_REPLY.COM
  1449. X*DOMILLER* * * T Q
  1450. X* * * A F DOMILLER
  1451. X* * * A Q
  1452. $ CALL UNPACK [.UTILITY]MAIL.DELIVERY;3 1211850481
  1453. $ create 'f'
  1454. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  1455. Vcccc
  1456. Xc
  1457. Xc`09This program allows adding a message to UBBS from a file.
  1458. Xc
  1459. Xc`09Begun: 19-Jul-1985
  1460. Xc`09Dale Miller - University of Arkansas at Little Rock
  1461. Xc`09Rev. 1.0  01-Jan-1988
  1462. Xc
  1463. Xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  1464. Vcccc
  1465. X`09implicit none
  1466. X`09include 'bbs_inc.for/nolist'
  1467. X`09character last_name*20,first_name*20
  1468. X`09character zmail_from*30
  1469. X`09character zfirst_name*20,zlast_name*20,zmail_to*30,qmail_to*30
  1470. X`09character zmail_subject*30
  1471. X`09integer i,j,k,l,ii,jj,kk,ll
  1472. X`09integer kmess,irec,krec,slen,num_flags
  1473. X`09integer status,next_mess,fmess,lmess,mess,mnum
  1474. X`09logical*1 busy
  1475. X
  1476. X`09external uopen
  1477. X
  1478. X`09record /userlog_structure/ zur
  1479. X`09record /mail_header_structure/ mh
  1480. X
  1481. Xc
  1482. X
  1483. X 1001`09format(a)
  1484. X 1002`09format(i1)
  1485. Xc`09open the userlog and message files
  1486. X`09open(unit=1,file='ubbs_data:userlog.dat',status='old',`09
  1487. X`091   organization='indexed',access='keyed',
  1488. X`092   recordtype='fixed',recl=50,shared,useropen=uopen)
  1489. X`09open(unit=2,file='ubbs_data:message.hed',status='old',`09
  1490. X`091   organization='relative',access='direct',
  1491. X`092   recordtype='fixed',recl=48,shared,useropen=uopen)
  1492. X`09open(unit=3,file='ubbs_data:message.dat',status='old',`09
  1493. X`091   organization='relative',access='direct',
  1494. X`092   recordtype='fixed',recl=20,shared,useropen=uopen)
  1495. X
  1496. X
  1497. Xc`09Read a message from MAIL_FILE, and add it to the message section.
  1498. Xc`09The first line is the FROM: name.
  1499. Xc`09The second line is the TO: name
  1500. Xc`09The third line is the section number
  1501. Xc`09The fourth line is the SUBJECT: line
  1502. Xc`09Remaining lines are the message
  1503. X`09open(unit=4,file='mail_file',status='old',carriagecontrol='none')
  1504. X
  1505. X`09read(4,1001)mail_name
  1506. X`09read(4,1001)zmail_to
  1507. X`09read(4,1002)mh.mail_section
  1508. X`09read(4,1001)mh.mail_subject
  1509. X
  1510. X`09mh.mail_private=.true.
  1511. X`09mh.mail_person=.true.
  1512. X
  1513. X
  1514. X`09do i=1,20
  1515. X`09    read(4,1001,end=3090)message(i)
  1516. X`09    ii=i
  1517. X`09    end do
  1518. X
  1519. X
  1520. X3090`09read(2,rec=1)last_header,last_data,
  1521. X`091   first_mnum,last_mnum,busy
  1522. X`09if(busy) then
  1523. X`09    unlock(unit=2)
  1524. X`09     call lib$wait(1.0)
  1525. X`09    go to 3090
  1526. X`09    end if
  1527. X
  1528. X`09last_header=last_header+1
  1529. X`09last_mnum=last_mnum+1
  1530. X`09write(2,rec=1)last_header,last_data+ii,
  1531. X`091   first_mnum,last_mnum,busy
  1532. X`09call date(mh.mail_date)
  1533. X`09call time(mh.mail_time)
  1534. X`09mh.mail_read=.false.
  1535. X`09mh.mail_deleted=.false.
  1536. X`09mh.mail_to=zmail_to
  1537. X`09mh.mail_reply_to=0
  1538. X`09do i=1,10
  1539. X`09    mh.mail_replys(i)=0
  1540. X`09    end do
  1541. X`09mh.mail_first=last_data+1
  1542. X`09mh.mail_last=last_data+ii
  1543. X`09mh.mail_from=mail_name
  1544. X`09mh.mail_messnum=last_mnum
  1545. X`09write(2,rec=last_header) mh
  1546. X
  1547. X`09do jj=1,ii
  1548. X`09    write(3,rec=last_data+jj)message(jj)
  1549. X`09    end do
  1550. X
  1551. X`09call str$upcase(zmail_to,zmail_to)
  1552. X`09jj = index(zmail_to,' ')
  1553. X`09zfirst_name=zmail_to(1:jj-1)`09
  1554. X`09zlast_name=zmail_to(jj+1:30)
  1555. X`09zur.user_key=zlast_name//zfirst_name
  1556. X`09
  1557. X`09read(1,key=zur.user_key)zur
  1558. X`09zur.num_unread=zur.num_unread+1
  1559. X`09rewrite(1)zur
  1560. X
  1561. X`09close(unit=1)
  1562. X`09close(unit=2)
  1563. X`09close(unit=3)
  1564. X`09close(unit=4)
  1565. X`09call exit
  1566. X`09end
  1567. X
  1568. $ CALL UNPACK [.UTILITY]MESSAGE.FOR;1 841550426
  1569. $ create 'f'
  1570. X`09`09`09UBBS file approval/editor.`09`0901-Jan-1988
  1571. X----------------------------------------------------------------------------
  1572. V----
  1573. XEnter ABC.XYZ in response to filename to download in order to access approva
  1574. Vl
  1575. Xsection.  Functions supported in file approval:
  1576. X
  1577. X`5BA`5Dpprove   `5BD`5Delete   `5BE`5Ddit   `5BM`5Dove  `5BR`5Dename   `5BW`
  1578. V5Drite   e`5BX`5Dit   <CR>
  1579. X
  1580. X1. Hit return to see the next file without altering the current one.
  1581. X2. Use `5BE`5Ddit for changing information in file description header.
  1582. X   After editing a description, it must be `5BW`5Dritten.
  1583. X3. To download an unapproved file, just download as usual.  The files are th
  1584. Vere,
  1585. X   although, they just don't show up in the general user's file listing unti
  1586. Vl
  1587. X   approved.
  1588. X4. To add a file to the listing, approve it then `5BW`5Drite it.
  1589. X5. `5BR`5Dename changes the name of the file, `5BM`5Dove will move it to ano
  1590. Vther
  1591. X   section but retain the file name.
  1592. X----------------------------------------------------------------------------
  1593. V----
  1594. X
  1595. XExample session:
  1596. X
  1597. XLast logon on 24-JUL-86 at 11:11:08
  1598. XYou have signed on   737 times.
  1599. XThe last message you read was 110415
  1600. X      Current last message is 110427
  1601. X          You are user number  94404
  1602. X
  1603. XThere are   6 bulletins today.  Last bulletin was 23-Jul-1986
  1604. X11:19:44-05 Command (B,C,E,F,G,H,K,M,P,R,S,U,W,X,?)?F`0D
  1605. X(D)ownload, (U)pload, (H)elp or (E)xit? `5Bexit`5D D`0D
  1606. XArea? AMI`0D
  1607. +-+-+-+-+-+-+-+-  END  OF PART 10 +-+-+-+-+-+-+-+-
  1608.