Exemple #1
0
TestDualInstance::TestDualInstance(QWidget *parent)
    : QMainWindow(parent),
      ui(new Ui::TestDual),
      _media1(0),
      _media2(0)
{
    ui->setupUi(this);

    _instance1 = new VlcInstance(VlcCommon::args(), this);
    _player1 = new VlcMediaPlayer(_instance1);
    _player1->setVideoWidget(ui->video1);

    ui->video1->setMediaPlayer(_player1);
    ui->volume1->setMediaPlayer(_player1);
    ui->volume1->setVolume(50);
    ui->seek1->setMediaPlayer(_player1);

    connect(ui->open1, SIGNAL(clicked()), this, SLOT(open1()));
    connect(ui->pause1, SIGNAL(clicked()), _player1, SLOT(pause()));
    connect(ui->stop1, SIGNAL(clicked()), _player1, SLOT(stop()));

    _instance2 = new VlcInstance(VlcCommon::args(), this);
    _player2 = new VlcMediaPlayer(_instance2);
    _player2->setVideoWidget(ui->video2);

    ui->video2->setMediaPlayer(_player2);
    ui->volume2->setMediaPlayer(_player2);
    ui->volume2->setVolume(50);
    ui->seek2->setMediaPlayer(_player2);

    connect(ui->open2, SIGNAL(clicked()), this, SLOT(open2()));
    connect(ui->pause2, SIGNAL(clicked()), _player2, SLOT(pause()));
    connect(ui->stop2, SIGNAL(clicked()), _player2, SLOT(stop()));
}
Exemple #2
0
FILE far *freopen
(const char far *path, const char far *mode, FILE far *stream)
{
fclose(stream);
if(open2 (fileno(stream), path, mflag(mode))==-1)return NULL;
return stream;
}
Exemple #3
0
/**
Copia arquivo dentro do T2FS
Os parametros são:
    primeiro parametro => arquivo origem
    segundo parametro  => arquivo destino
*/
void cmdCp(void) {

    // Pega os nomes dos arquivos origem e destion
    char *src = strtok(NULL," \t");
    char *dst = strtok(NULL," \t");
    if (src==NULL || dst==NULL) {
        printf ("Missing parameter\n");
        return;
    }
    // Abre o arquivo origem, que deve existir
    FILE2 hSrc = open2 (src);
    if (hSrc<0) {
        printf ("Open source file error: %d\n", hSrc);
        return;
    }
    // Cria o arquivo de destino, que será resetado se existir
    FILE2 hDst = create2 (dst);
    if (hDst<0) {
        close2(hSrc);
        printf ("Create destination file error: %d\n", hDst);
        return;
    }
    // Copia os dados de source para destination
    char buffer[2];
    while( read2(hSrc, buffer, 1) == 1 ) {
        write2(hDst, buffer, 1);
    }
    // Fecha os arquicos
    close2(hSrc);
    close2(hDst);

    printf ("Files successfully copied\n");
}
Exemple #4
0
int getarg() { int arglen1; int i; char *c; arglen1=*arglen; 
  if (arglen1) {i=arglen1+0x81; c=i; *c=0; strcpy1(namein, argv); 
    strcpy1(namelst, namein); i=strlen1(namelst); i--; c=&namelst+i; *c='S'; }
  else {strcpy1(namein, "F.C"); strcpy1(namelst, "F.S"); }  
  fdin=open2 (namein);
  if(DOS_ERR !=0){print1("Datei fehlt: "); print1(namein); exit1(1); }
  fdout=creat1(namelst);
  if(DOS_ERR !=0){print1("Datei nicht erzeugbar: ");print1(namelst);exit1(2);}
  prs("\n;Arglen: "); prnum(arglen1); if(arglen1){prs(", Argv: "); prs(argv);}
}  
Exemple #5
0
int doinclude() { int fdtemp;
  if (token==T_STRING) {  fdtemp=fdin;
  prs("\n;Verarbeite Include-Datei: "); prscomment(symbol);  
  fdin=open2(symbol);
  if (DOS_ERR !=0) {prs("Include-Datei fehlt: "); prscomment(symbol); 
    error1("Stop"); }
  linenoinclude=lineno; lineno=1;
  parse(); lineno=linenoinclude;
  fdin=fdtemp; prs("\n;Zurueck in Hauptdatei: "); prs(namein); 
  getfirstchar(); token=getlex(); }
}
Exemple #6
0
int libaacs_open(BD_AACS *p, const char *device,
                   void *file_open_handle, void *file_open_fp,
                   const char *keyfile_path)

