?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE SCL Interpreter: UNSEEN_MAIL_ACTION Commands & Functions' ??
MODULE clm$change_unseen_mail_action;

{
{ PURPOSE:
{   This module contains the processors for the CHNAGE_UNSEEN_MAIL_ACTION
{   command and the $UNSEEN_MAIL_ACTION function.
{

?? NEWTITLE := 'Global Declarations', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc clt$parameter_list
*copyc clt$unseen_mail_action
*copyc ost$status
?? POP ??
*copyc clp$change_unseen_mail_action
*copyc clp$evaluate_parameters
*copyc clp$find_unseen_mail_action
*copyc clp$make_value
?? OLDTITLE ??
?? NEWTITLE := 'clp$_change_unseen_mail_action', EJECT ??

  PROCEDURE [XDCL] clp$_change_unseen_mail_action
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (clm$chauma) change_unseen_mail_action, chauma (
{   action, a : key
{       (display, d)
{       (post, p)
{     keyend = display
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 3] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
        default_value: string (7),
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [88, 12, 19, 13, 56, 6, 382],
    clc$command, 3, 2, 0, 0, 0, 0, 2, 'CLM$CHAUMA'], [
    ['A                              ',clc$abbreviation_entry, 1],
    ['ACTION                         ',clc$nominal_entry, 1],
    ['STATUS                         ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,
  clc$optional_default_parameter, 0, 7],
{ PARAMETER 2
    [3, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$keyword_type], [4], [
    ['D                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['DISPLAY                        ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['P                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
    ['POST                           ', clc$nominal_entry, clc$normal_usage_entry, 2]]
    ,
    'display'],
{ PARAMETER 2
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$action = 1,
      p$status = 2;

    VAR
      pvt: array [1 .. 2] of clt$parameter_value;

    VAR
      action: clt$unseen_mail_action;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    IF pvt [p$action].value^.keyword_value = 'POST' THEN
      action := clc$post_unseen_mail;
    ELSE
      action := clc$display_unseen_mail;
    IFEND;
    clp$change_unseen_mail_action (action, status);
  PROCEND clp$_change_unseen_mail_action;
?? OLDTITLE ??
?? NEWTITLE := 'clp$$unseen_mail_action', EJECT ??

  PROCEDURE [XDCL] clp$$unseen_mail_action
    (    parameter_list: clt$parameter_list;
     VAR work_area {input, output} : ^clt$work_area;
     VAR result: ^clt$data_value;
     VAR status: ost$status);

{ FUNCTION (clm$$unsma) $unseen_mail_action

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
    recend := [
    [1,
    [90, 7, 18, 13, 23, 55, 898],
    clc$function, 0, 0, 0, 0, 0, 0, 0, 'CLM$$UNSMA']];

?? FMT (FORMAT := ON) ??
?? POP ??

    VAR
      action: ^clt$unseen_mail_action;


    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, NIL, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$find_unseen_mail_action (action);

    clp$make_value (clc$keyword, work_area, result);

    IF action^ = clc$post_unseen_mail THEN
      result^.keyword_value := 'POST';
    ELSE
      result^.keyword_value := 'DISPLAY';
    IFEND;

  PROCEND clp$$unseen_mail_action;
?? OLDTITLE ??

MODEND clm$change_unseen_mail_action;
