cdparanoia-gcc.patch 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. Index: interface/test_interface.c
  2. ===================================================================
  3. --- interface/test_interface.c (Revision 15337)
  4. +++ interface/test_interface.c (Revision 15340)
  5. @@ -66,9 +66,9 @@
  6. if(!fd)fd=fdopen(d->cdda_fd,"r");
  7. if(begin<lastread)
  8. - d->private->last_milliseconds=20;
  9. + d->private_data->last_milliseconds=20;
  10. else
  11. - d->private->last_milliseconds=sectors;
  12. + d->private_data->last_milliseconds=sectors;
  13. #ifdef CDDA_TEST_UNDERRUN
  14. sectors-=1;
  15. Index: interface/cdda_interface.h
  16. ===================================================================
  17. --- interface/cdda_interface.h (Revision 15337)
  18. +++ interface/cdda_interface.h (Revision 15340)
  19. @@ -84,7 +84,7 @@
  20. int is_atapi;
  21. int is_mmc;
  22. - cdda_private_data_t *private;
  23. + cdda_private_data_t *private_data;
  24. void *reserved;
  25. unsigned char inqbytes[4];
  26. Index: interface/interface.c
  27. ===================================================================
  28. --- interface/interface.c (Revision 15337)
  29. +++ interface/interface.c (Revision 15340)
  30. @@ -39,9 +39,9 @@
  31. if(d->drive_model)free(d->drive_model);
  32. if(d->cdda_fd!=-1)close(d->cdda_fd);
  33. if(d->ioctl_fd!=-1 && d->ioctl_fd!=d->cdda_fd)close(d->ioctl_fd);
  34. - if(d->private){
  35. - if(d->private->sg_hd)free(d->private->sg_hd);
  36. - free(d->private);
  37. + if(d->private_data){
  38. + if(d->private_data->sg_hd)free(d->private_data->sg_hd);
  39. + free(d->private_data);
  40. }
  41. free(d);
  42. @@ -127,7 +127,7 @@
  43. }
  44. }
  45. }
  46. - if(ms)*ms=d->private->last_milliseconds;
  47. + if(ms)*ms=d->private_data->last_milliseconds;
  48. return(sectors);
  49. }
  50. Index: interface/scsi_interface.c
  51. ===================================================================
  52. --- interface/scsi_interface.c (Revision 15337)
  53. +++ interface/scsi_interface.c (Revision 15340)
  54. @@ -15,13 +15,13 @@
  55. static int timed_ioctl(cdrom_drive *d, int fd, int command, void *arg){
  56. struct timespec tv1;
  57. struct timespec tv2;
  58. - int ret1=clock_gettime(d->private->clock,&tv1);
  59. + int ret1=clock_gettime(d->private_data->clock,&tv1);
  60. int ret2=ioctl(fd, command,arg);
  61. - int ret3=clock_gettime(d->private->clock,&tv2);
  62. + int ret3=clock_gettime(d->private_data->clock,&tv2);
  63. if(ret1<0 || ret3<0){
  64. - d->private->last_milliseconds=-1;
  65. + d->private_data->last_milliseconds=-1;
  66. }else{
  67. - d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.;
  68. + d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.;
  69. }
  70. return ret2;
  71. }
  72. @@ -96,7 +96,7 @@
  73. static void clear_garbage(cdrom_drive *d){
  74. fd_set fdset;
  75. struct timeval tv;
  76. - struct sg_header *sg_hd=d->private->sg_hd;
  77. + struct sg_header *sg_hd=d->private_data->sg_hd;
  78. int flag=0;
  79. /* clear out any possibly preexisting garbage */
  80. @@ -185,7 +185,7 @@
  81. struct timespec tv2;
  82. int tret1,tret2;
  83. int status = 0;
  84. - struct sg_header *sg_hd=d->private->sg_hd;
  85. + struct sg_header *sg_hd=d->private_data->sg_hd;
  86. long writebytes=SG_OFF+cmd_len+in_size;
  87. /* generic scsi device services */
  88. @@ -195,7 +195,7 @@
  89. memset(sg_hd,0,sizeof(sg_hd));
  90. memset(sense_buffer,0,SG_MAX_SENSE);
  91. - memcpy(d->private->sg_buffer,cmd,cmd_len+in_size);
  92. + memcpy(d->private_data->sg_buffer,cmd,cmd_len+in_size);
  93. sg_hd->twelve_byte = cmd_len == 12;
  94. sg_hd->result = 0;
  95. sg_hd->reply_len = SG_OFF + out_size;
  96. @@ -209,7 +209,7 @@
  97. tell if the command failed. Scared yet? */
  98. if(bytecheck && out_size>in_size){
  99. - memset(d->private->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size);
  100. + memset(d->private_data->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size);
  101. /* the size does not remove cmd_len due to the way the kernel
  102. driver copies buffers */
  103. writebytes+=(out_size-in_size);
  104. @@ -243,7 +243,7 @@
  105. }
  106. sigprocmask (SIG_BLOCK, &(d->sigset), NULL );
  107. - tret1=clock_gettime(d->private->clock,&tv1);
  108. + tret1=clock_gettime(d->private_data->clock,&tv1);
  109. errno=0;
  110. status = write(d->cdda_fd, sg_hd, writebytes );
  111. @@ -289,7 +289,7 @@
  112. }
  113. }
  114. - tret2=clock_gettime(d->private->clock,&tv2);
  115. + tret2=clock_gettime(d->private_data->clock,&tv2);
  116. errno=0;
  117. status = read(d->cdda_fd, sg_hd, SG_OFF + out_size);
  118. sigprocmask ( SIG_UNBLOCK, &(d->sigset), NULL );
  119. @@ -313,7 +313,7 @@
  120. if(bytecheck && in_size+cmd_len<out_size){
  121. long i,flag=0;
  122. for(i=in_size;i<out_size;i++)
  123. - if(d->private->sg_buffer[i]!=bytefill){
  124. + if(d->private_data->sg_buffer[i]!=bytefill){
  125. flag=1;
  126. break;
  127. }
  128. @@ -326,9 +326,9 @@
  129. errno=0;
  130. if(tret1<0 || tret2<0){
  131. - d->private->last_milliseconds=-1;
  132. + d->private_data->last_milliseconds=-1;
  133. }else{
  134. - d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000;
  135. + d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000;
  136. }
  137. return(0);
  138. }
  139. @@ -347,7 +347,7 @@
  140. memset(&hdr,0,sizeof(hdr));
  141. memset(sense,0,sizeof(sense));
  142. - memcpy(d->private->sg_buffer,cmd+cmd_len,in_size);
  143. + memcpy(d->private_data->sg_buffer,cmd+cmd_len,in_size);
  144. hdr.cmdp = cmd;
  145. hdr.cmd_len = cmd_len;
  146. @@ -355,7 +355,7 @@
  147. hdr.mx_sb_len = SG_MAX_SENSE;
  148. hdr.timeout = 50000;
  149. hdr.interface_id = 'S';
  150. - hdr.dxferp = d->private->sg_buffer;
  151. + hdr.dxferp = d->private_data->sg_buffer;
  152. hdr.flags = SG_FLAG_DIRECT_IO; /* direct IO if we can get it */
  153. /* scary buffer fill hack */
  154. @@ -400,7 +400,7 @@
  155. if(bytecheck && in_size<out_size){
  156. long i,flag=0;
  157. for(i=in_size;i<out_size;i++)
  158. - if(d->private->sg_buffer[i]!=bytefill){
  159. + if(d->private_data->sg_buffer[i]!=bytefill){
  160. flag=1;
  161. break;
  162. }
  163. @@ -412,7 +412,7 @@
  164. }
  165. /* Can't rely on .duration because we can't be certain kernel has HZ set to something useful */
  166. - /* d->private->last_milliseconds = hdr.duration; */
  167. + /* d->private_data->last_milliseconds = hdr.duration; */
  168. errno = 0;
  169. return 0;
  170. @@ -445,9 +445,9 @@
  171. handle_scsi_cmd(d, cmd, 6, 0, 56, 0,0, sense);
  172. - key = d->private->sg_buffer[2] & 0xf;
  173. - ASC = d->private->sg_buffer[12];
  174. - ASCQ = d->private->sg_buffer[13];
  175. + key = d->private_data->sg_buffer[2] & 0xf;
  176. + ASC = d->private_data->sg_buffer[12];
  177. + ASCQ = d->private_data->sg_buffer[13];
  178. if(key == 2 && ASC == 4 && ASCQ == 1) return 0;
  179. return 1;
  180. @@ -492,7 +492,7 @@
  181. if (handle_scsi_cmd (d, cmd, 10, 0, size+4,'\377',1,sense)) return(1);
  182. {
  183. - unsigned char *b=d->private->sg_buffer;
  184. + unsigned char *b=d->private_data->sg_buffer;
  185. if(b[0])return(1); /* Handles only up to 256 bytes */
  186. if(b[6])return(1); /* Handles only up to 256 bytes */
  187. @@ -604,8 +604,8 @@
  188. static unsigned int get_orig_sectorsize(cdrom_drive *d){
  189. if(mode_sense(d,12,0x01))return(-1);
  190. - d->orgdens = d->private->sg_buffer[4];
  191. - return(d->orgsize = ((int)(d->private->sg_buffer[10])<<8)+d->private->sg_buffer[11]);
  192. + d->orgdens = d->private_data->sg_buffer[4];
  193. + return(d->orgsize = ((int)(d->private_data->sg_buffer[10])<<8)+d->private_data->sg_buffer[11]);
  194. }
  195. /* switch CDROM scsi drives to given sector size */
  196. @@ -664,8 +664,8 @@
  197. return(-4);
  198. }
  199. - first=d->private->sg_buffer[2];
  200. - last=d->private->sg_buffer[3];
  201. + first=d->private_data->sg_buffer[2];
  202. + last=d->private_data->sg_buffer[3];
  203. tracks=last-first+1;
  204. if (last > MAXTRK || first > MAXTRK || last<0 || first<0) {
  205. @@ -683,7 +683,7 @@
  206. return(-5);
  207. }
  208. {
  209. - scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4);
  210. + scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4);
  211. d->disc_toc[i-first].bFlags=toc->bFlags;
  212. d->disc_toc[i-first].bTrack=i;
  213. @@ -704,7 +704,7 @@
  214. return(-2);
  215. }
  216. {
  217. - scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4);
  218. + scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4);
  219. d->disc_toc[i-first].bFlags=toc->bFlags;
  220. d->disc_toc[i-first].bTrack=0xAA;
  221. @@ -738,7 +738,7 @@
  222. }
  223. /* copy to our structure and convert start sector */
  224. - tracks = d->private->sg_buffer[1];
  225. + tracks = d->private_data->sg_buffer[1];
  226. if (tracks > MAXTRK) {
  227. cderror(d,"003: CDROM reporting illegal number of tracks\n");
  228. return(-3);
  229. @@ -754,33 +754,33 @@
  230. return(-5);
  231. }
  232. - d->disc_toc[i].bFlags = d->private->sg_buffer[10];
  233. + d->disc_toc[i].bFlags = d->private_data->sg_buffer[10];
  234. d->disc_toc[i].bTrack = i + 1;
  235. d->disc_toc[i].dwStartSector= d->adjust_ssize *
  236. - (((signed char)(d->private->sg_buffer[2])<<24) |
  237. - (d->private->sg_buffer[3]<<16)|
  238. - (d->private->sg_buffer[4]<<8)|
  239. - (d->private->sg_buffer[5]));
  240. + (((signed char)(d->private_data->sg_buffer[2])<<24) |
  241. + (d->private_data->sg_buffer[3]<<16)|
  242. + (d->private_data->sg_buffer[4]<<8)|
  243. + (d->private_data->sg_buffer[5]));
  244. }
  245. d->disc_toc[i].bFlags = 0;
  246. d->disc_toc[i].bTrack = i + 1;
  247. - memcpy (&foo, d->private->sg_buffer+2, 4);
  248. - memcpy (&bar, d->private->sg_buffer+6, 4);
  249. + memcpy (&foo, d->private_data->sg_buffer+2, 4);
  250. + memcpy (&bar, d->private_data->sg_buffer+6, 4);
  251. d->disc_toc[i].dwStartSector = d->adjust_ssize * (be32_to_cpu(foo) +
  252. be32_to_cpu(bar));
  253. d->disc_toc[i].dwStartSector= d->adjust_ssize *
  254. - ((((signed char)(d->private->sg_buffer[2])<<24) |
  255. - (d->private->sg_buffer[3]<<16)|
  256. - (d->private->sg_buffer[4]<<8)|
  257. - (d->private->sg_buffer[5]))+
  258. + ((((signed char)(d->private_data->sg_buffer[2])<<24) |
  259. + (d->private_data->sg_buffer[3]<<16)|
  260. + (d->private_data->sg_buffer[4]<<8)|
  261. + (d->private_data->sg_buffer[5]))+
  262. - ((((signed char)(d->private->sg_buffer[6])<<24) |
  263. - (d->private->sg_buffer[7]<<16)|
  264. - (d->private->sg_buffer[8]<<8)|
  265. - (d->private->sg_buffer[9]))));
  266. + ((((signed char)(d->private_data->sg_buffer[6])<<24) |
  267. + (d->private_data->sg_buffer[7]<<16)|
  268. + (d->private_data->sg_buffer[8]<<8)|
  269. + (d->private_data->sg_buffer[9]))));
  270. d->cd_extra = FixupTOC(d,tracks+1);
  271. @@ -817,7 +817,7 @@
  272. cmd[8] = sectors;
  273. if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  274. return(ret);
  275. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  276. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  277. return(0);
  278. }
  279. @@ -836,7 +836,7 @@
  280. cmd[9] = sectors;
  281. if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  282. return(ret);
  283. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  284. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  285. return(0);
  286. }
  287. @@ -854,7 +854,7 @@
  288. cmd[8] = sectors;
  289. if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  290. return(ret);
  291. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  292. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  293. return(0);
  294. }
  295. @@ -872,7 +872,7 @@
  296. cmd[9] = sectors;
  297. if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  298. return(ret);
  299. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  300. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  301. return(0);
  302. }
  303. @@ -890,7 +890,7 @@
  304. cmd[8] = sectors;
  305. if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  306. return(ret);
  307. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  308. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  309. return(0);
  310. }
  311. @@ -908,7 +908,7 @@
  312. cmd[9] = sectors;
  313. if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  314. return(ret);
  315. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  316. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  317. return(0);
  318. }
  319. @@ -922,7 +922,7 @@
  320. cmd[8] = sectors;
  321. if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  322. return(ret);
  323. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  324. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  325. return(0);
  326. }
  327. @@ -936,7 +936,7 @@
  328. cmd[8] = sectors;
  329. if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  330. return(ret);
  331. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  332. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  333. return(0);
  334. }
  335. @@ -950,7 +950,7 @@
  336. cmd[8] = sectors;
  337. if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  338. return(ret);
  339. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  340. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  341. return(0);
  342. }
  343. @@ -964,7 +964,7 @@
  344. cmd[8] = sectors;
  345. if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  346. return(ret);
  347. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  348. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  349. return(0);
  350. }
  351. @@ -978,7 +978,7 @@
  352. cmd[8] = sectors;
  353. if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  354. return(ret);
  355. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  356. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  357. return(0);
  358. }
  359. @@ -992,7 +992,7 @@
  360. cmd[8] = sectors;
  361. if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  362. return(ret);
  363. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  364. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  365. return(0);
  366. }
  367. @@ -1026,7 +1026,7 @@
  368. if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  369. return(ret);
  370. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  371. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  372. return(0);
  373. }
  374. @@ -1039,7 +1039,7 @@
  375. if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  376. return(ret);
  377. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  378. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  379. return(0);
  380. }
  381. @@ -1052,7 +1052,7 @@
  382. if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
  383. return(ret);
  384. - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  385. + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
  386. return(0);
  387. }
  388. @@ -1275,7 +1275,7 @@
  389. static int count_2352_bytes(cdrom_drive *d){
  390. long i;
  391. for(i=2351;i>=0;i--)
  392. - if(d->private->sg_buffer[i]!=(unsigned char)'\177')
  393. + if(d->private_data->sg_buffer[i]!=(unsigned char)'\177')
  394. return(((i+3)>>2)<<2);
  395. return(0);
  396. @@ -1284,7 +1284,7 @@
  397. static int verify_nonzero(cdrom_drive *d){
  398. long i,flag=0;
  399. for(i=0;i<2352;i++)
  400. - if(d->private->sg_buffer[i]!=0){
  401. + if(d->private_data->sg_buffer[i]!=0){
  402. flag=1;
  403. break;
  404. }
  405. @@ -1621,7 +1621,7 @@
  406. d->is_mmc=0;
  407. if(mode_sense(d,22,0x2A)==0){
  408. - b=d->private->sg_buffer;
  409. + b=d->private_data->sg_buffer;
  410. b+=b[3]+4;
  411. if((b[0]&0x3F)==0x2A){
  412. @@ -1669,7 +1669,7 @@
  413. cderror(d,"008: Unable to identify CDROM model\n");
  414. return(NULL);
  415. }
  416. - return (d->private->sg_buffer);
  417. + return (d->private_data->sg_buffer);
  418. }
  419. int scsi_init_drive(cdrom_drive *d){
  420. @@ -1725,8 +1725,8 @@
  421. check_cache(d);
  422. d->error_retry=1;
  423. - d->private->sg_hd=realloc(d->private->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128);
  424. - d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF;
  425. + d->private_data->sg_hd=realloc(d->private_data->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128);
  426. + d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF;
  427. d->report_all=1;
  428. return(0);
  429. }
  430. Index: interface/cooked_interface.c
  431. ===================================================================
  432. --- interface/cooked_interface.c (Revision 15337)
  433. +++ interface/cooked_interface.c (Revision 15340)
  434. @@ -13,13 +13,13 @@
  435. static int timed_ioctl(cdrom_drive *d, int fd, int command, void *arg){
  436. struct timespec tv1;
  437. struct timespec tv2;
  438. - int ret1=clock_gettime(d->private->clock,&tv1);
  439. + int ret1=clock_gettime(d->private_data->clock,&tv1);
  440. int ret2=ioctl(fd, command,arg);
  441. - int ret3=clock_gettime(d->private->clock,&tv2);
  442. + int ret3=clock_gettime(d->private_data->clock,&tv2);
  443. if(ret1<0 || ret3<0){
  444. - d->private->last_milliseconds=-1;
  445. + d->private_data->last_milliseconds=-1;
  446. }else{
  447. - d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.;
  448. + d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.;
  449. }
  450. return ret2;
  451. }
  452. Index: interface/scan_devices.c
  453. ===================================================================
  454. --- interface/scan_devices.c (Revision 15337)
  455. +++ interface/scan_devices.c (Revision 15340)
  456. @@ -264,11 +264,11 @@
  457. d->interface=COOKED_IOCTL;
  458. d->bigendianp=-1; /* We don't know yet... */
  459. d->nsectors=-1;
  460. - d->private=calloc(1,sizeof(*d->private));
  461. + d->private_data=calloc(1,sizeof(*d->private_data));
  462. {
  463. /* goddamnit */
  464. struct timespec tv;
  465. - d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);
  466. + d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);
  467. }
  468. idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",description);
  469. return(d);
  470. @@ -674,15 +674,15 @@
  471. d->bigendianp=-1; /* We don't know yet... */
  472. d->nsectors=-1;
  473. d->messagedest = messagedest;
  474. - d->private=calloc(1,sizeof(*d->private));
  475. + d->private_data=calloc(1,sizeof(*d->private_data));
  476. {
  477. /* goddamnit */
  478. struct timespec tv;
  479. - d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);
  480. + d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);
  481. }
  482. if(use_sgio){
  483. d->interface=SGIO_SCSI;
  484. - d->private->sg_buffer=(unsigned char *)(d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE));
  485. + d->private_data->sg_buffer=(unsigned char *)(d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE));
  486. g_fd=d->cdda_fd=dup(d->ioctl_fd);
  487. }else{
  488. version=verify_SG_version(d,messagedest,messages);
  489. @@ -696,8 +696,8 @@
  490. }
  491. /* malloc our big buffer for scsi commands */
  492. - d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE);
  493. - d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF;
  494. + d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE);
  495. + d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF;
  496. }
  497. {
  498. @@ -772,9 +772,9 @@
  499. if(i_fd!=-1)close(i_fd);
  500. if(g_fd!=-1)close(g_fd);
  501. if(d){
  502. - if(d->private){
  503. - if(d->private->sg_hd)free(d->private->sg_hd);
  504. - free(d->private);
  505. + if(d->private_data){
  506. + if(d->private_data->sg_hd)free(d->private_data->sg_hd);
  507. + free(d->private_data);
  508. }
  509. free(d);
  510. }
  511. @@ -821,7 +821,7 @@
  512. d->interface=TEST_INTERFACE;
  513. d->bigendianp=-1; /* We don't know yet... */
  514. d->nsectors=-1;
  515. - d->private=calloc(1,sizeof(*d->private));
  516. + d->private_data=calloc(1,sizeof(*d->private_data));
  517. d->drive_model=copystring("File based test interface");
  518. idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",d->drive_model);