Move number_set interface to separate files
* number_set.c: New file.
* number_set.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* basic_filters.c: Include "number_set.h".
(number_slot_t, struct number_set): Move to number_set.h.
(BITS_PER_SLOT, number_setbit, number_isset, reallocate_number_set,
add_number_to_set, is_number_in_set): Move to number_set.c.
* defs.h (struct number_set): Remove forward declaration.
(read_set, write_set, signal_set, is_number_in_set): Move to number_set.h.
* filter.h (add_number_to_set): Move to number_set.h.
* filter_qualify.c: Include "number_set.h".
(number_slot_t, struct number_set): Remove.
* strace.c: Include "number_set.h".
* syscall.c: Likewise.
2017-08-23 00:23:49 +03:00
/*
2018-12-25 02:46:43 +03:00
* Copyright ( c ) 2016 - 2018 Dmitry V . Levin < ldv @ altlinux . org >
Move number_set interface to separate files
* number_set.c: New file.
* number_set.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* basic_filters.c: Include "number_set.h".
(number_slot_t, struct number_set): Move to number_set.h.
(BITS_PER_SLOT, number_setbit, number_isset, reallocate_number_set,
add_number_to_set, is_number_in_set): Move to number_set.c.
* defs.h (struct number_set): Remove forward declaration.
(read_set, write_set, signal_set, is_number_in_set): Move to number_set.h.
* filter.h (add_number_to_set): Move to number_set.h.
* filter_qualify.c: Include "number_set.h".
(number_slot_t, struct number_set): Remove.
* strace.c: Include "number_set.h".
* syscall.c: Likewise.
2017-08-23 00:23:49 +03:00
* All rights reserved .
*
2018-12-10 03:00:00 +03:00
* SPDX - License - Identifier : LGPL - 2.1 - or - later
Move number_set interface to separate files
* number_set.c: New file.
* number_set.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* basic_filters.c: Include "number_set.h".
(number_slot_t, struct number_set): Move to number_set.h.
(BITS_PER_SLOT, number_setbit, number_isset, reallocate_number_set,
add_number_to_set, is_number_in_set): Move to number_set.c.
* defs.h (struct number_set): Remove forward declaration.
(read_set, write_set, signal_set, is_number_in_set): Move to number_set.h.
* filter.h (add_number_to_set): Move to number_set.h.
* filter_qualify.c: Include "number_set.h".
(number_slot_t, struct number_set): Remove.
* strace.c: Include "number_set.h".
* syscall.c: Likewise.
2017-08-23 00:23:49 +03:00
*/
# ifndef STRACE_NUMBER_SET_H
2018-12-30 18:35:21 +03:00
# define STRACE_NUMBER_SET_H
Move number_set interface to separate files
* number_set.c: New file.
* number_set.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* basic_filters.c: Include "number_set.h".
(number_slot_t, struct number_set): Move to number_set.h.
(BITS_PER_SLOT, number_setbit, number_isset, reallocate_number_set,
add_number_to_set, is_number_in_set): Move to number_set.c.
* defs.h (struct number_set): Remove forward declaration.
(read_set, write_set, signal_set, is_number_in_set): Move to number_set.h.
* filter.h (add_number_to_set): Move to number_set.h.
* filter_qualify.c: Include "number_set.h".
(number_slot_t, struct number_set): Remove.
* strace.c: Include "number_set.h".
* syscall.c: Likewise.
2017-08-23 00:23:49 +03:00
2018-12-30 18:35:21 +03:00
# include "gcc_compat.h"
2017-08-24 21:13:29 +03:00
Hide struct number_set implementation details from users
* number_set.h (number_slot_t, struct number_set): Move to number_set.c.
(struct number_set): Add forward declaration.
(read_set, write_set, signal_set): Change prototypes from objects
to pointers.
* filter_qualify.c (read_set, write_set, signal_set): Change definitions
from objects to pointers.
(abbrev_set, inject_set, raw_set, trace_set, verbose_set): Change
definitions from arrays to pointers.
(qualify_read): Initialize read_set before first use.
(qualify_write): Initialize write_set before first use.
(qualify_signals): Initialize signal_set before first use.
(qualify_trace): Initialize trace_set before first use.
(qualify_abbrev): Initialize abbrev_set before first use.
(qualify_verbose): Initialize verbose_set before first use.
(qualify_raw): Initialize raw_set before first use.
(qualify_inject_common): Initialize inject_set before first use.
* strace.c (print_signalled, print_stopped): Update signal_set usage.
* syscall.c (dumpio): Update usage of read_set and write_set.
2017-08-23 00:23:49 +03:00
struct number_set ;
Move number_set interface to separate files
* number_set.c: New file.
* number_set.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* basic_filters.c: Include "number_set.h".
(number_slot_t, struct number_set): Move to number_set.h.
(BITS_PER_SLOT, number_setbit, number_isset, reallocate_number_set,
add_number_to_set, is_number_in_set): Move to number_set.c.
* defs.h (struct number_set): Remove forward declaration.
(read_set, write_set, signal_set, is_number_in_set): Move to number_set.h.
* filter.h (add_number_to_set): Move to number_set.h.
* filter_qualify.c: Include "number_set.h".
(number_slot_t, struct number_set): Remove.
* strace.c: Include "number_set.h".
* syscall.c: Likewise.
2017-08-23 00:23:49 +03:00
Extend number_set interface
* number_set.h (number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, clear_number_set_array,
invert_number_set_array, alloc_number_set_array, free_number_set_array):
New function prototypes.
* number_set.c (number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, clear_number_set_array,
invert_number_set_array, alloc_number_set_array, free_number_set_array):
New functions.
* basic_filters.c (qualify_syscall_number, qualify_syscall_regex,
qualify_syscall_class, qualify_syscall_name): Use
add_number_to_set_array.
(qualify_syscall_tokens, qualify_tokens): Use
clear_number_set_array and invert_number_set_array.
* filter_qualify.c (qualify_inject_common): Use alloc_number_set_array,
number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, and free_number_set_array.
(qual_flags): Use is_number_in_set_array.
2017-08-23 00:23:49 +03:00
extern bool
number_set_array_is_empty ( const struct number_set * , unsigned int idx ) ;
Move number_set interface to separate files
* number_set.c: New file.
* number_set.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* basic_filters.c: Include "number_set.h".
(number_slot_t, struct number_set): Move to number_set.h.
(BITS_PER_SLOT, number_setbit, number_isset, reallocate_number_set,
add_number_to_set, is_number_in_set): Move to number_set.c.
* defs.h (struct number_set): Remove forward declaration.
(read_set, write_set, signal_set, is_number_in_set): Move to number_set.h.
* filter.h (add_number_to_set): Move to number_set.h.
* filter_qualify.c: Include "number_set.h".
(number_slot_t, struct number_set): Remove.
* strace.c: Include "number_set.h".
* syscall.c: Likewise.
2017-08-23 00:23:49 +03:00
extern bool
is_number_in_set ( unsigned int number , const struct number_set * ) ;
Extend number_set interface
* number_set.h (number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, clear_number_set_array,
invert_number_set_array, alloc_number_set_array, free_number_set_array):
New function prototypes.
* number_set.c (number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, clear_number_set_array,
invert_number_set_array, alloc_number_set_array, free_number_set_array):
New functions.
* basic_filters.c (qualify_syscall_number, qualify_syscall_regex,
qualify_syscall_class, qualify_syscall_name): Use
add_number_to_set_array.
(qualify_syscall_tokens, qualify_tokens): Use
clear_number_set_array and invert_number_set_array.
* filter_qualify.c (qualify_inject_common): Use alloc_number_set_array,
number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, and free_number_set_array.
(qual_flags): Use is_number_in_set_array.
2017-08-23 00:23:49 +03:00
extern bool
is_number_in_set_array ( unsigned int number , const struct number_set * , unsigned int idx ) ;
Move number_set interface to separate files
* number_set.c: New file.
* number_set.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* basic_filters.c: Include "number_set.h".
(number_slot_t, struct number_set): Move to number_set.h.
(BITS_PER_SLOT, number_setbit, number_isset, reallocate_number_set,
add_number_to_set, is_number_in_set): Move to number_set.c.
* defs.h (struct number_set): Remove forward declaration.
(read_set, write_set, signal_set, is_number_in_set): Move to number_set.h.
* filter.h (add_number_to_set): Move to number_set.h.
* filter_qualify.c: Include "number_set.h".
(number_slot_t, struct number_set): Remove.
* strace.c: Include "number_set.h".
* syscall.c: Likewise.
2017-08-23 00:23:49 +03:00
extern void
add_number_to_set ( unsigned int number , struct number_set * ) ;
Extend number_set interface
* number_set.h (number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, clear_number_set_array,
invert_number_set_array, alloc_number_set_array, free_number_set_array):
New function prototypes.
* number_set.c (number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, clear_number_set_array,
invert_number_set_array, alloc_number_set_array, free_number_set_array):
New functions.
* basic_filters.c (qualify_syscall_number, qualify_syscall_regex,
qualify_syscall_class, qualify_syscall_name): Use
add_number_to_set_array.
(qualify_syscall_tokens, qualify_tokens): Use
clear_number_set_array and invert_number_set_array.
* filter_qualify.c (qualify_inject_common): Use alloc_number_set_array,
number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, and free_number_set_array.
(qual_flags): Use is_number_in_set_array.
2017-08-23 00:23:49 +03:00
extern void
add_number_to_set_array ( unsigned int number , struct number_set * , unsigned int idx ) ;
extern void
clear_number_set_array ( struct number_set * , unsigned int nmemb ) ;
extern void
invert_number_set_array ( struct number_set * , unsigned int nmemb ) ;
extern struct number_set *
2017-08-24 21:13:29 +03:00
alloc_number_set_array ( unsigned int nmemb ) ATTRIBUTE_MALLOC ;
Extend number_set interface
* number_set.h (number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, clear_number_set_array,
invert_number_set_array, alloc_number_set_array, free_number_set_array):
New function prototypes.
* number_set.c (number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, clear_number_set_array,
invert_number_set_array, alloc_number_set_array, free_number_set_array):
New functions.
* basic_filters.c (qualify_syscall_number, qualify_syscall_regex,
qualify_syscall_class, qualify_syscall_name): Use
add_number_to_set_array.
(qualify_syscall_tokens, qualify_tokens): Use
clear_number_set_array and invert_number_set_array.
* filter_qualify.c (qualify_inject_common): Use alloc_number_set_array,
number_set_array_is_empty, is_number_in_set_array,
add_number_to_set_array, and free_number_set_array.
(qual_flags): Use is_number_in_set_array.
2017-08-23 00:23:49 +03:00
extern void
free_number_set_array ( struct number_set * , unsigned int nmemb ) ;
Hide struct number_set implementation details from users
* number_set.h (number_slot_t, struct number_set): Move to number_set.c.
(struct number_set): Add forward declaration.
(read_set, write_set, signal_set): Change prototypes from objects
to pointers.
* filter_qualify.c (read_set, write_set, signal_set): Change definitions
from objects to pointers.
(abbrev_set, inject_set, raw_set, trace_set, verbose_set): Change
definitions from arrays to pointers.
(qualify_read): Initialize read_set before first use.
(qualify_write): Initialize write_set before first use.
(qualify_signals): Initialize signal_set before first use.
(qualify_trace): Initialize trace_set before first use.
(qualify_abbrev): Initialize abbrev_set before first use.
(qualify_verbose): Initialize verbose_set before first use.
(qualify_raw): Initialize raw_set before first use.
(qualify_inject_common): Initialize inject_set before first use.
* strace.c (print_signalled, print_stopped): Update signal_set usage.
* syscall.c (dumpio): Update usage of read_set and write_set.
2017-08-23 00:23:49 +03:00
extern struct number_set * read_set ;
extern struct number_set * write_set ;
extern struct number_set * signal_set ;
Move number_set interface to separate files
* number_set.c: New file.
* number_set.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* basic_filters.c: Include "number_set.h".
(number_slot_t, struct number_set): Move to number_set.h.
(BITS_PER_SLOT, number_setbit, number_isset, reallocate_number_set,
add_number_to_set, is_number_in_set): Move to number_set.c.
* defs.h (struct number_set): Remove forward declaration.
(read_set, write_set, signal_set, is_number_in_set): Move to number_set.h.
* filter.h (add_number_to_set): Move to number_set.h.
* filter_qualify.c: Include "number_set.h".
(number_slot_t, struct number_set): Remove.
* strace.c: Include "number_set.h".
* syscall.c: Likewise.
2017-08-23 00:23:49 +03:00
# endif /* !STRACE_NUMBER_SET_H */