home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / indent / diffs / arp-kick-1.3.diffs < prev   
Text File  |  1999-05-21  |  5KB  |  210 lines

  1. diff -cr ram:indent-1.7/indent.c dh1:indent-1.7/indent.c
  2. *** ram:indent-1.7/indent.c    Sat Feb 13 18:17:07 1993
  3. --- dh1:indent-1.7/indent.c    Sat Feb 13 18:31:56 1993
  4. ***************
  5. *** 23,37 ****
  6.   
  7.   #ifdef AMIGA
  8.   #include <exec/types.h>
  9. ! #include <dos/dos.h>
  10. ! #include <dos/dosextens.h>
  11. ! #include <dos/dosasl.h>
  12.   #include <proto/dos.h>
  13.   
  14.   #define MAXPATH 200
  15.   #define MAXARGS 256
  16.   
  17. ! extern struct DosLibrary *DOSBase;
  18.   
  19.   int expand_args ();
  20.   #endif /* AMIGA */
  21. --- 23,39 ----
  22.   
  23.   #ifdef AMIGA
  24.   #include <exec/types.h>
  25. ! #include <libraries/dos.h>
  26. ! #include <libraries/dosextens.h>
  27. ! #include <libraries/arpbase.h>
  28. ! #include <proto/arp.h>
  29.   #include <proto/dos.h>
  30. + #include <proto/exec.h>
  31.   
  32.   #define MAXPATH 200
  33.   #define MAXARGS 256
  34.   
  35. ! struct ArpBase *ArpBase;
  36.   
  37.   int expand_args ();
  38.   #endif /* AMIGA */
  39. ***************
  40. *** 1654,1659 ****
  41. --- 1656,1662 ----
  42.     int using_stdin = false;
  43.   #ifdef AMIGA
  44.     int ex_err;
  45. +   int close_arp();
  46.   #endif /* AMIGA */
  47.   
  48.   #ifdef DEBUG
  49. ***************
  50. *** 1662,1672 ****
  51.   #endif
  52.   
  53.   #ifdef AMIGA
  54. !   if (DOSBase->dl_lib.lib_Version < 37)
  55. !     {
  56. !       fprintf (stderr, "You must have Kickstart 2.0 (V37) or higher!\n");
  57. !       exit (20);
  58. !     }
  59.   
  60.     if (argc == 2 && stricmp (argv[1],"-h") == 0)
  61.       {
  62. --- 1665,1677 ----
  63.   #endif
  64.   
  65.   #ifdef AMIGA
  66. !   ArpBase = (struct ArpBase *) OpenLibrary("arp.library",39);
  67. !   if (ArpBase != NULL)
  68. !     if(!onexit(close_arp))
  69. !       {
  70. !         fprintf (stderr, "Couldn't initialize properly\n");
  71. !         exit (20);
  72. !       }
  73.   
  74.     if (argc == 2 && stricmp (argv[1],"-h") == 0)
  75.       {
  76. ***************
  77. *** 1674,1688 ****
  78.         exit (0);
  79.       }
  80.   
  81. !   if ((ex_err = expand_args (&argc, &argv)) == 0)
  82.       {
  83. !       fprintf (stderr, "Couldn't expand wildcards\n");
  84. !       exit (20);
  85. !     }
  86. !   if (ex_err == 2)
  87. !     {
  88. !       fprintf (stderr, "Wildcards didn't match a file\n");
  89. !       exit (5);
  90.       }
  91.   #endif /* AMIGA */
  92.   
  93. --- 1679,1696 ----
  94.         exit (0);
  95.       }
  96.   
  97. !   if (ArpBase != NULL)
  98.       {
  99. !       if ((ex_err = expand_args (&argc, &argv)) == 0)
  100. !         {
  101. !           fprintf (stderr, "Couldn't expand wildcards\n");
  102. !           exit (20);
  103. !         }
  104. !       if (ex_err == 2)
  105. !         {
  106. !           fprintf (stderr, "Wildcards didn't match a file\n");
  107. !           exit (5);
  108. !         }
  109.       }
  110.   #endif /* AMIGA */
  111.   
  112. ***************
  113. *** 1879,1890 ****
  114.               an = malloc (sizeof (struct AnchorPath) + MAXPATH);
  115.               memset (an, 0, sizeof (struct AnchorPath) + MAXPATH);
  116.               an->ap_BreakBits = SIGBREAKF_CTRL_C;
  117. !             an->ap_Strlen = MAXPATH;
  118. !             an->ap_Flags = APF_DOWILD;
  119. !             err = MatchFirst (pattern, an);
  120.             }
  121.           else
  122. !           err = MatchNext (an);
  123.   
  124.           /* Expand only files */
  125.           if (an->ap_Info.fib_DirEntryType < 0)
  126. --- 1887,1898 ----
  127.               an = malloc (sizeof (struct AnchorPath) + MAXPATH);
  128.               memset (an, 0, sizeof (struct AnchorPath) + MAXPATH);
  129.               an->ap_BreakBits = SIGBREAKF_CTRL_C;
  130. !             an->ap_StrLen = MAXPATH;
  131. !             an->ap_Flags = APF_DoWild;
  132. !             err = FindFirst (pattern, an);
  133.             }
  134.           else
  135. !           err = FindNext (an);
  136.   
  137.           /* Expand only files */
  138.           if (an->ap_Info.fib_DirEntryType < 0)
  139. ***************
  140. *** 1893,1899 ****
  141.   
  142.     if (err)
  143.       {
  144. !       MatchEnd (an);
  145.         free (an);
  146.         an = NULL;
  147.         return NULL;
  148. --- 1901,1907 ----
  149.   
  150.     if (err)
  151.       {
  152. !       FreeAnchorChain (an);
  153.         free (an);
  154.         an = NULL;
  155.         return NULL;
  156. ***************
  157. *** 1937,1943 ****
  158.     argv[argc++] = (*oargv)[0];
  159.     for (i = 1; i < *oargc; i++)
  160.       {
  161. !       if (ParsePattern ((*oargv)[i], buf, MAXPATH))
  162.           {
  163.             contains_wildcards = 1;
  164.             num_matches = 0;
  165. --- 1945,1951 ----
  166.     argv[argc++] = (*oargv)[0];
  167.     for (i = 1; i < *oargc; i++)
  168.       {
  169. !       if (PreParse ((*oargv)[i], buf))
  170.           {
  171.             contains_wildcards = 1;
  172.             num_matches = 0;
  173. ***************
  174. *** 1978,1981 ****
  175. --- 1986,1999 ----
  176.     else
  177.       return 1;
  178.   }
  179. + int
  180. + close_arp(i)
  181. +      int i;
  182. + {
  183. +   if (ArpBase != NULL)
  184. +     CloseLibrary ((struct Library *) ArpBase);
  185. +   return (i);
  186. + }
  187.   #endif /* AMIGA */
  188. diff -cr ram:indent-1.7/io.c dh1:indent-1.7/io.c
  189. *** ram:indent-1.7/io.c    Sat Feb 13 18:17:11 1993
  190. --- dh1:indent-1.7/io.c    Sat Feb 13 18:31:57 1993
  191. ***************
  192. *** 28,34 ****
  193.   
  194.   #ifdef AMIGA
  195.   #include <exec/types.h>
  196. ! #include <dos/dos.h>
  197.   #include <proto/dos.h>
  198.   #else /* !AMIGA */
  199.   #include <sys/types.h>
  200. --- 28,34 ----
  201.   
  202.   #ifdef AMIGA
  203.   #include <exec/types.h>
  204. ! #include <libraries/dos.h>
  205.   #include <proto/dos.h>
  206.   #else /* !AMIGA */
  207.   #include <sys/types.h>
  208.