WS updates. No code changes
[yaz-moved-to-github.git] / client / admin.c
index 9db314e..84674be 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Copyright (c) 1995-2002, Index Data
+ * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: admin.c,v 1.13 2002-09-17 11:07:30 adam Exp $
+ * $Id: admin.c,v 1.20 2005-06-24 19:56:52 adam Exp $
  */
 
 #include <stdio.h>
 #include <time.h>
 #include <assert.h>
 
-#if HAVE_FNMATCH_H
+#if HAVE_DIRENT_H
 #include <dirent.h>
+#endif
+#if HAVE_FNMATCH_H
 #include <fnmatch.h>
+#endif
+#if HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
 
@@ -26,6 +30,7 @@
 
 #include <yaz/pquery.h>
 
+#include "admin.h"
 
 /* Helper functions to get to various statics in the client */
 ODR getODROutputStream();
@@ -128,7 +133,7 @@ int sendAdminES(int type, char* param1)
 
 /* cmd_adm_reindex
    Ask the specified database to fully reindex itself */
-int cmd_adm_reindex(char* arg)
+int cmd_adm_reindex(const char *arg)
 {
     sendAdminES(Z_ESAdminOriginPartToKeep_reIndex, NULL);
     return 2;
@@ -137,7 +142,7 @@ int cmd_adm_reindex(char* arg)
 /* cmd_adm_truncate
    Truncate the specified database, removing all records and index entries, but leaving 
    the database & it's explain information intact ready for new records */
-int cmd_adm_truncate(char* arg)
+int cmd_adm_truncate(const char *arg)
 {
     if ( arg )
     {
@@ -149,7 +154,7 @@ int cmd_adm_truncate(char* arg)
 
 /* cmd_adm_create
    Create a new database */
-int cmd_adm_create(char* arg)
+int cmd_adm_create(const char *arg)
 {
     if ( arg )
     {
@@ -161,7 +166,7 @@ int cmd_adm_create(char* arg)
 
 /* cmd_adm_drop
    Drop (Delete) a database */
-int cmd_adm_drop(char* arg)
+int cmd_adm_drop(const char *arg)
 {
     if ( arg )
     {
@@ -177,7 +182,7 @@ int cmd_adm_drop(char* arg)
    to existing records */
 
 #if HAVE_FNMATCH_H
-int cmd_adm_import(char *arg)
+int cmd_adm_import(const char *arg)
 {
     char type_str[20], dir_str[1024], pattern_str[1024];
     char *cp;
@@ -259,7 +264,7 @@ int cmd_adm_import(char *arg)
     return 2;
 }
 #else
-int cmd_adm_import(char *arg)
+int cmd_adm_import(const char *arg)
 {
     printf ("not available on WIN32\n");
     return 0;
@@ -269,7 +274,7 @@ int cmd_adm_import(char *arg)
 
 /* "Freshen" the specified database, by checking metadata records against the sources from which they were 
    generated, and creating a new record if the source has been touched since the last extraction */
-int cmd_adm_refresh(char* arg)
+int cmd_adm_refresh(const char *arg)
 {
     if ( arg )
     {
@@ -281,29 +286,20 @@ int cmd_adm_refresh(char* arg)
 
 /* cmd_adm_commit 
    Make imported records a permenant & visible to the live system */
-int cmd_adm_commit(char* arg)
+int cmd_adm_commit(const char *arg)
 {
     sendAdminES(Z_ESAdminOriginPartToKeep_commit, NULL);
     return 2;
 }
 
-int cmd_adm_shutdown(char* arg)
+int cmd_adm_shutdown(const char *arg)
 {
     sendAdminES(Z_ESAdminOriginPartToKeep_shutdown, NULL);
     return 2;
 }
 
-int cmd_adm_startup(char* arg)
+int cmd_adm_startup(const char *arg)
 {
     sendAdminES(Z_ESAdminOriginPartToKeep_start, NULL);
     return 2;
 }
-
-/*
- * Local variables:
- * tab-width: 8
- * c-basic-offset: 4
- * End:
- * vim600: sw=4 ts=8 fdm=marker
- * vim<600: sw=4 ts=8
- */