int
masxfs_levinfo_stat( masxfs_levinfo_t * li, masxfs_levinfo_flags_t flags,masxfs_entry_filter_t * entry_pfilter, masxfs_stat_t ** pstat )
{
  rDECLBAD;
#if 1
  if ( flags & MASXFS_CB_MODE_FS )
    rC( masxfs_levinfo_fs_stat( li, pstat ) );
  if ( flags & MASXFS_CB_MODE_DB )
    rC( masxfs_levinfo_db_stat( li, entry_pfilter, pstat ) );
#else
  masxfs_scan_mode_t mode = masxfs_levinfo_flags_mode( flags );

  switch ( mode )
  {
  case MASXFS_SCAN__MODE_NONE:
  /* rSETBAD; */
    QRLI( li, rCODE );
    break;
  case MASXFS_SCAN__MODE_FS:
    rC( masxfs_levinfo_fs_stat( li, flags ) );
    break;
  case MASXFS_SCAN__MODE_DB:
    rC( masxfs_levinfo_db_stat( li ) );
    break;
  }
#endif
  rRET;
}
/* flags: only MASXFS_CB_MODE_FS or/and MASXFS_CB_MODE_DB used */
int
masxfs_levinfo_close( masxfs_levinfo_t * li, masxfs_levinfo_flags_t flags )
{
  rDECLBAD;

#if 1
  if ( flags & MASXFS_CB_MODE_FS )
    rC( masxfs_levinfo_fs_close( li ) );
  if ( flags & MASXFS_CB_MODE_DB )
    rC( masxfs_levinfo_db_close( li ) );
#else
  masxfs_scan_mode_t mode = masxfs_levinfo_flags_mode( flags );

  switch ( mode )
  {
  case MASXFS_SCAN__MODE_NONE:
  /* rSETBAD; */
    QRLI( li, rCODE );
    break;
  case MASXFS_SCAN__MODE_FS:
    rC( masxfs_levinfo_fs_close( li ) );
    break;
  case MASXFS_SCAN__MODE_DB:
    rC( masxfs_levinfo_db_close( li ) );
    break;
  }
#endif
  rRET;
}
int
masxfs_levinfo_open( masxfs_levinfo_t * li, masxfs_levinfo_flags_t flags )
{
  rDECLBAD;

/* WARN( "%d: '%s'", li->detype, li->name ); */
#if 1
  if ( flags & MASXFS_CB_MODE_FS )
    rC( masxfs_levinfo_fs_open( li ) );
  if ( flags & MASXFS_CB_MODE_DB )
    rC( masxfs_levinfo_db_open( li ) );
#else
  masxfs_scan_mode_t mode = masxfs_levinfo_flags_mode( flags );

  switch ( mode )
  {
  case MASXFS_SCAN__MODE_NONE:
  /* rSETBAD; */
    QRLI( li, rCODE );
    break;
  case MASXFS_SCAN__MODE_FS:
    rC( masxfs_levinfo_fs_open( li, flags ) );
    break;
  case MASXFS_SCAN__MODE_DB:
    rC( masxfs_levinfo_db_open( li, flags ) );
    break;
  }
#endif
  rRET;
}
static int _uUu_
masxfs_levinfo_open_at( masxfs_levinfo_t * li, int fdparent, masxfs_levinfo_flags_t flags )
{
  rDECLBAD;

#if 1
  if ( flags & MASXFS_CB_MODE_FS )
    rC( masxfs_levinfo_fs_open_at( li, fdparent ) );
  if ( flags & MASXFS_CB_MODE_DB )
    rC( masxfs_levinfo_db_open_at( li, fdparent ) );
#else
  masxfs_scan_mode_t mode = masxfs_levinfo_flags_mode( flags );

  switch ( mode )
  {
  case MASXFS_SCAN__MODE_NONE:
  /* rSETBAD; */
    QRLI( li, rCODE );
    break;
  case MASXFS_SCAN__MODE_FS:
    rC( masxfs_levinfo_fs_open_at( li, fdparent ) );
    break;
  case MASXFS_SCAN__MODE_DB:
    rC( masxfs_levinfo_db_open_at( li, fdparent ) );
    break;
  }
#endif
  rRET;
}
int
masxfs_levinfo_rewinddir( masxfs_levinfo_t * li, masxfs_levinfo_flags_t flags )
{
  rDECLGOOD;

  if ( flags & MASXFS_CB_MODE_FS )
    rC( masxfs_levinfo_fs_rewinddir( li ) );
  if ( flags & MASXFS_CB_MODE_DB )
    rC( masxfs_levinfo_db_rewinddir( li ) );
  rRET;
}
int
masxfs_levinfo_readdir( masxfs_levinfo_t * li, masxfs_entry_filter_t * entry_pfilter, masxfs_levinfo_flags_t flags, int *phas_data )
{
  rDECLGOOD;

  if ( flags & MASXFS_CB_MODE_FS )
    rC( masxfs_levinfo_fs_readdir( li, entry_pfilter, phas_data ) );
  if ( flags & MASXFS_CB_MODE_DB )
    rC( masxfs_levinfo_db_readdir( li, entry_pfilter, phas_data ) );
  rRET;
}
/* flags: only MASXFS_CB_MODE_FS or/and MASXFS_CB_MODE_DB used */
int
masxfs_levinfo_closedir( masxfs_levinfo_t * li, masxfs_levinfo_flags_t flags )
{
  rDECLGOOD;

  if ( flags & MASXFS_CB_MODE_FS )
    rC( masxfs_levinfo_fs_closedir( li ) );
  if ( flags & MASXFS_CB_MODE_DB )
    rC( masxfs_levinfo_db_closedir( li ) );
/* assert(  (*any mode *) flags & ( MASXFS_CB_MODE_FS | MASXFS_CB_MODE_DB ) ); */
  rRET;
}
unsigned long long
mas_qstd_mstmt_insselget_datas_id( mas_qstd_t * qstd, const mas_qstd_stat_t * stat )
{
  rDECLBAD;
  QRGP( qstd );
  unsigned long long theid = mas_qstd_mstmt_insget_datas_id( qstd, stat );

  rC( mas_qstd_ret_code( qstd ) );

  if ( rGOOD && !theid )
  {
    theid = mas_qstd_mstmt_selget_datas_id( qstd, stat );
    rC( mas_qstd_ret_code( qstd ) );
  }

/* QRG( theid >= 0 ? 0 : -1 ); */
  qstd->ret_code = rCODE;
  return theid;
}
int
masxfs_levinfo_opendir( masxfs_levinfo_t * li, masxfs_levinfo_flags_t flags, masxfs_entry_filter_t * entry_pfilter )
{
  rDECLGOOD;
  assert( !masxfs_levinfo_opened_dir( li, flags, 0 ) );

  if ( flags & MASXFS_CB_MODE_FS )
  {
    rC( masxfs_levinfo_fs_opendir( li ) );
  /* WARN("[%d] %s", li->lidepth, li->name); */
    assert( masxfs_levinfo_opened_dir( li, flags, 1 ) );
  }
  if ( flags & MASXFS_CB_MODE_DB )
    rC( masxfs_levinfo_db_opendir( li, entry_pfilter ) );
  QRLI( li, rCODE );
/* assert(  (*any mode *) flags & ( MASXFS_CB_MODE_FS | MASXFS_CB_MODE_DB ) ); */
  assert( rBAD || masxfs_levinfo_opened_dir( li, flags, 1 ) );
  rRET;
}
unsigned long long
mas_qstd_mstmt_insget_datas_id( mas_qstd_t * qstd, const mas_qstd_stat_t * stat )
{
  rDECLBAD;
  QRGP( qstd );
  unsigned long long theid = 0;

  {
    int np = 0;
    mysqlpfs_mstmt_t *mstmt = mas_qstd_mstmt_get( qstd, STD_MSTMT_INSERT_DATAS );

    QRGP( mstmt );
    rC( mas_qstd_ret_code( qstd ) );
    /* rC( mas_qstd_mstmt_ret_code( mstmt ) ); */
    rC( mas_qstd_mstmt_set_param_longlong( mstmt, np++, stat->st_dev, FALSE ) );
    rC( mas_qstd_mstmt_set_param_longlong( mstmt, np++, stat->st_ino, FALSE ) );
    rC( mas_qstd_mstmt_set_param_longlong( mstmt, np++, stat->st_nlink, stat->st_nlink ? FALSE : TRUE ) );

    rC( mas_qstd_mstmt_execute( mstmt ) );
    if ( rGOOD && mas_qstd_mstmt_affected_rows( mstmt ) == 1 )
    {
      theid = mas_qstd_mstmt_insert_id( mstmt );
      rC( mas_qstd_mstmt_ret_code( mstmt ) );
    }
  }
/* QRG( theid >= 0 ? 0 : -1 ); */
  qstd->ret_code = rCODE;
  return theid;
}
unsigned long long
mas_qstd_mstmt_selget_datas_id( mas_qstd_t * qstd, const mas_qstd_stat_t * stat )
{
  rDECLBAD;
  unsigned long long theid = 0;

  {
    int np = 0;
    int nr = 0;
    int has_data = 0;
    mysqlpfs_mstmt_t *mstmt_s = mas_qstd_mstmt_get( qstd, STD_MSTMT_SELECT_DATAS_ID );

    QRGP( mstmt_s );
    rC( mas_qstd_ret_code( qstd ) );
    /* rC( mas_qstd_mstmt_ret_code( mstmt_s ) ); */

    rC( mas_qstd_mstmt_set_param_longlong( mstmt_s, np++, stat->st_dev, FALSE ) );
    rC( mas_qstd_mstmt_set_param_longlong( mstmt_s, np++, stat->st_ino, FALSE ) );
    rC( mas_qstd_mstmt_execute_store( mstmt_s ) );

    rC( mas_qstd_mstmt_fetch( mstmt_s, &has_data ) );

    if ( has_data )
    {
      unsigned is_null = 0;

      rC( mas_qstd_mstmt_get_result_longlong( mstmt_s, nr++, &theid, &is_null ) );
      assert( nr == STD_MSTMT_SELECT_DATAS_NRESULTS );
    }

    mas_qstd_mstmt_free_result( mstmt_s );
  }
  qstd->ret_code = rCODE;
  return theid;
}
int
masxfs_levinfo_closedir_all_up( masxfs_levinfo_t * li, masxfs_levinfo_flags_t flags )
{
#if 1
  rDECLGOOD;
  while ( li->lidepth && rGOOD )
  {
    rC( masxfs_levinfo_closedir( li, flags ) );
    li--;
  }
#else
  rDECLBAD;
  do
  {
    rC( masxfs_levinfo_closedir( li, flags ) );
    if ( !li->lidepth )
      break;
    li--;
  } while ( rGOOD );
#endif
  rRET;
}
int
mas_mysqlpfs_mstmt_reset( mysqlpfs_mstmt_t * mstmt )
{
  rDECLBAD;

  QRGP( mstmt );
  if ( mstmt )
  {
    QRGP( mstmt->stmt );
    if ( mstmt->stmt )
    {
      rC( mas_mysqlpfs_mstmt_free_result( mstmt ) );
      rC( mysql_stmt_close( mstmt->stmt ) );
      mstmt->stmt = NULL;
      mstmt->ret_code = rCODE;
    /* QRGS( rCODE ); */
    }
    mas_mysqlpfs_mstmt_reset_bind( &mstmt->binds.param );
    mas_mysqlpfs_mstmt_reset_bind( &mstmt->binds.result );
    mstmt->pfs = NULL;
  }
  rRET;
}
int
masxfs_levinfo_close_all_up( masxfs_levinfo_t * li, masxfs_levinfo_flags_t flags )
{
  rDECLBAD;
  if ( li )
  {
    do
    {
      rC( masxfs_levinfo_close( li, flags ) );
    /* test li->lidepth BEFORE li-- */
    } while ( rGOOD && li->lidepth && li-- );
  }
  else
    QRLI( li, rCODE );
  rRET;
}
Exemple #15
0
static void gen_vpermr(DisasContext *ctx)
{
    TCGv_ptr ra, rb, rc, rd;
    if (unlikely(!ctx->altivec_enabled)) {
        gen_exception(ctx, POWERPC_EXCP_VPU);
        return;
    }
    ra = gen_avr_ptr(rA(ctx->opcode));
    rb = gen_avr_ptr(rB(ctx->opcode));
    rc = gen_avr_ptr(rC(ctx->opcode));
    rd = gen_avr_ptr(rD(ctx->opcode));
    gen_helper_vpermr(cpu_env, rd, ra, rb, rc);
    tcg_temp_free_ptr(ra);
    tcg_temp_free_ptr(rb);
    tcg_temp_free_ptr(rc);
    tcg_temp_free_ptr(rd);
}
const struct stat *
masxfs_levinfo_stat_ref( masxfs_levinfo_t * li, masxfs_levinfo_flags_t tflags )
{
  rDECLBAD;
  const struct stat *st = NULL;

  if ( li && ( tflags & MASXFS_CB_STAT ) )
  {
    rC( masxfs_levinfo_stat( li, tflags, NULL /* entry_pfilter */ , NULL /* stat */  ) );
    if ( rGOOD )
      st = masxfs_levinfo_stat_val( li, 0, tflags );
    else
    {
    /* WARN( "STAT ERR" ); */
    }
  }
  return st;
}
mysqlpfs_mstmt_t *
mas_mysqlpfs_mstmt_create_setup( mysqlpfs_t * pfs, int nparams, int nresults, const char *sqlop )
{
  rDECLBAD;
  mysqlpfs_mstmt_t *mstmt = mas_mysqlpfs_mstmt_create(  );

  QRGP( mstmt );
  if ( mstmt )
  {
    mas_mysqlpfs_mstmt_init( pfs, mstmt, nparams, nresults );
    rC( mas_mysqlpfs_mstmt_prepare( mstmt, sqlop ) );
    mstmt->ret_code = rCODE;
  }
  QRG( rCODE );
/*if ( rBAD )
    WARN( "ERR sqlop: %s", sqlop );*/
  return mstmt;
}