(date): Interpret the date, L/M/N, as YYYY/MM/DD
[gnulib.git] / lib / argmatch.c
index f3f1a50..c0708bf 100644 (file)
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Written by David MacKenzie <djm@ai.mit.edu> */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <sys/types.h>
+
 #include <stdio.h>
 #ifdef STDC_HEADERS
-#include <string.h>
+# include <string.h>
 #endif
 
 extern char *program_name;
@@ -31,16 +37,16 @@ extern char *program_name;
 
 int
 argmatch (arg, optlist)
-     char *arg;
-     char **optlist;
+     const char *arg;
+     const char *const *optlist;
 {
   int i;                       /* Temporary index in OPTLIST.  */
-  int arglen;                  /* Length of ARG.  */
+  size_t arglen;               /* Length of ARG.  */
   int matchind = -1;           /* Index of first nonexact match.  */
   int ambiguous = 0;           /* If nonzero, multiple nonexact match(es).  */
-  
+
   arglen = strlen (arg);
-  
+
   /* Test all elements for either exact match or abbreviated matches.  */
   for (i = 0; optlist[i]; i++)
     {
@@ -70,8 +76,8 @@ argmatch (arg, optlist)
 
 void
 invalid_arg (kind, value, problem)
-     char *kind;
-     char *value;
+     const char *kind;
+     const char *value;
      int problem;
 {
   fprintf (stderr, "%s: ", program_name);