From 2ed9919bd7c5c636b9b24999bb50dea7aa8ce7db Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 18 Aug 1997 17:40:34 +0000 Subject: (struct ftp_conn): Add SYSHOOKS_VALID field. (ftp_conn_validate_syshooks): New inline function. --- libftpconn/ftpconn.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libftpconn') diff --git a/libftpconn/ftpconn.h b/libftpconn/ftpconn.h index 5af41ee3..445f5b38 100644 --- a/libftpconn/ftpconn.h +++ b/libftpconn/ftpconn.h @@ -157,6 +157,7 @@ struct ftp_conn const struct ftp_conn_hooks *hooks; /* Customization hooks. */ struct ftp_conn_syshooks syshooks; /* host-dependent hook functions */ + int syshooks_valid; /* True if the system type has been determined. */ int control; /* fd for ftp control connection */ @@ -229,6 +230,18 @@ error_t ftp_conn_open (struct ftp_conn *conn); void ftp_conn_close (struct ftp_conn *conn); +/* Makes sure that CONN's syshooks are set according to the remote system + type. */ +static inline error_t +ftp_conn_validate_syshooks (struct ftp_conn *conn) +{ + if (conn->syshooks_valid) + return 0; + else + /* Opening the connection should set the syshooks. */ + return ftp_conn_open (conn); +} + /* Create a new ftp connection as specified by PARAMS, and return it in CONN; HOOKS contains customization hooks used by the connection. Neither PARAMS nor HOOKS is copied, so a copy of it should be made if necessary before -- cgit v1.2.3