{       FSP$RESOLVE_PATH
{
{   The purpose of this procedure is to resolve the path it is given such that
{ the caller can determine whether the path designates an object that exists --
{ if so, whether it is a catalog or a file; and if it is file, which specific
{ cycle is being referenced.
{
{   The resolution of the PATH_ELEMENTS/CYCLE_REFERENCE combination is
{ determined according to the following rules.
{
{     For $local files:
{
{       1. If there is only one entry in the PATH_ELEMENTS array, then if
{          CYCLE_REFERENCE.SPECIFICATION =
{
{          (a) FSC$CYCLE_OMITTED - return:
{                  PATH_RESOLUTION              as FSC$CATALOG_PATH
{          (b) FSC$HIGH_CYCLE, FSC$LOW_CYCLE, FSC$NEXT_CYCLE or
{              FSC$CYCLE_NUMBER - return:
{                  abnormal status (fse$catalogs_do_not_have_cycles)
{
{       2. If there are more than two entries in the PATH_ELEMENTS array,
{          return abnormal status (fse$local_subcatalog_illegal).
{
{       3. If the last entry of the PATH_ELEMENTS array designates an object
{          that does not exist, then if CYCLE_REFERENCE.SPECIFICATION =
{
{          (a) FSC$CYCLE_OMITTED - return:
{                  CYCLE_REFERENCE.CYCLE_NUMBER as 1
{                  PATH_RESOLUTION              as FSC$PATH_DOES_NOT_EXIST
{          (b) FSC$HIGH_CYCLE or FSC$LOW_CYCLE - return:
{                  abnormal status (pfe$unknown_permanent_file)
{          (c) FSC$NEXT_CYCLE - return:
{                  CYCLE_REFERENCE.CYCLE_NUMBER as 1
{                  PATH_RESOLUTION              as FSC$NEW_FILE_PATH
{          (d) FSC$CYCLE_NUMBER - return:
{                  PATH_RESOLUTION              as FSC$NEW_FILE_PATH
{
{       4. If the last entry of the PATH_ELEMENTS array designates a file,
{          then if CYCLE_REFERENCE.SPECIFICATION =
{
{          (a) FSC$CYCLE_OMITTED or FSC$HIGH_CYCLE - return:
{                  CYCLE_REFERENCE.CYCLE_NUMBER as the number of the file's
{                                               currently highest cycle
{                  PATH_RESOLUTION              as FSC$CYCLE_PATH
{          (b) FSC$LOW_CYCLE - return:
{                  CYCLE_REFERENCE.CYCLE_NUMBER as the number of the file's
{                                               currently lowest cycle
{                  PATH_RESOLUTION              as FSC$CYCLE_PATH
{          (c) FSC$NEXT_CYCLE - return:
{                  CYCLE_REFERENCE.CYCLE_NUMBER as the number of the file's
{                                               currently highest cycle + 1
{                  PATH_RESOLUTION              as FSC$NEW_CYCLE_PATH
{          (d) FSC$CYCLE_NUMBER, and the cycle exists - return:
{                  PATH_RESOLUTION              as FSC$CYCLE_PATH
{          (e) FSC$CYCLE_NUMBER, and the cycle does not exist - return:
{                  PATH_RESOLUTION              as FSC$NEW_CYCLE_PATH
{
{     For non $local files:
{
{       1. If the PATH_ELEMENTS array consists of a single element, return
{          abnormal status (pfe$path_too_short).
{
{       2. If any but the last entry of the PATH_ELEMENTS array designates
{          an object that does not exist, return appropriate abnormal status.
{
{       3. If the last entry of the PATH_ELEMENTS array designates an object
{          that does not exist, then if CYCLE_REFERENCE.SPECIFICATION =
{
{          (a) FSC$CYCLE_OMITTED - return:
{                  CYCLE_REFERENCE.CYCLE_NUMBER as 1
{                  PATH_RESOLUTION              as FSC$PATH_DOES_NOT_EXIST
{          (b) FSC$HIGH_CYCLE or FSC$LOW_CYCLE - return:
{                  abnormal status (pfe$unknown_permanent_file)
{          (c) FSC$NEXT_CYCLE - return:
{                  CYCLE_REFERENCE.CYCLE_NUMBER as 1
{                  PATH_RESOLUTION              as FSC$NEW_FILE_PATH
{          (d) FSC$CYCLE_NUMBER - return:
{                  PATH_RESOLUTION              as FSC$NEW_FILE_PATH
{
{       4. If the last entry of the PATH_ELEMENTS array designates a
{          catalog, then if CYCLE_REFERENCE.SPECIFICATION =
{
{          (a) FSC$CYCLE_OMITTED - return:
{                  PATH_RESOLUTION              as FSC$CATALOG_PATH
{          (b) FSC$HIGH_CYCLE, FSC$LOW_CYCLE, FSC$NEXT_CYCLE or
{              FSC$CYCLE_NUMBER - return:
{                  abnormal status (fse$catalogs_do_not_have_cycles)
{
{       5. If the last entry of the PATH_ELEMENTS array designates a file,
{          then if CYCLE_REFERENCE.SPECIFICATION =
{
{          (a) FSC$CYCLE_OMITTED or FSC$HIGH_CYCLE - return:
{                  CYCLE_REFERENCE.CYCLE_NUMBER as the number of the file's
{                                               currently highest cycle
{                  PATH_RESOLUTION              as FSC$CYCLE_PATH
{          (b) FSC$LOW_CYCLE - return:
{                  CYCLE_REFERENCE.CYCLE_NUMBER as the number of the file's
{                                               currently lowest cycle
{                  PATH_RESOLUTION              as FSC$CYCLE_PATH
{          (c) FSC$NEXT_CYCLE - return:
{                  CYCLE_REFERENCE.CYCLE_NUMBER as the number of the file's
{                                               currently highest cycle + 1
{                  PATH_RESOLUTION              as FSC$NEW_CYCLE_PATH
{          (d) FSC$CYCLE_NUMBER, and the cycle exists - return:
{                  PATH_RESOLUTION              as FSC$CYCLE_PATH
{          (e) FSC$CYCLE_NUMBER, and the cycle does not exist - return:
{                  PATH_RESOLUTION              as FSC$NEW_CYCLE_PATH
{
{
{ FSP$RESOLVE_PATH (PATH_ELEMENTS, CYCLE_REFERENCE, PATH_RESOLUTION, STATUS)
{
{ PATH_ELEMENTS: (input) This parameter specifies the element names of the
{       path to be resolved.
{
{ CYCLE_REFERENCE: (i/o) This parameter specifies the cycle reference to
{       resolve, as input, and the resolved cycle reference, as output.
{
{ PATH_RESOLUTION: (output) This parameter specifies the resolution of the
{       PATH_ELEMENTS/CYCLE_REFERENCE.
{
{ STATUS: (output) This parameter specifies the request status.
{
