use crate::libcfn;

macro_rules! gen_hook_enum {
    ($($variant: ident)*) => (
        #[allow(non_camel_case_types)]
        #[allow(clippy::upper_case_acronyms)]
        #[derive(Debug, Hash, Eq, PartialEq)]
        /// libc hooks enum
        pub enum Hook {
            $($variant(&'static str),)*
        }
        impl Hook {
            pub fn function(&self, ) -> String {
                match self {
                    $(Hook::$variant(fun) => libcfn::$variant(fun),)*
                }
            }
        }
    )
}

gen_hook_enum!(
CMSG_DATA
CMSG_FIRSTHDR
CMSG_LEN
CMSG_NXTHDR
CMSG_SPACE
CPU_ALLOC_SIZE
CPU_CLR
CPU_COUNT
CPU_COUNT_S
CPU_EQUAL
CPU_ISSET
CPU_SET
CPU_ZERO
FD_CLR
FD_ISSET
FD_SET
FD_ZERO
IPOPT_CLASS
IPOPT_COPIED
IPOPT_NUMBER
IPTOS_ECN
IPTOS_PREC
IPTOS_TOS
NLA_ALIGN
QCMD
RT_ADDRCLASS
RT_LOCALADDR
RT_TOS
SO_EE_OFFENDER
WCOREDUMP
WEXITSTATUS
WIFCONTINUED
WIFEXITED
WIFSIGNALED
WIFSTOPPED
WSTOPSIG
WTERMSIG
W_EXITCODE
W_STOPCODE
__errno_location
_exit
abort
abs
accept
accept4
access
acct
addmntent
adjtimex
aio_cancel
aio_error
aio_fsync
aio_read
aio_return
aio_suspend
aio_write
alarm
atexit
atof
atoi
backtrace
bind
brk
bsearch
calloc
cfgetispeed
cfgetospeed
cfmakeraw
cfsetispeed
cfsetospeed
cfsetspeed
chdir
chmod
chown
chroot
clearenv
clearerr
clock_getcpuclockid
clock_getres
clock_gettime
clock_nanosleep
clock_settime
clone
close
closedir
closelog
connect
copy_file_range
creat
creat64
daemon
difftime
dirfd
dl_iterate_phdr
dladdr
dlclose
dlerror
dlinfo
dlmopen
dlopen
dlsym
dup
dup2
dup3
duplocale
endgrent
endmntent
endpwent
endservent
endspent
endutxent
epoll_create
epoll_create1
epoll_ctl
epoll_pwait
epoll_wait
eventfd
execl
execle
execlp
execv
execve
execvp
execvpe
exit
faccessat
fallocate
fallocate64
fanotify_init
fanotify_mark
fchdir
fchmod
fchmodat
fchown
fchownat
fclose
fcntl
fdatasync
fdopen
fdopendir
feof
ferror
fexecve
fflush
fgetc
fgetpos
fgetpos64
fgets
fgetspent_r
fgetxattr
fileno
flistxattr
flock
fmemopen
fopen
fopen64
fork
forkpty
fpathconf
fprintf
fputc
fputs
fread
fread_unlocked
free
freeaddrinfo
freeifaddrs
freelocale
fremovexattr
freopen
freopen64
fscanf
fseek
fseeko
fseeko64
fsetpos
fsetpos64
fsetxattr
fstat
fstat64
fstatat
fstatat64
fstatfs
fstatfs64
fstatvfs
fstatvfs64
fsync
ftell
ftello
ftello64
ftok
ftruncate
ftruncate64
futimens
futimes
fwrite
gai_strerror
getaddrinfo
getauxval
getchar
getchar_unlocked
getcontext
getcwd
getdomainname
getdtablesize
getegid
getenv
geteuid
getgid
getgrent
getgrent_r
getgrgid
getgrgid_r
getgrnam
getgrnam_r
getgrouplist
getgroups
gethostname
getifaddrs
getline
getloadavg
getlogin
getmntent
getnameinfo
getopt
getpeername
getpgid
getpgrp
getpid
getppid
getpriority
getprotobyname
getprotobynumber
getpt
getpwent
getpwent_r
getpwnam
getpwnam_r
getpwuid
getpwuid_r
getrandom
getresgid
getresuid
getrlimit
getrlimit64
getrusage
getservbyname
getservbyport
getservent
getsid
getsockname
getsockopt
getspent
getspent_r
getspnam
getspnam_r
gettid
gettimeofday
getuid
getutxent
getutxid
getutxline
getxattr
glob
glob64
globfree
globfree64
gmtime
gmtime_r
grantpt
hasmntopt
iconv
iconv_close
iconv_open
if_freenameindex
if_indextoname
if_nameindex
if_nametoindex
initgroups
inotify_add_watch
inotify_init
inotify_init1
inotify_rm_watch
ioctl
ioperm
iopl
isalnum
isalpha
isatty
isblank
iscntrl
isdigit
isgraph
islower
isprint
ispunct
isspace
isupper
isxdigit
kill
killpg
labs
lchown
lgetxattr
link
linkat
lio_listio
listen
listxattr
llistxattr
localeconv
localtime
localtime_r
lockf
login_tty
lremovexattr
lseek
lseek64
lsetxattr
lstat
lstat64
lutimes
madvise
major
makecontext
makedev
mallinfo
malloc
malloc_usable_size
mallopt
memalign
memchr
memcmp
memcpy
memmem
memmove
memrchr
memset
mincore
minor
mkdir
mkdirat
mkdtemp
mkfifo
mkfifoat
mknod
mknodat
mkostemp
mkostemps
mkstemp
mkstemps
mktime
mlock
mlockall
mmap
mmap64
mount
mprotect
mq_close
mq_getattr
mq_open
mq_receive
mq_send
mq_setattr
mq_timedreceive
mq_timedsend
mq_unlink
mremap
msgctl
msgget
msgrcv
msgsnd
msync
munlock
munlockall
munmap
nanosleep
newlocale
nice
nl_langinfo
nl_langinfo_l
ntp_adjtime
ntp_gettime
open
open64
open_memstream
open_wmemstream
openat
openat64
opendir
openlog
openpty
pathconf
pause
pclose
perror
personality
pipe
pipe2
poll
popen
posix_fadvise
posix_fadvise64
posix_fallocate
posix_fallocate64
posix_madvise
posix_memalign
posix_openpt
posix_spawn
posix_spawn_file_actions_addclose
posix_spawn_file_actions_adddup2
posix_spawn_file_actions_addopen
posix_spawn_file_actions_destroy
posix_spawn_file_actions_init
posix_spawnattr_destroy
posix_spawnattr_getflags
posix_spawnattr_getpgroup
posix_spawnattr_getschedparam
posix_spawnattr_getschedpolicy
posix_spawnattr_getsigdefault
posix_spawnattr_getsigmask
posix_spawnattr_init
posix_spawnattr_setflags
posix_spawnattr_setpgroup
posix_spawnattr_setschedparam
posix_spawnattr_setschedpolicy
posix_spawnattr_setsigdefault
posix_spawnattr_setsigmask
posix_spawnp
ppoll
prctl
pread
pread64
preadv
preadv2
preadv64
printf
prlimit
prlimit64
process_vm_readv
process_vm_writev
pselect
pthread_atfork
pthread_attr_destroy
pthread_attr_getaffinity_np
pthread_attr_getguardsize
pthread_attr_getstack
pthread_attr_init
pthread_attr_setaffinity_np
pthread_attr_setdetachstate
pthread_attr_setstacksize
pthread_cancel
pthread_cond_broadcast
pthread_cond_destroy
pthread_cond_init
pthread_cond_signal
pthread_cond_timedwait
pthread_cond_wait
pthread_condattr_destroy
pthread_condattr_getclock
pthread_condattr_getpshared
pthread_condattr_init
pthread_condattr_setclock
pthread_condattr_setpshared
pthread_create
pthread_detach
pthread_exit
pthread_getaffinity_np
pthread_getattr_np
pthread_getname_np
pthread_getschedparam
pthread_getspecific
pthread_join
pthread_key_create
pthread_key_delete
pthread_kill
pthread_mutex_destroy
pthread_mutex_init
pthread_mutex_lock
pthread_mutex_timedlock
pthread_mutex_trylock
pthread_mutex_unlock
pthread_mutexattr_destroy
pthread_mutexattr_getpshared
pthread_mutexattr_init
pthread_mutexattr_setpshared
pthread_mutexattr_settype
pthread_rwlock_destroy
pthread_rwlock_init
pthread_rwlock_rdlock
pthread_rwlock_tryrdlock
pthread_rwlock_trywrlock
pthread_rwlock_unlock
pthread_rwlock_wrlock
pthread_rwlockattr_destroy
pthread_rwlockattr_getkind_np
pthread_rwlockattr_getpshared
pthread_rwlockattr_init
pthread_rwlockattr_setkind_np
pthread_rwlockattr_setpshared
pthread_self
pthread_setaffinity_np
pthread_setname_np
pthread_setschedparam
pthread_setschedprio
pthread_setspecific
pthread_sigmask
ptrace
ptsname
ptsname_r
putchar
putchar_unlocked
putenv
puts
pututxline
pwrite
pwrite64
pwritev
pwritev2
pwritev64
qsort
qsort_r
quotactl
raise
rand
read
readahead
readdir
readdir64
readdir64_r
readdir_r
readlink
readlinkat
readv
realloc
realpath
reboot
recv
recvfrom
recvmmsg
recvmsg
regcomp
regerror
regexec
regfree
remap_file_pages
remove
removexattr
rename
renameat
renameat2
res_init
rewind
rewinddir
rmdir
sbrk
scanf
sched_get_priority_max
sched_get_priority_min
sched_getaffinity
sched_getcpu
sched_getparam
sched_getscheduler
sched_rr_get_interval
sched_setaffinity
sched_setparam
sched_setscheduler
sched_yield
seekdir
select
sem_close
sem_destroy
sem_getvalue
sem_init
sem_open
sem_post
sem_timedwait
sem_trywait
sem_unlink
sem_wait
semctl
semget
semop
send
sendfile
sendfile64
sendmmsg
sendmsg
sendto
setbuf
setcontext
setdomainname
setegid
setenv
seteuid
setfsgid
setfsuid
setgid
setgrent
setgroups
sethostname
setlocale
setlogmask
setmntent
setns
setpgid
setpriority
setpwent
setregid
setresgid
setresuid
setreuid
setrlimit
setrlimit64
setservent
setsid
setsockopt
setspent
settimeofday
setuid
setutxent
setvbuf
setxattr
sgetspent_r
shm_open
shm_unlink
shmat
shmctl
shmdt
shmget
shutdown
sigaction
sigaddset
sigaltstack
sigdelset
sigemptyset
sigfillset
sigismember
signal
signalfd
sigpending
sigprocmask
sigsuspend
sigtimedwait
sigwait
sigwaitinfo
sleep
snprintf
socket
socketpair
splice
sprintf
srand
sscanf
stat
stat64
statfs
statfs64
statvfs
statvfs64
statx
strcasecmp
strcasestr
strcat
strchr
strcmp
strcoll
strcpy
strcspn
strdup
strerror
strerror_r
strlen
strncasecmp
strncat
strncmp
strncpy
strndup
strnlen
strpbrk
strrchr
strsignal
strspn
strstr
strtod
strtok
strtol
strtoul
strxfrm
swapcontext
swapoff
swapon
symlink
symlinkat
sync
sync_file_range
syscall
sysconf
sysctl
sysinfo
syslog
system
tcdrain
tcflow
tcflush
tcgetattr
tcgetpgrp
tcgetsid
tcsendbreak
tcsetattr
tcsetpgrp
tee
telldir
time
timegm
timerfd_create
timerfd_gettime
timerfd_settime
times
tmpfile
tmpfile64
tmpnam
tolower
toupper
truncate
truncate64
ttyname
ttyname_r
umask
umount
umount2
uname
ungetc
unlink
unlinkat
unlockpt
unsetenv
unshare
uselocale
usleep
utime
utimensat
utimes
utmpname
utmpxname
vfork
vhangup
vmsplice
wait
wait4
waitid
waitpid
wcslen
wcstombs
wmemchr
write
writev
);
