Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / multimedia / regionset / patches / patch-ab
blobca96b05a4ee7befbd030f9b7963173c670fa594d
1 $NetBSD: patch-ab,v 1.3 2005/06/19 10:42:27 hira Exp $
3 --- regionset.c.old     2003-10-30 07:32:34.000000000 -0500
4 +++ regionset.c 2005-04-16 02:42:40.000000000 -0400
5 @@ -27,7 +27,11 @@
6  #include <stdio.h>
7  #include "dvd_udf.h"
8  
9 +#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
10 +#define DEFAULTDEVICE "/dev/cd0a"
11 +#else /* linux */
12  #define DEFAULTDEVICE "/dev/dvd"
13 +#endif
14  #define VERSION "0.1"
16  int main (int argc, char* argv[]) 
17 @@ -39,8 +43,9 @@
18         if (argc>1) err=UDFOpenDisc(argv[1]);
19         else err=UDFOpenDisc(DEFAULTDEVICE);
20         if (err<0) {
21 -               printf("ERROR: Could not open disc \"%s\"!\n",((argc>=1)?argv[1]:DEFAULTDEVICE));
22 +               printf("ERROR: Could not open disc \"%s\"!\n",((argc>=2)?argv[1]:DEFAULTDEVICE));
23                  printf("Ensure that there is any readable CD or DVD in the drive.\n");
24 +               printf("usage: regionset [dvd-device-node]\n");
25                 return 1;
26         }
27         if (UDFRPCGet(&type,&vra,&ucca,&region_mask,&rpc_scheme)) {
28 @@ -60,6 +65,20 @@
29         printf("Would you like to change the region setting of your drive? [y/n]:");
30         fgets(ch,3,stdin);
31         if ((ch[0]=='y') || (ch[0]=='Y')) {
32 +               printf("Choices include (not complete list):\n");
33 +               printf(" 0: Regionless DVDs only\n");
34 +               printf(" 1: USA, Canada, US Territories\n");
35 +               printf(" 2: W. Europe, Greenland, S. Africa, Lesotho, "
36 +                   "Swaziland, Japan, Egypt, Mid-East\n");
37 +               printf(" 3: Southeast Asia, South Korea, Hong Kong, Macau, "
38 +                   "Taiwan\n");
39 +               printf(" 4: Australia, New Zealand, Oceania, Mexico, Central "
40 +                   "America\n");
41 +               printf(" 5: Russia (& former Soviet Union), E. Europe, Indian "
42 +                   "subcontinent, Mongolia\n    N. Korea, rest of Africa\n");
43 +               printf(" 6: People's Republic of China\n");
44 +               printf(" 7: reserved\n");
45 +               printf(" 8: International Venues\n");
46                 printf("Enter the new region number for your drive [1..8]:");
47                 fgets(ch,3,stdin);
48                 if ((ch[0]<'0') || (ch[0]>'8')) {
49 @@ -72,7 +91,7 @@
50                         printf("Identical region code already set, aborting!\n");
51                         goto ERROR;
52                 }
53 -               printf("New mask: 0x%02X, correct? [y/n]:",i);
54 +               printf("New mask: 0x%02X, correct? [y/n]:",i & 0xff);
55                 fgets(ch,3,stdin);
56                 if ((ch[0]=='y') || (ch[0]=='Y')) {
57                         if (UDFRPCSet(i)) {