{
    int error_code = 0;

    fptr_p_void open;
    fptr_p_void open2;
    fptr_p_void init;
    fptr_int    open_device;
    fptr_int    aacs_get_mkb_version;
    fptr_p_void aacs_get_disc_id;

    _libaacs_close(p);

    *(void **)(&open)  = dl_dlsym(p->h_libaacs, "aacs_open");
    *(void **)(&open2) = dl_dlsym(p->h_libaacs, "aacs_open2");
    *(void **)(&init)  = dl_dlsym(p->h_libaacs, "aacs_init");
    *(void **)(&aacs_get_mkb_version) = dl_dlsym(p->h_libaacs, "aacs_get_mkb_version");
    *(void **)(&aacs_get_disc_id)     = dl_dlsym(p->h_libaacs, "aacs_get_disc_id");
    *(void **)(&open_device)          = dl_dlsym(p->h_libaacs, "aacs_open_device");

    if (init && open_device) {
        p->aacs = init();
        DL_CALL(p->h_libaacs, aacs_set_fopen, p->aacs, file_open_handle, file_open_fp);
        error_code = open_device(p->aacs, device, keyfile_path);
    } else if (open2) {
        BD_DEBUG(DBG_BLURAY, "Using old aacs_open2(), no UDF support available\n");
        p->aacs = open2(device, keyfile_path, &error_code);
    } else if (open) {
        BD_DEBUG(DBG_BLURAY, "Using old aacs_open(), no verbose error reporting available\n");
        p->aacs = open(device, keyfile_path);
    } else {
        BD_DEBUG(DBG_BLURAY, "aacs_open() not found\n");
    }

    if (p->aacs) {
        if (aacs_get_mkb_version) {
            p->mkbv = aacs_get_mkb_version(p->aacs);
        }
        if (aacs_get_disc_id) {
            p->disc_id = (const uint8_t *)aacs_get_disc_id(p->aacs);
        }
        return error_code;
    }

    return error_code ? error_code : 1;
}
Exemple #7
0
/**
Abre o arquivo informado no parametro [0]
Retorna sinalização de erro
Retorna HANDLE do arquivo retornado
*/
void cmdOpen(void) {
    FILE2 hFile;

    char *token = strtok(NULL," \t");
    if (token==NULL) {
        printf ("Missing parameter\n");
        return;
    }

    hFile = open2 (token);
    if (hFile<0) {
        printf ("Error: %d\n", hFile);
        return;
    }

    printf ("File opened with handle %d\n", hFile);
}
Exemple #8
0
void ImageViewer::createActions()
{
	openImg1 = new QAction(tr("&Open Input Image 1"), this);
	openImg1->setShortcut(tr("Ctrl+1"));
	openImg1->setStatusTip(tr("Open an existing file"));
	connect(openImg1, SIGNAL(triggered()), this, SLOT(open1()));

	openImg2 = new QAction(tr("&Open Input Image 2"), this);
	openImg2->setShortcut(tr("Ctrl+2"));
	openImg2->setStatusTip(tr("Open an existing file"));
	connect(openImg2, SIGNAL(triggered()), this, SLOT(open2()));

	openImg3 = new QAction(tr("&Open Input Image 3"), this);
	openImg3->setShortcut(tr("Ctrl+3"));
	openImg3->setStatusTip(tr("Open an existing file"));
	connect(openImg3, SIGNAL(triggered()), this, SLOT(open3()));

}
int fd_ensure_open (int fd, int w)
{
  int dummy ;
  if (fcntl(fd, F_GETFD, &dummy) < 0)
  {
    int newfd ;
    if (errno != EBADF) return 0 ;
    newfd = open2("/dev/null", w ? O_WRONLY : O_RDONLY) ;
    if (newfd < 0) return 0 ;
    if (fd_move(fd, newfd) < 0)
    {
      register int e = errno ;
      fd_close(newfd) ;
      errno = e ;
      return 0 ;
    }
  }
  return 1 ;
}
Exemple #10
0
int libaacs_open(BD_AACS *p, const char *device_path, const char *keyfile_path)
{
    int error_code = 0;

    fptr_p_void open;
    fptr_p_void open2;
    fptr_int    aacs_get_mkb_version;
    fptr_p_void aacs_get_disc_id;

    _libaacs_close(p);

    *(void **)(&open)  = dl_dlsym(p->h_libaacs, "aacs_open");
    *(void **)(&open2) = dl_dlsym(p->h_libaacs, "aacs_open2");
    *(void **)(&aacs_get_mkb_version) = dl_dlsym(p->h_libaacs, "aacs_get_mkb_version");
    *(void **)(&aacs_get_disc_id)     = dl_dlsym(p->h_libaacs, "aacs_get_disc_id");

    if (open2) {
        p->aacs = open2(device_path, keyfile_path, &error_code);
    } else if (open) {
        BD_DEBUG(DBG_BLURAY, "Using old aacs_open(), no verbose error reporting available\n");
        p->aacs = open(device_path, keyfile_path);
    } else {
        BD_DEBUG(DBG_BLURAY, "aacs_open() not found\n");
    }

    if (p->aacs) {
        if (aacs_get_mkb_version) {
            p->mkbv = aacs_get_mkb_version(p->aacs);
        }
        if (aacs_get_disc_id) {
            p->disc_id = (const uint8_t *)aacs_get_disc_id(p->aacs);
        }
        return error_code;
    }

    return error_code ? error_code : 1;
}
Exemple #11
0
int open_read (char const *fn)
{
  return open2(fn, O_RDONLY | O_NONBLOCK) ;
}
Exemple #12
0
/**
Copia arquivo de um sistema de arquivos para o outro
Os parametros são:
    primeiro parametro => direção da copia
        -t copiar para o T2FS
        -f copiar para o FS do host
    segundo parametro => arquivo origem
    terceiro parametro  => arquivo destino
*/
void cmdFscp(void) {
    // Pega a direção e os nomes dos arquivos origem e destion
    char *direcao = strtok(NULL, " \t");
    char *src = strtok(NULL," \t");
    char *dst = strtok(NULL," \t");
    if (direcao==NULL || src==NULL || dst==NULL) {
        printf ("Missing parameter\n");
        return;
    }
    // Valida direção
    if (strncmp(direcao, "-t", 2)==0) {
        // src == host
        // dst == T2FS

        // Abre o arquivo origem, que deve existir
        FILE *hSrc = fopen(src, "r+");
        if (hSrc==NULL) {
            printf ("Open source file error\n");
            return;
        }
        // Cria o arquivo de destino, que será resetado se existir
        FILE2 hDst = create2 (dst);
        if (hDst<0) {
            fclose(hSrc);
            printf ("Create destination file error: %d\n", hDst);
            return;
        }
        // Copia os dados de source para destination
        char buffer[2];
        while( fread((void *)buffer, (size_t)1, (size_t)1, hSrc) == 1 ) {
            write2(hDst, buffer, 1);
        }
        // Fecha os arquicos
        fclose(hSrc);
        close2(hDst);
    }
    else if (strncmp(direcao, "-f", 2)==0) {
        // src == T2FS
        // dst == host

        // Abre o arquivo origem, que deve existir
        FILE2 hSrc = open2 (src);
        if (hSrc<0) {
            printf ("Open source file error: %d\n", hSrc);
            return;
        }
        // Cria o arquivo de destino, que será resetado se existir
        FILE *hDst = fopen(dst, "w+");
        if (hDst==NULL) {
            printf ("Open destination file error\n");
            return;
        }
        // Copia os dados de source para destination
        char buffer[2];
        while ( read2(hSrc, buffer, 1) == 1 ) {
            fwrite((void *)buffer, (size_t)1, (size_t)1, hDst);
        }
        // Fecha os arquicos
        close2(hSrc);
        fclose(hDst);
    }
    else {
        printf ("Invalid copy direction\n");
        return;
    }

    printf ("Files successfully copied\n");
}
Exemple #13
0
extern "C" Box* open1(Box* arg) {
    Box* mode = boxStrConstant("r");
    Box *rtn = open2(arg, mode);
    return rtn;
}
Exemple #14
0
int open_read (char const *fn)
{
  return open2(fn, O_RDONLY | O_NDELAY) ;
}
Exemple #15
0
Box* fileNew3(BoxedClass *cls, Box* s, Box* m) {
    assert(cls == file_cls);
    return open2(s, m);
}
int open_write (char const *fn)
{
  return open2(fn, O_WRONLY | O_NDELAY) ;
}
TVerdict CTestSyscalls::doTestStepL()
	{
	int err;
	if(TestStepName() == KCreat)
   		{
   		INFO_PRINTF1(_L("Creat():"));
   		err = Creat();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   		}
	else if(TestStepName() == Kopen1)
		{
		INFO_PRINTF1(_L("open1():"));
		err = open1();
		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
   	   	
	else if(TestStepName() == Kopen2)
		{
		INFO_PRINTF1(_L("open2():"));
		err = open2();
		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == Kopen3)
		{
		INFO_PRINTF1(_L("open3():"));
		err = open3();
		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == Kopen4)
		{
		INFO_PRINTF1(_L("open4():"));
		err = open4();
		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == Kopen5)
		{
		INFO_PRINTF1(_L("open5():"));
		err = open5();
		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == Kopen6)
		{
		INFO_PRINTF1(_L("open6():"));
		err = open6();
		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == KOpenTruncate1)
		{
		INFO_PRINTF1(_L("OpenTruncate1:"));
		err = OpenTruncate1();
		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == KOpenTruncate2)
		{
		INFO_PRINTF1(_L("OpenTruncate2:"));
		err = OpenTruncate2();
		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == Kopen7)
   		{
   		INFO_PRINTF1(_L("open7():"));
   		err = open7();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == KOpenInAppendMode)
   		{
   		INFO_PRINTF1(_L("OpenInAppendMode():"));
   		err = OpenInAppendMode();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == Kwrite1)
		{
   		INFO_PRINTF1(_L("write1():"));
		err = write1();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   		}
	else if(TestStepName() == Kwrite2)
   		{
   		INFO_PRINTF1(_L("write2():"));
   		err = write2();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == Kwrite3)
   		{
   		INFO_PRINTF1(_L("write3():"));
   		err = write3();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   		}
	else if(TestStepName() == Kwrite5)
		{
   		INFO_PRINTF1(_L("write5():"));
   		err = write5();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   		}
	else if(TestStepName() == Kread1)
   		{
   		INFO_PRINTF1(_L("read1():"));
   		err = read1();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   		}
	else if(TestStepName() == Kread2)
   		{
		INFO_PRINTF1(_L("read2():"));
   		err = read2();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   		}
	else if(TestStepName() == Kread3)
   		{
		INFO_PRINTF1(_L("read3():"));
   		err = read3();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   		}
	else if(TestStepName() == Kread4)
		{
		INFO_PRINTF1(_L("read4():"));
		err = read4();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   		}
	else if(TestStepName() == KOpendir)
   		{
   	   	INFO_PRINTF1(_L("Opendir():"));
   	   	err = Opendir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KClosedir)
   		{
   	   	INFO_PRINTF1(_L("Closedir():"));
   	   	err = Closedir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KReaddir)
   		{
   	   	INFO_PRINTF1(_L("Readdir():"));
   	   	err = Readdir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KLseek)
   		{
   	   	INFO_PRINTF1(_L("Lseek():"));
   	   	err = Lseek();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KLseek1)
   		{
   	   	INFO_PRINTF1(_L("Lseek1():"));
   	   	err = Lseek1();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
    else if(TestStepName() == KAccess)
   		{
   	   	INFO_PRINTF1(_L("Access():"));
   	   	err = Access();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KAccess1)
   		{
   	   	INFO_PRINTF1(_L("Access1():"));
   	   	err = Access1();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KDup)
   		{
   	   	INFO_PRINTF1(_L("Dup():"));
   	   	err = Dup();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KDup2)
   		{
   	   	INFO_PRINTF1(_L("Dup2():"));
   	   	err = Dup2();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KRename)
   		{
   	   	INFO_PRINTF1(_L("Rename():"));
   	   	err = Rename();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KRename1)
   		{
   	   	INFO_PRINTF1(_L("Rename1():"));
   	   	err = Rename1();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KChmod)
   		{
   	   	INFO_PRINTF1(_L("Chmod():"));
   	   	err = Chmod();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KChmod1)
   		{
   	   	INFO_PRINTF1(_L("Chmod1():"));
   	   	err = Chmod1();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
    else if(TestStepName() == KChmod_dir)
   		{
   	   	INFO_PRINTF1(_L("Chmod_dir():"));
   	   	err = Chmod_dir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KFChmod)
   		{
   	   	INFO_PRINTF1(_L("FChmod():"));
   	   	err = FChmod();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KFChmod_dir)
   		{
   	   	INFO_PRINTF1(_L("FChmod_dir():"));
   	   	err = FChmod_dir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KExit)
   		{
   	   	INFO_PRINTF1(_L("Exit():"));
   	   	err = Exit();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KClose)
   		{
   	   	INFO_PRINTF1(_L("Close():"));
   	   	err = Close();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KMkdir)
   		{
   	   	INFO_PRINTF1(_L("Mkdir():"));
   	   	err = Mkdir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KMk_dir)
   		{
   	   	INFO_PRINTF1(_L("Mk_dir():"));
   	   	err = Mk_dir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
	else if(TestStepName() == KRmdir)
   		{
   	   	INFO_PRINTF1(_L("Rmdir():"));
   	   	err = Rmdir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
	else if(TestStepName() == KRm_dir)
   		{
   	   	INFO_PRINTF1(_L("Rm_dir():"));
   	   	err = Rm_dir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
    else if(TestStepName() == KRmdir1)
   		{
   	   	INFO_PRINTF1(_L("Rmdir1():"));
   	   	err = Rmdir1();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KRmdir_Chdir)
   		{
   	   	INFO_PRINTF1(_L("Rmdir_Chdir():"));
   	   	err = Rmdir_Chdir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KFsync)
   		{
   	   	INFO_PRINTF1(_L("Fsync():"));
   	   	err = Fsync();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KUtimes)
   		{
   	   	INFO_PRINTF1(_L("Utimes():"));
   	   	err = Utimes();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
   	else if(TestStepName() == KUtime)
   		{
   	   	INFO_PRINTF1(_L("Utime():"));
   	   	err = Utime();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KChdir)
   		{
   	   	INFO_PRINTF1(_L("Chdir():"));
   	   	err = Chdir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KFcntl)
   		{
   	   	INFO_PRINTF1(_L("Fcntl():"));
   	   	err = Fcntl();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KIoctl)
   		{
   	   	INFO_PRINTF1(_L("Ioctl():"));
   	   	err = Ioctl();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KFstat)
   		{
   	   	INFO_PRINTF1(_L("Fstat():"));
   	   	err = Fstat();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KStat)
   		{
   	   	INFO_PRINTF1(_L("Stat():"));
   	   	err = Stat();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KStat1)
   		{
   	   	INFO_PRINTF1(_L("Stat1():"));
   	   	err = Stat1();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KStat2)
   		{
   	   	INFO_PRINTF1(_L("Stat2():"));
   	   	err = Stat2();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
	else if(TestStepName() == KStat3)
   		{
   	   	INFO_PRINTF1(_L("Stat3():"));
   	   	err = Stat3();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KGetpid)
   		{
   	   	INFO_PRINTF1(_L("Getpid():"));
   	   	err = Getpid();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KClock)
   		{
   	   	INFO_PRINTF1(_L("Clock():"));
   	   	err = Clock();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KTime)
   		{
   	   	INFO_PRINTF1(_L("Time():"));
   	   	err = Time();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KWaitPid)
   		{
   	   	INFO_PRINTF1(_L("WaitPid():"));
   	   	err = WaitPid();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KReadV)
   		{
   	   	INFO_PRINTF1(_L("ReadV():"));
   	   	err = ReadV();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KWriteV)
   		{
   	   	INFO_PRINTF1(_L("WriteV():"));
   	   	err = WriteV();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KSleep)
   		{
   	   	INFO_PRINTF1(_L("Sleep():"));
   	   	err = Sleep();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
	else if(TestStepName() == KSeekDir)
   		{
   	   	INFO_PRINTF1(_L("SeekDir():"));
   	   	err = SeekDir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KRewindDir)
   		{
   	   	INFO_PRINTF1(_L("RewindDir():"));
   	   	err = RewindDir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KTelldir)
   		{
   	   	INFO_PRINTF1(_L("Telldir():"));
   	   	err = Telldir();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KTestClock)
   		{
   	   	INFO_PRINTF1(_L("TestClock():"));
   	   	err = TestClock();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KCreat2)
   		{
   		INFO_PRINTF1(_L("Creat2():"));
   		err = Creat2();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   		}
   	else if(TestStepName() == Kopen8)
   		{
   		INFO_PRINTF1(_L("open8():"));
   		err = open8();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   		}
   	else if(TestStepName() == KTestStat)
   		{
   		INFO_PRINTF1(_L("KTestStat():"));
   		err = TestStat();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == KLseekttytest1)
   		{
   		INFO_PRINTF1(_L("Lseekttytest1():"));
   		err = Lseekttytest1();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == KLseekttytest2)
   		{
   		INFO_PRINTF1(_L("Lseekttytest2():"));
   		err = Lseekttytest2();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == KWaitPidtest)
   		{
   		INFO_PRINTF1(_L("WaitPidtest():"));
   		err = WaitPidtest();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == KWaittest)
   		{
   		INFO_PRINTF1(_L("Waittest():"));
   		err = Waittest();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == KOpen_FileDes_Test)
   		{
   		INFO_PRINTF1(_L("Open_FileDes_Test():"));
   		err = Open_FileDes_Test();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == Kopenuid)
   		{
   		INFO_PRINTF1(_L("openuid():"));
   		err = openuid();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == KMkdir1)
   		{
   	   	INFO_PRINTF1(_L("Mkdir1():"));
   	   	err = Mkdir1();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KMkdir2)
   		{
   	   	INFO_PRINTF1(_L("Mkdir2():"));
   	   	err = Mkdir2();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
	else if(TestStepName() == KRename2)
   		{
   	   	INFO_PRINTF1(_L("Rename2():"));
   	   	err = Rename2();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == Ktestfsync)
   		{
   		INFO_PRINTF1(_L("testfsync():"));
   		err = testfsync();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == Ktestrename)
   		{
   		INFO_PRINTF1(_L("testrename():"));
   		err = testrename();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == Ktestopenvalidate)
   		{
   		INFO_PRINTF1(_L("testopenvalidate():"));
   		err = testopenvalidate();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == Ksync_safe)
   		{
   		INFO_PRINTF1(_L("sync_safe():"));
   		err = sync_safe();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
   	else if(TestStepName() == KFstat1)
   		{
   	   	INFO_PRINTF1(_L("Fstat1():"));
   	   	err = Fstat1();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KUtimes1)
   		{
   	   	INFO_PRINTF1(_L("Utimes1():"));
   	   	err = Utimes1();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
		}
	else if(TestStepName() == KMkdir_test1)
   		{
   	   	INFO_PRINTF1(_L("Mkdir_test1():"));
   	   	err = Mkdir_test1();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KChmod_test)
   		{
   	   	INFO_PRINTF1(_L("Chmod_test():"));
   	   	err = Chmod_test();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
	else if(TestStepName() == KChdir1)
   		{
   	   	INFO_PRINTF1(_L("Chdir1():"));
   	   	err = Chdir1();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}   
   	else if(TestStepName() == KRmdir2)
   		{
   	   	INFO_PRINTF1(_L("Rmdir2():"));
   	   	err = Rmdir2();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KRename_test)
   		{
   	   	INFO_PRINTF1(_L("Rename_test():"));
   	   	err = Rename_test();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KRename3)
   		{
   	   	INFO_PRINTF1(_L("Rename3():"));
   	   	err = Rename3();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
   	else if(TestStepName() == KCreat1)
   		{
   		INFO_PRINTF1(_L("Creat1():"));
   		err = Creat1();
   		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   		}
   	else if(TestStepName() == KReadV1)
   		{
   	   	INFO_PRINTF1(_L("ReadV1():"));
   	   	err = ReadV1();
   	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
   	   	}
 	else if(TestStepName() == KUtimes2)
    		{
    	   	INFO_PRINTF1(_L("Utimes2():"));
    	   	err = Utimes2();
    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
 		}
 	else if(TestStepName() == KStat_test)
    		{
    	   	INFO_PRINTF1(_L("Stat_test():"));
    	   	err = Stat_test();
    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    	   	}
    	else if(TestStepName() == KMkdir_test2)
    		{
    	   	INFO_PRINTF1(_L("Mkdir_test2():"));
    	   	err = Mkdir_test2();
    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    	   	}
    	else if(TestStepName() == KChmod2)
    		{
    	   	INFO_PRINTF1(_L("Chmod2():"));
    	   	err = Chmod2();
    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    	   	}
    	else if(TestStepName() == KChdir2)
    		{
    	   	INFO_PRINTF1(_L("Chdir2():"));
    	   	err = Chdir2();
    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    	   	} 
    	else if(TestStepName() == KRename4)
    		{
    	   	INFO_PRINTF1(_L("Rename4():"));
    	   	err = Rename4();
    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    	   	}
 	else if(TestStepName() == KRename5)
    		{
    	   	INFO_PRINTF1(_L("Rename5():"));
    	   	err = Rename5();
    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    	   	}  
 	else if(TestStepName() == KRmdir3)
    		{
    	   	INFO_PRINTF1(_L("Rmdir3():"));
    	   	err = Rmdir3();
    	   	SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    	   	}  
    	else if(TestStepName() == Kread5)
 		{
 		INFO_PRINTF1(_L("read5():"));
 		err = read5();
    		SetTestStepResult(err ? static_cast<TVerdict>(err) : EPass);
    		} 	   	 
	return TestStepResult(); 
	}
Exemple #18
0
int libaacs_open(BD_AACS *p, const char *device,
                   void *file_open_handle, void *file_open_fp,
                   const char *keyfile_path)

{
    int error_code = 0;

    fptr_p_void open;
    fptr_p_void open2;
    fptr_p_void init;
    fptr_int    open_device;
    fptr_int    aacs_get_mkb_version;
    fptr_p_void aacs_get_disc_id;

    _libaacs_close(p);

    *(void **)(&open)  = dl_dlsym(p->h_libaacs, "aacs_open");
    *(void **)(&open2) = dl_dlsym(p->h_libaacs, "aacs_open2");
    *(void **)(&init)  = dl_dlsym(p->h_libaacs, "aacs_init");
    *(void **)(&aacs_get_mkb_version) = dl_dlsym(p->h_libaacs, "aacs_get_mkb_version");
    *(void **)(&aacs_get_disc_id)     = dl_dlsym(p->h_libaacs, "aacs_get_disc_id");
    *(void **)(&open_device)          = dl_dlsym(p->h_libaacs, "aacs_open_device");

    if (init && open_device) {
        p->aacs = init();
        DL_CALL(p->h_libaacs, aacs_set_fopen, p->aacs, file_open_handle, file_open_fp);
        error_code = open_device(p->aacs, device, keyfile_path);
    } else if (open2) {
        BD_DEBUG(DBG_BLURAY, "Using old aacs_open2(), no UDF support available\n");
        p->aacs = open2(device, keyfile_path, &error_code);

        /* libmmbd needs dev: for devices */
        if (!p->aacs && p->impl_id == IMPL_LIBMMBD && !strncmp(device, "/dev/", 5)) {
            char *tmp_device = str_printf("dev:%s", device);
            if (tmp_device) {
                p->aacs = open2(tmp_device, keyfile_path, &error_code);
                X_FREE(tmp_device);
            }
        }
    } else if (open) {
        BD_DEBUG(DBG_BLURAY, "Using old aacs_open(), no verbose error reporting available\n");
        p->aacs = open(device, keyfile_path);
    } else {
        BD_DEBUG(DBG_BLURAY, "aacs_open() not found\n");
    }

    if (error_code) {
        /* failed. try next aacs implementation if available. */
        BD_AACS *p2 = _load(p->impl_id + 1);
        if (p2) {
            if (!libaacs_open(p2, device, file_open_handle, file_open_fp, keyfile_path)) {
                /* succeed - swap implementations */
                _unload(p);
                *p = *p2;
                X_FREE(p2);
                return 0;
            }
            /* failed - report original errors */
            libaacs_unload(&p2);
        }
    }

    if (p->aacs) {
        if (aacs_get_mkb_version) {
            p->mkbv = aacs_get_mkb_version(p->aacs);
        }
        if (aacs_get_disc_id) {
            p->disc_id = (const uint8_t *)aacs_get_disc_id(p->aacs);
        }
        return error_code;
    }

    return error_code ? error_code : 1;
}