From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 24-MAY-1991 16:47:20.01
To:	ARISIA::EVERHART
CC:	
Subj:	was Problem with VMSMAIL_PROFILE.DATA - now mail_edit 3/4

From:	RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP@CRDGW2
To:	Everhart@Arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.97)
	 id AA09300; Fri, 24 May 91 11:27:19 EDT
Message-Id:  <9105241527.AA09300@crdgw1.ge.com>
Received: From SCFB.NWC.NAVY.MIL by CRVAX.SRI.COM with TCP; Thu, 23 MAY 91 16:28:22 PDT
Date: 23 May 91 13:04:00 PDT
From: "351M::LEVINE" <levine%351m.decnet@scfb.nwc.navy.mil>
Subject: was Problem with VMSMAIL_PROFILE.DATA - now mail_edit 3/4
To: "info-vax" <info-vax@kl.sri.com>

-+-+-+-+-+-+-+-+ START OF PART 3 -+-+-+-+-+-+-+-+
X`09prompt.length=strlen(prompt.address);
X`09result.type=0;
X`09result.address= &name`5B0`5D;
X`09result.length=255;
X`09confirm.type=0;
X`09confirm.address= &"Confirm change (Y/N) `5BN`5D :";
X`09confirm.length=strlen(confirm.address);
X
X`09status=smg$set_cursor_abs(&banner_id,&20,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_string(&keyboard_id,&result,&prompt,&255,0,0,0,&r_len
X`09`09,0,&banner_id);
X`09if((status&1)==0)exit(status);
X`09status=smg$put_chars(&banner_id,&confirm,&21,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_keystroke(&keyboard_id,&terminator);
X`09if((status&1)==0)exit(status);
X`09if((terminator!=SMG$K_TRM_UPPERCASE_Y)&
X`09`09(terminator!=SMG$K_TRM_LOWERCASE_Y))return;
X`09memset(&temp_list->personal_name`5B0`5D,0,255);
X`09if(r_len==0)
X`09`7B`09set_list`5B1`5D.item_code=MAIL$_USER_SET_NO_PERSONAL_NAME;
X`09`7D
X`09else
X`09`7B`09if(r_len>255)r_len=255;
X`09`09strncpy(&temp_list->personal_name,&name,r_len);
X`09`09set_list`5B1`5D.item_code=MAIL$_USER_SET_PERSONAL_NAME;
X`09`09set_list`5B1`5D.buffer_length=r_len;
X`09`09set_list`5B1`5D.buffer= &name;
X`09`7D
X`09status=mail$user_set_info(&context,set_list,&get_list);
X`09if((status&1)==0)exit(status);
X`7D
Xvoid update_message_count(struct userlist *temp_list,struct itmlst *set_list
V)
X`7B`09char name`5B255`5D;
X`09unsigned short r_len,count;
X`09struct s_descripter result,prompt,confirm;
X`09short terminator;
X`09long status;
X`09struct itmlst get_list;
X
X`09memset(&get_list,0,sizeof(struct itmlst));
X`09prompt.type=0;
X`09prompt.address= &"Enter new message count :";
X`09prompt.length=strlen(prompt.address);
X`09result.type=0;
X`09result.address= &name`5B0`5D;
X`09result.length=255;
X`09confirm.type=0;
X`09confirm.address= &"Confirm change (Y/N) `5BN`5D :";
X`09confirm.length=strlen(confirm.address);
X`09memset(&name,0,255);
X
X`09status=smg$set_cursor_abs(&banner_id,&20,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_string(&keyboard_id,&result,&prompt,&254,0,0,0,&r_len
X`09`09,0,&banner_id);
X`09if((status&1)==0)exit(status);
X`09status=smg$put_chars(&banner_id,&confirm,&21,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_keystroke(&keyboard_id,&terminator);
X`09if((status&1)==0)exit(status);
X`09if((terminator!=SMG$K_TRM_UPPERCASE_Y)&
X`09`09(terminator!=SMG$K_TRM_LOWERCASE_Y))return;
X
X`09set_list`5B1`5D.item_code=MAIL$_USER_SET_NEW_MESSAGES;
X`09set_list`5B1`5D.buffer_length=2;
X`09set_list`5B1`5D.buffer= &count;
X`09if(r_len==0)
X`09`7B`09count=0;
X`09`7D
X`09else
X`09`7B`09if(r_len>255)r_len=255;
X`09`09count=atoi(&name);
X`09`7D
X`09temp_list->new_messages=count;
X`09status=mail$user_set_info(&context,set_list,&get_list);
X`09if((status&1)==0)exit(status);
X`7D
Xvoid update_mail_dir(struct userlist *temp_list,struct itmlst *set_list)
X`7B`09char name`5B255`5D;
X`09unsigned short r_len;
X`09struct s_descripter result,prompt,confirm,warning;
X`09struct itmlst get_list`5B3`5D,dum_list,name_list`5B2`5D;
X`09short terminator;
X`09long status;
X
X`09memset(&get_list,0,3*sizeof(struct itmlst));
X`09memset(&dum_list,0,sizeof(struct itmlst));
X`09memset(&name_list,0,2*sizeof(struct itmlst));
X`09prompt.type=0;
X`09prompt.address= &"Enter new subdirectory name :";
X`09prompt.length=strlen(prompt.address);
X`09result.type=0;
X`09result.address= &name`5B0`5D;
X`09result.length=255;
X`09confirm.type=0;
X`09confirm.address= &"Confirm change (Y/N) `5BN`5D :";
X`09confirm.length=strlen(confirm.address);
X`09warning.type=0;
X`09warning.address=`20
X&"Mail files not moved-only entry is changed. No syntax checking is made.";
X`09warning.length=strlen(warning.address);
X
X`09status=smg$put_chars(&banner_id,&warning,&19,&1,0,&SMG$M_BLINK);
X`09if((status&1)==0)exit(status);
X`09smg$ring_bell(&banner_id);
X`09status=smg$set_cursor_abs(&banner_id,&20,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_string(&keyboard_id,&result,&prompt,&255,0,0,0,&r_len
X`09`09,0,&banner_id);
X`09if((status&1)==0)exit(status);
X`09status=smg$put_chars(&banner_id,&confirm,&21,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_keystroke(&keyboard_id,&terminator);
X`09if((status&1)==0)exit(status);
X`09if((terminator!=SMG$K_TRM_UPPERCASE_Y)&
X`09`09(terminator!=SMG$K_TRM_LOWERCASE_Y))return;
X`09memset(&temp_list->subdirectory`5B0`5D,0,255);
X`09memset(&temp_list->directory`5B0`5D,0,255);
X`09if(r_len==0)
X`09`7B`09set_list`5B1`5D.item_code=MAIL$_USER_SET_NO_SUB_DIRECTORY;
X`09`7D
X`09else
X`09`7B`09if(r_len>255)r_len=255;
X`09`09set_list`5B1`5D.item_code=MAIL$_USER_SET_SUB_DIRECTORY;
X`09`09set_list`5B1`5D.buffer_length=r_len;
X`09`09set_list`5B1`5D.buffer= &name;
X`09`7D
X`09status=mail$user_set_info(&context,set_list,&dum_list);
X`09if((status&1)==0)exit(status);
X`09get_list`5B0`5D.item_code=MAIL$_USER_FULL_DIRECTORY;
X`09get_list`5B0`5D.buffer_length=255;
X`09get_list`5B0`5D.buffer= &temp_list->directory;
X`09get_list`5B1`5D.item_code=MAIL$_USER_SUB_DIRECTORY;
X`09get_list`5B1`5D.buffer_length=255;
X`09get_list`5B1`5D.buffer= &temp_list->subdirectory;
X`09name_list`5B0`5D.item_code=MAIL$_USER_USERNAME;
X`09name_list`5B0`5D.buffer= &temp_list->username;
X`09name_list`5B0`5D.buffer_length=strlen(name_list`5B0`5D.buffer);
X`09status=mail$user_get_info(&context,&name_list,&get_list);
X`09if((status&1)==0)exit(status);
X`7D
Xvoid update_forward(struct userlist *temp_list,struct itmlst *set_list)
X`7B`09char name`5B255`5D;
X`09unsigned short r_len;
X`09struct s_descripter result,prompt,confirm,warning;
X`09struct itmlst get_list;
X`09short terminator;
X`09long status;
X
X`09memset(&get_list,0,sizeof(struct itmlst));
X`09prompt.type=0;
X`09prompt.address= &"Enter new forwarding address :";
X`09prompt.length=strlen(prompt.address);
X`09result.type=0;
X`09result.address= &name`5B0`5D;
X`09result.length=255;
X`09confirm.type=0;
X`09confirm.address= &"Confirm change (Y/N) `5BN`5D :";
X`09confirm.length=strlen(confirm.address);
X`09warning.type=0;
X`09warning.address= &"No syntax checking of forwarding address is made.";
X`09warning.length=strlen(warning.address);
X
X`09status=smg$put_chars(&banner_id,&warning,&19,&1,0,&SMG$M_BLINK);
X`09if((status&1)==0)exit(status);
X`09smg$ring_bell(&banner_id);
X`09status=smg$set_cursor_abs(&banner_id,&20,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_string(&keyboard_id,&result,&prompt,&255,0,0,0,&r_len
X`09`09,0,&banner_id);
X`09if((status&1)==0)exit(status);
X`09status=smg$put_chars(&banner_id,&confirm,&21,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_keystroke(&keyboard_id,&terminator);
X`09if((status&1)==0)exit(status);
X`09if((terminator!=SMG$K_TRM_UPPERCASE_Y)&
X`09`09(terminator!=SMG$K_TRM_LOWERCASE_Y))return;
X`09memset(&temp_list->forwarding`5B0`5D,0,255);
X`09if(r_len==0)
X`09`7B`09set_list`5B1`5D.item_code=MAIL$_USER_SET_NO_FORWARDING;
X`09`7D
X`09else
X`09`7B`09if(r_len>255)r_len=255;
X`09`09strncpy(&temp_list->forwarding,&name,r_len);
X`09`09set_list`5B1`5D.item_code=MAIL$_USER_SET_FORWARDING;
X`09`09set_list`5B1`5D.buffer_length=r_len;
X`09`09set_list`5B1`5D.buffer= &name;
X`09`7D
X`09status=mail$user_set_info(&context,set_list,&get_list);
X`09if((status&1)==0)exit(status);
X`7D
Xvoid update_edit(struct userlist *temp_list,struct itmlst *set_list)
X`7B`09char name`5B255`5D;
X`09unsigned short r_len;
X`09struct s_descripter result,prompt,confirm,warning;
X`09struct itmlst get_list;
X`09short terminator;
X`09long status;
X
X`09memset(&get_list,0,sizeof(struct itmlst));
X`09prompt.type=0;
X`09prompt.address= &"Enter new default editor :";
X`09prompt.length=strlen(prompt.address);
X`09result.type=0;
X`09result.address= &name`5B0`5D;
X`09result.length=255;
X`09confirm.type=0;
X`09confirm.address= &"Confirm change (Y/N) `5BN`5D :";
X`09confirm.length=strlen(confirm.address);
X`09warning.type=0;
X`09warning.address=`20
X`09&"No syntax or validity checking of default editor is made.";
X`09warning.length=strlen(warning.address);
X
X`09status=smg$put_chars(&banner_id,&warning,&19,&1,0,&SMG$M_BLINK);
X`09if((status&1)==0)exit(status);
X`09smg$ring_bell(&banner_id);
X`09status=smg$set_cursor_abs(&banner_id,&20,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_string(&keyboard_id,&result,&prompt,&255,0,0,0,&r_len
X`09`09,0,&banner_id);
X`09if((status&1)==0)exit(status);
X`09status=smg$put_chars(&banner_id,&confirm,&21,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_keystroke(&keyboard_id,&terminator);
X`09if((status&1)==0)exit(status);
X`09if((terminator!=SMG$K_TRM_UPPERCASE_Y)&
X`09`09(terminator!=SMG$K_TRM_LOWERCASE_Y))return;
X`09memset(&temp_list->editor`5B0`5D,0,255);
X`09if(r_len==0)
X`09`7B`09set_list`5B1`5D.item_code=MAIL$_USER_SET_NO_EDITOR;
X`09`7D
X`09else
X`09`7B`09if(r_len>255)r_len=255;
X`09`09strncpy(&temp_list->editor,&name,r_len);
X`09`09set_list`5B1`5D.item_code=MAIL$_USER_SET_EDITOR;
X`09`09set_list`5B1`5D.buffer_length=r_len;
X`09`09set_list`5B1`5D.buffer= &name;
X`09`7D
X`09status=mail$user_set_info(&context,set_list,&get_list);
X`09if((status&1)==0)exit(status);
X`7D
Xvoid update_queue(struct userlist *temp_list,struct itmlst *set_list)
X`7B`09char name`5B255`5D;
X`09unsigned short r_len;
X`09struct s_descripter result,prompt,confirm,warning;
X`09struct itmlst get_list;
X`09short terminator;
X`09long status;
X
X`09memset(&get_list,0,sizeof(struct itmlst));
X`09prompt.type=0;
X`09prompt.address= &"Enter new default print queue :";
X`09prompt.length=strlen(prompt.address);
X`09result.type=0;
X`09result.address= &name`5B0`5D;
X`09result.length=255;
X`09confirm.type=0;
X`09confirm.address= &"Confirm change (Y/N) `5BN`5D :";
X`09confirm.length=strlen(confirm.address);
X`09warning.type=0;
X`09warning.address=`20
X`09&"No syntax or validity checking of default print queue is made.";
X`09warning.length=strlen(warning.address);
X
X`09status=smg$put_chars(&banner_id,&warning,&19,&1,0,&SMG$M_BLINK);
X`09if((status&1)==0)exit(status);
X`09smg$ring_bell(&banner_id);
X`09status=smg$set_cursor_abs(&banner_id,&20,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_string(&keyboard_id,&result,&prompt,&255,0,0,0,&r_len
X`09`09,0,&banner_id);
X`09if((status&1)==0)exit(status);
X`09status=smg$put_chars(&banner_id,&confirm,&21,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_keystroke(&keyboard_id,&terminator);
X`09if((status&1)==0)exit(status);
X`09if((terminator!=SMG$K_TRM_UPPERCASE_Y)&
X`09`09(terminator!=SMG$K_TRM_LOWERCASE_Y))return;
X`09memset(&temp_list->queue`5B0`5D,0,255);
X`09if(r_len==0)
X`09`7B`09set_list`5B1`5D.item_code=MAIL$_USER_SET_NO_QUEUE;
X`09`7D
X`09else
X`09`7B`09if(r_len>255)r_len=255;
X`09`09strncpy(&temp_list->queue,&name,r_len);
X`09`09set_list`5B1`5D.item_code=MAIL$_USER_SET_QUEUE;
X`09`09set_list`5B1`5D.buffer_length=r_len;
X`09`09set_list`5B1`5D.buffer= &name;
X`09`7D
X`09status=mail$user_set_info(&context,set_list,&get_list);
X`09if((status&1)==0)exit(status);
X`7D
Xvoid update_form(struct userlist *temp_list,struct itmlst *set_list)
X`7B`09char name`5B255`5D;
X`09unsigned short r_len;
X`09struct s_descripter result,prompt,confirm,warning;
X`09struct itmlst get_list;
X`09short terminator;
X`09long status;
X
X`09memset(&get_list,0,sizeof(struct itmlst));
X`09prompt.type=0;
X`09prompt.address= &"Enter new printer form :";
X`09prompt.length=strlen(prompt.address);
X`09result.type=0;
X`09result.address= &name`5B0`5D;
X`09result.length=255;
X`09confirm.type=0;
X`09confirm.address= &"Confirm change (Y/N) `5BN`5D :";
X`09confirm.length=strlen(confirm.address);
X`09warning.type=0;
X`09warning.address=`20
X`09&"No syntax or validity checking of printer form is made.";
X`09warning.length=strlen(warning.address);
X
X`09status=smg$put_chars(&banner_id,&warning,&19,&1,0,&SMG$M_BLINK);
X`09if((status&1)==0)exit(status);
X`09smg$ring_bell(&banner_id);
X`09status=smg$set_cursor_abs(&banner_id,&20,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_string(&keyboard_id,&result,&prompt,&255,0,0,0,&r_len
X`09`09,0,&banner_id);
X`09if((status&1)==0)exit(status);
X`09status=smg$put_chars(&banner_id,&confirm,&21,&1);
X`09if((status&1)==0)exit(status);
X`09status=smg$read_keystroke(&keyboard_id,&terminator);
X`09if((status&1)==0)exit(status);
X`09if((terminator!=SMG$K_TRM_UPPERCASE_Y)&
X`09`09(terminator!=SMG$K_TRM_LOWERCASE_Y))return;
X`09memset(&temp_list->form`5B0`5D,0,255);
X`09if(r_len==0)
X`09`7B`09set_list`5B1`5D.item_code=MAIL$_USER_SET_NO_FORM;
X`09`7D
X`09else
X`09`7B`09if(r_len>255)r_len=255;
X`09`09strncpy(&temp_list->form,&name,r_len);
X`09`09set_list`5B1`5D.item_code=MAIL$_USER_SET_FORM;
X`09`09set_list`5B1`5D.buffer_length=r_len;
X`09`09set_list`5B1`5D.buffer= &name;
X`09`7D
X`09status=mail$user_set_info(&context,set_list,&get_list);
X`09if((status&1)==0)exit(status);
X`7D
$ CALL UNPACK MAIL_PROFILE_EDIT.C;108 1635576221
$ create 'f'
X
X
X
X`09`09`09Mail Profile Editor Program
X
X
X
X
X
X
XMichael N. LeVine
XCode 3511
XNaval Weapons Center
XChina Lake
XCa, 93555 USA
Xlevine%fidler.decnet@scfb.nwc.navy.mil
X(619) 939-2614 avn 437-2614
X`0C
X`09`09`09Summary
X
X`09This program is intended for use by a system manager/operator to allow`20
Xhim/her to modify/delete records in the mail profile data file.
X`0C
X`09`09`09Building
X
X`09The distribution of this program consists of two files,
X
XMAIL_PROFILE_EDIT.C
XMAIL_PROFILE_EDIT.DOC`09(this document)
X
XBuilding requires only the compilation and linking of the source.
X`0C
X`09`09`09Running
X
X`09The default operation of this program is to read in the data on all`20
Xthe entries in the mail profile data file.
X
X$ run mail_profile_edit
Xor
X$ mm :== $'f$environment("default")'mail_profile_edit
X$ mm
X
Xor to only read in the information on selected user`5Bs`5D
X
X$ mm :== $'f$environment("default")'mail_profile_edit
X$ mm user_1 `5Buser_2 `5Buser_3 `5Buser_4.....`5D`5D`5D
X
X
X`09On invocation, the program will then load all users data or selected`20
Xusers data, and then display on the screen a menu of users with the last ent
Vry`20
Xbeing "Exit". Select the user record you want to edit by using the arrow key
Vs`20
Xto locate the wanted record ( or exit function) and hit return to select (no
Vte`20
Xthat <`5EZ> is also an exit function). User names that are terminated by the
V "*"`20
Xcharacter indicate records for users that no longer exist in sysuaf.dat.
X
+-+-+-+-+-+-+-+-  END  OF PART 3 +-+-+-+-+-+-+-+-


