Example #1
0
void Cmd::save_cb( void *ctx, int quiet)
{
  Cmd *cmd = (Cmd *) ctx;
  int sts;

  if ( !cmd->ldhses) {
    cmd->wnav->message( 'E', "Cmd is not attached to a volume");
    return;
  }
  sts = ldh_SaveSession( cmd->ldhses);
  if ( EVEN(sts)) {
    cmd->wnav->message( 'E', wnav_get_message( sts));
    return;
  }

  ldh_sVolumeInfo info;
  pwr_tCid volcid;

  ldh_GetVolumeInfo( ldh_SessionToVol( cmd->ldhses), &info);
  ldh_GetVolumeClass( cmd->wbctx, info.Volume, &volcid);
  
  if ( volcid == pwr_eClass_DirectoryVolume) {
    sts = lfu_SaveDirectoryVolume( cmd->ldhses, 0, quiet);
    if ( EVEN(sts)) {
      cmd->wnav->message( 'E', "Syntax error");
      return;
    }
  }
  cmd->wnav->message( 'E', "Session saved");
}
Example #2
0
int wnav_crr_get_volume_cb( void *ctx, pwr_tVid *vid, pwr_tVid prev_vid)
{
  int sts;
  ldh_sVolumeInfo info;
  CrrCtx *cctx = (CrrCtx *)ctx;
  ldh_tVolContext volctx = ldh_SessionToVol( cctx->ldhses);
  sts = ldh_GetVolumeInfo( volctx, &info);

  if ( prev_vid)
    return WNAV__NOSUCHVOLUME;

  *vid = info.Volume;
  return WNAV__SUCCESS;
}