type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
functions | bool pin_number_is_free(uint8_t pin_number) {
return !(claimed_pins[nrf_pin_port(pin_number)] & (1 << nrf_relative_pin_number(pin_number)));
} |
functions | bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) {
#ifdef MICROPY_HW_NEOPIXEL
if (pin == MICROPY_HW_NEOPIXEL) {
return !neopixel_in_use;
} |
functions | MICROPY_HW_APA102_MOSI
if (pin == MICROPY_HW_APA102_MOSI) {
return !apa102_mosi_in_use;
} |
functions | SPEAKER_ENABLE_PIN
if (pin == SPEAKER_ENABLE_PIN) {
return !speaker_enable_in_use;
} |
functions | uint8_t common_hal_mcu_pin_number(const mcu_pin_obj_t* pin) {
return pin->number;
} |
functions | void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) {
claim_pin(pin);
} |
functions | void common_hal_mcu_pin_reset_number(uint8_t pin_no) {
reset_pin_number(pin_no);
} |
functions | void
MultipleEscape ( )
{
_MultipleEscape ( _Context_->Lexer0 ) ;
} |
functions | void
CSL_Strlen ( )
{
DataStack_Push ( (int64) Strlen ( (char*) DataStack_Pop ( ) ) ) ;
} |
functions | void
CSL_Strcmp ( )
{
DataStack_Push ( (int64) Strcmp ( (byte*) DataStack_Pop ( ), (byte*) DataStack_Pop ( ) ) ) ;
} |
functions | void
CSL_Stricmp ( )
{
DataStack_Push ( (int64) Stricmp ( (byte*) DataStack_Pop ( ), (byte*) DataStack_Pop ( ) ) ) ;
} |
functions | void
CSL_StrCat ( )
{
//Buffer * b = Buffer_New ( BUFFER_SIZE ) ;
byte * buffer = Buffer_Data ( _CSL_->StrCatBuffer ); byte *str ;
char * src = (char*) DataStack_Pop ( ) ;
char * dst = (char*) DataStack_Pop ( ) ;
strcpy ( (char*) buffer, dst ) ;
if (src) strcat ( (char *) buffer, src ) ;
... |
functions | void
CSL_StrCpy ( )
{
// !! nb. this cant really work !! what do we want here ??
DataStack_Push ( (int64) strcpy ( (char*) DataStack_Pop ( ), (char*) DataStack_Pop ( ) ) ) ;
} |
functions | void
String_GetStringToEndOfLine ( )
{
DataStack_Push ( (int64) _String_Get_ReadlineString_ToEndOfLine ( ) ) ;
} |
includes |
#include <string.h> |
defines | #define SECSIZE(fs) (_MIN_SS) |
defines | #define SECSIZE(fs) ((fs)->ssize) |
defines |
#define mp_obj_fat_vfs_t fs_user_mount_t |
functions | mp_obj_t fat_vfs_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 1, 1, false);
// create new object
fs_user_mount_t *vfs = m_new_obj(fs_user_mount_t);
vfs->base.type = type;
vfs->flags = FSUSER_FREE_OBJ;
vfs->fatfs.drv = vfs... |
functions | mp_obj_t fat_vfs_mkfs(mp_obj_t bdev_in) {
// create new object
fs_user_mount_t *vfs = MP_OBJ_TO_PTR(fat_vfs_make_new(&mp_fat_vfs_type, 1, 0, &bdev_in));
// make the filesystem
uint8_t working_buf[_MAX_SS];
FRESULT res = f_mkfs(&vfs->fatfs, FM_FAT | FM_SFD, 0, working_buf, sizeof(working_buf));
... |
functions | mp_obj_t fat_vfs_listdir_func(size_t n_args, const mp_obj_t *args) {
mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(args[0]);
bool is_str_type = true;
const char *path;
if (n_args == 2) {
if (mp_obj_get_type(args[1]) == &mp_type_bytes) {
is_str_type = false;
} |
functions | mp_obj_t fat_vfs_remove_internal(mp_obj_t vfs_in, mp_obj_t path_in, mp_int_t attr) {
mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(vfs_in);
const char *path = mp_obj_str_get_str(path_in);
FILINFO fno;
FRESULT res = f_stat(&self->fatfs, path, &fno);
if (res != FR_OK) {
mp_raise_OSError(fresult_to_... |
functions | mp_obj_t fat_vfs_remove(mp_obj_t vfs_in, mp_obj_t path_in) {
return fat_vfs_remove_internal(vfs_in, path_in, 0); // 0 == file attribute
} |
functions | mp_obj_t fat_vfs_rmdir(mp_obj_t vfs_in, mp_obj_t path_in) {
return fat_vfs_remove_internal(vfs_in, path_in, AM_DIR);
} |
functions | mp_obj_t fat_vfs_rename(mp_obj_t vfs_in, mp_obj_t path_in, mp_obj_t path_out) {
mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(vfs_in);
const char *old_path = mp_obj_str_get_str(path_in);
const char *new_path = mp_obj_str_get_str(path_out);
FRESULT res = f_rename(&self->fatfs, old_path, new_path);
if (res =... |
functions | mp_obj_t fat_vfs_mkdir(mp_obj_t vfs_in, mp_obj_t path_o) {
mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(vfs_in);
const char *path = mp_obj_str_get_str(path_o);
FRESULT res = f_mkdir(&self->fatfs, path);
if (res == FR_OK) {
return mp_const_none;
} |
functions | mp_obj_t fat_vfs_chdir(mp_obj_t vfs_in, mp_obj_t path_in) {
mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(vfs_in);
const char *path;
path = mp_obj_str_get_str(path_in);
FRESULT res = f_chdir(&self->fatfs, path);
if (res != FR_OK) {
mp_raise_OSError(fresult_to_errno_table[res]);
} |
functions | mp_obj_t fat_vfs_getcwd(mp_obj_t vfs_in) {
mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(vfs_in);
char buf[MICROPY_ALLOC_PATH_MAX + 1];
FRESULT res = f_getcwd(&self->fatfs, buf, sizeof(buf));
if (res != FR_OK) {
mp_raise_OSError(fresult_to_errno_table[res]);
} |
functions | mp_obj_t fat_vfs_stat(mp_obj_t vfs_in, mp_obj_t path_in) {
mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(vfs_in);
const char *path = mp_obj_str_get_str(path_in);
FILINFO fno;
if (path[0] == 0 || (path[0] == '/' && path[1] == 0)) {
// stat root directory
fno.fsize = 0;
fno.fdate = 0x282... |
functions | mp_obj_t fat_vfs_statvfs(mp_obj_t vfs_in, mp_obj_t path_in) {
mp_obj_fat_vfs_t *self = MP_OBJ_TO_PTR(vfs_in);
(void)path_in;
DWORD nclst;
FATFS *fatfs = &self->fatfs;
FRESULT res = f_getfree(fatfs, &nclst);
if (FR_OK != res) {
mp_raise_OSError(fresult_to_errno_table[res]);
} |
functions | mp_obj_t vfs_fat_mount(mp_obj_t self_in, mp_obj_t readonly, mp_obj_t mkfs) {
fs_user_mount_t *self = MP_OBJ_TO_PTR(self_in);
// Read-only device indicated by writeblocks[0] == MP_OBJ_NULL.
// User can specify read-only device by:
// 1. readonly=True keyword argument
// 2. nonexistent writeblocks ... |
functions | mp_obj_t vfs_fat_umount(mp_obj_t self_in) {
fs_user_mount_t *self = MP_OBJ_TO_PTR(self_in);
FRESULT res = f_umount(&self->fatfs);
if (res != FR_OK) {
mp_raise_OSError(fresult_to_errno_table[res]);
} |
includes |
#include <wchar.h> |
includes | #include <unistd.h> |
includes | #include <winsock2.h> |
includes | #include <windows.h> |
includes | #include <direct.h> |
includes | #include <sys/types.h> |
includes | #include <sys/socket.h> |
includes | #include <netinet/in.h> |
includes | #include <arpa/inet.h> |
includes |
#include <process.h> |
defines | #define COMMAND_INT_PATH "%WINDIR%\\system32\\cmd.exe"
|
defines | #define COMMAND_INT "cmd.exe"
|
defines | #define COMMAND_ARG1 "/c"
|
defines | #define COMMAND_ARG2 "dir"
|
defines | #define COMMAND_ARG3 data
|
defines | #define COMMAND_INT_PATH "/bin/sh"
|
defines | #define COMMAND_INT "sh"
|
defines | #define COMMAND_ARG1 "ls"
|
defines | #define COMMAND_ARG2 "-la"
|
defines | #define COMMAND_ARG3 data
|
defines | #define CLOSE_SOCKET closesocket
|
defines | #define INVALID_SOCKET -1
|
defines | #define SOCKET_ERROR -1
|
defines | #define CLOSE_SOCKET close
|
defines | #define SOCKET int
|
defines |
#define TCP_PORT 27015
|
defines | #define IP_ADDRESS "127.0.0.1"
|
defines | #define EXECV _execv
|
functions | void CWE78_OS_Command_Injection__char_connect_socket_w32_execv_34_bad()
{
char * data;
CWE78_OS_Command_Injection__char_connect_socket_w32_execv_34_unionType myUnion;
char dataBuffer[100] = "";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
... |
functions | _WIN32
if (wsaDataInit)
{
WSACleanup();
} |
functions | void goodG2B()
{
char * data;
CWE78_OS_Command_Injection__char_connect_socket_w32_execv_34_unionType myUnion;
char dataBuffer[100] = "";
data = dataBuffer;
/* FIX: Append a fixed string to data (not user / external input) */
strcat(data, "*.*");
myUnion.unionFirst = data;
{
... |
functions | void CWE78_OS_Command_Injection__char_connect_socket_w32_execv_34_good()
{
goodG2B();
} |
main | int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE78_OS_Command_Injection__char_connect_socket_w32_execv_34_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("... |
defines | #define acmlcc1fft zfft1dx |
defines | #define acmlcc1fft cfft1dx |
functions | void cc1fft(complex *data, int n, int sign)
{
#if defined(HAVE_LIBSCS)
int ntable, nwork, zero=0;
static int isys, nprev[MAX_NUMTHREADS];
static float *work[MAX_NUMTHREADS], *table[MAX_NUMTHREADS], scale=1.0;
int pe, i;
#elif defined(ACML440)
static int nprev=0;
int nwork, zero=0, one=1, inpl=1, i;
... |
functions | void Rcc1fft(float *data, int n, int sign)
{
cc1fft((complex *)data, n , sign);
return;
} |
functions | void cc1fft_(complex *data, int *n, int *sign)
{
cc1fft(data, *n, *sign);
return;
} |
includes |
#include <net/tcp.h> |
includes | #include <linux/pkt_sched.h> |
includes | #include <linux/kprobes.h> |
includes | #include <asm/tlbflush.h> |
defines |
#define ECN_OR_COST(class) TC_PRIO_##class |
functions | void flush_tlb_page_offload(struct vm_area_struct *vma, unsigned long addr)
{
#if defined(CONFIG_SMP) && !defined(PPC64_TLB_BATCH_NR)
flush_tlb_page_p(vma, addr);
#endif
} |
functions | void tcp_time_wait(struct sock *sk, int state, int timeo)
{
struct inet_timewait_sock *tw = NULL;
const struct inet_connection_sock *icsk = inet_csk(sk);
const struct tcp_sock *tp = tcp_sk(sk);
int recycle_ok = 0;
if (tcp_death_row.tw_count < tcp_death_row.sysctl_max_tw_buckets)
tw = inet_twsk_alloc(sk, state);... |
functions | void flush_tlb_mm_offload(struct mm_struct *mm)
{
#if defined(CONFIG_SMP) && !defined(PPC64_TLB_BATCH_NR)
if (flush_tlb_mm_p)
flush_tlb_mm_p(mm);
#endif
} |
functions | int find_kallsyms_lookup_name(void)
{
int err = 0;
#if defined(KPROBES_KALLSYMS)
struct kprobe kp;
memset(&kp, 0, sizeof kp);
kp.symbol_name = "kallsyms_lookup_name";
err = register_kprobe(&kp);
if (!err) {
kallsyms_lookup_name_p = (void *)kp.addr;
unregister_kprobe(&kp);
} |
functions | int prepare_tom_for_offload(void)
{
#if defined(CONFIG_SMP) && !defined(PPC64_TLB_BATCH_NR)
if (!kallsyms_lookup_name_p) {
int err = find_kallsyms_lookup_name();
if (err)
return err;
} |
includes |
#include <clock.h> |
includes | #include <common.h> |
includes | #include <driver.h> |
includes | #include <init.h> |
includes | #include <of.h> |
includes | #include <malloc.h> |
includes | #include <types.h> |
includes | #include <xfuncs.h> |
includes | #include <linux/clk.h> |
includes | #include <linux/err.h> |
includes | #include <linux/math64.h> |
includes |
#include <io.h> |
includes | #include <i2c/i2c.h> |
defines |
#define DW_I2C_BIT_RATE 100000 |
defines |
#define DW_IC_CON 0x0 |
defines | #define DW_IC_CON_MASTER (1 << 0) |
defines | #define DW_IC_CON_SPEED_STD (1 << 1) |
defines | #define DW_IC_CON_SPEED_FAST (1 << 2) |
defines | #define DW_IC_CON_SLAVE_DISABLE (1 << 6) |
defines |
#define DW_IC_TAR 0x4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.