#include "config.h"
#include <errno.h>
#include <stdio.h>
#include <signal.h>
#include <sys/uio.h>
#include <sys/wait.h>
#include <netinet/tcp.h>
#include <ctype.h>
#include <fcntl.h>
#include <sys/fcntl.h>
#include <strings.h>
#include <setjmp.h>
#include <glib.h>
#include "casts.h"
Go to the source code of this file.
Defines | |
| #define | GTA_VERSION 0 |
| major version | |
| #define | GTA_SUBVERSION 96 |
| minor version | |
| #define | GTA_PATCHLEVEL 4 |
| patch level or teeny version | |
| #define | GTA_REVISION "unstable" |
| unstable, beta, stable | |
| #define | GTA_REVCHAR "u" |
| (u)nstable, (b)eta, none -> stable | |
| #define | GTA_RELEASE "2007-06-23" |
| ISO 8601 format YYYY-MM-DD. | |
| #define | GTA_WEBSITE "http://gtk-gnutella.sourceforge.net/" |
| #define | MAP_FAILED ((void *) -1) |
| #define | MAX_IOV_COUNT 16 |
| Unknown, use required minimum. | |
| #define | G_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0])) |
| #define | VA_COPY(dest, src) (dest) = (src) |
| #define | STDIN_FILENO 0 |
| #define | STDOUT_FILENO 1 |
| #define | STDERR_FILENO 2 |
| #define | S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK) |
| #define | MAX_INT_VAL_STEP(t) ((t) 1 << (CHAR_BIT * sizeof(t) - 1 - ((t) -1 < 1))) |
| #define | MAX_INT_VAL(t) ((MAX_INT_VAL_STEP(t) - 1) + MAX_INT_VAL_STEP(t)) |
| #define | MIN_INT_VAL(t) ((t) -MAX_INT_VAL(t) - 1) |
| #define | TIME_T_MAX MAX_INT_VAL(time_t) |
| #define | OFF_T_MAX MAX_INT_VAL(off_t) |
| #define | SRC_PREFIX "src/" |
| Common prefix to remove in filenames. | |
| #define | _WHERE_ __FILE__ |
| #define | PACKAGE_EXTRA_SOURCE_DIR PACKAGE_SOURCE_DIR G_DIR_SEPARATOR_S "extra_files" |
| #define | G_FREE_NULL(p) |
| Calls g_free() and sets the pointer to NULL afterwards. | |
| #define | HAVE_GCC(major, minor) 0 |
| #define | NON_NULL_PARAM(x) |
| #define | PRINTF_FUNC_PTR(x, y) |
| This is the same G_GNUC_FORMAT() but for function pointers. | |
| #define | WARN_UNUSED_RESULT |
| #define | KEEP_FUNCTION |
| #define | IGNORE_RESULT(x) G_STMT_START { switch (0 != (x)) { default: ; } } G_STMT_END |
| #define | G_LIKELY(x) (x) |
| #define | G_UNLIKELY(x) (x) |
| #define | ALWAYS_INLINE |
| #define | REGPARM(n) |
| #define | CMP(a, b) ((a) == (b) ? 0 : (a) > (b) ? 1 : (-1)) |
| CMP() returns the sign of a-b, that means -1, 0, or 1. | |
| #define | SIGN(x) ((x) == 0 ? 0 : (x) > 0 ? 1 : (-1)) |
| SIGN() returns the sign of an integer value. | |
| #define | STATIC_ASSERT(x) do { switch (0) { case ((x) ? 1 : 0): case 0: break; } } while(0) |
| STATIC_ASSERT() can be used to verify conditions at compile-time. | |
| #define | GTA_VERSION_NUMBER |
| #define | GTA_PORT 6346 |
| Default "standard" port. | |
| #define | MAX_HOSTLEN 256 |
| Max length for FQDN host. | |
| #define | GTA_BUILD "$Revision: 13938 $" |
| #define | SHA1_BASE16_SIZE 40 |
| 160 bits in base16 representation | |
| #define | SHA1_BASE32_SIZE 32 |
| 160 bits in base32 representation | |
| #define | SHA1_RAW_SIZE 20 |
| 160 bits in binary representation | |
| #define | TTH_BASE32_SIZE 39 |
| 160 bits in base32 representation | |
| #define | TTH_RAW_SIZE 24 |
| 160 bits in binary representation | |
| #define | BITPRINT_BASE32_SIZE 72 |
| 352 bits in base32 representation includes dot between sha1 and tiger | |
| #define | BITPRINT_RAW_SIZE 44 |
| 352 bits in binary representation | |
| #define | FILENAME_MAXBYTES 256 |
| Maximum bytes in filename i.e., including NUL. | |
| #define | g_snprintf DONT_CALL_g_snprintf |
| Use gm_snprintf instead. | |
| #define | g_vsnprintf DONT_CALL_g_vsnprintf |
| Use gm_vsnprintf instead. | |
| #define | textdomain(String) (String) |
| #define | gettext(String) (String) |
| #define | dgettext(Domain, Message) (Message) |
| #define | dcgettext(Domain, Message, Type) (Message) |
| #define | bindtextdomain(Domain, Directory) (Domain) |
| #define | ngettext(Single, Plural, Number) ((Number) == 1 ? (Single) : (Plural)) |
| #define | _(String) (String) |
| #define | N_(String) (String) |
| #define | Q_(String) g_strip_context ((String), (String)) |
| #define | NG_(Single, Plural, Number) ngettext_((Single), (Plural), (Number)) |
| Short-hand for ngettext(). | |
| #define | RCSID(x) |
| Stores a RCS ID tag inside the object file. | |
Typedefs | |
| typedef guint64 | filesize_t |
| Use filesize_t to hold filesizes. | |
| typedef gboolean(* | reclaim_fd_t )(void) |
Functions | |
| const gchar * | ngettext_ (const gchar *msg1, const gchar *msg2, gulong n) G_GNUC_FORMAT(1) G_GNUC_FORMAT(2) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 bits in base32 representation includes dot between sha1 and tiger
|
|
|
352 bits in binary representation
|
|
|
CMP() returns the sign of a-b, that means -1, 0, or 1.
|
|
|
|
|
|
|
|
|
Maximum bytes in filename i.e., including NUL.
|
|
|
Value: G_STMT_START { \
if (p) { \
g_free(p); \
p = NULL; \
} \
} G_STMT_END
You should use this instead of a bare g_free() to prevent double-free bugs and dangling pointers. |
|
|
|
|
|
|
|
|
Use gm_snprintf instead.
|
|
|
|
|
|
Use gm_vsnprintf instead.
|
|
|
|
|
|
|
|
|
patch level or teeny version
|
|
|
Default "standard" port.
|
|
|
ISO 8601 format YYYY-MM-DD.
|
|
|
(u)nstable, (b)eta, none -> stable
|
|
|
unstable, beta, stable
|
|
|
minor version
|
|
|
major version
|
|
|
Value: STRINGIFY(GTA_VERSION) "." \ STRINGIFY(GTA_SUBVERSION) "." \ STRINGIFY(GTA_PATCHLEVEL) GTA_REVCHAR |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Max length for FQDN host.
|
|
|
|
|
|
|
|
|
Unknown, use required minimum.
|
|
|
|
|
|
|
|
|
Short-hand for ngettext().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is the same G_GNUC_FORMAT() but for function pointers. Older versions of GCC do not allow function attributes for function pointers. |
|
|
|
|
|
Value: static KEEP_FUNCTION inline const char * \ get_rcsid(void) \ { \ static const char rcsid[] = "@(#) " x; \ const char *s = rcsid; \ while (*s != '\0') { \ if (*s++ == '$') \ break; \ } \ return s; \ } Every .c source file should use this macro once as `RCSID("<dollar>Id$")' on top. The ID tag is automagically updated each time the file is committed to the CVS repository. The RCS IDs can be looked up from the compiled binary with e.g. `what', `ident' or `strings'. See also rcs(1) and ident(1). |
|
|
|
|
|
|
|
|
160 bits in base16 representation
|
|
|
160 bits in base32 representation
|
|
|
160 bits in binary representation
|
|
|
SIGN() returns the sign of an integer value.
|
|
|
Common prefix to remove in filenames.
|
|
|
STATIC_ASSERT() can be used to verify conditions at compile-time. For example, it can be used to ensure that an array has a minimum or exact size. This is better than a run-time assertion because the condition is checked even if the code would seldomly or never reached at run-time. However, this can only be used for static conditions which can be verified at compile-time.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 bits in base32 representation
|
|
|
160 bits in binary representation
|
|
|
|
|
|
|
|
|
Use filesize_t to hold filesizes.
|
|
|
|
|
||||||||||||||||
|
|
1.3.9.1