Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
reset.c
Package: cssdvd.zip [view]
Upload User: lsh121205
Upload Date: 2007-01-08
Package Size: 25k
Code Size: 1k
Category:
DVD
Development Platform:
C/C++
- /*
- * A noddy program which tries to reset all AGID's on the DVD-ROM drive.
- */
- #include<stdio.h>
- #include<fcntl.h>
- #if defined(__OpenBSD__)
- # include <sys/dvdio.h>
- #elif defined(__linux__)
- # include <linux/cdrom.h>
- #else
- # error "Need the DVD ioctls"
- #endif
- #include<sys/ioctl.h>
- #include<errno.h>
- static int fd;
- #define DVD "/dev/cdrom"
- int main(int ac, char **av)
- {
- dvd_authinfo ai;
- char *device = DVD;
- int i;
- if (ac > 1)
- device = av[1];
- fd = open(device, O_RDONLY | O_NONBLOCK);
- if (fd < 0) {
- printf("unable to open dvd drive (%s).n", device);
- return 1;
- }
- for (i = 0; i < 4; i++) {
- memset(&ai, 0, sizeof(ai));
- ai.type = DVD_INVALIDATE_AGID;
- ai.lsa.agid = i;
- ioctl(fd, DVD_AUTH, &ai);
- }
- return 0;
- }