From a2e728fe9f34ca12c9d26eb299dbc8806273e9a4 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 11 Jul 2009 00:51:14 +0100 Subject: [PATCH] Prototypes for the update directory Prototyping, ANSIfication, and warning cleanup for the update directory Reviewed-on: http://gerrit.openafs.org/52 Verified-by: Jeffrey Altman Reviewed-by: Jeffrey Altman Verified-by: Russ Allbery Reviewed-by: Russ Allbery --- src/update/client.c | 7 ++++++- src/update/server.c | 14 ++++++++------ src/update/update.xg | 2 ++ src/update/update_internal.h | 24 ++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 src/update/update_internal.h diff --git a/src/update/client.c b/src/update/client.c index 7ab657f8a..362545a8a 100644 --- a/src/update/client.c +++ b/src/update/client.c @@ -52,6 +52,7 @@ #endif #include "update.h" #include "global.h" +#include "update_internal.h" char *whoami; static int verbose; @@ -62,6 +63,10 @@ static int GetFileFromUpServer(struct rx_connection *conn, char *filename, afs_int32 atime, afs_int32 mtime); static int RenameNewFiles(struct filestr *modFiles); static int PathsAreEquivalent(char *path1, char *path2); +int FetchFile(struct rx_call *, char *, char *, int); +int IsCompatible(char *, afs_int32, afs_int32); +int NotOnHost(char *, struct filestr *); +int update_ReceiveFile(int, struct rx_call *, struct stat *); afs_int32 GetServer(char *aname) @@ -80,7 +85,7 @@ GetServer(char *aname) int -osi_audit() +osi_audit(void) { /* this sucks but it works for now. */ diff --git a/src/update/server.c b/src/update/server.c index 1e996fbf3..1de831208 100644 --- a/src/update/server.c +++ b/src/update/server.c @@ -49,10 +49,13 @@ #include "update.h" #include "global.h" -extern int UPDATE_ExecuteRequest(); +extern int UPDATE_ExecuteRequest(struct rx_call *); static int AddObject(char **expPath, char *dir); static int PathInDirectory(char *dir, char *path); +int update_SendFile(int, struct rx_call *, struct stat *); +int update_SendDirInfo(char *, struct rx_call *, struct stat *, + char *origDir); struct afsconf_dir *cdir; int nDirs; @@ -60,7 +63,7 @@ char *dirName[MAXENTRIES]; int dirLevel[MAXENTRIES]; char *whoami; -static int Quit(); +static int Quit(char *); int rxBind = 0; @@ -165,7 +168,7 @@ AuthOkay(struct rx_call *call, char *name) } int -osi_audit() +osi_audit(void) { /* this sucks but it works for now. */ @@ -400,10 +403,9 @@ UPDATE_FetchInfo(struct rx_call *call, char *name) } static int -Quit(msg, a, b) - char *msg; +Quit(char *msg) { - fprintf(stderr, msg, a, b); + fprintf(stderr, msg); exit(1); } diff --git a/src/update/update.xg b/src/update/update.xg index 323e89296..087263344 100644 --- a/src/update/update.xg +++ b/src/update/update.xg @@ -13,6 +13,8 @@ statindex 13 %#include %#include +%#include "global.h" +%#include "update_internal.h" %#define UPDATE_SERVICEPORT htonl(0) /* user server's port */ %#define UPDATE_SERVICEID 4 diff --git a/src/update/update_internal.h b/src/update/update_internal.h new file mode 100644 index 000000000..b25d72e72 --- /dev/null +++ b/src/update/update_internal.h @@ -0,0 +1,24 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +#ifndef AFS_SRC_UPDATE_INTERNAL_H +#define AFS_SRC_UPDATE_INTERNAL_H + +/* utils.c */ + +extern int AddToList(struct filestr **, char *); +extern int ZapList(struct filestr **); + +/* server.c */ + +extern int UPDATE_FetchFile(struct rx_call *, char *); +extern int UPDATE_FetchInfo(struct rx_call *, char *); + +#endif + -- 2.39.5