"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "awk.h" between
gawk-5.0.1.tar.xz and gawk-5.1.0.tar.xz

About: GNU awk - pattern scanning and processing language.

awk.h  (gawk-5.0.1.tar.xz):awk.h  (gawk-5.1.0.tar.xz)
/* /*
* awk.h -- Definitions for gawk. * awk.h -- Definitions for gawk.
*/ */
/* /*
* Copyright (C) 1986, 1988, 1989, 1991-2019 the Free Software Foundation, Inc. * Copyright (C) 1986, 1988, 1989, 1991-2020 the Free Software Foundation, Inc.
* *
* This file is part of GAWK, the GNU implementation of the * This file is part of GAWK, the GNU implementation of the
* AWK Programming Language. * AWK Programming Language.
* *
* GAWK is free software; you can redistribute it and/or modify * GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* GAWK is distributed in the hope that it will be useful, * GAWK is distributed in the hope that it will be useful,
skipping to change at line 89 skipping to change at line 89
#endif #endif
#ifdef STDC_HEADERS #ifdef STDC_HEADERS
#include <stdlib.h> #include <stdlib.h>
#endif /* not STDC_HEADERS */ #endif /* not STDC_HEADERS */
/* We can handle multibyte strings. */ /* We can handle multibyte strings. */
#include <wchar.h> #include <wchar.h>
#include <wctype.h> #include <wctype.h>
#include "mbsupport.h" /* defines stuff for DJGPP to fake MBS */
#ifdef STDC_HEADERS #ifdef STDC_HEADERS
#include <float.h> #include <float.h>
#endif #endif
#undef CHARBITS #undef CHARBITS
#undef INTBITS #undef INTBITS
#if HAVE_INTTYPES_H #if HAVE_INTTYPES_H
# include <inttypes.h> # include <inttypes.h>
#endif #endif
skipping to change at line 1060 skipping to change at line 1058
const char *name; const char *name;
}; };
struct block_item { struct block_item {
struct block_item *freep; struct block_item *freep;
}; };
struct block_header { struct block_header {
struct block_item *freep; struct block_item *freep;
size_t size; size_t size;
const char *name;
long highwater;
#ifdef MEMDEBUG
long active;
#endif
}; };
enum block_id { enum block_id {
BLOCK_NODE = 0, BLOCK_NODE = 0,
BLOCK_BUCKET, BLOCK_BUCKET,
BLOCK_MPFR, BLOCK_MPFR,
BLOCK_MPZ, BLOCK_MPZ,
BLOCK_MAX /* count */ BLOCK_MAX /* count */
}; };
skipping to change at line 1176 skipping to change at line 1179
#define do_debug (do_flags & DO_DEBUG) #define do_debug (do_flags & DO_DEBUG)
#define do_mpfr (do_flags & DO_MPFR) #define do_mpfr (do_flags & DO_MPFR)
extern bool do_optimize; extern bool do_optimize;
extern int use_lc_numeric; extern int use_lc_numeric;
extern int exit_val; extern int exit_val;
#ifdef NO_LINT #ifdef NO_LINT
#define do_lint 0 #define do_lint 0
#define do_lint_old 0 #define do_lint_old 0
#define do_lint_extensions 0
#else #else
#define do_lint (do_flags & (DO_LINT_INVALID|DO_LINT_ALL)) #define do_lint (do_flags & (DO_LINT_INVALID|DO_LINT_ALL))
#define do_lint_old (do_flags & DO_LINT_OLD) #define do_lint_old (do_flags & DO_LINT_OLD)
#define do_lint_extensions (do_flags & DO_LINT_EXTENSIONS) #define do_lint_extensions (do_flags & DO_LINT_EXTENSIONS)
#endif #endif
extern int gawk_mb_cur_max; extern int gawk_mb_cur_max;
#if defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0 #if defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0
extern GETGROUPS_T *groupset; extern GETGROUPS_T *groupset;
extern int ngroups; extern int ngroups;
skipping to change at line 1321 skipping to change at line 1325
#define is_mpg_float(n) 0 #define is_mpg_float(n) 0
#define is_mpg_integer(n) 0 #define is_mpg_integer(n) 0
#define iszero(n) ((n)->numbr == 0.0) #define iszero(n) ((n)->numbr == 0.0)
#endif #endif
#define var_uninitialized(n) ((n)->var_value == Nnull_string) #define var_uninitialized(n) ((n)->var_value == Nnull_string)
#define get_lhs(n, r) (n)->type == Node_var && ! var_uninitialized(n) ? \ #define get_lhs(n, r) (n)->type == Node_var && ! var_uninitialized(n) ? \
&((n)->var_value) : r_get_lhs((n), (r)) &((n)->var_value) : r_get_lhs((n), (r))
#ifdef MEMDEBUG
extern void *r_getblock(int id);
extern void r_freeblock(void *, int id);
#define getblock(p, id, ty) (void) (p = r_getblock(id))
#define freeblock(p, id) (void) (r_freeblock(p, id))
#else /* MEMDEBUG */
#define getblock(p, id, ty) (void) ((p = (ty) nextfree[id].freep) ? \ #define getblock(p, id, ty) (void) ((p = (ty) nextfree[id].freep) ? \
(ty) (nextfree[id].freep = ((struct block_item *) p)->fre ep) \ (ty) (nextfree[id].freep = ((struct block_item *) p)->fre ep) \
: (p = (ty) more_blocks(id))) : (p = (ty) more_blocks(id)))
#define freeblock(p, id) (void) (((struct block_item *) p)->freep = nextf ree[id].freep, \ #define freeblock(p, id) (void) (((struct block_item *) p)->freep = nextf ree[id].freep, \
nextfree[id].freep = (struct block_item * ) p) nextfree[id].freep = (struct block_item * ) p)
#endif /* MEMDEBUG */
#define getnode(n) getblock(n, BLOCK_NODE, NODE *) #define getnode(n) getblock(n, BLOCK_NODE, NODE *)
#define freenode(n) freeblock(n, BLOCK_NODE) #define freenode(n) freeblock(n, BLOCK_NODE)
#define getbucket(b) getblock(b, BLOCK_BUCKET, BUCKET *) #define getbucket(b) getblock(b, BLOCK_BUCKET, BUCKET *)
#define freebucket(b) freeblock(b, BLOCK_BUCKET) #define freebucket(b) freeblock(b, BLOCK_BUCKET)
#define make_string(s, l) make_str_node((s), (l), 0) #define make_string(s, l) make_str_node((s), (l), 0)
// Flags for making string nodes // Flags for making string nodes
#define SCAN 1 #define SCAN 1
skipping to change at line 1971 skipping to change at line 1986
static inline void * static inline void *
emalloc_real(size_t count, const char *where, const char *var, const char *file, int line) emalloc_real(size_t count, const char *where, const char *var, const char *file, int line)
{ {
void *ret; void *ret;
if (count == 0) if (count == 0)
fatal("%s:%d: emalloc called with zero bytes", file, line); fatal("%s:%d: emalloc called with zero bytes", file, line);
ret = (void *) malloc(count); ret = (void *) malloc(count);
if (ret == NULL) if (ret == NULL)
fatal(_("%s:%d:%s: %s: can't allocate %ld bytes of memory (%s)"), fatal(_("%s:%d:%s: %s: cannot allocate %ld bytes of memory: %s"),
file, line, where, var, (long) count, strerror(errno)); file, line, where, var, (long) count, strerror(errno));
return ret; return ret;
} }
/* ezalloc_real --- malloc zero-filled bytes with error checking */ /* ezalloc_real --- malloc zero-filled bytes with error checking */
static inline void * static inline void *
ezalloc_real(size_t count, const char *where, const char *var, const char *file, int line) ezalloc_real(size_t count, const char *where, const char *var, const char *file, int line)
{ {
void *ret; void *ret;
if (count == 0) if (count == 0)
fatal("%s:%d: ezalloc called with zero bytes", file, line); fatal("%s:%d: ezalloc called with zero bytes", file, line);
ret = (void *) calloc(1, count); ret = (void *) calloc(1, count);
if (ret == NULL) if (ret == NULL)
fatal(_("%s:%d:%s: %s: can't allocate %ld bytes of memory (%s)"), fatal(_("%s:%d:%s: %s: cannot allocate %ld bytes of memory: %s"),
file, line, where, var, (long) count, strerror(errno)); file, line, where, var, (long) count, strerror(errno));
return ret; return ret;
} }
/* erealloc_real --- realloc with error checking */ /* erealloc_real --- realloc with error checking */
static inline void * static inline void *
erealloc_real(void *ptr, size_t count, const char *where, const char *var, const char *file, int line) erealloc_real(void *ptr, size_t count, const char *where, const char *var, const char *file, int line)
{ {
void *ret; void *ret;
if (count == 0) if (count == 0)
fatal("%s:%d: erealloc called with zero bytes", file, line); fatal("%s:%d: erealloc called with zero bytes", file, line);
ret = (void *) realloc(ptr, count); ret = (void *) realloc(ptr, count);
if (ret == NULL) if (ret == NULL)
fatal(_("%s:%d:%s: %s: can't reallocate %ld bytes of memory (%s)" ), fatal(_("%s:%d:%s: %s: cannot reallocate %ld bytes of memory: %s" ),
file, line, where, var, (long) count, strerror(errno)); file, line, where, var, (long) count, strerror(errno));
return ret; return ret;
} }
/* make_number_node --- make node with the given flags */ /* make_number_node --- make node with the given flags */
static inline NODE * static inline NODE *
make_number_node(unsigned int flags) make_number_node(unsigned int flags)
{ {
 End of changes. 9 change blocks. 
6 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)