]> sjero.net Git - wget/blobdiff - src/wget.h
[svn] Correctly check for unsupported socket families.
[wget] / src / wget.h
index b75aab60429d2d97694a202d299b48dee410757b..edc159900a63fd04dabfa07d3acc087acc2fe549 100644 (file)
@@ -40,11 +40,6 @@ so, delete this exception statement from your version.  */
 # define NDEBUG
 #endif
 
-/* Define this if you want primitive but extensive malloc debugging.
-   It will make Wget extremely slow, so only do it in development
-   builds.  */
-#undef DEBUG_MALLOC
-
 #ifndef PARAMS
 # if PROTOTYPES
 #  define PARAMS(args) args
@@ -64,8 +59,16 @@ so, delete this exception statement from your version.  */
 # define _(string) (string)
 #endif /* not HAVE_NLS */
 
-/* No-op version of gettext, used for constant strings. */
-#define N_(string) (string)
+/* A pseudo function call that serves as a marker for the automated
+   extraction of messages, but does not call gettext().  The run-time
+   translation is done at a different place in the code.  The purpose
+   of the N_("...") call is to make the message snarfer aware that the
+   "..." string needs to be translated.  STRING should be a string
+   literal.  Concatenated strings and other string expressions won't
+   work.  The macro's expansion is not parenthesized, so that it is
+   suitable as initializer for static 'char[]' or 'const char[]'
+   variables.  -- explanation partly taken from GNU make.  */
+#define N_(string) string
 
 /* I18N NOTE: You will notice that none of the DEBUGP messages are
    marked as translatable.  This is intentional, for a few reasons:
@@ -207,8 +210,7 @@ typedef enum
 {
   NOCONERROR, HOSTERR, CONSOCKERR, CONERROR, CONSSLERR,
   CONIMPOSSIBLE, NEWLOCATION, NOTENOUGHMEM, CONPORTERR,
-  BINDERR, BINDOK, LISTENERR, ACCEPTERR, ACCEPTOK,
-  CONCLOSED, FTPOK, FTPLOGINC, FTPLOGREFUSED, FTPPORTERR,
+  CONCLOSED, FTPOK, FTPLOGINC, FTPLOGREFUSED, FTPPORTERR, FTPSYSERR,
   FTPNSFOD, FTPRETROK, FTPUNKNOWNTYPE, FTPRERR,
   FTPREXC, FTPSRVERR, FTPRETRINT, FTPRESTFAIL, URLERROR,
   FOPENERR, FWRITEERR, HOK, HLEXC, HEOF,
@@ -221,15 +223,15 @@ typedef enum
   SSLERRCERTFILE,SSLERRCERTKEY,SSLERRCTXCREATE
 } uerr_t;
 
-/* In case old systems don't have EAFNOSUPPORT, which we use below. */
-#ifndef EAFNOSUPPORT
-# define EAFNOSUPPORT EINVAL
-#endif
+/* Whether the connection was unsuccessful or impossible.  If the
+   connection is considered impossible (e.g. for unsupported socket
+   family errors), there is no sense in retrying.  "Connection
+   refused" is normally not retried, except when opt.retry_connrefused
+   is specified.  */
 
-#define CONNECT_ERROR(err) ((   (err) == EAFNOSUPPORT          \
-                            || (err) == EINVAL                 \
-                            || ((err) == ECONNREFUSED          \
-                                && !opt.retry_connrefused))    \
+#define CONNECT_ERROR(err) ((unsupported_socket_family_error (err)     \
+                            || ((err) == ECONNREFUSED                  \
+                                && !opt.retry_connrefused))            \
                            ? CONIMPOSSIBLE : CONERROR)
 
 #endif /* WGET_H */