diff options
author | Miles Bader <miles@gnu.org> | 1997-08-18 17:40:34 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1997-08-18 17:40:34 +0000 |
commit | 2ed9919bd7c5c636b9b24999bb50dea7aa8ce7db (patch) | |
tree | 51685c219972d7b222af7b1b5693d0e14b429d91 /libftpconn/ftpconn.h | |
parent | 7461f926cf97bb398752db17ceb517e93ce5f901 (diff) |
(struct ftp_conn):
Add SYSHOOKS_VALID field.
(ftp_conn_validate_syshooks):
New inline function.
Diffstat (limited to 'libftpconn/ftpconn.h')
-rw-r--r-- | libftpconn/ftpconn.h | 13 |
1 files changed, 13 insertions, 0 deletions
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 |