⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 transport.hxx

📁 最新的linux下dvd刻录软件,支持DVD+RW、DVD-RW光盘刻录。
💻 HXX
字号:
//// This is part of dvd+rw-tools by Andy Polyakov <appro@fy.chalmers.se>//// Use-it-on-your-own-risk, GPL bless...//// For further details see http://fy.chalmers.se/~appro/linux/DVD+RW///#if defined(__unix) || defined(__unix__)#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <poll.h>#include <sys/time.h>inline long getmsecs(){ struct timeval tv;    gettimeofday (&tv,NULL);  return tv.tv_sec*1000+tv.tv_usec/1000;}#include <errno.h>#ifndef EMEDIUMTYPE#define EMEDIUMTYPE	EINVAL#endif#ifndef	ENOMEDIUM#define	ENOMEDIUM	ENODEV#endif#include <locale.h>#define ENV_LOCALE	""#elif defined(_WIN32)#include <windows.h>#include <stddef.h>#include <stdio.h>#include <stdlib.h>#define ssize_t		LONG_PTR#define off64_t		__int64#include "win32err.h"#define poll(a,b,t)	Sleep(t)#define getmsecs()	GetTickCount()#include <locale.h>#define ENV_LOCALE	".OCP"#endif#define CREAM_ON_ERRNO_NAKED(s)				\    switch ((s)[12])					\    {	case 0x04:	errno=EAGAIN;	break;		\	case 0x20:	errno=ENODEV;	break;		\	case 0x21:	if ((s)[13]==0)	errno=ENOSPC;	\			else		errno=EINVAL;	\			break;				\	case 0x30:	errno=EMEDIUMTYPE;	break;	\	case 0x3A:	errno=ENOMEDIUM;	break;	\    }#define CREAM_ON_ERRNO(s)	do { CREAM_ON_ERRNO_NAKED(s) } while(0)#ifndef FATAL_START#define	FATAL_START(er)	(0x80|(er))#endif#define ERRCODE(s)	((((s)[2]&0x0F)<<16)|((s)[12]<<8)|((s)[13]))#define	SK(errcode)	(((errcode)>>16)&0xF)#define	ASC(errcode)	(((errcode)>>8)&0xFF)#define ASCQ(errcode)	((errcode)&0xFF)static void sperror (const char *cmd,int err){ int saved_errno=errno;    if (err==-1)	fprintf (stderr,":-( unable to %s: ",cmd);    else	fprintf (stderr,":-[ %s failed with SK=%Xh/ASC=%02Xh/ACQ=%02Xh]: ",			cmd,SK(err),ASC(err),ASCQ(err));    errno=saved_errno, perror (NULL);}static void sperror (const char *cmd,unsigned char *sense){ int saved_errno=errno;  int err=ERRCODE(sense);    if (err==0)	fprintf (stderr,":-( unable to %s: ",cmd);    else    {	if ((err==0x20407 || err==0x20408) && sense[15]&0x80)	    fprintf (stderr,":-[ %s failed with SK=%Xh/ASC=%02Xh/ACQ=%02Xh@%.1f%%]: ",			cmd,SK(err),ASC(err),ASCQ(err),			100.0*(sense[16]<<8|sense[17])/65536.0);    	else	    fprintf (stderr,":-[ %s failed with SK=%Xh/ASC=%02Xh/ACQ=%02Xh]: ",			cmd,SK(err),ASC(err),ASCQ(err));    }    errno=saved_errno, perror (NULL);}class autofree {    private:	unsigned char *ptr;    public:	autofree()			{ ptr=NULL; }	~autofree()			{ if (ptr) free(ptr); }	unsigned char *operator=(unsigned char *str)					{ return ptr=str; }	operator unsigned char *()	{ return ptr; }};extern "C" char *plusminus_locale(){ static class __plusminus {    private:	char str[4];    public:	__plusminus()	{   setlocale(LC_CTYPE,ENV_LOCALE);			    int l = wctomb(str,(wchar_t)(unsigned char)'

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -