?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Object Code Management: Create Command Description' ??
MODULE ocm$create_command_description;

{
{ PURPOSE:
{   This module contains the commands that create command descriptions
{   and system command descriptions.
{

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc cle$ecc_parsing
*copyc clt$parameter_list
*copyc llt$command_description
*copyc llt$object_library_header
*copyc oce$library_generator_errors
*copyc oct$display_toggles
*copyc ost$status
?? POP ??
*copyc avp$get_capability
*copyc clp$count_list_elements
*copyc clp$evaluate_parameters
*copyc i#current_sequence_position
*copyc ocp$add_an_nlm
*copyc ocp$close_all_open_files
*copyc ocp$create_an_nlm
*copyc ocp$initialize_olg_working_heap
*copyc ocp$search_nlm_tree
*copyc osp$set_status_abnormal
*copyc osp$set_status_condition
*copyc pmp$continue_to_cause
*copyc pmp$disestablish_cond_handler
*copyc pmp$establish_condition_handler
*copyc pmp$get_date
*copyc pmp$get_time
*copyc ocv$nlm_list
*copyc ocv$olg_scratch_seq
*copyc ocv$olg_working_heap
*copyc ocv$open_file_list
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] ocp$_create_command_description', EJECT ??

  PROCEDURE [XDCL] ocp$_create_command_description
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

{ PROCEDURE (ocm$creol_crecd) create_command_description, crecd (
{   name, names, n: record
{       name: name
{       aliases: list rest of name = $optional
{     recend = $required
{   starting_procedure, sp: (BY_NAME) program_name = $optional
{   library, l: (BY_NAME) any of
{       key
{         osf$current_library
{       keyend
{       file
{       string
{     anyend = $optional
{   system_command_name, scn: (BY_NAME) name = $optional
{   availability, a: (BY_NAME) key
{       (normal_usage, nu)
{       (advanced_usage, au)
{       (hidden, h)
{     keyend = normal_usage
{   scope, s: (BY_NAME) key
{       (xdcl, x)
{       (gate, g)
{       (local, l)
{     keyend = xdcl
{   log_option, lo: (BY_NAME) key
{       (automatic, a)
{       (manual, m)
{     keyend = automatic
{   merge_option, mo: (BY_NAME) key
{       (add, a)
{       (replace, r)
{       (combine, c)
{     keyend = combine
{   application_identifier, ai: (BY_NAME, ADVANCED) name = $optional
{   status)

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 20] of clt$pdt_parameter_name,
      parameters: array [1 .. 10] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$record_type_qualifier,
        field_spec_1: clt$field_specification,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$name_type_qualifier,
        recend,
        field_spec_2: clt$field_specification,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$list_type_qualifier,
          element_type_spec: record
            header: clt$type_specification_header,
            qualifier: clt$name_type_qualifier,
          recend,
        recend,
      recend,
      type2: record
        header: clt$type_specification_header,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
        recend,
        type_size_3: clt$type_specification_size,
        element_type_spec_3: record
          header: clt$type_specification_header,
          qualifier: clt$string_type_qualifier,
        recend,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
        default_value: string (12),
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
        default_value: string (4),
      recend,
      type7: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 4] of clt$keyword_specification,
        default_value: string (9),
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 6] of clt$keyword_specification,
        default_value: string (7),
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$name_type_qualifier,
      recend,
      type10: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [89, 9, 12, 22, 0, 23, 724],
    clc$command, 20, 10, 1, 1, 0, 0, 10, 'OCM$CREOL_CRECD'], [
    ['A                              ',clc$abbreviation_entry, 5],
    ['AI                             ',clc$abbreviation_entry, 9],
    ['APPLICATION_IDENTIFIER         ',clc$nominal_entry, 9],
    ['AVAILABILITY                   ',clc$nominal_entry, 5],
    ['L                              ',clc$abbreviation_entry, 3],
    ['LIBRARY                        ',clc$nominal_entry, 3],
    ['LO                             ',clc$abbreviation_entry, 7],
    ['LOG_OPTION                     ',clc$nominal_entry, 7],
    ['MERGE_OPTION                   ',clc$nominal_entry, 8],
    ['MO                             ',clc$abbreviation_entry, 8],
    ['N                              ',clc$abbreviation_entry, 1],
    ['NAME                           ',clc$nominal_entry, 1],
    ['NAMES                          ',clc$alias_entry, 1],
    ['S                              ',clc$abbreviation_entry, 6],
    ['SCN                            ',clc$abbreviation_entry, 4],
    ['SCOPE                          ',clc$nominal_entry, 6],
    ['SP                             ',clc$abbreviation_entry, 2],
    ['STARTING_PROCEDURE             ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 10],
    ['SYSTEM_COMMAND_NAME            ',clc$nominal_entry, 4]],
    [
{ PARAMETER 1
    [12, 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, 105, clc$required_parameter, 0, 0],
{ PARAMETER 2
    [18, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0],
{ PARAMETER 3
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 79, clc$optional_parameter, 0, 0],
{ PARAMETER 4
    [20, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],
{ PARAMETER 5
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 229, clc$optional_default_parameter, 0, 12],
{ PARAMETER 6
    [16, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 229, clc$optional_default_parameter, 0, 4],
{ PARAMETER 7
    [8, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 155, clc$optional_default_parameter, 0, 9],
{ PARAMETER 8
    [9, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 229, clc$optional_default_parameter, 0, 7],
{ PARAMETER 9
    [3, clc$advanced_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 5, clc$optional_parameter, 0, 0],
{ PARAMETER 10
    [19, 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$record_type], [2],
    ['NAME                           ', clc$required_field, 5], [[1, 0,
  clc$name_type], [1, osc$max_name_size]],
    ['ALIASES                        ', clc$optional_field, 21], [[1, 0,
  clc$list_type], [5, 0, clc$max_list_size, TRUE],
        [[1, 0, clc$name_type], [1, osc$max_name_size]]
      ]
    ],
{ PARAMETER 2
    [[1, 0, clc$program_name_type]],
{ PARAMETER 3
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type,
    clc$string_type],
    FALSE, 3],
    44, [[1, 0, clc$keyword_type], [1], [
      ['OSF$CURRENT_LIBRARY            ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
      ],
    3, [[1, 0, clc$file_type]],
    8, [[1, 0, clc$string_type], [0, clc$max_string_size, FALSE]]
    ],
{ PARAMETER 4
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 5
    [[1, 0, clc$keyword_type], [6], [
    ['ADVANCED_USAGE                 ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
    ['AU                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
    ['H                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 3],
    ['HIDDEN                         ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
    ['NORMAL_USAGE                   ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['NU                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1]]
    ,
    'normal_usage'],
{ PARAMETER 6
    [[1, 0, clc$keyword_type], [6], [
    ['G                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
    ['GATE                           ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
    ['L                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 3],
    ['LOCAL                          ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
    ['X                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1],
    ['XDCL                           ', clc$nominal_entry,
  clc$normal_usage_entry, 1]]
    ,
    'xdcl'],
{ PARAMETER 7
    [[1, 0, clc$keyword_type], [4], [
    ['A                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1],
    ['AUTOMATIC                      ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['M                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
    ['MANUAL                         ', clc$nominal_entry,
  clc$normal_usage_entry, 2]]
    ,
    'automatic'],
{ PARAMETER 8
    [[1, 0, clc$keyword_type], [6], [
    ['A                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 1],
    ['ADD                            ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
    ['C                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 3],
    ['COMBINE                        ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
    ['R                              ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
    ['REPLACE                        ', clc$nominal_entry,
  clc$normal_usage_entry, 2]]
    ,
    'combine'],
{ PARAMETER 9
    [[1, 0, clc$name_type], [1, osc$max_name_size]],
{ PARAMETER 10
    [[1, 0, clc$status_type]]];

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

    CONST
      p$name = 1,
      p$starting_procedure = 2,
      p$library = 3,
      p$system_command_name = 4,
      p$availability = 5,
      p$scope = 6,
      p$log_option = 7,
      p$merge_option = 8,
      p$application_identifier = 9,
      p$status = 10;

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

    VAR
      alias_list: ^pmt$module_list,
      alias_number: clt$list_size,
      application_administrator: boolean,
      application_identifier: ^llt$application_identifier,
      command_description_contents: ^llt$command_desc_contents,
      command_description_header: ^llt$library_member_header,
      date: ost$date,
      ignore_status: ost$status,
      library_parameter: ^clt$string_value,
      library_path: ^fst$file_reference,
      member: ^SEQ ( * ),
      member_size: ost$segment_length,
      module_already_exists: boolean,
      module_description: ^oct$module_description,
      nlm: ^oct$new_library_module_list,
      node: ^clt$data_value,
      sequence: ^SEQ ( * ),
      size: ost$segment_length,
      time: ost$time;

    VAR
      established_conditions: pmt$condition,
      established_descriptor: pmt$established_handler;

?? NEWTITLE := 'check_parameters', EJECT ??

{
{ This "check parameters procedure" verifies that command description
{ parameters specify information for either a "normal" command description
{ or a "system command description" but not both.
{

    PROCEDURE check_parameters
      (    pvt: ^clt$parameter_value_table;
           ignore_which_parameter: clt$which_parameter;
       VAR status: ost$status);


      status.normal := TRUE;

      IF pvt^ [p$system_command_name].specified THEN
        IF pvt^ [p$starting_procedure].specified OR pvt^ [p$library].specified THEN
          osp$set_status_condition (oce$e_bad_command_desc_params, status);
        IFEND;
      ELSEIF NOT pvt^ [p$starting_procedure].specified THEN
        osp$set_status_abnormal ('OC', cle$required_parameter_omitted,
              'STARTING_PROCEDURE or SYSTEM_COMMAND_NAME', status);
      IFEND;

    PROCEND check_parameters;
?? OLDTITLE ??
?? NEWTITLE := 'condition_handler', EJECT ??

{ PURPOSE:
{   The purpose of this procedure is to handle the terminate break and
{   block exit conditions.

    PROCEDURE condition_handler
      (    condition: pmt$condition;
           condition_descriptor: ^pmt$condition_information;
           stack_frame_save_area_p: ^ost$stack_frame_save_area;
       VAR handler_status: ost$status);


      IF (condition.selector = ifc$interactive_condition) AND
            (condition.interactive_condition = ifc$terminate_break) THEN

{ Ignore the condition.

        RETURN;
      ELSEIF condition.selector = pmc$block_exit_processing THEN
        ocp$close_all_open_files (ocv$open_file_list);
        ocp$initialize_olg_working_heap;
        RESET ocv$olg_scratch_seq;
      ELSE
        pmp$continue_to_cause (pmc$execute_standard_procedure, handler_status);
      IFEND;

    PROCEND condition_handler;
?? OLDTITLE, EJECT ??

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

    RESET ocv$olg_scratch_seq;

    pmp$get_time (osc$hms_time, time, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    pmp$get_date (osc$mdy_date, date, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    established_conditions.selector := pmc$condition_combination;
    established_conditions.combination := $pmt$condition_combination
          [ifc$interactive_condition, pmc$block_exit_processing];
    pmp$establish_condition_handler (established_conditions, ^condition_handler, ^established_descriptor,
          status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  /protect/
    BEGIN

      NEXT command_description_header IN ocv$olg_scratch_seq;
      IF command_description_header = NIL THEN
        osp$set_status_condition (oce$e_internal_olg_seg_overflow, status);
        RETURN;
      IFEND;

      command_description_header^.name := pvt [p$name].value^.field_values^ [1].value^.name_value;

      IF pvt [p$application_identifier].specified THEN
        avp$get_capability (avc$application_administration, avc$user, application_administrator, status);
        IF NOT status.normal THEN
          EXIT /protect/;
        IFEND;
        IF NOT application_administrator THEN
          osp$set_status_condition (oce$not_application_administrtr, status);
          EXIT /protect/;
        IFEND;
        NEXT application_identifier IN ocv$olg_scratch_seq;
        IF application_identifier = NIL THEN
          osp$set_status_condition (oce$e_internal_olg_seg_overflow, status);
          RETURN;
        IFEND;
        application_identifier^.name := pvt [p$application_identifier].value^.name_value;
        command_description_header^.kind := llc$applic_command_description;
      ELSE
        command_description_header^.kind := llc$command_description;
      IFEND;

      command_description_header^.time_created := time;
      command_description_header^.date_created := date;
      command_description_header^.generator_id := llc$object_library_generator;
      command_description_header^.generator_name_vers := occ$generator_name CAT llc$object_library_version;
      command_description_header^.commentary := osc$null_name;

      command_description_header^.number_of_aliases :=
            clp$count_list_elements (pvt [p$name].value^.field_values^ [2].value);
      IF command_description_header^.number_of_aliases <> 0 THEN
        NEXT alias_list: [1 .. command_description_header^.number_of_aliases] IN ocv$olg_scratch_seq;
        IF alias_list = NIL THEN
          osp$set_status_condition (oce$e_internal_olg_seg_overflow, status);
          RETURN;
        IFEND;
        node := pvt [p$name].value^.field_values^ [2].value;
        FOR alias_number := 1 TO command_description_header^.number_of_aliases DO
          alias_list^ [alias_number] := node^.element_value^.name_value;
          node := node^.link;
        FOREND;
      IFEND;

      IF pvt [p$availability].value^.keyword_value = 'HIDDEN' THEN
        command_description_header^.command_function_availability := clc$hidden_entry;
      ELSEIF pvt [p$availability].value^.keyword_value = 'ADVANCED_USAGE' THEN
        command_description_header^.command_function_availability := clc$advanced_usage_entry;
      ELSE {NORMAL_USAGE}
        command_description_header^.command_function_availability := clc$normal_usage_entry;
      IFEND;

      IF pvt [p$scope].value^.keyword_value = 'XDCL' THEN
        command_description_header^.command_function_kind := llc$entry_point;
      ELSEIF pvt [p$scope].value^.keyword_value = 'GATE' THEN
        command_description_header^.command_function_kind := llc$gate;
      ELSE {LOCAL}
        command_description_header^.command_function_kind := llc$local_to_library;
      IFEND;

      IF pvt [p$log_option].value^.keyword_value = 'AUTOMATIC' THEN
        command_description_header^.command_log_option := clc$automatically_log;
      ELSE {MANUAL}
        command_description_header^.command_log_option := clc$manually_log;
      IFEND;

      NEXT command_description_contents IN ocv$olg_scratch_seq;
      IF command_description_contents = NIL THEN
        osp$set_status_condition (oce$e_internal_olg_seg_overflow, status);
        RETURN;
      IFEND;

      command_description_contents^.version := llc$command_desc_version;
      command_description_contents^.system_command := pvt [p$system_command_name].specified;

      IF command_description_contents^.system_command THEN
        command_description_contents^.system_command_name := pvt [p$system_command_name].value^.name_value;

      ELSE
        command_description_contents^.starting_procedure := pvt [p$starting_procedure].value^.
              program_name_value;

        IF NOT pvt [p$library].specified THEN
          command_description_contents^.library_path_size := 0;
        ELSE
          CASE pvt [p$library].value^.kind OF
          = clc$keyword = {OSF$CURRENT_LIBRARY}
            library_parameter := ^pvt [p$library].value^.keyword_value;
          = clc$file =
            library_parameter := pvt [p$library].value^.file_value;
          ELSE {clc$string}
            library_parameter := pvt [p$library].value^.string_value;
          CASEND;
          IF STRLENGTH (library_parameter^) >= fsc$max_path_size THEN
            command_description_contents^.library_path_size := fsc$max_path_size;
          ELSE
            command_description_contents^.library_path_size := STRLENGTH (library_parameter^);
          IFEND;
          NEXT library_path: [command_description_contents^.library_path_size] IN ocv$olg_scratch_seq;
          IF library_path = NIL THEN
            osp$set_status_condition (oce$e_internal_olg_seg_overflow, status);
            RETURN;
          IFEND;
          library_path^ := library_parameter^;
        IFEND;
      IFEND;

      ALLOCATE module_description IN ocv$olg_working_heap^;
      IF module_description = NIL THEN
        osp$set_status_condition (oce$e_internal_olg_seg_overflow, status);
        RETURN;
      IFEND;

      module_description^.name := command_description_header^.name;
      module_description^.source := occ$current;
      IF pvt [p$application_identifier].specified THEN
        module_description^.kind := occ$applic_command_description
      ELSE
        module_description^.kind := occ$command_description;
      IFEND;

      ocp$search_nlm_tree (command_description_header^.name, nlm, module_already_exists);

      IF pvt [p$merge_option].value^.keyword_value = 'ADD' THEN
        IF module_already_exists THEN
          osp$set_status_abnormal ('OC', oce$e_module_already_on_library, command_description_header^.name,
                status);
          EXIT /protect/;
        ELSE
          ocp$create_an_nlm (module_description, nlm, status);
          IF NOT status.normal THEN
            EXIT /protect/;
          IFEND;
          ocp$add_an_nlm (ocv$nlm_list^.b_link, nlm);
        IFEND;

      ELSEIF pvt [p$merge_option].value^.keyword_value = 'REPLACE' THEN
        IF module_already_exists THEN
          nlm^.description := module_description;
          nlm^.changed_info := NIL;
        ELSE
          osp$set_status_abnormal ('OC', oce$e_module_not_found, command_description_header^.name, status);
          EXIT /protect/;
        IFEND;

      ELSE {COMBINE}
        IF module_already_exists THEN
          nlm^.description := module_description;
          nlm^.changed_info := NIL;
        ELSE
          ocp$create_an_nlm (module_description, nlm, status);
          IF NOT status.normal THEN
            EXIT /protect/;
          IFEND;
          ocp$add_an_nlm (ocv$nlm_list^.b_link, nlm);
        IFEND;
      IFEND;

      size := i#current_sequence_position (ocv$olg_scratch_seq);
      RESET ocv$olg_scratch_seq;
      NEXT sequence: [[REP size OF cell]] IN ocv$olg_scratch_seq;
      ALLOCATE module_description^.file: [[REP size OF cell]] IN ocv$olg_working_heap^;
      IF module_description^.file = NIL THEN
        osp$set_status_condition (oce$e_internal_olg_seg_overflow, status);
        RETURN;
      IFEND;

      module_description^.file^ := sequence^;
      RESET module_description^.file;
      IF pvt [p$application_identifier].specified THEN
        NEXT module_description^.applic_command_description_hdr IN module_description^.file;
        IF module_description^.applic_command_description_hdr^.library_member_header.number_of_aliases <>
              0 THEN
          NEXT alias_list: [1 .. module_description^.applic_command_description_hdr^.library_member_header.
                number_of_aliases] IN module_description^.file;
          module_description^.applic_command_description_hdr^.library_member_header.aliases :=
                #REL (alias_list, module_description^.file^);
        IFEND;
      ELSE
        NEXT module_description^.command_description_header IN module_description^.file;
        IF module_description^.command_description_header^.number_of_aliases <> 0 THEN
          NEXT alias_list: [1 .. module_description^.command_description_header^.number_of_aliases] IN
                module_description^.file;
          module_description^.command_description_header^.aliases :=
                #REL (alias_list, module_description^.file^);
        IFEND;
      IFEND;

      member_size := size - i#current_sequence_position (module_description^.file);
      NEXT member: [[REP member_size OF cell]] IN module_description^.file;

      IF pvt [p$application_identifier].specified THEN
        module_description^.applic_command_description_hdr^.library_member_header.member :=
              #REL (member, module_description^.file^);
        module_description^.applic_command_description_hdr^.library_member_header.member_size := member_size;
      ELSE
        module_description^.command_description_header^.member := #REL (member, module_description^.file^);
        module_description^.command_description_header^.member_size := member_size;
      IFEND;

    END /protect/;
    pmp$disestablish_cond_handler (established_conditions, ignore_status);

  PROCEND ocp$_create_command_description;

MODEND ocm$create_command_description;
